/* theme variables */
:root {
  --bg: #000;
  --fg: #fff;
  --surface: #121212;
  --surface-2: #171717;
  --border: #2a2a2a;
  --accent-dark: rgb(48,0,10);
  --accent: rgb(228,98,88);
  --bottom-bar-h: 64px;
  --radius: 12px;
  --table-max-w: 900px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg);
    color: var(--fg);
    text-align: center;
    margin: 0;
    background-color: var(--surface);
    overflow-y: auto;
    padding-bottom: calc(var(--bottom-bar-h) + env(safe-area-inset-bottom));
}


/* font similar to trojan but under free liscence ) */
/* bold one for title */
@font-face {
    font-family: 'Cinzel Bold';
    src: url('/static/cinzel_bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* site title */
.h1, h1.site-title {
    font-family: 'Cinzel Bold', 'Cinzel', serif;
    font-size: 10rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin: 0.5rem 0 1rem;
    color: var(--fg);
    text-shadow: 0 0 24px rgba(0, 0, 0, 0.35);
}

/* results table */
.table-container {
    max-width: min(var(--table-max-w), 92vw);
    margin: 0 auto;
    padding-bottom: var(--bottom-bar-h);
}

table {
    margin: 1.25em auto;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--surface);
    color: white;
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
th, td {
    border: 1px solid var(--border);
    padding: 0.7em 1.2em;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.95rem;
}
th {
    text-align: center;
    text-transform: uppercase;
    background: var(--accent-dark);
    color: var(--fg);
    border-bottom: 2px solid var(--border);
}

tbody > tr:nth-child(even) {
    background: var(--surface-2);
}

tbody > tr:hover {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* del external border to round properly */
thead th { border-top: none; }
th:first-child, td:first-child { border-left: none; }
th:last-child, td:last-child { border-right: none; }
tbody tr:last-child td { border-bottom: none; }

/* inputs and buttons */
select,
input[type="text"],
input[type="email"],
input[type="number"],
button,
input[type="submit"] {
    background: #0e0e0e;
    color: var(--fg);
    border: 1px solid var(--border);
    padding: 0.55rem 0.9rem;
    border-radius: 6px;
}

input[type="submit"], button {
    background: var(--accent);
    border-color: var(--accent);
    color: #100;
    font-weight: 700;
    cursor: pointer;
}

input[type="submit"]:hover,
button:hover {
    filter: brightness(0.95);
}

select:focus,
input:focus,
button:focus {
    outline: 2px solid color-mix(in srgb, var(--accent) 60%, transparent);
    outline-offset: 2px;
}

/* links */
a { color: var(--accent); }
a:hover { color: color-mix(in srgb, var(--accent) 80%, #fff 20%); }

/* selection */
::selection { background: var(--accent); color: #100; }

/* selection bar in bottom */
.bottom-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    align-items: center;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
    min-height: var(--bottom-bar-h);
    background: var(--surface);
    border-top: 1px solid var(--border);
    z-index: 100;
    backdrop-filter: blur(2px);
}

.bottom-bar select { min-width: 220px; }

/* coloration depending on results veracity */
td[data-result="Equal"] {
    background: #1b5e20;
    color: #fff;
}

td[data-result="Smaller"],
td[data-result="Greater"],
td[data-result="NotCorrect"] {
    background: #8b1e1e;
    color: #fff;
}

/* less density on small screens */
@media (max-width: 600px) {
  th, td {
        padding: 0.5em 0.6em;
        font-size: 0.95rem;
    }
  .h1, h1.site-title { font-size: clamp(2.2rem, 10vw, 4rem); }
}

/* less density on really small screens */
@media (max-width: 420px) {
  th, td { font-size: 0.9rem; padding: 0.5em 0.6em; }
}