:root{--panel-soft:#182638;--panel-quiet:#0c1825;--button-ink:#08291e}
html[data-theme=light]{color-scheme:light;--paper:#f4f7f3;--card:#fff;--ink:#19372c;--muted:#52685d;--line:#ccd9d0;--green:#176446;--green-light:#e1f2e8;--purple:#704692;--purple-light:#efe5f7;--gold:#8f6618;--panel-soft:#edf4ef;--panel-quiet:#f8faf7;--button-ink:#fff;--shadow:0 20px 65px #224b2c0c}
.topbar{height:auto;min-height:94px;gap:15px;padding-block:16px}.top-tools{flex-wrap:wrap;justify-content:flex-end;gap:9px}.top-tools>button{min-height:42px}.header-player{margin-inline-end:7px}
.v4-badge{display:inline-grid;place-items:center;min-width:21px;min-height:21px;border-radius:8px;background:var(--gold);color:#172319;font-size:12px;font-weight:800}
.v4-dialog{color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:24px;width:min(610px,calc(100vw - 28px));padding:24px;max-height:88vh;max-height:88svh;overflow-y:auto;box-shadow:var(--shadow)}
.v4-dialog::backdrop{background:#040b15b8;backdrop-filter:blur(5px)}.v4-dialog h2{font-size:21px}.v4-dialog h3{font-size:16px;margin-bottom:10px}.v4-dialog p{line-height:1.9}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:18px}.dialog-heading button{font-size:23px;min-width:44px;border:1px solid var(--line);border-radius:12px;background:transparent;color:var(--ink)}
.dialog-section{padding-block:19px;border-top:1px solid var(--line)}.dialog-section:first-of-type{border-top:0}.v4-actions{display:flex;flex-wrap:wrap;gap:9px;margin-top:12px}.v4-actions button{flex:1;min-width:95px}.v4-help{font-size:12px;line-height:1.9;color:var(--muted);margin-block:10px}.settings-line{display:flex;align-items:center;justify-content:space-between;gap:18px;padding-block:11px;font-size:14px}.settings-line input{width:21px;height:21px;accent-color:var(--green);flex-shrink:0}.settings-themes{display:flex;gap:10px}.settings-themes button{flex:1}.settings-themes button[aria-pressed=true]{background:var(--green-light);border-color:var(--green);color:var(--green);font-weight:800}.identity-line{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:13px;border:1px solid var(--line);border-radius:13px;background:var(--panel-quiet);margin-bottom:14px}.identity-line bdi{font-size:18px;letter-spacing:1px}.identity-profile{display:flex;align-items:center;gap:15px;margin-bottom:15px}.identity-profile .avatar{width:62px;height:62px}.identity-profile label{font-size:13px;cursor:pointer}.identity-profile input{display:none}
.friend-row{display:flex;align-items:center;gap:11px;padding:14px 0;border-bottom:1px solid var(--line)}.friend-info{flex:1;min-width:0}.friend-info strong,.friend-info bdi,.friend-info small{display:block}.friend-info strong{font-size:16px;overflow-wrap:anywhere}.friend-info bdi{font-size:11px;letter-spacing:.3px;color:var(--muted)}.friend-info small{font-size:12px}.friend-row button{font-size:12px;padding:8px 10px}.friend-online{color:var(--green)}.friend-offline{color:var(--muted)}.invitation-row{border:1px solid var(--green);border-radius:14px;padding:15px;background:var(--green-light);margin-block:10px}.invitation-row strong{font-size:14px}.invitation-banner{border:1px solid var(--green);border-radius:13px;background:var(--green-light);padding:12px 15px;margin-top:20px;display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:14px}.invitation-banner button{flex-shrink:0}.recovery-field{direction:ltr!important;text-align:left!important;letter-spacing:0!important;font-size:12px!important}.recovery-details summary{cursor:pointer;font-size:13px}.recovery-details form{margin-top:14px}.global-toast{position:fixed;bottom:calc(20px + env(safe-area-inset-bottom,0px));inset-inline:20px;margin-inline:auto;width:max-content;max-width:calc(100vw - 40px);background:var(--ink);color:var(--paper);border:1px solid var(--line);border-radius:15px;padding:14px 19px;font-size:14px;line-height:1.8;box-shadow:var(--shadow);z-index:100;pointer-events:none}
.word-policy{width:100%;min-height:48px;padding:9px 12px;color:var(--ink);background:var(--panel-quiet);border:1px solid var(--line);border-radius:12px;font:inherit;font-size:13px}.room-word-card{margin-block:18px;padding:20px;border:1px solid var(--line);border-radius:18px;background:var(--panel-quiet)}.room-word-card h2{font-size:14px;color:var(--muted);margin-bottom:15px}.word-tiles{display:flex;justify-content:center;direction:rtl;gap:11px}.word-tiles .word-tile{display:grid;place-items:center;width:62px;height:70px;font-size:34px;line-height:1.2;font-weight:800;border:1px solid var(--green);border-radius:13px;color:var(--green);background:var(--green-light)}.word-tiles.guess-tiles .word-tile{border-color:var(--line);color:var(--ink);background:var(--panel-soft)}.last-guess-display{margin-top:20px;border-top:1px solid var(--line);padding-top:18px}.last-guess-display p{font-size:13px;color:var(--muted);margin-bottom:11px}.large-last-word{font-size:29px!important;line-height:1.8}.last-guess-result{display:flex;justify-content:center;gap:22px;margin-top:13px;font-size:14px}.last-guess-result b{font-size:23px;color:var(--green)}.last-guess-result span:last-child b{color:var(--purple)}.ready-card{padding:20px;border-radius:16px;background:var(--green-light);border:1px solid var(--green);margin-block:18px}.ready-card p{font-size:14px;margin-bottom:14px}.word-review{padding:15px;border:1px solid var(--gold);border-radius:13px;margin-bottom:16px;background:var(--panel-quiet)}.word-review p{font-size:14px;line-height:1.9}.rejected-list{padding:14px;border:1px solid var(--line);border-radius:13px;margin-top:17px}.rejected-list summary{font-size:13px;cursor:pointer}.rejected-list p{font-size:13px;margin-top:9px;color:var(--muted)}.rejected-list b{color:var(--ink);font-size:17px}.unlisted-confirm{font-size:13px;line-height:2;margin-top:10px;display:block}.unlisted-confirm input{width:18px;height:18px;vertical-align:middle;accent-color:var(--green)}.word-input-line{display:flex;gap:9px;align-items:center}.word-input-line .word-input{min-width:0}.word-input-line button{min-width:55px;min-height:48px}.pending-deadline{font-size:12px;color:var(--muted);margin-bottom:12px}
.history-word,.history-word-button{font-size:21px}.history-row{min-height:54px}.history-head{font-size:12px}.online-state-message{font-size:14px}.score-badge{width:35px;height:35px;font-size:19px}.footer{align-items:center;flex-wrap:wrap}.footer .copyright{font:10px/1.6 -apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;direction:ltr;text-align:center;opacity:.8;letter-spacing:.45px}.welcome-theme{position:absolute;inset-inline-end:17px;top:15px;font-size:12px}.welcome-card{position:relative}.welcome-footnote{margin-top:18px}.online-rematch .guess-actions{margin-top:10px}.online-rematch{padding-top:18px}.primary{color:var(--button-ink)}
html.large-text .history-word,html.large-text .history-word-button{font-size:27px}html.large-text .word-tile{font-size:39px}html.large-text .word-input{font-size:27px}html.large-text .online-state-message,html.large-text .chat-bubble{font-size:18px}html.large-text .field-label,html.large-text .reply-panel>p,html.large-text .last-guess-display p,html.large-text .settings-line{font-size:16px}html.large-text .score-badge{font-size:23px;width:40px;height:40px}html.large-text .history-head{font-size:13px}html.large-text .friend-info strong{font-size:20px}html.large-text .friend-row button{font-size:14px}html.large-text .onlinePendingWord{font-size:29px}
html[data-theme=light] body{background:radial-gradient(ellipse at 85% 0,#e4f2e7aa,transparent 50%),var(--paper)}
html[data-theme=light] .board,html[data-theme=light] .welcome-card,html[data-theme=light] .chat-panel,html[data-theme=light] .modal,html[data-theme=light] .profile-editor{background:var(--card);border-color:var(--line);color:var(--ink)}
html[data-theme=light] .word-input,html[data-theme=light] .profile-input,html[data-theme=light] .welcome-form input,html[data-theme=light] .chat-form textarea,html[data-theme=light] .reply-fields select{background:#fff;color:var(--ink);border-color:#a9beb0}
html[data-theme=light] .mode-switch,html[data-theme=light] .history-row,html[data-theme=light] .example,html[data-theme=light] .referee-option,html[data-theme=light] .hint-picker-card,html[data-theme=light] .game-hud,html[data-theme=light] .player-card,html[data-theme=light] .reply-panel,html[data-theme=light] .online-connection.lost,html[data-theme=light] .invite-line,html[data-theme=light] .last-result{background:var(--panel-soft);border-color:var(--line);color:var(--ink)}
html[data-theme=light] .mode-switch button[aria-pressed=true],html[data-theme=light] .online-tabs button[aria-pressed=true]{background:var(--green-light);color:var(--green);border-color:var(--green)}
html[data-theme=light] .player-self,html[data-theme=light] .history-row:first-child,html[data-theme=light] .win-box,html[data-theme=light] .online-state-message,html[data-theme=light] .extension-panel,html[data-theme=light] .chat-message.mine .chat-bubble{background:var(--green-light);border-color:#a9cdb7;color:var(--ink)}
html[data-theme=light] .hint-position-picker button,html[data-theme=light] .secret-tile,html[data-theme=light] .chat-message.theirs .chat-bubble{background:#f0f4ee;color:var(--muted);border-color:var(--line)}
html[data-theme=light] .hint-position-picker button[aria-pressed=true],html[data-theme=light] .hint-position-picker button.known,html[data-theme=light] .secret-tile.revealed{background:var(--green-light);color:var(--green);border-color:var(--green)}
html[data-theme=light] .avatar,html[data-theme=light] .player-initial{background:#dcece2;color:var(--green);border-color:#b9d1c2}
html[data-theme=light] .subtle-button,html[data-theme=light] .secondary,html[data-theme=light] .room-toolbar button,html[data-theme=light] .show-word{background:transparent;color:var(--ink);border-color:var(--line)}
html[data-theme=light] .primary:hover{background:#125437;color:white}html[data-theme=light] .online-label,html[data-theme=light] .chat-caption,html[data-theme=light] .field-hint,html[data-theme=light] .room-rules,html[data-theme=light] .welcome-note,html[data-theme=light] .player-greeting{color:var(--muted)}
html[data-theme=light] .board-top{background:var(--panel-soft);border-color:var(--line)}html[data-theme=light] .tag{background:var(--green-light);color:var(--green);border-color:#aacdb9}
html[data-theme=light] .lead,html[data-theme=light] .micro,html[data-theme=light] .bank-info,html[data-theme=light] .hint-choice-note,html[data-theme=light] .local-wallet-note,html[data-theme=light] .chat-meta,html[data-theme=light] .chat-sender{color:var(--muted)}
html[data-theme=light] .room-code,html[data-theme=light] .presence-text,html[data-theme=light] .welcome-slogan{color:var(--green)}html[data-theme=light] .presence-text.offline,html[data-theme=light] .error{color:#9b343e}
html[data-theme=light] .player-card>div>span{color:var(--muted)}html[data-theme=light] .other-wallet{color:var(--gold)}
html[data-theme=light] .game-hud>div{background:var(--panel-soft)}html[data-theme=light] .game-hud span,html[data-theme=light] .game-hud small{color:var(--muted)}html[data-theme=light] .game-hud strong{color:var(--ink)}html[data-theme=light] .game-hud output{color:var(--green)}html[data-theme=light] .game-hud .wallet-stat strong{color:var(--gold)}html[data-theme=light] .game-hud.time-low output{color:#a32c3a}
html[data-theme=light] .field-label,html[data-theme=light] .welcome-card h1,html[data-theme=light] .welcome-tagline,html[data-theme=light] .welcome-form label,html[data-theme=light] .reply-panel h2,html[data-theme=light] .chat-heading h2{color:var(--ink)}html[data-theme=light] .welcome-footnote,html[data-theme=light] .win-box p{color:var(--muted)}html[data-theme=light] .hint-picker-card .secondary span{color:var(--gold)}
html[data-theme=light] .header-player,html[data-theme=light] .room-rules h3{color:var(--ink)}html[data-theme=light] .room-rules p{color:var(--muted)}html[data-theme=light] .online-connection{background:var(--green-light);color:var(--green);border-color:#a9cdb7}
.word-tiles .word-tile{flex:1;min-width:0;max-width:62px}
.friend-row .avatar-holder{flex-shrink:0}.friend-offline{color:#efa2aa}html[data-theme=light] .friend-offline{color:#9b343e}
@media(max-width:700px){.topbar{align-items:flex-start}.top-tools{gap:6px}.top-tools>button{font-size:11px;padding:7px 10px}.header-player{width:100%;justify-content:flex-end;margin:0}.v4-dialog{padding:18px}.friend-row{gap:8px;flex-wrap:wrap}.friend-row .avatar{width:38px;height:38px}.friend-row button{padding:7px 9px}.identity-line bdi{font-size:15px}.word-tiles .word-tile{width:55px;height:65px;font-size:32px}.word-tiles{gap:8px}.room-word-card{padding:16px}.footer .copyright{font-size:9px}.invitation-banner{font-size:12px}.history-word,.history-word-button{font-size:21px}.history-head,.history-row{grid-template-columns:20px minmax(63px,1fr) 59px 59px;gap:5px}.history-list{max-height:390px}.settings-line{font-size:14px}.global-toast{font-size:13px}.online-rematch .guess-actions{flex-wrap:wrap}.online-rematch .guess-actions .word-input-line{width:100%;flex:1 1 100%}.online-rematch .guess-actions>.primary{width:100%}.onlinePendingWord{font-size:28px}}
@media(max-width:370px){.page{padding-inline:13px}.word-tiles .word-tile{width:48px;height:60px}.word-tiles{gap:6px}.footer{gap:12px}.footer .copyright{order:3;width:100%}.last-guess-result{font-size:12px;gap:14px}.history-head,.history-row{grid-template-columns:18px minmax(48px,1fr) 49px 49px;gap:3px}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}

.wallet-stat .coin-icon{display:none}
/* v4.1: account, story, consent and release UI */
.welcome-links{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:12px}.about-story{line-height:2}.about-story p{margin:16px 0}.about-story h3{font-size:1.35rem;color:var(--accent,#8ce9c2)}.about-story .dedication{border-inline-start:3px solid #44bba4;padding:12px 16px;font-weight:700}.about-poster{display:block;width:100%;height:auto;border-radius:20px;margin:20px 0}.poster-dialog{padding:12px;max-width:430px}.poster-dialog img{display:block;max-width:100%;width:auto;max-height:72dvh;object-fit:contain;margin:0 auto 12px;border-radius:14px}.account-input{width:100%;min-width:0;margin-bottom:14px;box-sizing:border-box}.terms-list{line-height:1.9;padding-inline-start:24px}.terms-list li{margin:12px 0}.terms-check{display:flex;align-items:center;gap:12px;margin:22px 0;line-height:1.8}.terms-check input{width:22px;height:22px;flex-shrink:0}.update-banner{position:fixed;bottom:max(16px,env(safe-area-inset-bottom));inset-inline:12px;z-index:3000;padding:14px;border:1px solid #44bba4;border-radius:16px;max-width:640px;margin:auto;background:#142332;color:#fff;display:flex;gap:12px;align-items:center;box-shadow:0 12px 40px #0006}.update-banner[hidden]{display:none}.update-banner span{flex:1}.update-banner button{flex-shrink:0}html[data-theme=light] .about-story h3{color:#11725f}html[data-theme=light] .update-banner{background:#f4fff9;color:#17392f}.top-tools{flex-wrap:wrap}button:disabled{cursor:default}.account-error{line-height:1.8}@media(max-width:420px){.top-tools{gap:7px}.top-tools .subtle-button{font-size:.78rem;padding:8px}.poster-dialog{max-width:calc(100vw - 24px)}.update-banner{font-size:.85rem;flex-wrap:wrap}}@supports not (height:1dvh){.poster-dialog img{max-height:70vh}}
html[data-theme=light] .primary{background:var(--green);border-color:var(--green);color:#fff}html[data-theme=light] .text-button{color:#315d4b}.welcome-theme{position:relative!important;display:block;margin:0 0 12px auto;inset:auto!important;z-index:1}.welcome-links .text-button{font-size:13px;text-decoration:none}.welcome-links .text-button:hover{text-decoration:underline}
/* v4.2: play first; helper panels stay compact and optional. */
.guide{border:1px solid var(--line);border-radius:16px;padding:14px!important;align-self:start}.guide>summary{cursor:pointer;font-size:14px;font-weight:700;color:var(--ink)}.guide-content{margin-top:16px}.guide:not([open])>.guide-content{display:none}.hint-picker-card{display:block;padding:0!important;margin:12px 0 16px}.hint-picker-card>summary{cursor:pointer;padding:12px 15px;font-size:14px;font-weight:650;color:var(--ink)}.hint-picker-card>summary span{font-size:12px;color:var(--gold);margin-inline-start:12px}.hint-picker-card .hint-content{padding:3px 14px 14px;display:grid;gap:10px}.hint-picker-card:not([open])>.hint-content{display:none}.active-game .hero,.in-room .hero{display:none}.active-game .guide{display:none}.active-game .layout{grid-template-columns:minmax(0,820px);justify-content:center;padding-top:14px}.in-room .layout{padding-top:14px}.active-game .board-body,.in-room .board-body{padding:18px 22px}.active-game #secretTiles{margin:0 0 14px}.active-game .secret-tile{width:48px;height:52px;font-size:25px}.active-game .game-hud,.in-room .game-hud{margin-bottom:12px}.active-game .game-hud>div,.in-room .game-hud>div{padding:8px 10px}.active-game .play-header{margin-bottom:10px}.active-game .local-wallet-note{display:none}.active-game .last-result{margin:10px 0}.active-game .history{margin-top:18px}.clock-policy{color:var(--gold);font-weight:650}.active-game .field-label{margin-bottom:8px}.active-game .game-hud small,.in-room .game-hud small{font-size:10px}.waiting-spinner{display:none}#quickPlay{margin-top:12px}#localRestoreNotice[hidden]{display:none}#localRestoreNotice{padding:12px;border:1px solid var(--gold);border-radius:12px;margin-bottom:15px}.in-room .players-grid{margin-bottom:12px}.in-room .player-card{padding:11px}.in-room .online-room-head{margin-bottom:12px}@media(max-width:780px){.active-game .board-body,.in-room .board-body{padding:16px}.active-game .layout,.in-room .layout{padding-top:12px}.active-game .game-hud small,.in-room .game-hud small{font-size:9px}.active-game .secret-tile{width:43px;height:48px}}

.reply-time-note{grid-column:1/-1;margin:0;color:var(--muted);font-size:13px;line-height:1.8}
/* Dochar 4.3: learning and end-of-round details use the existing tile language. */
.computer-options{margin:12px 0 18px}.setup-extras{display:flex;flex-wrap:wrap;gap:10px;justify-content:center;margin:12px 0}.round-summary{margin:18px 0;text-align:start}.result-mode{display:inline-block;font-size:12px;border:1px solid var(--line);color:var(--green);background:var(--green-light);border-radius:20px;padding:4px 12px}.result-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:10px 0}.result-stats>div{border:1px solid var(--line);background:var(--panel-soft,#142332);border-radius:13px;padding:12px 8px;text-align:center}.result-stats dt{font-size:11px;color:var(--muted)}.result-stats dd{margin:5px 0 0;font-size:21px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums}.result-note{font-size:12px!important;color:var(--muted)!important;line-height:1.9}.result-record{font-size:14px!important;line-height:1.9;color:var(--ink)!important}.round-series{border-top:1px solid var(--line);margin:16px 0;padding-top:12px;text-align:start}.round-series h3{font-size:17px;margin:0 0 10px}.series-row,.record-row{display:grid;gap:6px;padding:12px 0;border-bottom:1px solid var(--line)}.series-row span,.record-row span{font-size:14px}.series-row small,.record-row small{color:var(--muted);font-size:12px}.record-row strong{font-size:22px;letter-spacing:1px}.record-row .result-mode{justify-self:start}.records-list{max-height:55dvh;overflow:auto;overscroll-behavior:contain;margin-top:16px}.tutorial-target{display:flex;gap:9px;justify-content:center;margin:16px 0}.tutorial-target .word-tile{width:52px;height:56px;display:grid;place-items:center;border:1px solid var(--line);background:var(--green-light);border-radius:13px;font-size:29px;color:var(--ink)}.tutorial-dialog h3{font-size:19px;margin:20px 0 12px}.tutorial-dialog p{line-height:1.9}.tutorial-feedback{border:1px solid var(--green);border-radius:13px;padding:12px;color:var(--ink);background:var(--green-light)}.poster-dialog{border-color:var(--green);background:var(--card);box-shadow:0 20px 70px #0005}.poster-dialog img,.about-poster{border:1px solid var(--line);border-radius:18px}.invite-line{flex-wrap:wrap}.invite-line input{min-width:0;flex:1 1 200px}.invite-line button{min-height:44px}#reviewLocalRound{margin-bottom:10px}.in-room .guide{display:none}#onlineLastResult{margin:10px 0}.online-state-message{line-height:1.9}
@media(max-width:520px){.result-stats{grid-template-columns:repeat(2,minmax(0,1fr))}.result-stats dd{font-size:20px}.tutorial-target .word-tile{width:45px;height:50px}.tutorial-dialog{padding:18px}.tutorial-dialog .guess-actions{flex-wrap:wrap}.tutorial-dialog .guess-actions input{min-width:0;flex:1 1 170px}.records-list{max-height:52dvh}}@supports not (height:1dvh){.records-list{max-height:52vh}}
html[data-theme=light] .win-box h2{color:var(--green)}html[data-theme=light] .win-box .win-code{background:#c3e4d2;color:#174932}#endTitle:focus-visible{outline:2px solid var(--green);outline-offset:5px;border-radius:8px}
