@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    color-scheme: dark;
    --bg: #17100c;
    --panel: #241a14;
    --panel-raised: #34261d;
    --panel-hover: #463427;
    --gold: #e8c93a;
    --gold-bright: #f7ee94;
    --gold-deep: #a87d17;
    --text: #f6efdc;
    --muted: #b7a98f;
    --line: rgba(232, 201, 58, .22);
    --green: #578e3a;
    --amber: #d4a432;
    --red: #ad332f;
    --unknown: #57503f;
    --crimson: #4f0d0b;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    background: var(--bg);
}

body {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: Arial, Helvetica, sans-serif;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .24);
}

.background-art {
    position: fixed;
    z-index: -1;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    background: var(--bg);
}

.background-art::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(180deg, rgba(24, 12, 8, .58), rgba(10, 6, 4, .9));
}

.background-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 24%;
    opacity: .48;
    filter: saturate(.82) sepia(.18);
}

button,
input {
    font: inherit;
}

button {
    color: inherit;
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 3px solid rgba(232, 201, 58, .75);
    outline-offset: 3px;
}

.app-shell {
    position: relative;
    width: min(1100px, calc(100% - 40px));
    margin: 0 auto;
    padding: 23px 0 26px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--text);
    text-decoration: none;
}

.brand-logo {
    display: block;
    height: 48px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, .55));
}

.brand-divider {
    width: 1px;
    height: 31px;
    margin: 0 2px 0 4px;
    background: rgba(232, 201, 58, .45);
}

.brand-edition {
    color: #e0cf9d;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.38;
    letter-spacing: .12em;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 9px;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid #6f5712;
    border-top-color: #f6ec9a;
    border-bottom-color: #8a6a10;
    border-radius: 4px;
    background: linear-gradient(180deg, #f1e07a, #ddbe2f 55%, #b8901a);
    color: #241a02;
    cursor: pointer;
    font-size: 17px;
    font-weight: 800;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), 0 2px 6px rgba(0, 0, 0, .42);
    transition: border-color .18s ease, filter .18s ease, transform .18s ease;
}

.icon-button:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.intro {
    padding: 43px 0 25px;
    text-align: center;
}

.intro h1 {
    margin: 0;
    font: 700 clamp(35px, 6vw, 54px)/1.05 "Barlow Condensed", Impact, sans-serif;
    letter-spacing: .01em;
}

.lede {
    margin: 12px 0 9px;
    color: #c5c6cc;
    font-size: 15px;
}

.lede em {
    color: #fff;
}

.roster-count {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .035em;
}

.roster-count span {
    color: var(--gold);
    font-weight: 700;
}

.yesterday {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px 10px;
    max-width: 100%;
    margin-top: 15px;
    padding: 6px 15px 6px 7px;
    border: 1px solid rgba(232, 201, 58, .4);
    border-radius: 4px;
    background: rgba(36, 26, 20, .8);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .03);
    animation: yesterday-in .5s .15s both;
}

.yesterday-label {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.yesterday-character {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.yesterday-avatar {
    position: relative;
    display: grid;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(232, 201, 58, .55);
    border-radius: 4px;
    background: #1c130f;
    color: var(--gold);
    font: 700 18px "Barlow Condensed", Impact, sans-serif;
}

.yesterday-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

.yesterday-name {
    color: var(--text);
    font-size: 12px;
    font-weight: 700;
}

@keyframes yesterday-in {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game {
    position: relative;
    width: 100%;
    margin: 0 auto;
    padding: 21px;
    border-radius: 6px;
}

#guess-form {
    position: relative;
    z-index: 5;
}

.roster-filter {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.roster-filter label {
    flex: 0 0 auto;
    color: #d9c37e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.roster-filter select {
    flex: 0 1 340px;
    min-width: 0;
    height: 36px;
    padding: 0 30px 0 10px;
    border: 1px solid rgba(232, 201, 58, .3);
    border-radius: 4px;
    background: #1b120e;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.roster-filter select:focus {
    border-color: rgba(232, 201, 58, .65);
    outline: none;
}

.roster-filter select:disabled {
    cursor: default;
    opacity: .55;
}

@media (max-width: 390px) {
    .roster-filter {
        align-items: stretch;
        flex-direction: column;
        gap: 5px;
    }

    .roster-filter select {
        flex-basis: auto;
    }
}

.search-wrap {
    display: flex;
    min-height: 54px;
}

.search-icon {
    display: grid;
    width: 49px;
    place-items: center;
    border: 1px solid rgba(232, 201, 58, .3);
    border-right: 0;
    border-radius: 4px 0 0 4px;
    background: #1b120e;
    color: var(--gold);
    font-size: 28px;
}

.search-wrap input {
    flex: 1;
    min-width: 0;
    height: 54px;
    padding: 0 15px;
    border: 1px solid rgba(232, 201, 58, .3);
    border-radius: 0;
    background: #1b120e;
    color: var(--text);
    font-size: 15px;
}

.search-wrap input::placeholder {
    color: #8d7f6b;
}

.search-wrap input:focus {
    border-color: rgba(232, 201, 58, .65);
    outline: none;
}

.search-wrap input:disabled {
    opacity: .64;
}

.submit-button,
.share-button,
.dialog-ok,
.hint-button {
    border: 1px solid #6f5712;
    border-top-color: #f6ec9a;
    border-bottom-color: #8a6a10;
    border-radius: 4px;
    background: linear-gradient(180deg, #f8f0a0 0%, #efdf63 30%, #e3c92b 58%, #c9a318 100%);
    color: #241a02;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(90, 64, 0, .28), 0 2px 5px rgba(0, 0, 0, .45);
    cursor: pointer;
    transition: filter .18s ease, transform .18s ease, box-shadow .18s ease;
}

.submit-button {
    min-width: 100px;
    padding: 0 20px;
    border-radius: 0 4px 4px 0;
    font-size: 15px;
}

.submit-button:hover:not(:disabled),
.share-button:hover,
.dialog-ok:hover,
.hint-button:hover:not(:disabled) {
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 0 rgba(90, 64, 0, .28), 0 4px 14px rgba(232, 201, 58, .28);
}

.submit-button:disabled,
.hint-button:disabled {
    cursor: default;
    opacity: .55;
}

.suggestions {
    position: absolute;
    top: calc(100% - 1px);
    left: 49px;
    right: 100px;
    max-height: 280px;
    margin: 0;
    padding: 5px;
    overflow-y: auto;
    border: 1px solid rgba(232, 201, 58, .52);
    border-top-color: var(--line);
    border-radius: 0 0 4px 4px;
    background: #2a1e16;
    box-shadow: 0 12px 24px rgba(0, 0, 0, .5);
    list-style: none;
}

.suggestion {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 9px;
    border-radius: 3px;
    color: #f0e6cf;
    cursor: pointer;
    font-size: 14px;
}

.suggestion:hover,
.suggestion.is-selected {
    background: #463427;
    color: var(--gold-bright);
}

.suggestion-avatar,
.character-avatar {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(232, 201, 58, .48);
    background: #1c130f;
    color: var(--gold);
    font: 700 21px "Barlow Condensed", Impact, sans-serif;
}

.suggestion-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 4px;
}

.character-avatar {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 4px;
}

.avatar-fallback {
    display: grid;
    width: 100%;
    height: 100%;
    place-items: center;
}

.suggestion-avatar img,
.character-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 25%;
}

.suggestion-name {
    min-width: 0;
}

.game-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    min-height: 43px;
    padding: 14px 2px 7px;
}

.game-message,
.guess-counter {
    margin: 0;
    font-size: 12px;
}

.game-message {
    color: #d3c6ad;
}

.guess-counter {
    flex: 0 0 auto;
    color: var(--gold);
    font-weight: 700;
}

.answer-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin: 3px 0 11px;
    padding: 11px 15px;
    border: 1px solid rgba(140, 190, 90, .55);
    border-radius: 4px;
    background: linear-gradient(90deg, rgba(76, 122, 51, .42), rgba(36, 26, 20, .96));
    color: #e7f2d6;
    font-size: 13px;
}

.answer-banner strong {
    color: #c9e6a3;
    font-size: 16px;
}

.share-button {
    display: block;
    margin: 0 0 13px auto;
    padding: 9px 14px;
    border-radius: 3px;
    font-size: 13px;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px 18px;
    padding: 6px 2px 12px;
    color: #cdbfa3;
    font-size: 11px;
}

.legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend .arrow-key {
    margin-left: auto;
    color: #a99b81;
}

.dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-radius: 3px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.dot.exact {
    background: var(--green);
}

.dot.partial {
    background: var(--amber);
}

.dot.miss {
    background: var(--red);
}

.dot.unknown {
    background: var(--unknown);
}

.hint-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 0 2px 11px;
}

.hint-button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 14px;
    border-radius: 4px;
    font-size: 12px;
}

.hint-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hint-item {
    padding: 3px 8px;
    border: 1px solid rgba(232, 201, 58, .26);
    border-radius: 3px;
    background: #2a1e16;
    color: #e6dcc4;
    font-size: 11px;
    letter-spacing: .02em;
}

.table-scroll {
    position: relative;
    max-width: 100%;
    min-height: 158px;
    overflow: auto;
    border: 1px solid rgba(232, 201, 58, .16);
    border-radius: 4px;
    background: rgba(16, 10, 7, .5);
    scrollbar-color: var(--gold) #241a14;
}

table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 4px;
    table-layout: fixed;
}

thead th {
    padding: 7px 4px 5px;
    border-bottom: 1px solid rgba(232, 201, 58, .22);
    color: #d9c37e;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .09em;
    text-align: center;
    text-transform: uppercase;
}

thead th:first-child {
    width: 166px;
    text-align: left;
    padding-left: 12px;
}

thead th:nth-child(2) {
    width: 94px;
}

thead th:nth-child(3) {
    width: 126px;
}

thead th:nth-child(4) {
    width: 70px;
}

thead th:nth-child(5) {
    width: 86px;
}

thead th:nth-child(6) {
    width: 110px;
}

thead th:nth-child(7) {
    width: 140px;
}

thead th:nth-child(8) {
    width: 84px;
}

thead th:nth-child(9) {
    width: 116px;
}

tbody td {
    position: relative;
    height: 57px;
    padding: 7px 8px;
    overflow-wrap: anywhere;
    border: 1px solid rgba(232, 201, 58, .14);
    border-radius: 3px;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    box-shadow: inset 0 0 6px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
}

tbody td:first-child {
    text-align: left;
    padding-left: 7px;
    font-size: 12px;
}

.character-name-cell {
    min-width: 160px;
}

.character-name-content {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.character-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 10px;
}

.clue-value {
    white-space: pre-line;
}

.clue-correct {
    background: linear-gradient(145deg, #578e3a, #3a6d29);
}

.clue-partial {
    background: linear-gradient(145deg, #d4a432, #a8721d);
}

.clue-incorrect {
    background: linear-gradient(145deg, #ad332f, #711f1f);
}

.clue-unknown {
    background: linear-gradient(145deg, #5a5344, #3f3a2e);
    color: #e0d8c6;
}

.direction {
    display: inline-grid;
    width: 18px;
    height: 19px;
    place-items: center;
    margin-left: 4px;
    border-radius: 3px;
    background: rgba(0, 0, 0, .26);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
    vertical-align: -1px;
}

.guess-row.is-fresh {
    animation: reveal .35s both;
    animation-delay: calc(var(--row-index, 0) * 35ms);
}

.guess-row.is-fresh>td {
    animation: clue-pop .45s cubic-bezier(.18, .89, .32, 1.16) both;
    animation-delay: calc(var(--row-index, 0) * 35ms + var(--cell-index, 0) * 32ms);
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(7px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes clue-pop {
    from {
        opacity: 0;
        transform: translateY(9px) scale(.92);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.empty-board {
    position: absolute;
    inset: 48px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8a7c66;
    pointer-events: none;
}

.empty-board span {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px dashed #6b5f4b;
    border-radius: 4px;
    color: #b7a98f;
    font: 700 24px "Barlow Condensed", sans-serif;
}

.empty-board p {
    margin: 8px 0 0;
    font-size: 11px;
}

footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 17px 2px 0;
    color: #9c8f79;
    font-size: 10px;
}

footer a {
    color: var(--gold);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.modal {
    position: relative;
    width: min(490px, calc(100% - 32px));
    max-height: min(82vh, 720px);
    padding: 30px;
    overflow: auto;
    border: 1px solid rgba(232, 201, 58, .6);
    border-radius: 6px;
    background: linear-gradient(160deg, #2f231b, #1e1511);
    color: var(--text);
    box-shadow: 0 25px 80px rgba(0, 0, 0, .62), inset 0 0 0 1px rgba(232, 201, 58, .1);
}

.modal::backdrop {
    background: rgba(8, 5, 4, .78);
    backdrop-filter: blur(4px);
}

.modal h2 {
    margin: 0 0 16px;
    color: var(--gold-bright);
    font: 700 32px/1 "Barlow Condensed", Impact, sans-serif;
}


.dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    padding: 0 4px;
    border: 0;
    background: none;
    color: #c4b493;
    cursor: pointer;
    font-size: 27px;
    line-height: 1;
}

.dialog-close:hover {
    color: var(--gold);
}

.guide-key {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 9px 0;
    color: #d4c7ae;
    font-size: 12px;
}

.guide-key .dot {
    width: 13px;
    height: 13px;
    flex-basis: 13px;
}

.guide-key strong {
    color: #fff;
}

.dialog-ok {
    min-width: 100px;
    margin-top: 9px;
    padding: 10px 15px;
    border-radius: 4px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 18px 0 25px;
    text-align: center;
}

.stats-grid div {
    padding: 13px 7px;
    border: 1px solid rgba(232, 201, 58, .2);
    border-radius: 4px;
    background: #1e1511;
}

.stats-grid strong,
.stats-grid span {
    display: block;
}

.stats-grid strong {
    color: var(--gold);
    font: 700 27px "Barlow Condensed", sans-serif;
}

.stats-grid span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.modal .next-label {
    margin-bottom: 3px;
    text-align: center;
}

.countdown {
    margin: 0 0 13px !important;
    color: var(--gold) !important;
    font: 700 25px "Barlow Condensed", sans-serif;
    text-align: center;
    letter-spacing: .09em;
}

@media (max-width: 700px) {
    .app-shell {
        width: min(100% - 22px, 560px);
        padding-top: 12px;
    }

    .brand {
        gap: 8px;
    }

    .brand-logo {
        width: 118px;
        height: 40px;
    }

    .brand-divider {
        height: 27px;
        margin-left: 2px;
    }

    .brand-edition {
        font-size: 8px;
    }

    .icon-button {
        width: 34px;
        height: 34px;
    }

    .intro {
        padding: 36px 0 21px;
    }

    .game {
        padding: 13px 10px;
    }

    .submit-button {
        min-width: 78px;
        padding: 0 12px;
        font-size: 13px;
    }

    .search-icon {
        width: 39px;
    }

    .suggestions {
        left: 39px;
        right: 78px;
    }

    .legend {
        gap: 8px 12px;
        font-size: 10px;
    }

    .legend .arrow-key {
        width: 100%;
        margin-left: 0;
    }

    .table-scroll {
        min-height: 145px;
    }

    table {
        min-width: 820px;
    }

    footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        font-size: 9px;
    }
}

@media (max-width: 390px) {
    .brand-logo {
        width: 103px;
        height: 36px;
    }

    .brand-edition {
        font-size: 7px;
    }

    .top-actions {
        gap: 5px;
    }

    .game-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}


.icon-button[aria-pressed="true"] {
    background: linear-gradient(180deg, #f7ee94, #e8c93a);
    border-color: var(--gold);
    color: #241a02;
  }

.mode-indicator {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 4px;
    background: var(--panel);
    letter-spacing: .06em;
  }

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
