:root {
    color-scheme: dark;
    --bg: #1c130e;
    --ink: #2a1c14;
    --cream: #f6eadc;
    --muted: #cbb5a4;
    --caramel: #e2a15a;
    --mint: #c5d39a;
    --rose: #e0a090;
    --room: #3a2a22;
    --line: #6d5a4c;
    --panel: #261910;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--cream);
    font-family: Arial, "Noto Sans", sans-serif;
}

button { font: inherit; color: inherit; }

#app { min-height: 100%; }

#turn {
    display: none;
    min-height: 100vh;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 32px;
    text-align: center;
    font-size: 28px;
    line-height: 1.35;
}

#play {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px 10px;
}

#top, .row, .power, .line, .choices, .budget {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#top { justify-content: space-between; min-height: 36px; }

h1, h2, p { margin: 0; font-weight: 400; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }

#coach {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 28px;
}
#coach p { flex: 0 1 auto; font-size: 15px; line-height: 1.3; }

#stage {
    flex: 1;
    min-height: 0;
    display: flex;
    gap: 8px;
    position: relative;
}

#game-container {
    flex: 1;
    min-width: 0;
    min-height: 0;
    position: relative;
}

#panel {
    width: min(440px, 46vw);
    background: var(--panel);
    border: 1px solid #4a3b32;
    border-radius: 8px;
    padding: 8px 10px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#panel[hidden] { display: none; }

.panel-head, .panel-head .row { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.standing, .blurb, .their, #strip, .word, .free, .num {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.35;
}
.blurb { margin: 0; }
.num { width: 14px; }
.free { width: 34px; }

#tools {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}
.their { display: flex; align-items: center; gap: 6px; margin: 0; }

#strip { min-height: 22px; font-size: 14px; color: var(--cream); }
#strip.quiet { color: var(--muted); }
.panel-help { min-height: 20px; color: var(--cream); font-size: 14px; line-height: 1.35; }

.chip, .q, .texty, .start {
    border: 0;
    border-radius: 4px;
    cursor: pointer;
}
.chip {
    background: var(--caramel);
    color: var(--ink);
    min-height: 32px;
    padding: 4px 8px;
    font-size: 14px;
}
.chip.mint { background: var(--mint); }
.chip.rose { background: var(--rose); }
.chip.off, .chip.locked { background: var(--room); color: var(--cream); }
.chip.ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.chip.locked { cursor: default; }
.start {
    background: var(--caramel);
    color: var(--ink);
    border-radius: 999px;
    min-height: 34px;
    padding: 4px 18px;
    font-size: 16px;
}
.start[data-running='true'], #play[data-running='true'] .start {
    color: var(--cream);
    background: #8d4638;
}
.q {
    width: 28px;
    height: 28px;
    padding: 0;
    background: var(--room);
    color: var(--cream);
    flex: none;
}
.q.open { background: var(--caramel); color: var(--ink); }
.texty {
    background: transparent;
    color: var(--cream);
    border: 1px solid var(--line);
    min-height: 26px;
    padding: 2px 8px;
    font-size: 13px;
}
.texty:disabled, .chip:disabled { opacity: 0.38; cursor: default; }

.slots { display: inline-flex; gap: 4px; }
.slots i {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    border: 2px solid var(--muted);
    display: block;
}
.slots i.on { background: var(--caramel); border-color: var(--caramel); }

.choices { padding-left: 18px; }

button:focus-visible {
    outline: 2px solid var(--cream);
    outline-offset: 2px;
}

@media (max-height: 520px) {
    #panel:not([hidden]) {
        position: fixed;
        top: 8px;
        right: 8px;
        bottom: 8px;
        left: 8px;
        width: auto;
        z-index: 5;
    }
}

@media (orientation: portrait) {
    #play { display: none !important; }
    #turn { display: flex; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
