body {
    /* Site-wide warm page background */
    background-color: var(--sw-bg-page, #E8BC7E) !important;
    color: var(--sw-text-on-page, #302418);
}
/* Rack area (question tiles) */
#rack-tiles {
    min-height: 60px;
}
/* Input tiles (answer area) - no black background */
#input-tiles {
    min-height: 84px; /* Increased to accommodate larger tiles */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
}
.question-tile:not(.swappo-tile) {
    width: 52px;
    height: 52px;
    min-height: 52px;
    margin: 2px;
    object-fit: contain;
    background: #fff;
    border-radius: 3px;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.answer-tile:not(.swappo-tile) {
    width: 52px;
    height: 52px;
    min-height: 52px;
    margin: 0;
    object-fit: contain;
    background: #fff;
    border-radius: 3px;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}
.answer-tile-placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 52px;
    height: 52px;
    min-height: 52px;
    margin: 2px;
    border: 1px solid #6d4c2a;
    background-color: #3d2b1a;
    border-radius: 3px;
    /* Always visible even when empty */
    visibility: visible;
    flex-shrink: 0;
}
.answer-tile-placeholder .answer-tile {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
}
.answer-tile.fixed {
    opacity: 0.7; /* Visually distinguish fixed tiles */
    pointer-events: none; /* Prevent dragging fixed tiles */
}
.nohooks {
    color: red; /* Words or hooks with no hooks */
}
.no_s_hook {
    color: blue; /* Words or hooks without -S hook */
}
.submission-log {
    max-height: 300px;
    overflow-y: auto;
}
.submission-log table {
    width: 100%;
    border-collapse: collapse;
}
.submission-log th, .submission-log td {
    border: 1px solid #495057;
    padding: 5px;
    text-align: center;
}
.submission-log .table-dark {
    background-color: #212529;
}
.submission-log .table-dark thead th {
    border-color: #495057;
}
.submission-log .table-dark tbody td {
    border-color: #495057;
}
.submission-log td[data-value="0"], .submission-log td[data-value="null"] {
    color: transparent;
}
#feedback.duplicate {
    color: #ffffff !important;
    font-weight: bold;
}
.correct { color: green !important; }
.correct-with-hints { color: rgb(126, 83, 3) !important; }
.incorrect { color: red !important; }
tr.incorrect td { color: red !important; }
tr.skipped td { color: rgba(255, 183, 77, 0.95) !important; }
tr.skipped td.col-symbol { color: #f59e0b !important; }
tr.correct td { color: #FFB74D !important; }
tr.correct-with-hints td { color: #FFB74D !important; }
#last-entry-area {
    text-align: center;
}
.alphabox {
    background-color: var(--sw-bg-shell);
    font-family: monospace;
    color: var(--sw-text-on-dark);
    font-weight: bold;
    margin: 20px;
    padding: 20px;
}
.alphaheadline {
    font-family: monospace;
    color: white;
    font-size: 2.5em;
    font-weight: bolder;
    margin-bottom: 20px;
}
.word-illustration {
    display: block;
    width: 100%;
    max-width: 256px;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 6px;
    margin: 0 auto 12px;
}
.word-illustration.word-illustration-loading {
    opacity: 0.45;
    filter: grayscale(0.3);
}
.word-illustration-admin {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    max-width: 256px;
}
.word-illustration-admin-status {
    flex: 1 1 100%;
    font-size: 0.75rem;
    text-align: center;
}

.word-image-prompt-modal {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.word-image-prompt-modal[hidden] {
    display: none !important;
}
.word-image-prompt-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}
.word-image-prompt-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    max-height: min(85vh, 640px);
    overflow: auto;
    padding: 1rem 1.1rem 1rem;
    border-radius: 8px;
    background: var(--sw-bg-panel, #2a2420);
    color: var(--sw-text-on-panel, #f5efe8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.word-image-prompt-modal-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}
.word-image-prompt-modal-hint {
    margin: 0 0 0.75rem;
}
.word-image-prompt-modal-label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
    color: #b0a79f;
}
.word-image-prompt-modal-dialog .word-img-prompt-input {
    width: 100%;
    min-height: 8rem;
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    resize: vertical;
}
.word-image-prompt-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}
.deffield {
    font-family: monospace;
    color: white;
    font-weight: bold;
    font-size: medium;
    margin-bottom: 10px;
}
/* hookfield – layout-only containers for hooks/similar words/backwords.
   Colour comes from inner .ab-word (amber) and .ab-def (grey) spans. */
.hookfield, .hookfield2, .hookfield3, .hookfield4 {
    margin-bottom: 6px;
    text-align: left;
}
.hookfield2 { padding-left: 20px; }
.hookfield3 { padding-left: 40px; }
.hookfield4 { padding-left: 60px; }

/* alphabox inner spans – amber/gold for words & hooks, grey for definitions */
.ab-word {
    color: #FFB74D;
    font-weight: bold;
}
.ab-def {
    color: #aaa;
    font-size: 0.85em;
}
.ab-label {
    color: #888;
    font-size: 0.85em;
    font-weight: bold;
}
.ab-reveal-btn {
    background: transparent;
    border: 1px solid #6d4c2a;
    color: #FFB74D;
    border-radius: 3px;
    font-size: 0.85em;
    line-height: 1;
    padding: 0 5px;
    margin-left: 2px;
    cursor: pointer;
}
.ab-reveal-btn:hover {
    background: #3d2b1a;
}
.extrabox {
    font-family: monospace;
    color: white;
    font-weight: bold;
    font-size: large;
    margin-bottom: 20px;
    margin-top: 20px;
}
#last-entry-area .accordion {
    text-align: left;
}
#last-entry-area .accordion-body {
    background-color: var(--sw-bg-shell);
    padding: 10px;
    color: var(--sw-text-on-dark);
}
#last-entry-area .accordion-button {
    background-color: var(--sw-bg-elevated);
    font-family: monospace;
    font-size: large;
    font-weight: bold;
    color: var(--sw-accent-soft);
}
#last-entry-area .accordion-button:not(.collapsed) {
    background-color: var(--sw-bg-shell);
    color: var(--sw-accent);
}
/* FSRS plus button: matches game log style */
.fsrs-plus-wrap {
    display: inline;
    font-size: inherit;
    line-height: inherit;
}
.fsrs-plus-btn {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    padding: 0;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    font-weight: bold;
    font-family: inherit;
    color: #fff;
    background-color: #2E7D32;
    border: 1px solid #1B5E20;
    border-radius: 3px;
    cursor: pointer;
    box-sizing: border-box;
}
.fsrs-minus-indicator {
    width: 16px;
    height: 16px;
    margin-right: 4px;
    padding: 0;
    vertical-align: middle;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    line-height: 1;
    font-weight: bold;
    font-family: inherit;
    color: #fff;
    background-color: #0D47A1;
    border: 1px solid #08306B;
    border-radius: 3px;
    box-sizing: border-box;
    cursor: pointer;
}
.fsrs-minus-indicator:hover {
    background-color: #0B3A85;
}
/* FSRS minus indicator hover uses theme blue — see fsrs styles above */

/* Toolbar buttons use Bootstrap btn classes — see css/buttons.css */

/* === Brown/Wood Panel Theme === */
/* Reusable brown-themed panel matching the endgame analysis cards */
.panel_cantik {
    background: #302418;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.32), 0 1px 3px rgba(0, 0, 0, 0.22);
}
.panel_cantik_header {
    font-size: 13px;
    font-weight: bold;
    color: #FFB74D;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === Brown Table – reusable table class matching the endgame move-list look === */
/* Wrap inside a .panel_cantik for the full card appearance.                       */
/*   <div class="panel_cantik"><table class="table_cantik">...</table></div>       */
/*                                                                                */
/* Column widths shrink-to-fit by default. Use the predefined .col-* classes     */
/* on BOTH <th> and <td> for each column you need. Omit any you don't use.       */
/*                                                                                */
/* Predefined columns:                                                            */
/*   .col-date     – "Date"   – fits YYMMDD HH:MM                                */
/*   .col-pos      – "Pos"    – fits e.g. A15                                    */
/*   .col-player   – "Player" – auto-width for name, won't stretch               */
/*   .col-score    – "Score"  – fits 3-digit + sign, bold                         */
/*   .col-num      – "#"      – narrow row-number                                 */
/*   .col-move     – "Move"   – the main content column, takes remaining space    */
/*   .col-total    – "Total"  – cumulative score, right-aligned                   */
/*   .col-icon     – (no hdr) – tiny icon column                                  */
/*   .col-symbol   – (no hdr) – status symbol after turn # (skull etc.)           */
.table_cantik {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: #ccc;
    margin-bottom: 0;
    table-layout: auto;
}

/* ---- Header ---- */
.table_cantik thead tr {
    border-bottom: 1px solid #555;
}
.table_cantik th {
    padding: 4px 8px;
    color: #FFB74D !important;
    font-weight: bold;
    font-size: 12px;
    white-space: nowrap;
    text-align: left;
}

/* ---- Body ---- */
.table_cantik tbody tr {
    border-bottom: 1px solid #3d2b1a;
}
.table_cantik tbody tr.player-b {
    background: #3d2b1a;
}
.table_cantik tbody tr:hover {
    background: #444 !important;
}
.table_cantik td {
    padding: 3px 8px;
    white-space: nowrap;
    font-size: 12px;
    color: #ccc;
}

/* ================================================================
   PREDEFINED COLUMNS – use on both <th> and <td>
   ================================================================ */

/* --- .col-date  "Date" – YYMMDD HH:MM --- */
.table_cantik .col-date {
    width: 1%;          /* shrink-to-fit */
    white-space: nowrap;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-family: monospace, Arial, sans-serif;
    font-size: 11px;
    padding: 3px 6px;
}

/* --- .col-pos  "Pos" – e.g. A15, 8H --- */
.table_cantik .col-pos {
    width: 1%;
    white-space: nowrap;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-family: monospace, Arial, sans-serif;
    font-size: 11px;
    padding: 3px 6px;
    text-align: left;
}

/* --- .col-player  "Player" – auto-width for name --- */
.table_cantik .col-player {
    width: 1%;          /* shrink-to-fit, won't stretch */
    white-space: nowrap;
    color: #ccc;
    font-size: 12px;
    padding: 3px 6px;
}

/* --- .col-score  "Score" – 3-digit score, bold --- */
.table_cantik .col-score {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    font-weight: bold;
    color: #ccc;
    font-variant-numeric: tabular-nums;
    font-family: monospace, Arial, sans-serif;
    font-size: 12px;
    padding: 3px 6px;
}

/* --- .col-num  "#" – narrow row counter --- */
.table_cantik .col-num {
    width: 1%;
    white-space: nowrap;
    color: #888;
    font-variant-numeric: tabular-nums;
    font-family: monospace, Arial, sans-serif;
    font-size: 11px;
    padding: 3px 6px;
    text-align: right;
}

/* --- .col-move  "Move" – main content, takes remaining space --- */
.table_cantik .col-move {
    width: auto;
    color: #ccc;
}

/* --- .col-total  "Total" – cumulative score, right-aligned --- */
.table_cantik .col-total {
    width: 1%;
    white-space: nowrap;
    text-align: right;
    font-weight: bold;
    color: #fff;
    font-variant-numeric: tabular-nums;
    font-family: monospace, Arial, sans-serif;
    font-size: 12px;
    padding: 3px 6px;
}

/* --- .col-icon  icon slot (star, phony marker etc.) --- */
.table_cantik .col-icon {
    width: 18px;
    min-width: 18px;
    text-align: center;
    padding: 3px 2px;
}

/* --- .col-symbol  status symbol column (after turn #) --- */
.table_cantik .col-symbol {
    width: 1%;
    min-width: 16px;
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
    padding: 3px 2px;
}

/* --- .col-hooks  front/back hooks column (X+ / +X) --- */
.table_cantik .col-hooks {
    width: 1%;
    white-space: nowrap;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
    color: #ccc;
    padding: 3px 2px;
}

/* ---- Anagram log overrides ---- */
.anagram-log th {
    text-align: center !important;
}
.anagram-log .col-move {
    width: 100%;
}
.anagram-log .col-move .tile-word {
    display: inline-flex;
    gap: 1px;
    align-items: center;
    vertical-align: middle;
    margin: 0 3px;
}
/* Letter-only log tiles (PNG lexicons — avoids baked-in point values on tile images) */
.anagram-log .col-move .anagram-log-letter-tile {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    margin: 0;
    padding: 0;
    background: #fff;
    color: #000;
    font-weight: 700;
    font-size: 0.62rem;
    line-height: 1;
    border-radius: 2px;
    flex-shrink: 0;
    vertical-align: middle;
}
.anagram-log .col-move .anagram-log-letter-tile.tile-hook {
    width: 13px;
    height: 13px;
    min-width: 13px;
    min-height: 13px;
    max-width: 13px;
    max-height: 13px;
    margin: 0 0.5px;
    font-size: 0.5rem;
    opacity: 0.7;
}
.anagram-log .col-move .tile-word.tile-invalid .anagram-log-letter-tile,
.anagram-log .col-move .anagram-log-letter-tile.anagram-log-letter-tile-invalid {
    background: #d32f2f;
    color: #fff;
}
.anagram-log .col-move .tile-word.tile-skipped .anagram-log-letter-tile {
    background: #ffb74d;
    border-color: #e65100;
    color: #000;
}
.anagram-log tr.skipped .col-move .anagram-log-letter-tile.tile-hook {
    background: #ffb74d;
    border-color: #e65100;
    color: #000;
    opacity: 1;
}
.anagram-log .col-move .tile-word img,
.anagram-log .col-move .tile-word img.question-tile,
.anagram-log .col-move .tile-word img.answer-tile {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    max-height: 18px;
    margin: 0;
    padding: 0;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    background: #fff;
    border-radius: 2px;
}
.anagram-log .col-move .tile-word.tile-invalid img {
    background: #d32f2f;
}
.anagram-log .col-move .tile-word.tile-skipped img {
    background: #ffb74d;
}
.anagram-log tr.skipped .col-move img.tile-hook {
    background: #ffb74d;
    opacity: 1;
}
.anagram-log .col-symbol .skipped-marker {
    color: #e65100;
    font-weight: bold;
}

/* Hook letter PNGs in log row; sit outside .tile-word so need their own sizing */
.anagram-log .col-move img.tile-hook {
    width: 13px;
    height: 13px;
    min-width: 13px;
    min-height: 13px;
    max-width: 13px;
    max-height: 13px;
    margin: 0 0.5px;
    padding: 0;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
    background: #fff;
    border-radius: 2px;
    opacity: 0.7;
}

/* ================================================================
   GENERIC MODIFIERS – combine with any column
   ================================================================ */
.table_cantik .col-right {
    text-align: right;
}
.table_cantik .col-center {
    text-align: center;
}
.table_cantik .col-bold {
    font-weight: bold;
}
.table_cantik .col-dim {
    color: #bbb;
}
.table_cantik .col-accent {
    color: #FFB74D;
}

/* Score colouring utilities – apply to <tr> to highlight the whole row */
.table_cantik .score-bingo {
    color: #FF9800 !important;
    font-weight: bold;
}
.table_cantik tr.bingo-row .col-pos,
.table_cantik tr.bingo-row .col-move,
.table_cantik tr.bingo-row .col-score {
    color: #FFB74D !important;
    font-weight: bold;
}
.table_cantik .score-invalid {
    color: #ff4757 !important;
    font-weight: bold;
}

/* Current / active row highlight */
.table_cantik .row-active td,
.table_cantik .row-current td {
    background: #4a3520;
}
.table_cantik .row-active td:hover,
.table_cantik .row-current td:hover {
    background: #444;
}

/* Endgame-style summary row */
.table_cantik .row-summary td {
    text-align: center;
    font-weight: bold;
    color: #FFB74D;
    padding: 8px;
}

/* ================================================================
   UNIFIED SCRABBLE BOARD
   Shared board class for consistent look across all pages:
   boardview.php, play.php, first_move.php, etc.
   ================================================================ */

/* Board table – sits inside a .panel_cantik wrapper.
   Use CSS Grid (not table layout) so 15×15 row heights cannot overflow the square. */
.scrabble-board {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    grid-template-rows: repeat(15, 1fr);
    aspect-ratio: 1 / 1;
    border-collapse: collapse;
    border-spacing: 0;
    border: 0;
    line-height: 0;
    width: 567px;
    box-sizing: border-box;
}
.scrabble-board tbody,
.scrabble-board tr {
    display: contents;
}
.scrabble-board td {
    padding: 0 !important;
    margin: 0 !important;
    border: 0;
    line-height: normal;
    vertical-align: top;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
}

html[data-tile-renderer="css"] .scrabble-board td {
    overflow: hidden;
}

/* Board cells */
.scrabble-board .board-cell {
    width: 100%;
    height: 100%;
    border: 1px solid #555;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin: 0;
    padding: 0;
    cursor: pointer;
    line-height: normal;
    box-sizing: border-box;
}

/* Premium squares */
.scrabble-board .board-cell.star          { background: #8B4513; }
.scrabble-board .board-cell.double-word   { background: #FF6B6B; }
.scrabble-board .board-cell.double-letter { background: #4ECDC4; }
.scrabble-board .board-cell.triple-word   { background: #FF4757; }
.scrabble-board .board-cell.triple-letter { background: #5352ED; }

/* Tile images inside cells.
   PNG glyphs are 100×100 letters on a transparent canvas, with the ink
   systematically ~3.5px right of center. Pinning the IMG at top/left 100%
   plus question-tile min-height/margin also shoved faces toward the
   bottom-right. Face color lives on the cell; the IMG is a centered glyph. */
html[data-tile-renderer="png"] .scrabble-board .board-cell:has(> img.board-tile),
html[data-tile-renderer="png"] .scrabble-board .board-cell:has(> img.tile-preview-placed) {
    background: #fff !important;
}
.scrabble-board img.board-tile,
.scrabble-board img.tile-preview-placed {
    box-sizing: border-box !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 78% !important;
    height: 78% !important;
    max-width: 78% !important;
    max-height: 78% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: auto !important;
    padding: 0 !important;
    object-fit: contain !important;
    object-position: center center !important;
    /* Counter the right-heavy letter art without moving the cell face. */
    transform: translate(-3.5%, 0);
    background: transparent;
    background-color: transparent;
}
.scrabble-board .board-tile.blank-tile {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}
.scrabble-board .board-tile.placed {
    cursor: pointer;
}

/* Most-recent-move highlight: amber/gold standard */
.scrabble-board .board-cell.last-move-highlight {
    background: #FFB74D !important;
}
.scrabble-board .board-cell.last-move-highlight img.board-tile,
.scrabble-board .board-cell.last-move-highlight img.tile-preview-placed {
    background: transparent !important;
    background-color: transparent !important;
}
html[data-tile-renderer="png"] .scrabble-board .board-cell.last-move-highlight:has(> img.board-tile),
html[data-tile-renderer="png"] .scrabble-board .board-cell.last-move-highlight:has(> img.tile-preview-placed) {
    background: #FFB74D !important;
}
html[data-tile-renderer="css"] .scrabble-board .board-cell.last-move-highlight {
    background: #ffb74d !important;
    box-shadow: none !important;
}
html[data-tile-renderer="css"] .scrabble-board .board-cell.last-move-highlight .swappo-tile.board-tile {
    --swappo-tile-bg: #ffb74d;
    --swappo-tile-border-color: #e65100;
    --swappo-tile-letter-color: #1a1a1a;
    --swappo-tile-point-color: #1a1a1a;
    background: #ffb74d !important;
    border-color: #e65100 !important;
    box-shadow: none !important;
}
html[data-tile-renderer="css"] .scrabble-board .board-cell.last-move-highlight .swappo-tile.board-tile .swappo-tile-letter {
    color: #1a1a1a !important;
}

/* Preview tiles (ranked move hover) */
.scrabble-board .board-cell.preview-tile {
    background: rgba(78, 205, 196, 0.3) !important;
    border: 2px solid #4ECDC4 !important;
}

/* Ghost play: letter drawn under tile PNG so the letter is visible if the image fails */
.scrabble-board .board-cell.preview-tile .board-preview-fallback-letter.board-preview-fallback-under {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(11px, 2.6vw, 18px);
    z-index: 4;
    color: #111;
    background: #fff;
    border: 1px solid #555;
    box-sizing: border-box;
    pointer-events: none;
}
.scrabble-board .board-cell.preview-tile .board-tile.preview-placement-tile {
    z-index: 5;
}

/* Mobile responsive: board width; aspect-ratio keeps square.
   Uses safe-area-inset for modern iPhones and caps height to avoid cutoff. */
@media (max-width: 1200px) {
    .scrabble-board {
        width: min(
            calc(100vw - 32px - env(safe-area-inset-left) - env(safe-area-inset-right)),
            calc(100vh - 200px)
        ) !important;
        max-width: 100%;
    }
}

/* ================================================================
   UNSEEN TILES – shared bag/unseen panel (annotate / stream standard)
   ================================================================ */
.sw-unseen-wrap {
    margin-top: 0;
}
.sw-unseen-label {
    font-size: 13px;
    color: #FFB74D;
    margin-bottom: 6px;
}
.sw-unseen-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    justify-content: flex-start;
    align-items: center;
    min-height: 16px;
}
/* PNG unseen chips must stay compact. Do not use % padding — it is relative
   to the panel width, so 10% on a 300–1200px sidebar blows chips up to
   rack/board scale. */
.sw-unseen-tiles img,
.sw-unseen-tiles img.sw-unseen-tile,
.sw-unseen-tiles img.question-tile,
.sw-unseen-tiles img.bv-inline-tile,
.sw-unseen-tiles img.bv-inline-tile-16 {
    box-sizing: border-box !important;
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
    margin: 1px !important;
    padding: 1px !important;
    flex: 0 0 16px;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 1px;
    background: #fff;
}
.sw-unseen-tiles .question-tile:not(.swappo-tile) {
    width: 16px;
    height: 16px;
    min-height: 16px;
    margin: 1px;
}
body.play-php-page .sw-unseen-tiles img,
body.play-php-page .sw-unseen-tiles img.sw-unseen-tile,
body.play-php-page .sw-unseen-tiles img.question-tile,
body.play-php-page .sw-unseen-tiles .question-tile:not(.swappo-tile) {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    max-width: 16px !important;
    min-height: 16px !important;
    max-height: 16px !important;
}
.sw-unseen-status {
    font-size: 11px;
    color: #888;
    margin-top: 4px;
    min-height: 1.1em;
}

/* ================================================================
   WORD_LIST – Reusable alphabox-inspired word list styling.
   All-caps words in amber/yellow, hooks (+X) and plus sign also
   amber/yellow, headlines small grey bold.
   ================================================================ */
.word_list {
    font-family: monospace, Arial, sans-serif;
    color: #ccc;
    font-size: 12px;
    line-height: 1.6;
}
.word_list .wl-word {
    color: #FFB74D;
    font-weight: bold;
    text-transform: uppercase;
}
.word_list .wl-hook {
    color: #FFB74D;
    font-weight: bold;
    text-transform: uppercase;
}
.word_list .wl-headline {
    color: #888;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
    margin-bottom: 1px;
}
.word_list .wl-prob {
    color: #888;
    font-size: 10px;
}
.word_list .wl-def {
    color: #aaa;
    font-size: 11px;
    font-style: italic;
}

/* ================================================================
   WORD_POPUP – Mouseover popup for played tiles on any scrabble-board
   Uses word_list styling inside. Shows: words, probability,
   optional definition, optional hooks.
   Two-word mode uses side-by-side columns.
   ================================================================ */
.word_popup {
    position: absolute;
    background: #1a1a1a;
    color: #ccc;
    border: 1px solid #FFB74D;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 12px;
    line-height: 1.5;
    z-index: 2000;
    display: none;
    pointer-events: none;
    max-width: 520px;
    min-width: 160px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    font-family: monospace, Arial, sans-serif;
}
/* Two-column container for 2-word popups */
.word_popup .wordpop-columns {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.word_popup .wordpop-col {
    flex: 1;
    min-width: 0;
}
/* Vertical divider between columns */
.word_popup .wordpop-col + .wordpop-col {
    border-left: 1px solid #444;
    padding-left: 16px;
}
.word_popup .wordpop-word {
    font-weight: bold;
    color: #FFB74D;
    font-size: 14px;
    margin-bottom: 2px;
    text-transform: uppercase;
}
.word_popup .wordpop-prob {
    color: #888;
    font-size: 10px;
    margin-bottom: 2px;
}
.word_popup .wordpop-def {
    color: #aaa;
    font-size: 11px;
    margin-bottom: 8px;
    font-style: italic;
}
.word_popup .wordpop-hooks-label {
    color: #888;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    margin-bottom: 1px;
}
.word_popup .wordpop-hook {
    color: #FFB74D;
    font-weight: bold;
    font-size: 12px;
    text-transform: uppercase;
    line-height: 1.6;
}
.word_popup .wordpop-divider {
    border-top: 1px solid #444;
    margin: 6px 0;
}

.form-group {
    margin-bottom: 1rem;
}
.form-label {
    color: white !important;
    font-family: monospace;
    font-weight: bold;
}
.form-control, .form-select {
    background-color: #333 !important;
    color: white !important;
    border: 1px solid #808080;
}
.form-check-input {
    background-color: #333;
    border: 1px solid #808080;
}
.form-check-label {
    color: white !important;
    font-family: monospace;
}
#optionsAccordion {
    background-color: var(--sw-bg-shell);
}
#optionsAccordion .accordion-item {
    background-color: var(--sw-bg-shell);
    color: var(--sw-text-on-dark);
    border-color: var(--sw-border);
}
#optionsAccordion .accordion-button {
    background-color: var(--sw-bg-elevated);
    color: var(--sw-accent-soft);
}
#optionsAccordion .accordion-button:not(.collapsed) {
    background-color: var(--sw-bg-shell);
    color: var(--sw-accent);
}

/* ================================================================
   AUTH PAGES (login.php, etc.) – brown panel + amber accents
   ================================================================ */
.auth-page {
    min-height: 100vh;
    background: var(--sw-bg-page, #E8BC7E);
    color: var(--sw-text-muted-on-dark, #d7ccc8);
}
.auth-page .auth-card {
    background: #302418;
    border: 1px solid #6d4c2a;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.auth-page .auth-card .card-header {
    background: #3d2b1a;
    border-bottom: 1px solid #6d4c2a;
    color: #FFB74D;
}
.auth-page .auth-card .card-header h3 {
    color: #FFB74D;
    font-weight: 700;
}
.auth-page .auth-card .card-body {
    background: transparent;
    color: #ccc;
}
.auth-page .auth-logo {
    display: block;
    height: 88px;
    width: auto;
    max-width: min(420px, 100%);
    margin-left: auto;
    margin-right: auto;
}
.auth-page .form-label {
    color: #d7ccc8 !important;
}
.auth-page .form-control {
    background-color: #1a1410 !important;
    color: #f5f5f5 !important;
    border: 1px solid #6d4c2a !important;
}
.auth-page .form-control::placeholder {
    color: #888;
}
.auth-page .form-control:focus {
    border-color: #FFB74D !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 183, 77, 0.22);
}
/* Auth primary button (login/register — no buttons.css on those pages) */
.auth-page .btn-primary {
    --bs-btn-bg: #505050;
    --bs-btn-border-color: #777777;
    --bs-btn-color: #e8e8e8;
    --bs-btn-hover-bg: #626262;
    --bs-btn-hover-border-color: #888888;
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-bg: #444444;
    --bs-btn-active-border-color: #888888;
    --bs-btn-focus-shadow-rgb: 120, 120, 120;
}
.btn-google-signin {
    display: block;
    width: 100%;
    padding: 0.5rem 1rem;
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    color: #fff !important;
    background-color: #1b5e20;
    border: 1px solid #145218;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn-google-signin:hover,
.btn-google-signin:focus {
    color: #fff !important;
    background-color: #237027;
    border-color: #1b5e20;
    text-decoration: none;
}
.btn-google-signin:active {
    color: #fff !important;
    background-color: #145218;
    border-color: #0d3d10;
}
/* Google Identity light-theme sign-in button (login/register) */
.btn-sign-in-with-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #1F1F1F !important;
    background: #FFFFFF;
    border: 1px solid #747775;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-sign-in-with-google:hover,
.btn-sign-in-with-google:focus {
    color: #1F1F1F !important;
    background: #F8F9FA;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.btn-sign-in-with-google:active {
    color: #1F1F1F !important;
    background: #EEEEEE;
}
.btn-sign-in-with-google__icon {
    display: flex;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: #FFFFFF;
}
.btn-sign-in-with-google__icon svg {
    display: block;
    width: 20px;
    height: 20px;
}
.btn-sign-in-with-google__label {
    flex: 0 1 auto;
}
/* X Identity sign-in button (login/register) */
.btn-sign-in-with-x {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 10px 12px;
    font-family: 'Roboto', sans-serif;
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: #FFFFFF !important;
    background: #000000;
    border: 1px solid #000000;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.btn-sign-in-with-x:hover,
.btn-sign-in-with-x:focus {
    color: #FFFFFF !important;
    background: #1a1a1a;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}
.btn-sign-in-with-x:active {
    color: #FFFFFF !important;
    background: #333333;
}
.btn-sign-in-with-x__icon {
    display: flex;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}
.btn-sign-in-with-x__icon svg {
    display: block;
    width: 18px;
    height: 18px;
    fill: #FFFFFF;
}
.btn-sign-in-with-x__label {
    flex: 0 1 auto;
}
.auth-page .legacy-login-toggle {
    color: #a1887f !important;
    font-size: 0.875rem;
    text-decoration: none;
}
.auth-page .legacy-login-toggle:hover,
.auth-page .legacy-login-toggle:focus {
    color: #ffb74d !important;
    text-decoration: underline;
}
.auth-page a {
    color: #ffb74d;
}
.auth-page a:hover {
    color: #ffcc80;
}
.auth-page .alert-danger {
    background: #3d1a1a;
    border-color: #8b3a3a;
    color: #ffcdd2;
}
.auth-page .alert-success {
    background: #1b2d1b;
    border-color: #2e7d32;
    color: #c8e6c9;
}
.auth-page .text-muted {
    color: #a1887f !important;
}
.auth-page .legal-card-body {
    color: #ccc;
    line-height: 1.55;
}
.auth-page .legal-main-title {
    color: #FFB74D;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}
.auth-page .legal-section-title {
    color: #FFCC80;
    font-size: 1.15rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.auth-page .legal-subhead {
    color: #e0e0e0;
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.4rem;
}
.auth-page .legal-card-body ul {
    padding-left: 1.25rem;
}
.auth-page .legal-nav-links {
    border-top: 1px solid #6d4c2a;
    padding-top: 1rem;
    margin-top: 1.5rem;
    text-align: center;
}

/* Compact landing / login news tiles, ads, and sister-site cards */
.landing-news-screens,
.login-page-news .landing-news-screens {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin: 0.4rem 0 0.45rem;
}
.landing-news-screens a,
.login-page-news .landing-news-screens a {
    display: block;
    width: 100%;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(85, 85, 85, 0.65);
    line-height: 0;
}
.landing-news-screens img,
.login-page-news .landing-news-screens img {
    width: 100%;
    height: 72px;
    object-fit: cover;
    display: block;
}
.landing-news-screens:has(> :only-child),
.login-page-news .landing-news-screens:has(> :only-child) {
    grid-template-columns: 1fr;
}
.landing-news-screens:has(> :only-child) img,
.login-page-news .landing-news-screens:has(> :only-child) img {
    height: 88px;
}
.landing-kb-promo,
.login-page-news .landing-kb-promo {
    margin: 0;
    padding: 0;
}
.landing-kb-promo + .landing-kb-promo,
.login-page-news .landing-kb-promo + .landing-kb-promo {
    margin-top: 0.65rem;
}
.landing-kb-promo a,
.login-page-news .landing-kb-promo a {
    display: block;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(85, 85, 85, 0.65);
    line-height: 0;
}
.landing-kb-promo img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}
.login-page-news .landing-kb-promo img {
    max-height: 120px;
}
/* Login page ads: compact card with image filling the space properly */
.login-page-ads-panel.panel_cantik {
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
}
.login-page-ads-panel .landing-kb-promo img {
    max-height: none;
    border-radius: 6px;
}
.landing-ad-title,
.login-page-news .landing-ad-title {
    color: #000;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.auth-page .landing-ad-title {
    color: #000;
}
.landing-ad-description,
.login-page-news .landing-ad-description {
    color: #b0a79f;
    font-size: 0.75rem;
    line-height: 1.35;
    margin: 0 0 0.35rem;
}
.landing-sister-sites {
    margin: 0 0 0.85rem;
}
.landing-sister-heading {
    color: #FFB74D;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}
.auth-page .landing-sister-heading {
    color: #302418;
}
.landing-sister-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.55rem;
}
.landing-sister-card {
    display: block;
    background: #302418;
    border: 1px solid #6d4c2a;
    border-radius: 8px;
    padding: 0.7rem 0.8rem;
    text-decoration: none !important;
    color: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.landing-sister-card:hover {
    border-color: #FFB74D;
    background: #3a2a1a;
}
.landing-sister-card-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.15rem;
}
.landing-sister-flag {
    font-size: 1.05rem;
    line-height: 1;
}
.landing-sister-name {
    color: #FFB74D;
    font-weight: 700;
    font-size: 0.92rem;
}
.landing-sister-label {
    color: #FFCC80;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}
.landing-sister-desc {
    color: #b0a79f;
    font-size: 0.78rem;
    line-height: 1.35;
    margin: 0;
}
.landing-public-wrap {
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}
.landing-public-row {
    align-items: start;
}
@media (max-width: 991.98px) {
    .landing-public-row {
        display: flex;
        flex-direction: column;
    }
    .landing-public-center { order: 1; }
    .landing-public-left { order: 2; }
    .landing-public-news { order: 3; }
}