:root {
    --bg-main: #ece3d6;
    --bg-panel: #fffdf8;
    --bg-strong: #d07a12;
    --ink: #17130f;
    --line: #423225;
    --success: #4caf50;
    --success-dark: #388e3c;
    --primary: #2196f3;
    --primary-dark: #1976d2;
    --danger: #f44336;
    --danger-dark: #d32f2f;
    --neutral: #ffc107;
    --left-dock-width: 260px;
    --right-dock-width: 330px;
    --fixed-score-height: 160px;
    --score-compact-height: 78px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    overflow: visible;
    background: linear-gradient(180deg, #f7f1e8 0%, var(--bg-main) 100%);
}

body.error-list-page {
    overflow: visible;
}

body.possible-plays-popup-page {
    overflow: visible;
    background: linear-gradient(180deg, #f8f2e9 0%, #e7ddcf 100%);
}

.possible-plays-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 14px 18px 18px;
    background: rgba(248, 243, 235, 0.95);
}

.possible-plays-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: default;
}

.possible-plays-window {
    position: relative;
    z-index: 1;
    width: min(860px, calc(100vw - 28px));
    max-height: calc(100vh - 30px);
    display: flex;
    flex-direction: column;
    pointer-events: auto;
    border: 2px solid rgba(66, 50, 37, 0.26);
    border-radius: 16px;
    background: #fffdf8;
    box-shadow: 0 18px 38px rgba(42, 33, 24, 0.16);
    overflow: hidden;
}

.possible-plays-window .used-words-panel {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0 0 14px 14px;
    background: #fffdf8;
}

.possible-plays-report-head {
    display: grid;
    grid-template-rows: auto auto;
    gap: 0;
    margin-bottom: 4px;
    border: 1px solid rgba(42, 33, 24, 0.28);
    border-radius: 4px;
    overflow: hidden;
}

.possible-plays-report-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.possible-plays-report-head .possible-plays-report-line {
    border-radius: 0;
    border-right: 1px solid rgba(70, 55, 39, 0.22);
    border-bottom: 1px solid rgba(70, 55, 39, 0.22);
    text-align: center;
}

.possible-plays-report-head .possible-plays-report-line:nth-child(2n) {
    border-right: 0;
}

.possible-plays-report-head .possible-plays-report-row:last-child .possible-plays-report-line {
    border-bottom: 0;
}

.top-status-vocabulus .status-dropdown-summary.vocabulus {
    cursor: default;
}

.vocabulus-level-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    white-space: nowrap;
}

.vocabulus-level-name {
    white-space: nowrap;
}

.vocabulus-thinking-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.vocabulus-thinking-text {
    white-space: nowrap;
}

.vocabulus-thinking-hourglass {
    display: inline-block;
    font-size: 0.9em;
    line-height: 1;
    animation: vocabulus-hourglass-spin 0.9s linear infinite;
    transform-origin: 50% 50%;
}

@keyframes vocabulus-hourglass-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.page {
    width: min(1880px, calc(100vw - 8px));
    margin: 0 auto;
    padding: 4px 0 calc(var(--score-compact-height) + 14px);
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    align-items: stretch;
    margin-bottom: 6px;
}

.toolbar-hero {
    display: grid;
    grid-template-columns: var(--left-dock-width) minmax(0, 1fr) var(--right-dock-width);
    align-items: center;
    gap: 4px;
    margin-bottom: 0;
    position: relative;
    padding: 4px 6px 2px;
    border-bottom: 2px solid rgba(66, 50, 37, 0.18);
}

.toolbar-hero .hero-title {
    grid-column: 1;
    min-width: 0;
}

.toolbar-hero .top-status-messages {
    grid-column: 2;
    min-width: 0;
    margin: 0;
    justify-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
}

.toolbar-hero .top-status-track {
    min-width: 0;
    position: relative;
}

.toolbar-hero .top-status-human {
    justify-self: stretch;
}

.toolbar-hero .top-status-vocabulus {
    justify-self: stretch;
}

.toolbar-hero .top-status-human .status-dropdown {
    margin-right: auto;
}

.toolbar-hero .top-status-vocabulus .status-dropdown {
    margin-left: auto;
}

.toolbar-hero .top-status-messages .message {
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 5px 12px;
    font-size: 0.94rem;
    font-weight: 900;
    line-height: 1.18;
    text-align: center;
}

.toolbar-hero .top-status-human .message {
    margin-right: auto;
    text-align: left;
}

.toolbar-hero .top-status-vocabulus .message {
    margin-left: auto;
    text-align: left;
}

.status-dropdown {
    position: relative;
    min-width: 0;
    width: 100%;
}

.status-dropdown-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
    width: 100%;
}

.status-dropdown-summary::-webkit-details-marker {
    display: none;
}

.status-dropdown-text {
    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    overflow-y: hidden;
}

.status-message-viewport {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
}

.status-history-message {
    display: block;
    white-space: nowrap;
    will-change: transform;
}

.status-message-viewport.is-overflowing .status-history-message {
    animation: status-text-scroll var(--status-scroll-duration, 10s) linear infinite alternate;
}

.status-history-player {
    flex: 0 0 auto;
    font-weight: 900;
}

.status-dropdown-arrow {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.16);
    color: inherit;
    font-size: 0.78rem;
    line-height: 1;
}

.status-dropdown[open] .status-dropdown-arrow {
    transform: rotate(180deg);
}

.status-dropdown-menu {
    position: absolute;
    top: calc(100% + 5px);
    z-index: 80;
    display: grid;
    gap: 3px;
    width: 100%;
    max-height: 180px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 6px 8px 6px 6px;
    border: 2px solid rgba(42, 33, 24, 0.86);
    border-radius: 8px;
    background: rgba(255, 249, 238, 0.98);
    box-shadow: 0 10px 22px rgba(23, 19, 15, 0.26);
    scrollbar-gutter: stable;
}

.status-dropdown-human .status-dropdown-menu {
    left: 0;
}

.status-dropdown-vocabulus .status-dropdown-menu {
    right: 0;
}

.status-history-row {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    min-width: 100%;
    overflow-x: hidden;
    overflow-y: hidden;
}

@keyframes status-text-scroll {
    0% {
        transform: translateX(0);
    }
    18% {
        transform: translateX(0);
    }
    82% {
        transform: translateX(calc(-1 * var(--status-scroll-distance, 0px)));
    }
    100% {
        transform: translateX(calc(-1 * var(--status-scroll-distance, 0px)));
    }
}

.toolbar-hero .top-status-messages .status-dropdown .message,
.toolbar-hero .top-status-messages .status-history-row.message {
    width: 100%;
    text-align: left;
}

.toolbar-hero .top-status-messages.has-error-message .message.error {
    animation: status-error-flash 0.35s steps(1, end) 12;
    background: #d60000;
    border: 2px solid #fff;
    border-radius: 6px;
    box-shadow: 0 0 0 2px #d60000;
    color: #fff;
}

@media (max-width: 980px) {
    .toolbar-hero .top-status-messages {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 6px;
    }

    .toolbar-hero .top-status-vocabulus {
        justify-self: stretch;
    }

    .toolbar-hero .top-status-vocabulus .message {
        margin-left: 0;
        margin-right: auto;
    }
}

.hero-title {
    display: flex;
    align-items: baseline;
    gap: 4px;
    padding: 2px 0 0 4px;
}

.hero-title h1 {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 0;
}

.brand-vocabulus {
    color: #c45100;
    font-size: clamp(1.18rem, 1.95vw, 1.9rem);
    font-weight: 900;
    letter-spacing: 0;
}

.brand-by {
    color: #2a2118;
    font-size: clamp(0.68rem, 1vw, 0.94rem);
    font-weight: 700;
}

.build-marker {
    position: absolute;
    top: 4px;
    right: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border: 1px solid rgba(42, 33, 24, 0.38);
    border-radius: 6px;
    background: #fff4db;
    color: #8b4f00;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    white-space: nowrap;
    pointer-events: none;
}

.eyebrow {
    margin: 0 0 2px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-size: 8px;
}

h1, h2, h3, p {
    margin-top: 0;
}

h1 {
    margin-bottom: 1px;
    font-size: clamp(0.9rem, 1.5vw, 1.3rem);
}

.subtitle {
    max-width: 360px;
    font-size: 0.66rem;
    margin-bottom: 0;
}

.mode-card,
.panel {
    background: var(--bg-panel);
    border: 2px solid var(--line);
    border-radius: 14px;
    box-shadow: 4px 4px 0 rgba(23, 19, 15, 0.15);
}

.mode-card {
    min-width: 170px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toolbar-mode {
    min-width: auto;
    padding: 3px 6px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}

.toolbar-mode form {
    margin: 0;
}

.workspace {
    position: relative;
    display: grid;
    grid-template-columns: var(--left-dock-width) minmax(0, 1fr) var(--right-dock-width);
    gap: 8px;
    align-items: start;
    margin-bottom: 8px;
    padding-bottom: 26px;
}

.dock-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 6px;
    margin-bottom: 8px;
    min-height: 10px;
    padding: 0;
    border-radius: 12px;
    background: transparent;
}

.bottom-dock {
    position: fixed;
    left: 4px;
    right: 4px;
    bottom: 4px;
    z-index: 900;
    width: auto;
    height: auto;
    min-height: var(--score-compact-height);
    max-height: var(--fixed-score-height);
    overflow: visible;
    margin: 0;
    padding: 0;
    background: rgba(244, 225, 191, 0.92);
    box-shadow: 0 -8px 22px rgba(42, 33, 24, 0.18);
}

.workspace-score-title {
    position: absolute;
    left: 14px;
    bottom: calc(100% + 6px);
    z-index: 901;
    width: 204px;
    pointer-events: none;
    border: 2px solid var(--line);
    border-radius: 12px;
    background: var(--bg-panel);
    box-shadow: 3px 3px 0 rgba(23, 19, 15, 0.16);
    padding: 3px;
}

.workspace-score-title .panel-handle {
    border-bottom: 0;
    cursor: default;
    padding: 4px 10px;
}

.workspace-score-title .panel-title {
    font-size: 0.82rem;
    line-height: 1;
}

.dock-column {
    display: grid;
    gap: 4px;
    min-height: 140px;
    padding: 4px;
    border-radius: 12px;
    background: rgba(255, 251, 244, 0.42);
    align-content: start;
    align-items: start;
}

.dock-zone {
    align-content: start;
}

.dock-zone.drag-over {
    outline: none;
    background: transparent;
}

.top-dock:empty,
.bottom-dock:empty {
    min-height: 0;
    margin: 0;
}

body.is-dragging-panels .top-dock:empty,
body.is-dragging-panels .bottom-dock:empty {
    min-height: 52px;
    margin-bottom: 6px;
    padding: 4px;
    background: transparent;
    border: none;
}

.sidebar {
    display: grid;
    gap: 4px;
}

.side-panel {
    padding: 5px 4px;
}

.dock-panel {
    cursor: default;
    resize: vertical;
    overflow: auto;
    min-width: 150px;
    max-width: 100%;
    min-height: 54px;
    transition: none;
    position: relative;
    border-radius: 12px;
    border: 1px solid rgba(66, 50, 37, 0.22);
    box-shadow: 0 4px 12px rgba(42, 33, 24, 0.08);
    background: #fffdf8;
}

.auto-size-panel {
    resize: none;
    overflow: visible;
    height: auto !important;
}

.dock-panel.is-dragging {
    opacity: 0.6;
    transform: scale(0.98);
    box-shadow: 0 10px 24px rgba(42, 33, 24, 0.18);
}

.dock-panel.is-floating {
    position: fixed;
    z-index: 1000;
    margin: 0;
    pointer-events: none;
    transform: rotate(1deg);
    box-shadow: 0 14px 28px rgba(42, 33, 24, 0.25);
}

.dock-placeholder {
    min-height: 52px;
    border: none;
    border-radius: 12px;
    background: transparent;
}

.dock-column .dock-placeholder {
    width: 100%;
}

.dock-row .dock-placeholder {
    min-width: 220px;
}

.panel-handle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    cursor: grab;
    user-select: none;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(66, 50, 37, 0.14);
    background: linear-gradient(180deg, #f7d39a 0%, #f3c977 100%);
    border-radius: 10px 10px 6px 6px;
    padding: 4px 6px;
}

.panel-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.panel-title::before {
    content: "≡";
    font-size: 0.84rem;
    opacity: 0.7;
}

.collapse-toggle {
    width: 22px;
    min-width: 22px;
    height: 22px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff9ee;
    cursor: pointer;
    font-weight: 900;
    position: relative;
    z-index: 2;
}

.panel-body {
    display: grid;
    gap: 6px;
}

.dock-panel[data-panel-id="jogada"] {
    resize: none;
    overflow: visible;
    height: auto !important;
    min-width: 320px;
}

.dock-panel[data-panel-id="jogada"] .panel-body {
    overflow: visible;
    gap: 4px;
}

.dock-panel[data-panel-id="jogada"] input:not(.input-word-main),
.dock-panel[data-panel-id="jogada"] select {
    min-height: 36px;
    padding-top: 4px;
    padding-bottom: 4px;
}

.dock-panel.is-collapsed .panel-body {
    display: none;
}

.dock-panel.is-collapsed .collapse-toggle {
    background: #f3d46b;
}

.compact-vocabulus-panel {
    min-width: 120px;
    max-width: 150px;
    width: 140px;
    resize: vertical;
}

.compact-vocabulus-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.compact-vocabulus-buttons .button {
    flex: 1 1 54px;
}

.quick-panel {
    padding: 4px;
}

.side-buttons {
    display: grid;
    gap: 7px;
}

.dock-panel[data-panel-id="controles"] .panel-body {
    gap: 8px;
}

.dock-panel[data-panel-id="controles"] .stack-form {
    gap: 0;
}

.dock-panel[data-panel-id="controles"] .control-button {
    position: relative;
    width: 100%;
    min-height: 34px;
    border: 1px solid rgba(44, 35, 27, 0.42);
    border-radius: 8px;
    color: #fffdf6;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -2px 0 rgba(0, 0, 0, 0.22),
        0 4px 0 rgba(65, 48, 32, 0.82),
        0 8px 13px rgba(42, 33, 24, 0.22);
    transform: translateY(0);
    transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms ease;
}

.dock-panel[data-panel-id="controles"] .control-button:hover {
    filter: brightness(1.06) saturate(1.03);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.22),
        0 5px 0 rgba(65, 48, 32, 0.82),
        0 10px 16px rgba(42, 33, 24, 0.26);
}

.dock-panel[data-panel-id="controles"] .control-button:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.28),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18),
        0 1px 0 rgba(65, 48, 32, 0.82),
        0 3px 7px rgba(42, 33, 24, 0.18);
}

.dock-panel[data-panel-id="controles"] .logs-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .pass-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .time-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .penalty-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .words-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .metric-button {
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
}

.dock-panel[data-panel-id="controles"] .reset-button {
    background: linear-gradient(#3d3d3d, #050505);
    color: #fffdf6;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.52);
}

.dock-panel[data-panel-id="grade"] .inline-pair {
    grid-template-columns: repeat(2, minmax(72px, 86px));
    justify-content: center;
    gap: 14px;
}

.dock-panel[data-panel-id="grade"] .inline-pair label {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 5px 7px;
    border: 1px solid rgba(42, 33, 24, 0.28);
    border-radius: 8px;
    background: #fff4df;
    color: #2b2118;
    font-size: 0.86rem;
    font-weight: 900;
    text-align: center;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.78),
        0 3px 7px rgba(42, 33, 24, 0.13);
}

.dock-panel[data-panel-id="grade"] .input-xs {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    min-height: 24px;
    background: #fffdf8;
    font-size: 1rem;
    font-weight: 900;
    text-align: center;
}

.sidebar-form,
.stack-form {
    display: grid;
    gap: 6px;
}

.dictionary-search-label {
    font-size: 1.14rem;
    font-weight: 800;
}

.input-lookup-word {
    font-size: 1.24rem;
    font-weight: 700;
    min-height: 42px;
    text-align: center;
}

.dictionary-inline-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 108px;
    gap: 5px;
    align-items: center;
}

.dictionary-current-selection {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border: 1px solid rgba(42, 33, 24, 0.22);
    border-radius: 8px;
    background: #fff8eb;
    font-size: 0.96rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    justify-content: center;
    overflow-wrap: anywhere;
}

.dock-panel[data-panel-id="dicionario"] .sidebar-form .button,
.dock-panel[data-panel-id="jogadores"] .players-popup-button {
    position: relative;
    width: 100%;
    min-height: 34px;
    border: 1px solid rgba(44, 35, 27, 0.42);
    border-radius: 8px;
    background: linear-gradient(#ffeaa4, #d69c26);
    color: #2b2118;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -2px 0 rgba(0, 0, 0, 0.22),
        0 4px 0 rgba(65, 48, 32, 0.82),
        0 8px 13px rgba(42, 33, 24, 0.22);
    transform: translateY(0);
    transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms ease;
}

.dock-panel[data-panel-id="dicionario"] .sidebar-form .button:hover,
.dock-panel[data-panel-id="jogadores"] .players-popup-button:hover {
    filter: brightness(1.06) saturate(1.03);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -2px 0 rgba(0, 0, 0, 0.22),
        0 5px 0 rgba(65, 48, 32, 0.82),
        0 10px 16px rgba(42, 33, 24, 0.26);
}

.dock-panel[data-panel-id="dicionario"] .sidebar-form .button:active,
.dock-panel[data-panel-id="jogadores"] .players-popup-button:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.28),
        inset 0 -1px 0 rgba(255, 255, 255, 0.18),
        0 1px 0 rgba(65, 48, 32, 0.82),
        0 3px 7px rgba(42, 33, 24, 0.18);
}

.dictionary-popup-button {
    width: 108px;
    min-width: 108px;
    max-width: 108px;
    padding-inline: 3px;
    font-size: 0.66rem;
    letter-spacing: 0.02em;
}

.dictionary-popup-form {
    display: grid;
    gap: 8px;
}

.dictionary-popup-panel {
    padding: 8px 10px;
}

.dictionary-popup-options {
    display: grid;
    gap: 5px;
}

.dictionary-option {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    font-weight: 800;
}

.dictionary-option input {
    width: auto;
    margin: 0;
}

.used-words-shell {
    max-width: 520px;
}

.used-words-panel {
    padding: 0;
    overflow: hidden;
}

.possible-plays-window .used-words-panel {
    overflow: auto;
}

.used-words-filter {
    margin-bottom: 10px;
}

.used-words-filter label {
    display: grid;
    gap: 5px;
    color: #3c2f23;
    font-size: 0.84rem;
    font-weight: 900;
}

.used-words-filter select {
    min-height: 34px;
    border: 1px solid rgba(42, 33, 24, 0.28);
    border-radius: 8px;
    background: #fff8eb;
    color: #241a12;
    font-size: 0.92rem;
    font-weight: 800;
    padding: 4px 8px;
}

.used-words-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.used-words-table th,
.used-words-table td {
    border-bottom: 1px solid rgba(70, 55, 39, 0.16);
    padding: 8px 10px;
    text-align: left;
}

.used-words-table th:first-child,
.used-words-table td:first-child {
    width: 68px;
}

.used-words-table th:last-child,
.used-words-table td:last-child {
    width: 132px;
}

.possible-plays-table th:last-child,
.possible-plays-table td:last-child {
    width: auto;
}

.possible-play-positions {
    white-space: nowrap;
    overflow-x: auto;
}

.possible-plays-report {
    margin: 0;
    max-height: 470px;
    overflow: visible;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.45;
    color: #1f1710;
    display: block;
    width: max-content;
    min-width: 100%;
    gap: 3px;
}

.possible-plays-item {
    display: block;
    gap: 0;
    margin: 0 0 6px;
    width: max-content;
    min-width: max-content;
}

.possible-plays-main-line {
    width: max-content;
    min-width: max-content;
    display: inline-flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 10px;
    border: 0;
    border-radius: 6px;
    background: #f7d49b;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 1px 0 rgba(70, 55, 39, 0.12);
    color: #2b2118;
    font: inherit;
    font-weight: 900;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.possible-plays-main-line:hover {
    background: #f0c97d;
}

.possible-plays-main-line:focus-visible {
    outline: 2px solid #c45100;
    outline-offset: 1px;
}

.possible-plays-main-line .possible-plays-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.74);
    color: #8a4a00;
    font-size: 1rem;
    line-height: 1;
    font-weight: 900;
    flex: 0 0 auto;
}

.possible-plays-main-number {
    color: #2b2118;
    font-weight: 900;
}

.possible-plays-main-text {
    min-width: 0;
    color: #2b2118;
}

.possible-plays-toggle {
    color: #8a4a00;
    font-weight: 900;
}

.possible-plays-subitems {
    display: grid;
    gap: 2px;
    padding: 6px 0 0 28px;
}

.possible-plays-subitems[hidden] {
    display: none !important;
}

.possible-plays-subitem-line {
    width: max-content;
    min-width: max-content;
    display: inline-flex;
    align-items: flex-start;
    padding: 4px 10px 4px 12px;
    border-right: 1px solid rgba(70, 55, 39, 0.12);
    border-bottom: 1px solid rgba(70, 55, 39, 0.12);
    background: #fffdf7;
    color: #5b4632;
    white-space: nowrap;
}

.possible-plays-submask-trigger {
    width: 100%;
    border: 0;
    text-align: left;
    cursor: pointer;
}

.possible-plays-submask-trigger:hover {
    background: #fff6d9;
}

.possible-plays-submask-trigger:focus-visible {
    outline: 2px solid #c45100;
    outline-offset: 1px;
}

.possible-plays-subitem-number {
    font-weight: 700;
}

.possible-plays-submask-link {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    color: #8a3b00;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.possible-plays-submask-link:hover,
.possible-plays-submask-link:focus-visible {
    color: #5f2500;
    background: rgba(138, 59, 0, 0.08);
    outline: none;
}

.possible-plays-submask-text {
    font-weight: 900;
    color: inherit;
}

.possible-plays-subitem-line.is-empty {
    color: #8c1212;
    background: #fff1f1;
    border-right-color: rgba(140, 18, 18, 0.18);
    border-bottom-color: rgba(140, 18, 18, 0.18);
}

.possible-plays-submask-item {
    display: grid;
    gap: 4px;
    margin: 0 0 4px;
}

.possible-plays-submask-accordion {
    display: grid;
    gap: 2px;
    margin-left: 18px;
    padding: 8px 8px 10px;
    border: 1px solid rgba(121, 93, 48, 0.18);
    border-radius: 6px;
    background: #fff5d9;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42);
    width: auto;
    min-width: 0;
    max-width: min(100%, 760px);
    justify-self: start;
}

.possible-plays-submask-accordion[hidden] {
    display: none !important;
}

.possible-plays-submask-accordion-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 12px;
    row-gap: 2px;
    padding: 0 2px 4px;
}

.possible-plays-submask-accordion-title {
    font-size: 0.78rem;
    font-weight: 900;
    color: #6a4a11;
    text-transform: uppercase;
}

.possible-plays-submask-accordion-mask {
    font-size: 0.92rem;
    font-weight: 900;
    color: #2b2118;
}

.possible-plays-submask-accordion-mask-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: baseline;
    gap: 10px;
    min-width: 0;
    grid-column: 1 / -1;
}

.possible-plays-submask-accordion-total {
    font-size: 0.78rem;
    font-weight: 900;
    color: #7a5a1b;
    white-space: nowrap;
    justify-self: end;
}

.possible-plays-total-summary {
    display: grid;
    gap: 0;
    padding: 2px 0 4px;
    min-width: 0;
    width: 100%;
}

.possible-plays-total-line {
    display: block;
    font-size: 0.9rem;
    font-weight: 900;
    color: #2b2118;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.possible-plays-total-line strong {
    color: #2b2118;
}

.possible-plays-submask-accordion-controls {
    display: grid;
    grid-template-columns: auto auto;
    gap: 8px;
    margin-bottom: 6px;
}

.possible-mask-sort-button {
    border: 1px solid rgba(70, 55, 39, 0.18);
    background: #fff7e8;
    color: #5b4632;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 900;
    padding: 5px 9px;
    cursor: pointer;
}

.possible-mask-sort-button.is-active {
    background: #f7d49b;
    color: #2b2118;
}

.possible-plays-submask-accordion-scroll {
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    width: auto;
    max-width: 100%;
}

.possible-plays-submask-words {
    display: grid;
    gap: 2px;
}

.possible-mask-word-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) 64px;
    gap: 8px;
    align-items: baseline;
    padding: 5px 8px;
    border-right: 1px solid rgba(70, 55, 39, 0.12);
    border-bottom: 1px solid rgba(70, 55, 39, 0.12);
    background: #fffdf7;
    font-family: Consolas, "Courier New", monospace;
}

button.possible-mask-word-row {
    width: 100%;
    cursor: pointer;
    text-align: left;
    color: inherit;
}

button.possible-mask-word-row:hover,
button.possible-mask-word-row:focus-visible {
    background: #fff2ca;
    outline: 1px solid #c78b2b;
}

.possible-mask-word-order {
    color: #8a4a00;
    font-weight: 900;
}

.possible-mask-word-text {
    min-width: 0;
    font-weight: 800;
    color: #241a12;
}

.possible-mask-word-freq {
    color: #6a5948;
    font-weight: 700;
    text-align: right;
}

.mask-words-shell {
    width: min(330px, calc(100vw - 8px));
    max-height: min(92vh, 920px);
}

.mask-words-panel {
    max-height: min(72vh, 640px);
    overflow-y: auto;
    padding-right: 4px;
}

.mask-words-list {
    display: grid;
    gap: 2px;
}

.mask-words-table {
    display: grid;
    gap: 2px;
}

.mask-words-header-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: center;
    padding: 0 10px 4px;
}

.mask-word-spacer {
    display: block;
}

.mask-word-title {
    width: 100%;
    border: 0;
    background: #f7d49b;
    color: #2b2118;
    cursor: pointer;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0;
    text-align: left;
    padding: 6px 8px;
}

.mask-word-freq-title {
    text-align: right;
}

.mask-sort-button {
    border: 1px solid rgba(70, 55, 39, 0.18);
    background: #fff7e8;
    color: #5b4632;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 900;
    padding: 6px 10px;
    cursor: pointer;
}

.mask-sort-button.is-active {
    background: #f7d49b;
    color: #2b2118;
}

.mask-word-row {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 92px;
    gap: 8px;
    align-items: baseline;
    padding: 6px 10px;
    background: #fffdf7;
    border-right: 1px solid rgba(70, 55, 39, 0.12);
    border-bottom: 1px solid rgba(70, 55, 39, 0.12);
    font-family: Consolas, "Courier New", monospace;
}

.mask-word-order {
    color: #8a4a00;
    font-weight: 900;
}

.mask-word-text {
    min-width: 0;
    font-weight: 800;
    color: #241a12;
}

.mask-word-freq {
    color: #6a5948;
    font-weight: 700;
    text-align: right;
}

.possible-plays-report-header {
    margin-top: 8px;
    gap: 2px;
}

.possible-plays-report-header .possible-plays-report-line {
    padding: 3px 8px;
    min-width: 0;
}

.possible-plays-thermometer {
    width: min(520px, 100%);
    height: 16px;
    margin: 8px auto 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(70, 55, 39, 0.34);
    border-radius: 999px;
    background: #fff7e8;
    box-shadow: inset 0 1px 2px rgba(42, 33, 24, 0.18);
}

.possible-plays-thermometer-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #2e7d32, #f4c542, #d84315);
    transition: width 160ms linear, background-color 160ms linear;
}

.possible-plays-thermometer.is-complete .possible-plays-thermometer-fill {
    width: 100%;
    background: #2e7d32;
}

.possible-plays-thermometer.is-error .possible-plays-thermometer-fill {
    width: 100%;
    background: #a40000;
}

.possible-plays-thermometer-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 900;
    color: #2b2118;
    letter-spacing: 0;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}

.possible-plays-report-line {
    min-width: max-content;
    padding: 5px 10px;
    border-radius: 0;
    border-right: 1px solid rgba(70, 55, 39, 0.22);
    border-bottom: 1px solid rgba(70, 55, 39, 0.22);
    background: rgba(255, 255, 255, 0.62);
    white-space: pre;
}

.possible-plays-report-row .possible-plays-report-line:nth-child(2) {
    border-right: 0;
}

.possible-plays-report-row:last-child .possible-plays-report-line {
    border-bottom: 0;
}

.possible-plays-report-line.is-empty {
    min-height: 4px;
    padding: 0;
    border: 0;
    background: transparent;
}

.possible-plays-report-line.is-total,
.possible-plays-report-line.is-title {
    background: #ffe0a7;
    font-weight: 900;
}

.possible-plays-report-line.is-play {
    background: #fffaf0;
}

.possible-plays-report-line.is-excluded {
    background: #ffe3e3;
    color: #a40000;
    font-weight: 800;
}

.possible-plays-invalids-toggle {
    width: 100%;
    text-align: left;
    appearance: none;
    border: 0;
    padding: 5px 10px;
    font: inherit;
    cursor: pointer;
}

.possible-plays-invalids-toggle::after {
    content: "";
}

.possible-plays-invalids-panel {
    display: grid;
    grid-auto-rows: min-content;
}

.possible-plays-invalids-panel[hidden] {
    display: none !important;
}

.possible-plays-item .possible-plays-report-line.is-empty {
    display: none;
}

.used-words-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f7d49b;
}

.used-words-sort {
    width: 100%;
    border: 0;
    background: transparent;
    color: #2b2118;
    cursor: pointer;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 900;
    text-align: left;
}

.used-word-order {
    color: #473525;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.used-word-text {
    color: #111827;
    font-size: 0.98rem;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.used-word-player {
    color: #473525;
    font-size: 0.86rem;
    font-weight: 900;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.used-word-lookup {
    width: 100%;
    border: 0;
    background: transparent;
    color: #111827;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
    text-align: left;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.used-word-lookup:hover {
    color: var(--danger-dark);
}

.used-words-empty {
    margin: 0;
    padding: 14px;
}

.lookup-popup-shell {
    max-width: 560px;
    max-height: none;
    overflow: visible;
}

.lookup-popup-panel {
    display: grid;
    gap: 12px;
    max-height: none;
    overflow: visible;
}

.lookup-popup-multi {
    display: grid;
    gap: 12px;
}

.lookup-popup-overview {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid rgba(42, 33, 24, 0.16);
    border-radius: 12px;
    background: #fff4df;
}

.lookup-popup-overview h2 {
    margin: 0;
    font-size: 0.96rem;
}

.lookup-popup-overview-grid {
    display: grid;
    gap: 6px;
}

.lookup-popup-overview-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    font-size: 0.92rem;
}

.lookup-popup-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(42, 33, 24, 0.16);
    border-radius: 12px;
    background: #fffaf1;
}

.lookup-popup-card-header {
    display: grid;
    gap: 6px;
}

.lookup-popup-card-header h2,
.lookup-popup-results h3,
.lookup-popup-definition h3 {
    margin: 0;
    font-size: 0.96rem;
}

.lookup-popup-summary {
    display: grid;
    gap: 8px;
    font-size: 0.92rem;
    font-weight: 700;
}

.lookup-popup-results {
    display: grid;
    gap: 8px;
}

.lookup-popup-definition {
    display: grid;
    gap: 8px;
}

.lookup-popup-definition h2 {
    margin: 0;
    font-size: 0.92rem;
}

.lookup-popup-definition p {
    margin: 0;
    line-height: 1.5;
    font-size: 0.92rem;
    white-space: pre-wrap;
}

.lookup-popup-results h2 {
    margin: 0;
    font-size: 0.92rem;
}

.lookup-popup-source {
    margin: 0;
    font-size: 0.8rem;
    word-break: break-all;
}

.lookup-status-ok {
    color: #1f6b3b;
}

.lookup-status-fail {
    color: #b03a2e;
}

.hidden-row {
    display: none;
}

.player-color-1 {
    color: #1f4e79;
}

.player-color-2 {
    color: #c94c4c;
}

.player-color-3 {
    color: #3f88c5;
}

.player-color-4 {
    color: #4f9d69;
}

.player-color-5 {
    color: #8b5fbf;
}

.player-color-6 {
    color: #1f6b3b;
}

.player-name-row input {
    color: #17130f;
}

.player-name-row {
    border-left: 4px solid currentColor;
    padding-left: 6px;
}

.players-form-compact {
    gap: 8px;
}

.players-inline-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: end;
}

.players-count-row {
    align-items: start;
    margin: 0;
}

.player-name-row {
    gap: 2px;
    min-width: 0;
}

.player-name-row .input-word {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.players-popup-button {
    width: auto;
    min-width: 132px;
    align-self: end;
}

.players-popup-shell {
    max-width: 360px;
    min-height: auto;
    display: grid;
    align-content: start;
    justify-content: center;
    padding: 8px 10px;
}

.players-popup-form {
    display: grid;
    justify-items: center;
    gap: 6px;
}

.players-popup-panel {
    margin-bottom: 4px;
    padding: 6px 8px;
    width: fit-content;
    justify-self: center;
}

.players-popup-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    width: fit-content;
}

.players-popup-row {
    display: grid;
    grid-template-columns: 84px 148px;
    align-items: center;
    gap: 4px;
    padding-left: 4px;
}

.players-popup-label {
    font-weight: 700;
    white-space: nowrap;
    font-size: 0.92rem;
}

.players-popup-row .input-word {
    width: 148px;
    max-width: 148px;
    min-height: 32px;
    font-size: 0.95rem;
    padding: 4px 8px;
}

.vocabulus-popup-shell {
    max-width: 380px;
}

.vocabulus-popup-form {
    width: 100%;
}

.vocabulus-popup-panel {
    width: min(100%, 300px);
    padding: 10px 12px;
}

.vocabulus-popup-options {
    display: grid;
    gap: 8px;
}

.vocabulus-popup-option {
    display: grid;
    grid-template-columns: 18px 1fr;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid rgba(42, 33, 24, 0.22);
    border-radius: 8px;
    background: rgba(255, 247, 237, 0.9);
    font-weight: 800;
}

.vocabulus-popup-option input {
    margin: 0;
}


.player-heading {
    margin: 0 0 2px;
    font-size: 0.62rem;
    font-weight: 800;
}

.score-game-time {
    margin: 0 0 4px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
}

.score-card.player-color-1 {
    background: #2f5d8a;
    border-color: #000000;
    color: #ffffff;
}

.score-card.player-color-2 {
    background: #c94c4c;
    border-color: #000000;
    color: #ffffff;
}

.score-card.player-color-3 {
    background: #72b7e6;
    border-color: #000000;
    color: #ffffff;
}

.score-card.player-color-4 {
    background: #78bb8d;
    border-color: #000000;
    color: #ffffff;
}

.score-card.player-color-5 {
    background: #a784d4;
    border-color: #000000;
    color: #ffffff;
}

.score-card.player-color-6 {
    background: #2f7d4e;
    border-color: #000000;
    color: #ffffff;
}

.inline-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 6px;
    align-items: end;
}

.inline-triple {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, auto));
    gap: 6px;
    align-items: end;
}

.jogada-posicao-row {
    gap: 4px;
    justify-content: center;
}

.jogada-posicao-row .input-md {
    width: 126px;
    min-width: 126px;
    max-width: 126px;
}

.jogada-config-row {
    grid-template-columns: repeat(2, minmax(0, auto));
    gap: 14px;
    justify-content: center;
    justify-items: center;
}

.jogada-tamanho-row {
    display: grid;
    grid-template-columns: repeat(5, auto);
    gap: 8px;
    align-items: end;
    justify-content: center;
    justify-items: center;
    width: fit-content;
    justify-self: center;
    padding: 2px 0;
}

.jogada-tamanho-row label {
    justify-items: center;
    text-align: center;
    align-content: end;
    min-width: 0;
}

.jogada-tamanho-row .input-md {
    width: 138px;
    min-width: 138px;
    max-width: 138px;
    text-align-last: center;
}

.jogada-tamanho-row .input-xs {
    width: 58px;
    min-width: 58px;
    max-width: 58px;
    padding-left: 8px;
    padding-right: 4px;
}

.regra-tamanho-campo {
    min-width: 58px;
}

.jogada-config-row .input-md {
    width: 118px;
    min-width: 118px;
    max-width: 118px;
}

.jogada-config-row .input-xs {
    width: 64px;
    min-width: 64px;
    max-width: 64px;
}

.jogada-config-row label {
    justify-items: center;
    text-align: center;
}

.dock-panel[data-panel-id="jogada"] .input-xs,
.dock-panel[data-panel-id="jogada"] .input-md,
.dock-panel[data-panel-id="jogada"] select {
    border: 2px solid rgba(42, 33, 24, 0.82);
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff 0%, #fff8eb 100%);
    font-weight: 900;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(196, 81, 0, 0.08), 0 5px 12px rgba(42, 33, 24, 0.16);
}

.dock-panel[data-panel-id="jogada"] .input-xs:focus,
.dock-panel[data-panel-id="jogada"] .input-md:focus,
.dock-panel[data-panel-id="jogada"] select:focus {
    outline: none;
    border-color: #c45100;
    box-shadow: 0 0 0 3px rgba(196, 81, 0, 0.18), 0 7px 16px rgba(42, 33, 24, 0.2);
}

.turn-timer-panel {
    display: grid;
    gap: 4px;
    padding: 6px 8px;
    border: 2px solid #caa06f;
    border-radius: 12px;
    background: #fff4df;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.turn-timer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.turn-timer-header strong {
    font-size: 0.86rem;
    font-weight: 900;
    color: #7c3b00;
}

.turn-timer-header span {
    font-size: 0.94rem;
    font-weight: 900;
    color: #2a2118;
    letter-spacing: 0.04em;
}

.turn-timer-bar {
    height: 12px;
    border-radius: 999px;
    overflow: hidden;
    background: #e4cfb4;
    box-shadow: inset 0 1px 2px rgba(42, 33, 24, 0.16);
}

.turn-timer-bar-fill {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #39a850 0%, #c6b81f 55%, #d34332 100%);
    transition: width 160ms linear, filter 160ms linear;
}

.turn-timer-bar-fill.warning {
    filter: saturate(1.08) brightness(0.96);
}

.turn-timer-bar-fill.danger {
    filter: saturate(1.15) brightness(0.88);
}

.jogada-turn-timer-panel {
    padding: 5px 7px;
    border-radius: 9px;
}

.jogada-turn-timer-panel .turn-timer-header strong {
    font-size: 0.78rem;
}

.jogada-turn-timer-panel .turn-timer-header span {
    font-size: 0.84rem;
}

.jogada-turn-timer-panel .turn-timer-bar {
    height: 9px;
}

.board-center {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: calc(100vh - var(--fixed-score-height) - 42px);
}

.mode-label {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 8px;
}

.mode-value {
    font-size: 0.78rem;
}

.mode-value.online {
    color: var(--danger-dark);
}

.mode-value.offline {
    color: var(--success-dark);
}

.messages {
    display: grid;
    gap: 4px;
    margin-bottom: 4px;
}

.message {
    border-radius: 8px;
    padding: 5px 7px;
    border: 1px solid var(--line);
    background: #fff;
    font-size: 0.72rem;
}

.message.success {
    background: #eef9ee;
}

.message.vocabulus {
    background: #14833b;
    border-color: #0d5a28;
    color: #ffffff;
    font-weight: 900;
    box-shadow: 0 0 0 1px rgba(13, 90, 40, 0.22);
}

.message.error {
    background: #d60000;
    border-color: #8f0000;
    color: #fff;
    font-weight: 800;
}

.score-messages {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    display: flex;
    gap: 4px;
    overflow: hidden;
}

.score-messages .message {
    min-width: 0;
    padding: 3px 8px;
    font-size: 0.86rem;
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-messages.has-error-message {
    overflow: visible;
}

.score-messages.has-error-message .message.error {
    animation: status-error-flash 0.35s steps(1, end) 12;
    background: #d60000;
    border: 2px solid #fff;
    border-radius: 6px;
    padding: 3px 8px;
    box-shadow: 0 0 0 2px #d60000;
    color: #fff;
    font-weight: 900;
}

@keyframes status-error-flash {
    0%,
    49% {
        background: #d60000;
        box-shadow: 0 0 0 2px #d60000;
    }

    50%,
    100% {
        background: #7f0000;
        box-shadow: 0 0 0 2px #7f0000;
    }
}

.panel-grid,
.control-strip,
.score-section {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin-bottom: 4px;
    align-items: start;
}

.panel {
    padding: 5px 6px;
}

.ultra-compact .panel {
    padding: 3px 5px;
    border-radius: 10px;
}

.form-grid,
.lookup-form {
    display: grid;
    gap: 6px;
}

.control-strip {
    grid-template-columns: 1fr 1.35fr 0.85fr;
    align-items: start;
}

.ultra-compact {
    gap: 3px;
    margin-bottom: 3px;
}

.control-strip .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 5px;
    row-gap: 2px;
}

.control-strip .lookup-form {
    grid-template-columns: 1fr auto;
    align-items: end;
    column-gap: 4px;
}

.toolbar-form {
    align-items: end;
}

label {
    display: grid;
    gap: 1px;
    font-weight: 700;
    font-size: 0.82rem;
    align-content: start;
}

input,
select,
button {
    font: inherit;
}

input,
select {
    width: 100%;
    padding: 1px 4px;
    border-radius: 5px;
    border: 1px solid var(--line);
    background: white;
    min-height: 19px;
    font-size: 0.88rem;
}

.input-xs {
    width: 56px;
    min-width: 56px;
    max-width: 56px;
}

.input-md {
    width: 120px;
    min-width: 120px;
    max-width: 120px;
}

.input-word {
    width: 140px;
    min-width: 140px;
    max-width: 140px;
}

.input-lookup-word {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    padding: 6px 10px;
}

.input-word-main {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 42px;
    padding: 6px 10px;
    font-size: 1.1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-align: center;
    color: #0f2f57;
    background: #fffef8;
    border: 2px solid #1976d2;
    box-shadow: inset 0 0 0 1px rgba(25, 118, 210, 0.08), 0 4px 10px rgba(25, 118, 210, 0.12);
}

.current-player-word-label {
    gap: 3px;
}

.word-label-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.current-player-name {
    font-size: 0.92rem;
    font-weight: 900;
}

.input-word-main.player-color-1 {
    border-color: #1f4e79;
    color: #1f4e79;
    box-shadow: inset 0 0 0 1px rgba(31, 78, 121, 0.08), 0 4px 10px rgba(31, 78, 121, 0.14);
}

.input-word-main.player-color-2 {
    border-color: #c94c4c;
    color: #8f2e2e;
    box-shadow: inset 0 0 0 1px rgba(201, 76, 76, 0.08), 0 4px 10px rgba(201, 76, 76, 0.14);
}

.input-word-main.player-color-3 {
    border-color: #3f88c5;
    color: #2e6491;
    box-shadow: inset 0 0 0 1px rgba(63, 136, 197, 0.08), 0 4px 10px rgba(63, 136, 197, 0.14);
}

.input-word-main.player-color-4 {
    border-color: #4f9d69;
    color: #326845;
    box-shadow: inset 0 0 0 1px rgba(79, 157, 105, 0.08), 0 4px 10px rgba(79, 157, 105, 0.14);
}

.input-word-main.player-color-5 {
    border-color: #8b5fbf;
    color: #5e3f83;
    box-shadow: inset 0 0 0 1px rgba(139, 95, 191, 0.08), 0 4px 10px rgba(139, 95, 191, 0.14);
}

.input-word-main.player-color-6 {
    border-color: #1f6b3b;
    color: #1f6b3b;
    box-shadow: inset 0 0 0 1px rgba(31, 107, 59, 0.08), 0 4px 10px rgba(31, 107, 59, 0.14);
}

.input-word-main:focus {
    outline: none;
    border-color: #c45100;
    box-shadow: 0 0 0 3px rgba(196, 81, 0, 0.18), 0 6px 14px rgba(25, 118, 210, 0.18);
}

.jogada-toggle-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    align-items: stretch;
}

.jogada-mode-card {
    min-width: 0;
    width: 100%;
    padding: 3px 5px;
    gap: 2px;
}

.jogada-mode-card form {
    margin: 0;
}

.jogada-mode-card .mode-label {
    font-size: 7px;
}

.jogada-mode-card .mode-value {
    font-size: 0.68rem;
}

.jogada-mode-card .button.toggle {
    width: 100%;
    min-height: 36px;
    font-size: 0.86rem;
    font-weight: 900;
    letter-spacing: 0.05em;
    padding: 3px 6px;
}

.checkbox {
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 4px;
}

.checkbox input {
    width: auto;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 19px;
    border: 1px solid var(--line);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    transition: transform 0.12s ease, background-color 0.12s ease;
    font-size: 0.79rem;
    padding: 1px 4px;
}

.button:hover {
    transform: translateY(-1px);
}

.button.success {
    background: var(--success);
}

.button.primary {
    background: var(--primary);
}

.write-button {
    width: 100%;
    min-height: 38px;
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    box-shadow: 0 0 0 2px rgba(25, 118, 210, 0.18), 0 6px 14px rgba(25, 118, 210, 0.24);
}

.write-button.player-color-1 {
    background: #1f4e79;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(31, 78, 121, 0.22), 0 8px 18px rgba(31, 78, 121, 0.34);
}

.write-button.player-color-2 {
    background: #c94c4c;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(201, 76, 76, 0.22), 0 8px 18px rgba(201, 76, 76, 0.34);
}

.write-button.player-color-3 {
    background: #3f88c5;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(63, 136, 197, 0.22), 0 8px 18px rgba(63, 136, 197, 0.34);
}

.write-button.player-color-4 {
    background: #4f9d69;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(79, 157, 105, 0.22), 0 8px 18px rgba(79, 157, 105, 0.34);
}

.write-button.player-color-5 {
    background: #8b5fbf;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(139, 95, 191, 0.22), 0 8px 18px rgba(139, 95, 191, 0.34);
}

.write-button.player-color-6 {
    background: #1f6b3b;
    color: #ffffff;
    box-shadow: 0 0 0 2px rgba(31, 107, 59, 0.22), 0 8px 18px rgba(31, 107, 59, 0.34);
}

.dock-panel[data-panel-id="jogada"] .write-button {
    position: relative;
    border: 1px solid rgba(44, 35, 27, 0.42);
    border-radius: 8px;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -2px 0 rgba(0, 0, 0, 0.24),
        0 4px 0 rgba(65, 48, 32, 0.82),
        0 8px 13px rgba(42, 33, 24, 0.22);
    transform: translateY(0);
    transition: transform 90ms ease, box-shadow 90ms ease, filter 120ms ease;
}

.dock-panel[data-panel-id="jogada"] .write-button:hover {
    filter: brightness(1.06) saturate(1.03);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.42),
        inset 0 -2px 0 rgba(0, 0, 0, 0.24),
        0 5px 0 rgba(65, 48, 32, 0.82),
        0 10px 16px rgba(42, 33, 24, 0.26);
}

.dock-panel[data-panel-id="jogada"] .write-button:active {
    transform: translateY(3px);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 -1px 0 rgba(255, 255, 255, 0.16),
        0 1px 0 rgba(65, 48, 32, 0.82),
        0 3px 7px rgba(42, 33, 24, 0.18);
}

.button.neutral {
    background: var(--neutral);
}

.button.subtle {
    background: #ece0cb;
}

.button.danger {
    background: var(--danger);
}

.button.toggle.success {
    background: var(--success);
}

.button.toggle.danger {
    background: var(--danger);
}

.board-section {
    background: #fffdf8;
    border: 2px solid rgba(66, 50, 37, 0.28);
    border-radius: 16px;
    padding: 10px 12px 8px;
    box-shadow: 0 10px 24px rgba(42, 33, 24, 0.08);
    margin-bottom: 6px;
    width: 100%;
    height: min(
        calc((var(--board-visible-rows) * 30px) + ((var(--board-visible-rows) - 1) * 1px) + 76px),
        calc(100vh - var(--fixed-score-height) - 58px)
    );
    max-height: calc(100vh - var(--fixed-score-height) - 58px);
    overflow: hidden;
}

.board-score-panel {
    position: relative;
    width: calc(var(--score-player-count, 2) * 16.6667%);
    min-width: min(100%, calc((var(--score-player-count, 2) * 160px) + ((var(--score-player-count, 2) - 1) * 4px) + 12px));
    max-width: 100%;
    margin-inline: auto;
    box-sizing: border-box;
    padding: 4px 6px;
    resize: none;
    overflow: hidden;
    min-height: calc(var(--score-compact-height) - 4px);
    height: auto;
    max-height: calc(var(--fixed-score-height) - 4px);
    box-shadow: 3px 3px 0 rgba(23, 19, 15, 0.18);
}

.board-score-panel .panel-body {
    overflow-x: visible;
    overflow-y: auto;
    height: auto;
    max-height: calc(var(--fixed-score-height) - 8px);
    padding-right: 4px;
}

.board-score-panel .panel-handle {
    display: none;
}

.board-score-panel .panel-title {
    font-size: 0.62rem;
    line-height: 1;
    letter-spacing: 0.06em;
}

.board-score-panel .panel-title::before {
    content: none;
}

.board-score-panel .collapse-toggle {
    display: none;
}

.board-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.board-wrapper {
    overflow: auto;
    margin-top: 6px;
    padding: 8px 18px 20px 22px;
    max-height: 100%;
    display: block;
    overflow-anchor: none; /* Evita que o navegador tente reposicionar a grade sozinho durante a troca do HTML. */
}

.board-top-header {
    --board-cell-size: 30px;
    --board-line-color: #bca985;
    position: sticky;
    top: 0;
    z-index: 8;
    display: grid;
    grid-template-columns: repeat(var(--board-cols), var(--board-cell-size));
    gap: 1px;
    width: calc((var(--board-cols) * var(--board-cell-size)) + ((var(--board-cols) - 1) * 1px));
    margin: 0 auto 1px;
    padding: 0 1px 1px 0;
    box-sizing: content-box;
    background: #fffdf8;
}

.board {
    --board-cell-size: 30px;
    --board-line-color: #bca985;
    box-sizing: content-box;
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: repeat(var(--board-cols), var(--board-cell-size));
    grid-auto-rows: var(--board-cell-size);
    gap: 1px;
    width: calc((var(--board-cols) * var(--board-cell-size)) + ((var(--board-cols) - 1) * 1px));
    min-width: calc((var(--board-cols) * var(--board-cell-size)) + ((var(--board-cols) - 1) * 1px));
    max-width: calc((var(--board-cols) * var(--board-cell-size)) + ((var(--board-cols) - 1) * 1px));
    height: calc((var(--board-rows) * var(--board-cell-size)) + ((var(--board-rows) - 1) * 1px));
    min-height: calc((var(--board-rows) * var(--board-cell-size)) + ((var(--board-rows) - 1) * 1px));
    max-height: calc((var(--board-rows) * var(--board-cell-size)) + ((var(--board-rows) - 1) * 1px));
    margin: 0 auto;
    padding-right: 1px;
    padding-bottom: 1px;
    border-radius: 12px;
    background: var(--board-line-color);
    box-shadow: 0 8px 0 rgba(199, 167, 111, 0.72);
    overflow: hidden;
}

.board::after {
    content: none;
}

.board-header-cell,
.board-cell {
    position: relative;
    z-index: 1;
    width: var(--board-cell-size);
    min-width: var(--board-cell-size);
    max-width: var(--board-cell-size);
    height: var(--board-cell-size);
    min-height: var(--board-cell-size);
    max-height: var(--board-cell-size);
    aspect-ratio: 1 / 1;
    border: 0;
    text-align: center;
    padding: 0;
    line-height: 1;
    overflow: hidden;
}

.board-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1c56f;
    font-size: 0.72rem;
    font-weight: 800;
}

.board-corner-header {
    background: #fffdf8;
    box-shadow: none;
    color: transparent;
    pointer-events: none;
}

.board-row-header {
    font-size: 0.66rem;
    letter-spacing: 0;
    padding-left: 2px;
    padding-right: 2px;
    box-sizing: border-box;
}

.board-cell {
    background: #fffdf9;
    font-weight: 800;
    font-size: 1.12rem;
}

.cell-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    background: #fffdf9;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    padding: 0;
    text-shadow: 0 0 0.01px currentColor;
}

.cell-button:hover {
    background: #fff0cc;
}

.cell-button.selected {
    background: #ffffff;
    box-shadow: inset 0 0 0 2px #ff8c00, 0 0 0 2px rgba(255, 140, 0, 0.16);
    outline: 2px solid #ff8c00;
    outline-offset: -2px;
}

.cell-button.filled {
    background: #ffffff;
}

.cell-button.filled.player-color-1 {
    background: #ffffff;
    color: #1f4e79;
}

.cell-button.filled.player-color-2 {
    background: #ffffff;
    color: #c94c4c;
}

.cell-button.filled.player-color-3 {
    background: #ffffff;
    color: #3f88c5;
}

.cell-button.filled.player-color-4 {
    background: #ffffff;
    color: #4f9d69;
}

.cell-button.filled.player-color-5 {
    background: #ffffff;
    color: #8b5fbf;
}

.cell-button.filled.player-color-6 {
    background: #ffffff;
    color: #1f6b3b;
}

.cell-button.vocabulus-last-play-highlight {
    animation: vocabulus-last-play-blink 0.6s steps(1, end) 5;
    filter: invert(1);
    outline: 3px solid #ffffff;
    outline-offset: -3px;
    box-shadow:
        inset 0 0 0 2px #000000,
        0 0 0 2px #ffffff,
        0 0 12px rgba(0, 0, 0, 0.75);
    z-index: 2;
}

.cell-button.vocabulus-valid-cell-highlight {
    background: #ffe04f;
    color: #111111;
    outline: 3px solid #1f4e79;
    outline-offset: -3px;
    box-shadow:
        inset 0 0 0 2px #ffffff,
        0 0 0 2px #1f4e79,
        0 0 14px rgba(31, 78, 121, 0.85);
    z-index: 3;
}

@keyframes vocabulus-last-play-blink {
    0%,
    100% {
        filter: invert(1);
    }
    50% {
        filter: invert(0);
    }
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.chip {
    display: inline-flex;
    padding: 2px 5px;
    border-radius: 999px;
    background: #f7d49b;
    border: 1px solid #70573d;
    font-weight: 700;
    font-size: 0.6rem;
}

.score-list {
    display: grid;
    grid-template-columns: repeat(var(--score-player-count, 2), minmax(0, 1fr));
    gap: 4px;
    align-items: start;
    justify-content: center;
    width: 100%;
    padding-top: 2px;
}

.score-card {
    border: 0;
    border-radius: 12px;
    padding: 5px 7px;
    background: #fffef8;
    outline: none;
    box-shadow: 0 2px 6px rgba(23, 19, 15, 0.08);
    transition: transform 140ms ease, box-shadow 140ms ease;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 2px;
}

.score-card > .muted {
    margin: 0;
    line-height: 1.1;
}

.score-card.current-turn {
    transform: translateY(3px);
    outline: 2px solid rgba(35, 24, 14, 0.82);
    outline-offset: -2px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.78),
        inset 0 -3px 0 rgba(0, 0, 0, 0.18),
        0 -7px 0 rgba(58, 40, 24, 0.9),
        0 -15px 22px rgba(23, 19, 15, 0.42),
        0 0 0 4px rgba(255, 210, 86, 0.7),
        0 0 22px rgba(255, 185, 32, 0.76);
}

.score-card.human-current-turn .player-heading {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 8px 2px 7px;
    border-radius: 999px;
    background: #fffef8;
    color: #17130f;
    box-shadow: inset 0 0 0 1px rgba(42, 33, 24, 0.22), 0 4px 10px rgba(23, 19, 15, 0.14);
}

.score-card.human-current-turn .player-heading-text {
    color: #17130f;
}

.score-card.is-out {
    opacity: 0.78;
    filter: grayscale(0.18);
    box-shadow: inset 0 0 0 2px rgba(40, 34, 30, 0.58);
}

.player-out-badge {
    margin: 1px 0 2px;
    display: inline-block;
    padding: 1px 5px;
    border-radius: 999px;
    background: #4b3625;
    color: #fff7e8;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.score-card * {
    outline: none;
}

.compact-hero {
    align-items: center;
}

.compact-panels .panel h2,
.board-section h2,
.score-section h2 {
    font-size: 0.66rem;
    margin-bottom: 2px;
}

.ultra-compact .panel h2 {
    font-size: 0.58rem;
    margin-bottom: 1px;
}

.board-header p,
.score-card p,
.score-card li,
.muted {
    font-size: 0.82rem;
}

.score-section .panel {
    padding: 3px 5px;
}

.score-section h3 {
    margin: 0 0 1px;
    font-size: 1rem;
}

.score-card ul {
    margin: 0;
    padding-left: 12px;
    line-height: 1.15;
}

.score-last-play {
    display: none;
}

.score-history-list {
    width: 100%;
    margin-top: 5px;
    display: grid;
    gap: 4px;
    max-height: 92px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 10px 4px 0;
    scrollbar-gutter: stable;
}

.score-history-list::-webkit-scrollbar {
    width: 10px;
}

.score-history-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.55);
    border-radius: 999px;
}

.score-history-list::-webkit-scrollbar-thumb {
    background: rgba(69, 53, 36, 0.72);
    border: 2px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
}

.score-word-detail {
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.26);
}

.score-word-detail summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    min-height: 26px;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 7px;
    cursor: pointer;
    list-style: none;
    color: #111827;
}

.score-word-detail summary::-webkit-details-marker {
    display: none;
}

.score-word-detail summary::before {
    content: "+";
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.86);
    color: #111827;
    font-size: 0.74rem;
    font-weight: 900;
}

.score-word-detail[open] summary::before {
    content: "-";
}

.score-word-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: left;
    color: #111827;
    font-weight: 900;
}

.score-word-points {
    flex: 0 0 auto;
    font-size: 0.74rem;
    font-weight: 900;
    color: #111827;
    white-space: nowrap;
}

.score-word-breakdown {
    margin: 0 6px 6px;
    padding: 7px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.82);
    color: #1f2937;
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1.28;
    text-align: left;
}

.score-word-breakdown p {
    margin: 0 0 5px;
}

.score-word-breakdown p:last-child {
    margin-bottom: 0;
}

.player-heading {
    grid-column: 1 / 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1 1 auto;
    font-size: 0.92rem;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
}

.player-heading-text {
    display: inline-block;
    min-width: 0;
    will-change: transform;
}

.player-heading.is-overflowing .player-heading-text {
    padding-right: 24px;
    animation: player-name-scroll 7s linear infinite;
}

.score-card .score-heading-row {
    grid-template-columns: minmax(0, 1fr) auto auto auto;
}

.score-card .player-heading {
    grid-column: 1 / 2;
}

.score-card .vocabulus-score-badge {
    grid-column: 2 / 3;
}

.score-card .player-score-summary {
    grid-column: 3 / 4;
}

.score-card .score-game-time {
    grid-column: 4 / 5;
}

.vocabulus-level-box {
    grid-column: 1 / 4;
    grid-row: 2;
    justify-self: start;
    align-self: start;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 2px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(42, 33, 24, 0.22);
    background: rgba(244, 236, 212, 0.96);
    color: #2e251a;
    font-size: 0.76rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.vocabulus-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4em;
    min-height: 1.4em;
    padding: 0 6px;
    border-radius: 999px;
    border: 1px solid rgba(42, 33, 24, 0.22);
    background: rgba(244, 236, 212, 0.96);
    color: #2e251a;
    font-size: 0.78rem;
    line-height: 1;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.score-card.current-turn .vocabulus-score-badge {
    animation: vocabulus-score-badge-spin 0.9s linear infinite;
}

.score-card.human-current-turn .human-turn-hourglass-badge {
    visibility: hidden;
    opacity: 0;
}

.score-card.human-current-turn.human-turn-action-started .human-turn-hourglass-badge {
    visibility: visible;
    opacity: 1;
}

.score-time-hourglass-button {
    display: none;
    align-items: center;
    justify-content: center;
    width: 1.55em;
    height: 1.55em;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(42, 33, 24, 0.22);
    border-radius: 999px;
    background: rgba(244, 236, 212, 0.96);
    color: #2e251a;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.88);
    pointer-events: none;
    appearance: none;
}

.score-game-time.has-game-time-limit .score-time-hourglass-button {
    display: inline-flex;
}

.score-time-hourglass-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    line-height: 1;
}

.score-card.current-turn .score-time-hourglass-icon {
    animation: vocabulus-hourglass-spin 0.9s linear infinite;
    transform-origin: 50% 50%;
}

.score-game-time {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.score-game-time .score-game-time-text {
    white-space: nowrap;
}

@keyframes vocabulus-score-badge-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes player-name-scroll {
    0%,
    18% {
        transform: translateX(0);
    }

    82%,
    100% {
        transform: translateX(calc(-100% + var(--player-heading-width, 100%)));
    }
}

.player-score-summary {
    display: contents;
}

.player-total-score,
.player-total-crossings,
.player-total-letters {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 3px 6px;
    border-radius: 999px;
    color: #111827;
    font-weight: 900;
    letter-spacing: 0.01em;
    line-height: 1;
    text-align: center;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.player-total-score {
    grid-column: 4;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
    padding-inline: 3px;
    background: rgba(255, 255, 255, 0.98);
    color: #020617;
    font-size: 0.86rem;
    font-weight: 950;
    font-variant-numeric: tabular-nums;
    text-align: center;
    border: 1px solid rgba(17, 24, 39, 0.18);
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.player-total-crossings,
.player-total-letters {
    min-width: 36px;
    background: rgba(255, 246, 210, 0.95);
    font-size: 0.72rem;
    text-transform: uppercase;
    text-align: center;
}

.player-total-letters {
    grid-column: 3;
    grid-row: 2;
    justify-self: end;
    background: rgba(229, 247, 255, 0.96);
}

.player-total-crossings {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
}

.score-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    align-items: center;
    gap: 3px 5px;
    margin: 0;
    line-height: 1;
}

.score-game-time {
    grid-column: 4;
    grid-row: 2;
    justify-self: end;
    font-size: 0.72rem;
    font-weight: 800;
    margin-bottom: 0;
    white-space: nowrap;
}

.muted {
    color: #6d5a49;
}

@media (max-width: 1100px) {
    .hero,
    .panel-grid,
    .control-strip,
    .score-section {
        grid-template-columns: 1fr;
        display: grid;
    }

    .control-strip .form-grid,
    .control-strip .lookup-form {
        grid-template-columns: 1fr;
    }

    .toolbar-mode {
        flex-wrap: wrap;
    }

    .workspace {
        grid-template-columns: 1fr;
    }

    .dock-row {
        grid-template-columns: 1fr;
    }
}

.error-list-page {
    background: linear-gradient(180deg, #fff7ed 0%, #fffbeb 100%);
    min-height: 100vh;
    margin: 0;
}

.error-list-shell {
    box-sizing: border-box;
    max-width: 760px;
    margin: 0 auto;
    padding: 12px 16px;
    border-radius: 18px;
}

.error-list-header h1 {
    margin: 0 0 4px;
    color: #9a3412;
    font-size: 1.55rem;
}

.error-list-header p {
    margin: 0 0 10px;
    color: #57534e;
    font-size: 0.95rem;
}

.vocabulus-report-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 8px 0 0;
}

.vocabulus-report-progress[hidden] {
    display: none !important;
}

.vocabulus-report-progress-track {
    position: relative;
    height: 22px;
    border: 1px solid #6a8f4d;
    border-radius: 999px;
    background: linear-gradient(180deg, #f6fbef 0%, #d9e8c9 100%);
    box-shadow:
        inset 0 1px 2px rgba(255, 255, 255, 0.8),
        inset 0 -2px 3px rgba(84, 118, 58, 0.15),
        0 1px 2px rgba(79, 103, 48, 0.12);
    overflow: hidden;
}

.vocabulus-report-progress-fill {
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(180deg, #8ec45d 0%, #5f9642 100%);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.45),
        inset 0 -1px 0 rgba(40, 67, 27, 0.18);
    transition: width 0.25s ease;
}

.vocabulus-report-progress-percent {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #111111;
    font-weight: 900;
    font-size: 0.92rem;
    letter-spacing: 0;
    text-shadow:
        0 1px 0 rgba(255, 255, 255, 0.65);
    pointer-events: none;
}

.vocabulus-report-progress-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: flex-end;
    color: #4b3514;
    font-weight: 900;
    font-size: 0.82rem;
    white-space: nowrap;
}

.possible-plays-window .error-list-header {
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(66, 50, 37, 0.18);
    background: linear-gradient(180deg, #fff8ea 0%, #fffdf8 100%);
}

.possible-plays-window .error-list-header h1 {
    line-height: 1.15;
    padding-top: 2px;
    color: #b45309;
    letter-spacing: 0;
    margin-bottom: 4px;
}

.possible-plays-window .possible-plays-report-header {
    margin-top: 4px;
    border: 1px solid rgba(66, 50, 37, 0.16);
    border-radius: 10px;
    background: #fffaf0;
}

.possible-plays-window .possible-plays-report {
    gap: 2px;
    padding: 2px 0;
    width: max-content;
    min-width: 100%;
}

.vocabulus-report-panel {
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;
}

.vocabulus-report-scroll {
    box-sizing: border-box;
    width: 100%;
    max-height: calc(100vh - 150px);
    overflow: auto;
    border-top: 1px solid rgba(66, 50, 37, 0.14);
    background: #fffdf8;
}

.vocabulus-report-content {
    width: max-content;
    min-width: 100%;
    padding: 6px 10px 8px;
}

.vocabulus-report-content > .possible-plays-report-line.is-title {
    margin: 0 0 8px;
    padding: 6px 12px;
    border: 1px solid #315b54;
    border-top-color: #d8fff7;
    border-left-color: #d8fff7;
    border-radius: 4px;
    background: linear-gradient(180deg, #67c7b5 0%, #2f8377 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.72),
        inset -1px -1px 0 rgba(17, 71, 65, 0.38),
        0 3px 6px rgba(23, 55, 51, 0.22);
    color: #071f1c;
}

.vocabulus-report-item {
    margin-bottom: 2px;
}

.vocabulus-report-item > .possible-plays-report-line {
    margin: 3px 0;
    padding: 6px 12px;
    border: 1px solid #2f675d;
    border-top-color: #d8fff7;
    border-left-color: #d8fff7;
    border-radius: 4px;
    background: linear-gradient(180deg, #b7efe4 0%, #57ad9f 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.82),
        inset -1px -1px 0 rgba(17, 71, 65, 0.34),
        0 3px 6px rgba(23, 55, 51, 0.2);
    color: #082d28;
    font-weight: 850;
    transition:
        background 140ms ease,
        box-shadow 140ms ease,
        transform 140ms ease,
        border-color 140ms ease;
}

.vocabulus-report-toggle {
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.vocabulus-report-toggle:hover {
    border-color: #24564e;
    border-top-color: #effffb;
    border-left-color: #effffb;
    background: linear-gradient(180deg, #d6fff7 0%, #69c1b2 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.9),
        inset -1px -1px 0 rgba(17, 71, 65, 0.4),
        0 5px 10px rgba(23, 55, 51, 0.28);
    transform: translateY(-2px);
}

.vocabulus-report-toggle:focus-visible {
    outline: 2px solid #064e3b;
    outline-offset: 2px;
}

.vocabulus-report-toggle[aria-expanded="true"] {
    background: linear-gradient(180deg, #57ad9f 0%, #348b7e 100%);
    box-shadow:
        inset -1px -1px 0 rgba(255, 255, 255, 0.42),
        inset 1px 1px 2px rgba(17, 71, 65, 0.34),
        0 1px 2px rgba(23, 55, 51, 0.18);
    transform: translateY(1px);
}

.vocabulus-report-toggle::after {
    content: " +";
    font-weight: 900;
}

.vocabulus-report-toggle[aria-expanded="true"]::after {
    content: " -";
}

.vocabulus-report-coordinates {
    margin-left: 22px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #1f1710;
    font-weight: 700;
}

.vocabulus-report-coordinates[hidden] {
    display: none !important;
}

.vocabulus-report-detail-item {
    min-width: max-content;
}

.vocabulus-report-detail-line {
    min-width: max-content;
    margin: 4px 0;
    padding: 7px 12px;
    border: 1px solid #c9872e;
    border-top-color: #ffe3ac;
    border-left-color: #ffe3ac;
    border-radius: 4px;
    background: linear-gradient(180deg, #ffd98f 0%, #f2b75e 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.72),
        inset -1px -1px 0 rgba(120, 70, 16, 0.28),
        0 2px 3px rgba(70, 45, 20, 0.18);
    white-space: pre;
    transition:
        background 140ms ease,
        box-shadow 140ms ease,
        transform 140ms ease,
        border-color 140ms ease;
}

.vocabulus-report-detail-toggle {
    display: block;
    width: 100%;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
}

.vocabulus-report-detail-toggle:hover {
    border-color: #b86f16;
    border-top-color: #fff0c7;
    border-left-color: #fff0c7;
    background: linear-gradient(180deg, #ffe6ad 0%, #f5bf66 100%);
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.8),
        inset -1px -1px 0 rgba(120, 70, 16, 0.34),
        0 4px 7px rgba(70, 45, 20, 0.24);
    transform: translateY(-1px);
}

.vocabulus-report-detail-toggle:focus-visible {
    outline: 2px solid #7c2d12;
    outline-offset: 2px;
}

.vocabulus-report-detail-toggle[aria-expanded="true"] {
    background: linear-gradient(180deg, #f2b75e 0%, #e7a242 100%);
    box-shadow:
        inset -1px -1px 0 rgba(255, 255, 255, 0.42),
        inset 1px 1px 2px rgba(88, 48, 10, 0.26),
        0 1px 2px rgba(70, 45, 20, 0.18);
    transform: translateY(1px);
}

.vocabulus-report-detail-toggle::after {
    content: " +";
    font-weight: 900;
}

.vocabulus-report-detail-toggle[aria-expanded="true"]::after {
    content: " -";
}

.vocabulus-report-submask-panel[hidden] {
    display: none !important;
}

.vocabulus-report-submask-heading {
    min-width: max-content;
    padding: 5px 10px 5px 48px;
    border-right: 1px solid rgba(70, 55, 39, 0.12);
    border-bottom: 1px solid rgba(70, 55, 39, 0.12);
    background: #ffe0a7;
    color: #4a2d11;
    font-weight: 900;
    white-space: pre;
}

.vocabulus-report-submask-line {
    min-width: max-content;
    padding: 5px 10px 5px 48px;
    border-right: 1px solid rgba(70, 55, 39, 0.08);
    border-bottom: 1px solid rgba(70, 55, 39, 0.08);
    background: rgba(255, 253, 248, 0.86);
    color: #4a2d11;
    white-space: pre;
}

.vocabulus-report-submask-item {
    min-width: max-content;
}

.vocabulus-report-submask-line.is-clickable {
    display: block;
    width: 100%;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.vocabulus-report-submask-line.is-clickable:hover {
    background: #fff2ca;
}

.vocabulus-report-submask-line.is-clickable[aria-expanded="true"] {
    background: #f7d79f;
    font-weight: 900;
}

.vocabulus-report-submask-line.is-without-words {
    background: #c62828;
    color: #fff;
    font-weight: 900;
}

.vocabulus-report-submask-line.is-over-limit {
    background: #f4b2b2;
    color: #6b1111;
}

.vocabulus-report-submask-line.is-over-limit.is-without-words {
    background: #f1a6a6;
    color: #5f0e0e;
}

.vocabulus-report-submask-line.is-over-limit.is-clickable:hover {
    background: #ef9f9f;
}

.vocabulus-report-submask-line.is-over-limit.is-clickable[aria-expanded="true"] {
    background: #ea8f8f;
    color: #4d0d0d;
}

.vocabulus-report-words-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2000;
    width: min(560px, calc(100vw - 36px));
    max-height: min(78vh, 680px);
    transform: translate(-50%, -50%);
    overflow: hidden;
    border: 1px solid rgba(121, 93, 48, 0.32);
    box-shadow: 0 18px 42px rgba(44, 31, 16, 0.34);
}

.vocabulus-report-words-panel .possible-plays-submask-accordion-scroll {
    max-height: min(52vh, 420px);
    overflow-y: auto;
    overflow-x: auto;
}

.vocabulus-report-words-panel .possible-mask-word-row {
    grid-template-columns: 54px minmax(220px, 1fr) 72px;
    min-width: 360px;
}

.vocabulus-report-words-panel .possible-mask-word-text {
    overflow: visible;
    white-space: nowrap;
}

.vocabulus-report-words-close {
    justify-self: end;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(82, 54, 22, 0.36);
    border-radius: 4px;
    background: #f7d79f;
    color: #2b2118;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.vocabulus-report-words-close:hover,
.vocabulus-report-words-close:focus-visible {
    background: #c62828;
    color: #fff;
    outline: none;
}

.vocabulus-report-definition-panel {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 2100;
    box-sizing: border-box;
    width: min(640px, calc(100vw - 36px));
    min-width: 0;
    height: min(82vh, 760px);
    max-height: min(82vh, 760px);
    transform: translate(-50%, -50%);
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    gap: 6px;
    padding: 12px;
    border: 1px solid rgba(121, 93, 48, 0.34);
    border-radius: 6px;
    background: #fffdf7;
    box-shadow: 0 18px 42px rgba(44, 31, 16, 0.36);
    overflow: hidden;
}

.vocabulus-report-definition-panel[hidden] {
    display: none !important;
}

.vocabulus-report-definition-title {
    font-size: 0.78rem;
    font-weight: 900;
    color: #6a4a11;
    text-transform: uppercase;
}

.vocabulus-report-definition-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.vocabulus-report-definition-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(82, 54, 22, 0.36);
    border-radius: 4px;
    background: #f7d79f;
    color: #2b2118;
    cursor: pointer;
    font: inherit;
    font-weight: 900;
}

.vocabulus-report-definition-close:hover,
.vocabulus-report-definition-close:focus-visible {
    background: #c62828;
    color: #fff;
    outline: none;
}

.vocabulus-report-definition-word {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-weight: 900;
    color: #2b2118;
}

.vocabulus-report-definition-status {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: 0.82rem;
    font-weight: 800;
    color: #7a5a1b;
}

.vocabulus-report-definition-text {
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    height: 100%;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    color: #241a12;
    line-height: 1.45;
    padding: 6px 2px 10px;
}

.vocabulus-report-dictionary-block {
    margin: 0 0 10px;
    border: 1px solid rgba(121, 93, 48, 0.28);
    border-radius: 5px;
    background: #fffaf0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.vocabulus-report-dictionary-name {
    padding: 7px 9px;
    background: linear-gradient(#f6d28f, #d59a42);
    border-bottom: 1px solid rgba(88, 59, 23, 0.32);
    color: #2b2118;
    font-weight: 900;
    text-transform: uppercase;
}

.vocabulus-report-dictionary-body {
    padding: 8px 9px 10px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.possible-plays-window .possible-plays-report-line.is-total,
.possible-plays-window .possible-plays-report-line.is-title {
    background: #f7d79f;
}

.possible-plays-window .possible-plays-report-line.is-play {
    background: #fffdf8;
}

.possible-plays-window .possible-plays-report-line.is-excluded {
    background: #ffe7e7;
}

.possible-plays-window .vocabulus-report-content > .possible-plays-report-line.is-title {
    background: linear-gradient(180deg, #67c7b5 0%, #2f8377 100%);
}

.possible-plays-window .vocabulus-report-item > .possible-plays-report-line.is-play {
    background: linear-gradient(180deg, #b7efe4 0%, #57ad9f 100%);
}

.possible-plays-window .vocabulus-report-item > .vocabulus-report-toggle:hover {
    background: linear-gradient(180deg, #d6fff7 0%, #69c1b2 100%);
}

.possible-plays-window .vocabulus-report-item > .vocabulus-report-toggle[aria-expanded="true"] {
    background: linear-gradient(180deg, #57ad9f 0%, #348b7e 100%);
}

.possible-plays-window .vocabulus-report-item > .vocabulus-report-toggle {
    border-width: 2px;
    border-style: solid;
    border-top-color: #555;
    border-left-color: #555;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.72),
        inset -1px -1px 0 rgba(0, 0, 0, 0.28),
        2px 2px 0 #000,
        0 4px 7px rgba(0, 0, 0, 0.22);
}

.possible-plays-window .vocabulus-report-item > .vocabulus-report-toggle:hover {
    border-top-color: #777;
    border-left-color: #777;
    border-right-color: #000;
    border-bottom-color: #000;
    box-shadow:
        inset 1px 1px 0 rgba(255, 255, 255, 0.82),
        inset -1px -1px 0 rgba(0, 0, 0, 0.32),
        3px 3px 0 #000,
        0 6px 10px rgba(0, 0, 0, 0.28);
}

.possible-plays-window .vocabulus-report-item > .vocabulus-report-toggle[aria-expanded="true"] {
    border-top-color: #000;
    border-left-color: #000;
    border-right-color: #555;
    border-bottom-color: #555;
    box-shadow:
        inset 2px 2px 3px rgba(0, 0, 0, 0.35),
        1px 1px 0 #000;
}

.possible-plays-window .possible-plays-valids-toggle {
    width: 100%;
    text-align: left;
    appearance: none;
    border: 0;
    padding: 5px 10px;
    font: inherit;
    cursor: pointer;
    background: #f7d79f;
    color: #2a2118;
    border-bottom: 1px solid rgba(66, 50, 37, 0.16);
    font-weight: 900;
}

.possible-plays-window .possible-plays-valids-panel {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: grid;
    grid-auto-rows: min-content;
    border: 1px solid rgba(66, 50, 37, 0.12);
    border-top: 0;
    border-radius: 0 0 10px 10px;
    background: #fffaf4;
    padding-bottom: 2px;
    overflow: visible;
}

.possible-plays-window .possible-plays-valids-scroll {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: min(46vh, calc(100vh - 380px));
    overflow: auto;
    overflow-x: scroll;
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
    box-sizing: border-box;
    padding-right: 6px;
    display: block;
    border: 1px solid rgba(66, 50, 37, 0.12);
    border-radius: 0 0 10px 10px;
    background: #fffaf4;
}

.possible-plays-window .possible-plays-valids-list {
    display: block;
    min-width: 0;
    width: max-content;
    min-width: max-content;
    max-width: none;
    padding-right: 6px;
}

.possible-plays-window .possible-plays-invalids-section {
    display: grid;
    gap: 4px;
    margin-top: 8px;
    min-width: 0;
    width: 100%;
}

.possible-plays-window .possible-plays-invalids-scroll {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: min(28vh, calc(100vh - 500px));
    overflow: auto;
    overflow-x: scroll;
    overflow-y: scroll;
    scrollbar-gutter: stable both-edges;
    box-sizing: border-box;
    display: block;
    border: 1px solid rgba(66, 50, 37, 0.12);
    border-radius: 0 0 10px 10px;
    background: #fffaf4;
}

.possible-plays-window .possible-plays-invalids-list {
    display: block;
    min-width: 0;
    width: max-content;
    min-width: max-content;
    max-width: none;
    padding-right: 6px;
}

.possible-plays-window .possible-plays-valids-section,
.possible-plays-window .possible-plays-invalids-section {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    display: grid;
    gap: 4px;
    border: 1px solid rgba(66, 50, 37, 0.12);
    border-radius: 10px;
    background: #fffaf4;
    padding: 0 0 4px;
}

.possible-plays-window .possible-plays-valids-section {
    margin-bottom: 8px;
}

.error-list-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.error-list-panel {
    background: rgba(255, 255, 255, 0.92);
    border: 2px solid #fdba74;
    border-radius: 18px;
    padding: 8px 10px;
    box-shadow: 0 14px 34px rgba(154, 52, 18, 0.12);
}

.error-option {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    column-gap: 10px;
    align-items: start;
    padding: 6px 4px;
    border-bottom: 1px solid #fed7aa;
    font-size: 0.93rem;
    color: #292524;
}

.error-option:last-child {
    border-bottom: 0;
}

.error-option input[type="checkbox"] {
    margin: 2px 0 0;
    transform: scale(1.05);
    justify-self: center;
}

.final-metric-option input[type="radio"] {
    margin: 2px 0 0;
    transform: scale(1.05);
    justify-self: center;
}

.error-option-text {
    display: block;
    line-height: 1.18;
    text-align: left;
}

.error-option-content {
    display: block;
}

.error-option-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7c2d12;
    text-align: left;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.error-option-trigger:hover {
    text-decoration: underline;
}

.error-option-trigger.active {
    color: #c2410c;
}

.error-option-help {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #3f2b1d;
    box-shadow: inset 0 0 0 1px rgba(255, 140, 0, 0.08);
}

.error-option-help[hidden] {
    display: none !important;
}

.error-option-help strong,
.error-option-help span,
.error-option-help em {
    display: block;
}

.error-option-help strong {
    margin-bottom: 4px;
    font-size: 0.93rem;
}

.error-option-help span {
    margin-bottom: 4px;
    line-height: 1.25;
}

.error-option-help em {
    color: #7c2d12;
    font-style: normal;
    line-height: 1.25;
}

.final-metric-option {
    align-items: start;
}

.final-metric-option-title {
    display: block;
    margin-bottom: 6px;
    color: #7c2d12;
    font-weight: 900;
    font-size: 0.98rem;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

.final-metric-popup-panel {
    display: grid;
    gap: 6px;
}

.final-metric-popup-form {
    display: grid;
    gap: 12px;
}

.error-list-messages {
    margin-bottom: 10px;
}

.time-log-shell {
    max-width: 680px;
}

.time-log-panel {
    padding: 12px;
}

.turn-history-table {
    display: grid;
    gap: 6px;
}

.turn-history-head,
.turn-history-row {
    display: grid;
    grid-template-columns: 1.1fr 1fr 110px;
    gap: 12px;
    align-items: center;
}

.turn-history-head {
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #7c2d12;
    padding: 0 6px 4px;
    border-bottom: 2px solid #fdba74;
}

.turn-history-row {
    border-radius: 12px;
    padding: 10px 12px;
    box-shadow: 0 4px 12px rgba(23, 19, 15, 0.12);
}

.turn-history-row strong,
.turn-history-row span {
    font-size: 0.96rem;
}

.turn-history-row span:last-child {
    font-weight: 900;
    letter-spacing: 0.04em;
    text-align: right;
}

.turn-history-empty {
    padding: 12px 10px;
    border-radius: 10px;
    background: #fff7ed;
    color: #7c2d12;
    font-weight: 700;
}

.time-log-list {
    display: grid;
    gap: 10px;
}

.time-log-summary-header h2 {
    margin: 0 0 10px;
    font-size: 1rem;
    color: #7c2d12;
}

.time-menu-shell {
    max-width: 560px;
}

.time-menu-panel {
    padding: 14px;
}

.time-menu-options {
    display: grid;
    gap: 12px;
}

.time-menu-card {
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid #fdba74;
    background: #fff7ed;
    color: #3f2b1d;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(23, 19, 15, 0.12);
}

.time-menu-card strong {
    font-size: 1rem;
    color: #9a3412;
}

.time-menu-card span {
    font-size: 0.92rem;
    line-height: 1.3;
}

.time-match-form {
    display: grid;
    gap: 10px;
}

.time-match-help {
    margin: 0;
    font-size: 0.9rem;
    color: #7c2d12;
}

.field-help-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    overflow: visible;
}

.field-help-tooltip {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    transform: none;
    width: max-content;
    max-width: 165px;
    padding: 3px 5px;
    border-radius: 10px;
    background: #2a2118;
    color: #fffaf0;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.05;
    text-align: left;
    box-shadow: 0 8px 20px rgba(23, 19, 15, 0.28);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
    z-index: 20;
}

.field-help-tooltip::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 14px;
    transform: none;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #2a2118 transparent;
}

.field-help-wrap:hover .field-help-tooltip,
.field-help-wrap:focus-within .field-help-tooltip {
    opacity: 1;
}

.field-help-tooltip-left-shift {
    left: auto;
    right: 0;
}

.field-help-tooltip-left-shift::after {
    left: auto;
    right: 14px;
}


.time-log-card {
    border-radius: 14px;
    padding: 12px 14px;
    box-shadow: 0 6px 18px rgba(23, 19, 15, 0.14);
}

.time-log-card.current-turn {
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(23, 19, 15, 0.22);
}

.time-log-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.time-log-card-header strong {
    font-size: 1rem;
}

.time-log-card-header span {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.time-log-time {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.game-over-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, rgba(247, 212, 155, 0.72), transparent 32%),
        linear-gradient(180deg, #f6ebd6 0%, #efe0c4 100%);
}

body.game-over-open {
    overflow: hidden;
}

.game-over-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    padding: 24px;
    background: transparent;
    pointer-events: none;
}

.game-over-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.game-over-card {
    width: min(860px, 100%);
    background: #fffaf0;
    border: 2px solid #6d4e2f;
    border-radius: 22px;
    box-shadow: 0 16px 40px rgba(46, 31, 15, 0.18);
    padding: 24px 26px;
}

.game-over-card-overlay {
    max-height: min(88vh, 900px);
    overflow: auto;
    pointer-events: auto;
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.game-over-card-overlay .game-over-header {
    cursor: move;
    user-select: none;
}

.game-over-card-overlay.is-dragging {
    box-shadow: 0 22px 48px rgba(46, 31, 15, 0.24);
}

.game-over-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 18px;
    cursor: grab;
    user-select: none;
}

.game-over-kicker {
    margin: 0 0 6px;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #7a5838;
}

.game-over-header h1 {
    margin: 0;
    font-size: 2rem;
    color: #a14813;
}

.game-over-message {
    display: block;
    width: 100%;
    margin: 10px 0 0;
    font-size: 0.95rem;
    color: #5e4631;
    line-height: 1.45;
}

.game-over-ranking {
    margin-top: 18px;
}

.game-over-ranking-head,
.game-over-row {
    display: grid;
    grid-template-columns: 90px minmax(0, 1fr) 150px;
    align-items: center;
    gap: 12px;
}

.game-over-ranking-head {
    padding: 0 12px 8px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #74553a;
}

.game-over-ranking-list {
    display: grid;
    gap: 8px;
}

.game-over-row {
    border-radius: 16px;
    padding: 12px 14px;
    box-shadow: 0 4px 14px rgba(31, 20, 12, 0.08);
}

.game-over-position,
.game-over-points {
    font-size: 1.2rem;
    font-weight: 900;
}

.game-over-player-block {
    display: grid;
    gap: 6px;
}

.game-over-player {
    font-size: 1rem;
}

.game-over-status {
    font-size: 0.74rem;
    font-weight: 700;
    color: #6d4c30;
}

.game-over-player-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.game-over-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(42, 33, 24, 0.16);
    background: rgba(244, 236, 212, 0.72);
    color: #463425;
    font-size: 0.74rem;
    line-height: 1;
    white-space: nowrap;
}

.game-over-metric.is-selected {
    border-color: rgba(161, 72, 19, 0.5);
    background: rgba(255, 238, 198, 0.96);
    box-shadow: inset 0 0 0 1px rgba(161, 72, 19, 0.14);
}

.game-over-metric-label {
    font-weight: 700;
    opacity: 0.78;
}

.game-over-metric-value {
    font-weight: 900;
}

.game-over-points {
    justify-self: end;
    text-align: right;
}

.game-over-actions {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}
