:root {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--page);
  color-scheme: light;
  font-synthesis: none;
  --accent: #d65c13;
  --muted: #6b6b6b;
  --line: #dedede;
  --soft: #ededed;
  --tint: #f5f5f5;
  --ink: #404040;
  --revealed-text: #a45151;
  --green: #c6f78c;
  --text: #292929;
  --page: #f7f7f7;
  --surface: #fff;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --text: #f0f0f0;
  --page: #181818;
  --surface: #242424;
  --accent: #ff9b54;
  --muted: #b0b0b0;
  --line: #444444;
  --soft: #353535;
  --tint: #2c2c2c;
  --ink: #e0e0e0;
  --revealed-text: #e5aaaa;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; border: 0; padding: 0; line-height: 1.2; text-align: center; transition: background .15s, transform .15s; }
button:active { transform: translateY(1px); }
button:disabled { cursor: default; opacity: .55; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #f6a460; outline-offset: 2px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.icon { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 11px; line-height: 1.6; }
.text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: none; color: var(--ink); padding: 0; font-weight: 650; }
.text-button:hover { color: var(--accent); }
.icon-button { height: 40px; width: 40px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.icon-button:hover { background: var(--soft); }
.topbar { height: 80px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 28px; padding: 0 max(24px, 5%); background: var(--surface); }
#account-controls:not([hidden]) { display: flex; flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 22px; }
#account-controls #account-note { margin: 0; }
#account-controls #google-login { align-self: center; text-align: center; }
#account-controls svg { flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; letter-spacing: -.7px; line-height: 1; }
.brand-small { display: block; font-size: 20px; }
.brand-dot { color: var(--accent); }
.brand-mark { display: block; flex-shrink: 0; width: 44px; height: 44px; overflow: visible; }
.header-ad { flex: 1; min-width: 0; max-width: 280px; height: 38px; margin-inline: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 6px; background: color-mix(in srgb, var(--accent) 7%, var(--surface)); color: var(--accent); text-align: center; overflow: hidden; }
.header-ad > span { font-size: 16px; font-weight: 800; white-space: nowrap; }
.header-ad > small { font-size: 7px; letter-spacing: .8px; white-space: nowrap; }
nav { margin-left: auto; display: flex; gap: 8px; }
.mobile-ranking { display: none; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar > .topbar-right { margin-left: auto; }
.settings-help { margin-bottom: 16px; min-height: 36px; color: var(--accent); }
.online-badge { width: 42px; height: 40px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 10px; background: var(--tint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--muted); }
.online-value { display: flex; align-items: center; gap: 3px; }
.online-badge .icon { width: 13px; height: 13px; }
.online-badge strong { font-size: 12px; font-variant-numeric: tabular-nums; line-height: 1; }
.online-label { font-size: 8px; line-height: 1.1; }
.online-badge.connected .online-value { color: var(--accent); }
.room-presence { display: flex; align-items: center; gap: 7px; flex-shrink: 0; }
.connection { display: flex; align-items: center; font-size: 0; color: var(--muted); white-space: nowrap; }
.connection span, .live-dot, .pulse-dot { width: 6px; height: 6px; background: #a3a3a3; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.connection.online span, .live-dot { background: #70aa83; }
.connection.offline span { background: #d47676; }
.shell { max-width: 1400px; margin: auto; padding: 32px 5% 0; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow, .section-caption { font-size: 9px; font-weight: 750; letter-spacing: 1.5px; color: var(--muted); }
h1 { font-size: 30px; line-height: 1.2; letter-spacing: -1px; margin: 9px 0 0; }
h1 em { color: var(--accent); font-style: normal; }
h2 { font-size: 13px; margin: 0; letter-spacing: -.2px; }
.prototype-label { color: var(--ink); font-size: 9px; letter-spacing: 1px; font-weight: 700; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; width: 240px; }
.prototype-label > span:last-child { font-size: 11px; font-weight: 400; letter-spacing: 0; color: var(--muted); padding-left: 13px; width: 100%; }
.pulse-dot { background: var(--accent); }
.workspace { display: grid; grid-template-columns: 205px minmax(360px, 1fr) 240px; gap: 18px; align-items: start; }
.left-column, .right-column { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.game-column { min-width: 0; grid-column: 2; grid-row: 1; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 0; box-shadow: 0 5px 18px #00000003; }
.profile-card { padding: 20px 16px; }
.achievement-toast { position: fixed; z-index: 30; display: flex; align-items: center; gap: 10px; width: min(320px, calc(100vw - 16px)); padding: 12px 14px; text-align: left; border: 1px solid var(--accent); border-radius: 12px; color: var(--ink); background: var(--surface); box-shadow: 0 6px 24px #0005; cursor: pointer; }
.achievement-toast > .icon { width: 30px; height: 30px; flex-shrink: 0; color: var(--accent); }
.achievement-toast strong, .achievement-toast span span, .achievement-toast small { display: block; }
.achievement-toast strong { font-size: 12px; color: var(--accent); }
.achievement-toast span span { margin-top: 4px; font-size: 12px; }
.achievement-toast small { margin-top: 4px; font-size: 10px; color: var(--muted); }
.achievement-toast { padding: 7px 10px; }
.achievement-toast span span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.achievement-toast > span { min-width: 0; }
.achievement-toast small { display: none; }
.achievement-announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.identity { display: flex; align-items: center; gap: 9px; width: 100%; background: none; text-align: left; padding: 0; margin: 20px 0; min-width: 0; color: inherit; }
.avatar { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--soft); color: var(--accent); flex-shrink: 0; }
.identity-text { min-width: 0; }
.identity strong { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.identity-text { border: 1px solid color-mix(in srgb, var(--accent) 32%, var(--line)); border-radius: 6px; padding: 3px 6px; background: color-mix(in srgb, var(--accent) 5%, var(--surface)); }
.identity:hover .identity-text { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
.identity-text > span { font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.identity .icon { width: 10px; height: 10px; }
.personal-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 16px; gap: 10px; }
.personal-stats strong { display: block; font-size: 23px; letter-spacing: -.8px; font-variant-numeric: tabular-nums; }
.personal-stats span { font-size: 10px; color: var(--muted); }
.personal-bonus strong { color: var(--accent); }
.bonus-card { background: var(--soft); border: 1px solid var(--line); border-radius: 0; padding: 22px 18px; }
.bonus-icon { display: grid; place-items: center; height: 34px; width: 34px; background: var(--surface); border-radius: 10px; color: var(--accent); margin-bottom: 18px; }
.bonus-card .section-caption { font-size: 8px; letter-spacing: 1px; color: var(--ink); }
.bonus-card h2 { font-size: 24px; line-height: 1.15; letter-spacing: -.8px; margin: 12px 0; color: var(--accent); }
.bonus-card p { color: var(--ink); font-size: 11px; line-height: 1.8; }
.bonus-chip { display: inline-flex; align-items: center; gap: 5px; background: #ffffffb0; color: var(--accent); border-radius: 7px; padding: 7px; font-size: 9px; font-weight: 700; }
.bonus-chip .icon { width: 13px; height: 13px; }
.bonus-card > .text-button { font-size: 11px; margin-top: 20px; }
.bonus-card > .text-button .icon { width: 16px; }
.little-note { display: flex; gap: 9px; align-items: center; padding: 0 8px; color: var(--muted); }
.little-note p { font-size: 10px; line-height: 1.8; margin: 0; }
.little-note strong { font-weight: 600; color: var(--ink); }
.board { padding: 18px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.board-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.status { margin-right: auto; min-width: 0; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 1.2; color: var(--muted); white-space: nowrap; }
#status-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.status .status-flag { display: none; width: 14px; height: 14px; }
.status[data-state="playing"] { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); border-radius: 6px; padding: 3px 6px; font-weight: 750; }
.status[data-state="playing"] .status-flag { display: block; }
.status[data-state="playing"] { border-radius: 0; }
.timer { display: flex; gap: 5px; align-items: center; color: var(--ink); font-size: 18px; font-variant-numeric: tabular-nums; }
.timer .icon { width: 16px; height: 16px; stroke: var(--muted); }
.timer.urgent { color: #c95166; }
.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; background: var(--green); color: #385025; font-size: 12px; font-weight: 750; padding: 12px 15px; border-radius: 10px; white-space: nowrap; min-height: 40px; }
.primary-button:hover { background: #b8ed77; }
.primary-button .icon { width: 15px; height: 15px; }
.letter-zone { background: linear-gradient(120deg, #d85c17, #f58b36); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; min-height: 88px; }
.board-kicker { text-align: center; color: #fff; font-size: 8px; letter-spacing: 1.3px; font-weight: 650; }
.letter-controls { display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0; }
.letters { display: flex; justify-content: center; gap: 7px; flex: 1; max-width: 384px; min-width: 0; }
.letter { --tile-depth: 4px; width: 52px; height: 48px; flex: 1; min-width: 0; max-width: 52px; padding: 0; line-height: 1; text-align: center; background: var(--surface); border-radius: 10px; display: grid; place-items: center; color: var(--ink); font-weight: 800; font-size: 28px; border: 0; box-shadow: inset 0 calc(-1 * var(--tile-depth)) 0 var(--line), 0 2px 0 #00000020; user-select: none; }
.letter:hover { background: var(--soft); }
.letter.used { background: var(--soft); color: var(--muted); box-shadow: none; transform: translateY(2px); }
.letter:focus-visible { outline-color: #d7fcad; }
.shuffle-button { display: grid; place-items: center; color: #fff; background: #ffffff15; border: 1px solid #ffffff40; border-radius: 10px; width: 40px; height: 44px; flex-shrink: 0; }
.shuffle-button:hover { background: #ffffff30; }
.shuffle-button .icon { width: 18px; height: 18px; }
.answers-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.answers-header > span { font-size: 10px; color: var(--muted); }
.answers-header strong { color: var(--accent); }
.words { --slot: 17px; container-type: inline-size; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 3px; }
.word { background: var(--tint); border: 1px solid var(--line); border-radius: 0; min-height: 34px; padding: 1px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0; }
/* One integer size for the entire board: three columns, two 3px gutters,
   6px card border/padding and six 1px letter gaps in each column. */
.word-letters { --fit-slot: round(down, min(var(--slot), calc((100cqw - 42px) / 21)), 1px); display: flex; flex: none; justify-content: center; gap: 1px; font-weight: 750; color: var(--ink); white-space: nowrap; }
.letter-slot { width: var(--fit-slot); height: var(--fit-slot); flex: 0 0 var(--fit-slot); display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 3px; font-size: calc(var(--fit-slot) * .7); line-height: 1; }
.word-owner { color: var(--text); font-size: 11px; font-weight: 500; line-height: 1.15; flex-shrink: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.word.claimed .letter-slot { background: #e1f1cf; border-color: #bed79f; }
.word.instagram .letter-slot { background: #f9deeb; border-color: #e5bbcf; }
.word.revealed .letter-slot { background: var(--soft); border-color: var(--line); }
.word.claimed { background: #f0f8e8; border-color: #deebd1; animation: found .3s ease-out; }
.word.claimed .word-letters { color: #58753b; }
.word.claimed .word-owner { color: #7b9461; }
.word.instagram { background: #fbf0f7; border-color: #efdbea; }
.word.instagram .word-letters { color: #985483; }
.word.instagram .word-owner { color: #aa729a; }
.word.revealed { background: var(--tint); }
.word.revealed .word-letters { color: var(--revealed-text); }
@keyframes found { from { transform: scale(.95); } to { transform: scale(1); } }
.entry-card { border-top: 1px solid var(--line); padding-top: 4px; min-width: 0; }
.example-button { display: grid; place-items: center; background: none; color: var(--ink); margin-left: auto; padding: 0; width: 28px; height: 18px; flex-shrink: 0; }
.example-button .icon { width: 15px; height: 15px; }
.guess-row { display: flex; align-items: center; gap: 4px; background: var(--tint); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.guess-row:focus-within { border-color: #e99551; }
.guess-input { border: 0; background: none; outline: 0; width: 100%; min-width: 0; padding: 8px; font-size: 16px; font-weight: 600; letter-spacing: 1.2px; color: var(--ink); text-transform: uppercase; }
.guess-input::placeholder { color: var(--muted); font-size: 12px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.guess-input[readonly] { cursor: default; caret-color: transparent; }
.submit-button, .erase-button { width: 42px; height: 40px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; color: #fff; background: var(--accent); }
.submit-button:hover { background: #b84b0b; }
.erase-button { background: var(--soft); color: var(--ink); border: 1px solid var(--muted); }
.erase-button:hover:not(:disabled) { background: var(--line); color: var(--text); }
.erase-button .icon { width: 20px; height: 20px; stroke-width: 1.7; }
.answers-header { min-height: 18px; }
.answers-header > h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answers-header > span, .answers-header > button { flex-shrink: 0; }
.answers-header:has(.feedback:not(:empty)) > h2 { display: none; }
.answers-header .feedback-slot { height: 18px; min-width: 0; flex: 1; display: flex; align-items: center; overflow: hidden; }
.answers-header .feedback { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedback-slot:has(.feedback:empty) { display: none; }
.entry-card:has(.feedback:empty) { row-gap: 0; }
.feedback { font-size: 11px; margin: 0; color: var(--muted); line-height: 1.3; overflow-wrap: anywhere; }
.feedback.success { color: #5d843c; font-weight: 600; }
.feedback.error { color: #b35e78; }
.feedback.round-end { color: var(--accent); font-weight: 600; }
.ranking-card, .activity-card { padding: 18px 14px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.panel-heading h2 { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.panel-heading h2 .icon { width: 16px; height: 16px; color: #d58b4e; }
.panel-heading .text-button { font-size: 9px; min-height: 28px; }
.panel-heading .text-button .icon { width: 12px; height: 12px; }
.ranking-list, .activity-list { list-style: none; padding: 0; margin: 10px 0 0; }
.rank-row { display: flex; align-items: center; gap: 7px; min-height: 49px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border: 0; }
.rank-position { font-size: 10px; color: var(--muted); width: 14px; text-align: center; }
.rank-avatar { height: 28px; width: 28px; border-radius: 9px; background: var(--soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 10px; flex-shrink: 0; }
.rank-row:first-child .rank-avatar { background: var(--soft); color: var(--accent); }
.rank-detail { min-width: 0; flex: 1; }
.rank-name { display: block; font-size: 11px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-extra { font-size: 9px; color: var(--muted); display: block; margin-top: 4px; }
.rank-score { font-size: 13px; font-weight: 750; }
.rank-row.me .rank-name { color: var(--accent); }
.ranking-footer { margin-top: 15px; border-top: 1px solid var(--line); padding-top: 12px; text-align: center; color: var(--muted); font-size: 9px; }
.empty-state { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); min-height: 100px; }
.empty-state > .icon { height: 24px; width: 24px; }
.empty-state p { font-size: 11px; color: var(--muted); line-height: 1.6; margin: 0; }
.live-dot { box-shadow: 0 0 0 4px #f1f8ed; height: 5px; width: 5px; }
.activity-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding: 12px 0; }
.activity-row:last-child { border: 0; padding-bottom: 0; }
.source-icon { width: 26px; height: 26px; display: grid; place-items: center; background: #eff5e9; color: #8da575; border-radius: 8px; flex-shrink: 0; }
.source-icon.instagram { background: #faedf5; color: #b77fa4; }
.source-icon .icon { width: 13px; height: 13px; }
.activity-content { flex: 1; min-width: 0; }
.activity-content strong { font-size: 11px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-content span { font-size: 10px; color: var(--muted); margin-top: 3px; display: block; }
.activity-points { font-size: 11px; font-weight: 650; color: #819961; }
.activity-bonus { display: block; font-size: 8px; color: #b580a3; margin-top: 4px; }
.game-toolbar { grid-column: 2; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 4px; margin-top: -4px; }
@media (min-width: 761px) and (min-height: 601px), (min-width: 1001px) {
  .game-toolbar { display: none; }
  .left-column, .right-column { contain: size; align-self: stretch; min-height: 0; }
  .profile-card, .ranking-card { flex: 0 0 auto; }
  .left-column .profile-card { padding: 14px 12px; }
  .left-column .bonus-card { flex: 1; min-height: 0; padding: 14px 12px; display: flex; flex-direction: column; align-items: flex-start; }
  .left-column .bonus-icon { flex-shrink: 0; height: 28px; width: 28px; margin-bottom: 6px; }
  .left-column .bonus-card h2 { font-size: 20px; margin: 6px 0; }
  .left-column .bonus-card p { line-height: 1.5; margin: 4px 0 8px; }
  .left-column .bonus-card > .text-button { margin-top: auto; padding-top: 6px; flex-shrink: 0; }
  .right-column .activity-card { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .right-column .activity-list { overflow-y: auto; min-height: 0; }
}
.bonus-status { display: flex; align-items: center; gap: 6px; color: #a06c93; min-width: 0; font-size: 11px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.bonus-status:hover { background: var(--soft); border-color: var(--muted); }
.bonus-status .icon { width: 14px; height: 14px; }
.game-toolbar .text-button { font-size: 11px; min-height: 36px; }
.game-toolbar .text-button .icon { width: 14px; height: 14px; }
.page-footer { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0; color: var(--muted); font-size: 10px; }
dialog { border: 1px solid var(--line); border-radius: 22px; width: 440px; max-width: calc(100% - 24px); max-height: calc(100dvh - 24px); padding: 26px; color: var(--text); background: var(--surface); box-shadow: 0 25px 100px #00000025; overscroll-behavior: contain; }
dialog::backdrop { background: #00000060; backdrop-filter: blur(5px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.dialog-heading h2 { font-size: 22px; margin-top: 8px; letter-spacing: -.7px; }
.close-dialog { flex-shrink: 0; }
.close-dialog .icon { width: 18px; height: 18px; }
dialog p { font-size: 12px; line-height: 1.7; }
.bonus-rules { margin: 0 0 18px; padding-left: 20px; font-size: 12px; line-height: 1.7; color: var(--muted); }
.bonus-rules li + li { margin-top: 10px; }
.bonus-rules strong { color: var(--text); }
.publication-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: var(--tint); }
.publication-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; min-height: 42px; border-radius: 8px; background: var(--accent); color: white; text-decoration: none; font-size: 12px; font-weight: 650; }
.publication-link[aria-disabled="true"] { background: var(--soft); color: var(--muted); cursor: default; }
.publication-card p { margin-bottom: 0; }
.bonus-simulation { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 4px; }
.bonus-simulation .primary-button + .primary-button { margin-top: 8px; }
.field-label { display: block; font-size: 12px; font-weight: 600; margin: 18px 0 8px; color: var(--ink); }
dialog select, .dialog-input { width: 100%; font-size: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--tint); color: var(--ink); }
dialog select { font-size: 12px; }
#settings-form > .primary-button { margin-top: 18px; }
.full-width { width: 100%; }
.reset-button { background: none; color: #a56c7e; display: block; margin: 20px auto 0; font-size: 11px; padding: 8px; }
.help-steps { list-style: none; padding: 0; margin: 0; }
.help-steps li { display: flex; gap: 14px; margin-bottom: 20px; }
.help-steps li > span { color: var(--accent); background: var(--soft); border-radius: 10px; display: grid; place-items: center; width: 34px; height: 34px; flex-shrink: 0; font-size: 11px; }
.help-steps strong { font-size: 13px; }
.help-steps p { margin: 6px 0 0; color: var(--muted); }
.help-note { font-size: 11px; line-height: 1.7; color: var(--ink); background: var(--soft); padding: 14px; border-radius: 10px; margin-bottom: 22px; }
.ranking-tabs { display: flex; gap: 6px; padding: 4px; background: var(--tint); border-radius: 12px; }
.ranking-tab { flex: 1; display: flex; align-items: center; justify-content: center; border-radius: 9px; padding: 11px; background: transparent; color: var(--muted); font-weight: 650; }
.ranking-tab[aria-selected="true"] { background: var(--soft); color: var(--accent); }
.theme-setting { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); cursor: pointer; }
.theme-setting strong { display: block; font-size: 13px; }
.theme-setting span span { display: block; margin-top: 5px; font-size: 11px; line-height: 1.4; color: var(--muted); }
.theme-setting input { appearance: none; width: 44px; height: 26px; flex-shrink: 0; margin: 0; border: 1px solid var(--muted); border-radius: 20px; background: var(--line); cursor: pointer; }
.theme-setting input::before { content: ''; display: block; width: 18px; height: 18px; margin: 3px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 3px #0004; }
.theme-setting input:checked { background: var(--accent); border-color: var(--accent); }
.theme-setting input:checked::before { transform: translateX(18px); }
#settings-dialog, #settings-dialog .theme-setting, #settings-dialog .icon-button,
#settings-dialog .primary-button, #settings-dialog select { border-radius: 0; }
#settings-dialog .close-dialog { border-radius: 10px; }
#engagement-dialog, #engagement-dialog .publication-card,
#engagement-dialog .publication-link, #engagement-dialog button { border-radius: 0; }
#engagement-dialog .close-dialog { border-radius: 10px; }
#engagement-dialog .publication-link { border-radius: 8px; }
#engagement-dialog #verify-instagram { border-radius: 12px; margin-top: 10px; }

/* Profile collection: one expandable track per family, not 330 cards at once. */
#profile-dialog { width: 680px; padding: 24px; border-radius: 0; }
.profile-edit { display: flex; align-items: flex-end; gap: 12px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.profile-edit > div { flex: 1; min-width: 0; }
.profile-edit .dialog-input { width: 100%; margin: 0; }
.profile-edit .primary-button { min-height: 44px; background: var(--soft); color: var(--text); }
.achievement-intro { margin: 24px 0 18px; }
.achievement-intro .eyebrow { font-size: 8px; letter-spacing: 1.4px; color: var(--accent); }
.achievement-intro h3 { margin: 8px 0 0; font-size: 29px; letter-spacing: -1.1px; line-height: 1.12; }
.achievement-intro em { font-style: normal; color: var(--accent); }
.achievement-intro p { margin: 10px 0 0; color: var(--muted); font-size: 11px; }
.achievement-passport { display: grid; grid-template-columns: 70px 1fr; gap: 14px; align-items: center; padding: 20px; border: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line)); border-radius: 0; background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--accent) 15%, transparent), transparent 70%), var(--tint); }
.passport-emblem { width: 68px; height: 76px; display: grid; place-items: center; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); clip-path: polygon(50% 0, 95% 22%, 95% 70%, 50% 100%, 5% 70%, 5% 22%); }
.passport-emblem .icon { width: 38px; height: 38px; stroke-width: 1.3; }
.passport-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.passport-copy > span { color: var(--muted); font-size: 11px; }
#achievements-owner { color: var(--text); font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passport-copy > strong { font-size: 36px; line-height: 1; letter-spacing: -1.5px; font-variant-numeric: tabular-nums; }
.passport-copy small { color: var(--muted); font-size: 16px; letter-spacing: -.4px; font-weight: 500; }
.passport-stats { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); padding-top: 12px; }
.passport-stats > span { display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 10px; }
.passport-stats > span + span { border-left: 1px solid var(--line); padding-left: 18px; }
.passport-stats strong { color: var(--text); font-size: 19px; font-variant-numeric: tabular-nums; }
.achievement-shelf-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 24px; }
.achievement-shelf-heading h4 { margin: 0; font-size: 15px; }
.achievement-shelf-heading > span { font-size: 10px; color: var(--muted); }
.achievements .achievement-help { font-size: 11px; color: var(--muted); margin: 6px 0 14px; }
#achievement-tracks { display: grid; gap: 9px; }
.achievement-track { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.achievement-track[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.achievement-track-summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px; cursor: pointer; }
.achievement-track-summary::-webkit-details-marker { display: none; }
.achievement-track-summary:hover { background: var(--tint); }
.achievement-track-summary:focus-visible, .achievement-rules summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -3px; }
.achievement-track-copy { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.achievement-track-copy strong { font-size: 12px; line-height: 1.2; }
.achievement-track-copy > span { color: var(--muted); font-size: 10px; }
.achievement-track-count { font-size: 10px; font-variant-numeric: tabular-nums; color: var(--muted); flex-shrink: 0; }
.has-medals .achievement-track-count { color: var(--accent); }
.achievement-chevron { color: var(--muted); font-size: 18px; line-height: 1; }
.achievement-track[open] .achievement-chevron { transform: rotate(180deg); }
.achievement-track-body { padding: 0 14px 14px; }
.achievements .achievement-description { margin: 0 0 12px; font-size: 11px; color: var(--muted); }
.achievement-progress-box { padding: 12px; background: var(--tint); border-radius: 9px; margin-bottom: 14px; }
.achievement-progress-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; font-size: 10px; }
.achievement-progress-label > span { color: var(--muted); }
.achievement-progress { display: block; appearance: none; width: 100%; height: 5px; border: 0; border-radius: 5px; overflow: hidden; background: var(--line); margin: 9px 0 7px; accent-color: var(--accent); }
.achievement-progress::-webkit-progress-bar { background: var(--line); border-radius: 5px; }
.achievement-progress::-webkit-progress-value { background: linear-gradient(90deg, #e36e28, #fbbf63); border-radius: 5px; }
.achievement-progress::-moz-progress-bar { background: var(--accent); }
.achievements .achievement-progress-box p { margin: 0; font-size: 10px; color: var(--muted); }
.achievement-medals { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.achievement-level { min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 3px 10px; border: 1px solid var(--line); background: var(--tint); border-radius: 10px; }
.achievement-level.unlocked { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.achievement-level.next { border-style: dashed; border-color: var(--accent); }
.achievement-medal { --metal: var(--muted); display: grid; place-items: center; flex-shrink: 0; width: 48px; height: 54px; margin-bottom: 3px; color: var(--muted); background: var(--soft); clip-path: polygon(50% 0, 94% 23%, 94% 75%, 50% 100%, 6% 75%, 6% 23%); }
.achievement-medal .icon { width: 21px; height: 21px; stroke-width: 1.5; }
.achievement-medal.bronze { --metal: #b87543; }
.achievement-medal.silver { --metal: #758da6; }
.achievement-medal.gold { --metal: #b8871f; }
.achievement-medal.platinum { --metal: #428b87; }
.achievement-medal.diamond { --metal: #6c70c9; }
.achievement-medal.legend { --metal: #b94c83; }
.achievement-medal.earned { color: white; background: linear-gradient(145deg, color-mix(in srgb, var(--metal) 65%, white), var(--metal) 65%, color-mix(in srgb, var(--metal) 80%, black)); filter: drop-shadow(0 2px 2px #0002); }
.achievement-medal.earned .icon { width: 28px; height: 28px; }
.achievement-medal.compact { width: 34px; height: 38px; margin: 0; }
.achievement-medal.compact .icon { width: 20px; height: 20px; }
.achievement-goal { font-size: 14px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.3px; }
.achievement-unit { font-size: 9px; color: var(--muted); }
.achievement-level-state { margin-top: 5px; font-size: 8px; color: var(--muted); }
.unlocked .achievement-level-state, .next .achievement-level-state { color: var(--accent); font-weight: 650; }
.achievement-rules { margin-top: 18px; padding: 12px; background: var(--tint); border-radius: 10px; }
.achievement-rules summary { cursor: pointer; color: var(--text); font-size: 11px; font-weight: 650; }
.achievements .achievement-rules p, .achievements .achievement-storage { color: var(--muted); font-size: 10px; line-height: 1.6; }
.achievement-status { color: var(--muted); }
@media (max-width: 520px) {
  #profile-dialog { padding: 18px; }
  .profile-edit { gap: 8px; }
  .profile-edit .primary-button { padding-inline: 10px; font-size: 10px; gap: 5px; }
  .profile-edit .primary-button .icon { width: 12px; height: 12px; }
  .achievement-intro h3 { font-size: 25px; }
  .achievement-passport { padding: 14px; grid-template-columns: 52px 1fr; gap: 12px; }
  .passport-emblem { width: 52px; height: 60px; }
  .passport-emblem .icon { width: 30px; height: 30px; }
  .passport-copy > strong { font-size: 31px; }
  .achievement-medals { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .achievement-level { aspect-ratio: 1; justify-content: center; gap: 2px; padding: 4px 2px; border-radius: 7px; }
  .achievement-level .achievement-medal { width: 26px; height: 28px; margin-bottom: 1px; }
  .achievement-level .achievement-medal .icon { width: 16px; height: 16px; }
  .achievement-goal { font-size: 12px; }
  .achievement-unit { font-size: 8px; line-height: 1; }
  /* Lock/medal icon, border and accessible item label already convey state. */
  .achievement-level-state { display: none; }
  .achievement-track-summary { gap: 7px; padding: 10px 8px; }
  .achievement-track-body { padding: 0 8px 10px; }
  .achievement-shelf-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
}

/* The dark palette includes every game state, not just the empty board. */
[data-theme="dark"] .bonus-icon, [data-theme="dark"] .bonus-chip { background: var(--tint); }
[data-theme="dark"] .letter-zone { background: linear-gradient(120deg, #e05c12, #f58125); }
[data-theme="dark"] .guess-row:focus-within { border-color: var(--accent); }
[data-theme="dark"] .word.claimed { background: #273321; border-color: #405535; }
[data-theme="dark"] .word.claimed .letter-slot { background: #35472c; border-color: #647e50; }
[data-theme="dark"] .word.claimed .word-letters { color: #d0edb1; }
[data-theme="dark"] .word.claimed .word-owner { color: #afc698; }
[data-theme="dark"] .word.instagram { background: #392733; border-color: #614255; }
[data-theme="dark"] .word.instagram .letter-slot { background: #513347; border-color: #90667f; }
[data-theme="dark"] .word.instagram .word-letters { color: #ffd0eb; }
[data-theme="dark"] .word.instagram .word-owner { color: #d7a7c2; }
[data-theme="dark"] .submit-button { background: #dc681e; }
[data-theme="dark"] .submit-button:hover { background: #be5312; }
[data-theme="dark"] .feedback.success, [data-theme="dark"] .activity-points { color: #b3d58d; }
[data-theme="dark"] .feedback.error, [data-theme="dark"] .timer.urgent, [data-theme="dark"] .reset-button { color: #f09cae; }
[data-theme="dark"] .live-dot { box-shadow: 0 0 0 4px #2d3929; }
[data-theme="dark"] .source-icon { background: #2d3929; color: #b3d58d; }
[data-theme="dark"] .source-icon.instagram { background: #442c3a; color: #e5a8cf; }
[data-theme="dark"] .activity-bonus, [data-theme="dark"] .bonus-status { color: #dca0c5; }
[data-theme="dark"] dialog::backdrop { background: #0009; }

/* Carry the collection's warm highlights and medal details into the game.
   Decorative layers do not change the carefully fitted board geometry. */
.topbar { background: linear-gradient(110deg, var(--surface) 50%, color-mix(in srgb, var(--accent) 5%, var(--surface))); }
.topbar .icon-button { background: var(--surface); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text) 5%, transparent); }
.intro .eyebrow { color: var(--accent); }
.intro h1 { font-weight: 800; letter-spacing: -1.2px; }
.profile-card { background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--accent) 15%, transparent), transparent 80%), var(--surface); border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
.profile-card .section-caption { color: var(--accent); }
.profile-card .avatar { color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); clip-path: polygon(50% 0, 94% 23%, 94% 75%, 50% 100%, 6% 75%, 6% 23%); }
.profile-card .mobile-ranking { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.board { border-color: color-mix(in srgb, var(--accent) 18%, var(--line)); background: linear-gradient(155deg, color-mix(in srgb, var(--accent) 4%, var(--surface)), var(--surface) 30%); box-shadow: 0 8px 25px #00000008; }
.board-header { background: transparent; }
.answers-header h2 { font-weight: 750; }
.online-badge { background: color-mix(in srgb, var(--accent) 5%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 20%, var(--line)); }
.word:not(.claimed):not(.revealed) { background: linear-gradient(150deg, var(--surface), var(--tint)); }
.word.claimed { background-image: linear-gradient(135deg, #a9d47516, transparent 70%); box-shadow: inset 0 1px 0 #a9d47524; }
#words .word { background-image: radial-gradient(ellipse at top right, color-mix(in srgb, var(--accent) 15%, transparent), transparent 80%); }
#words .word.revealed { background-image: radial-gradient(ellipse at top right, #db62622e, transparent 80%); }
#words .word.claimed { background-image: radial-gradient(ellipse at top right, #8acb4d38, transparent 80%); }
.letter-zone, [data-theme="dark"] .letter-zone { background: radial-gradient(ellipse at top right, #ffcc7c55, transparent 70%), linear-gradient(120deg, #b95018, #dc7126); box-shadow: inset 0 1px 0 #ffe3b670, inset 0 -1px 0 #69321140; }
.letter { background: linear-gradient(155deg, var(--surface), var(--tint)); }
.letter.used { background: var(--soft); }
.submit-button, [data-theme="dark"] .submit-button { background: linear-gradient(145deg, #e78636, #c55717); box-shadow: inset 0 1px 0 #ffdda34d; }
.submit-button:hover:not(:disabled) { background: #bd5216; }
.shuffle-button { background: #ffffff12; }
.ranking-card, .activity-card { background: linear-gradient(145deg, color-mix(in srgb, var(--accent) 5%, var(--surface)), var(--surface) 60%); }
.ranking-card { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.rank-row:first-child .rank-position { color: var(--accent); font-weight: 800; }
.rank-avatar { clip-path: polygon(50% 0, 94% 23%, 94% 75%, 50% 100%, 6% 75%, 6% 23%); }
.empty-state > .icon { color: var(--accent); stroke-width: 1.4; }
.bonus-card { background: radial-gradient(ellipse at top right, color-mix(in srgb, var(--accent) 13%, transparent), transparent 75%), var(--surface); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); }
.bonus-card .bonus-icon { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); clip-path: polygon(50% 0, 94% 23%, 94% 75%, 50% 100%, 6% 75%, 6% 23%); }
.game-toolbar .bonus-status { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 28%, var(--line)); background: linear-gradient(120deg, var(--surface), color-mix(in srgb, var(--accent) 8%, var(--surface))); }

/* Size against the browser viewport, not the physical phone screen.
   Portrait layouts prioritize the board; ranking opens in its dialog. */
@media (max-width: 1100px) and (min-width: 761px) and (min-height: 601px) {
  .shell { padding: 25px 24px 0; }
  .workspace { grid-template-columns: 170px minmax(320px, 1fr) 190px; gap: 12px; }
  .profile-card { padding: 16px 12px; }
  .personal-stats { gap: 5px; }
  .personal-stats strong { font-size: 20px; }
  .bonus-card { padding: 18px 12px; }
  .rank-avatar { display: none; }
  .panel-heading .text-button { font-size: 8px; }
  .board { padding: 14px; }
  .letter { font-size: 25px; }
}
@media (max-width: 760px), (max-height: 600px) and (max-width: 1000px) {
  body { height: 100svh; height: 100dvh; display: flex; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .topbar { flex: 0 0 52px; height: 52px; padding: 0 4px 0 14px; gap: 3px; }
  .header-ad { height: 30px; max-width: 220px; margin-inline: 6px; gap: 2px; }
  .header-ad > span { font-size: clamp(11px, 3.6vw, 15px); }
  .header-ad > small { font-size: 6px; letter-spacing: .2px; }
  .brand { font-size: 13px; gap: 8px; }
  .brand-small { font-size: 15px; }
  .brand-mark { width: 31px; height: 31px; }
  nav { margin-left: 0; }
  .icon-button { height: 36px; width: 36px; border-radius: 10px; }
  .topbar-right { gap: 7px; }
  .online-badge { width: 38px; height: 26px; }
  .connection span { width: 5px; height: 5px; }
  .topbar .icon { width: 18px; height: 18px; }
  .online-badge .icon { width: 12px; height: 12px; }
  .shell { flex: 1; min-height: 0; width: 100%; padding: 8px 10px; display: flex; flex-direction: column; }
  .intro, .page-footer, .bonus-card, .little-note { display: none; }
  .workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 36px minmax(0, 1fr) 108px 24px; gap: 8px; align-items: stretch; }
  .left-column { display: contents; }
  .profile-card { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 8px; padding: 2px 8px; }
  .profile-card .section-caption { display: none; }
  .identity { flex: 1; margin: 0; min-height: 28px; }
  .profile-card .avatar, .identity-text > span { display: none; }
  .identity strong { font-size: 11px; max-width: 125px; }
  .personal-stats { display: flex; flex-shrink: 0; align-items: center; gap: 10px; padding: 0; border: 0; text-align: right; }
  .personal-stats strong { font-size: 16px; line-height: 1.1; letter-spacing: -.4px; }
  .personal-stats span { display: block; font-size: 8px; line-height: 1.2; margin-top: 1px; }
  .personal-stats .mobile-ranking { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; }
  .personal-stats .mobile-ranking .icon { width: 16px; height: 16px; }
  .game-column { grid-column: 1; grid-row: 2; min-height: 0; display: flex; }
  .board { width: 100%; min-height: 0; padding: 4px 10px 3px; gap: 7px; grid-template-rows: 26px 18px minmax(124px, 1fr) 74px auto; }
  .board-header { gap: 9px; }
  .status { font-size: 9px; }
  .timer { font-size: 17px; gap: 4px; }
  .timer .icon { width: 14px; height: 14px; }
  .letter-zone { min-height: 0; padding: 7px; gap: 5px; border-radius: 12px; }
  .board-kicker { font-size: 7px; letter-spacing: .8px; }
  .letter-controls { gap: 6px; }
  .letters { gap: 5px; }
  .letter { --tile-depth: 3px; height: clamp(38px, 5.6dvh, 52px); border-radius: 8px; font-size: 25px; }
  .shuffle-button { width: 32px; height: 38px; border-radius: 8px; }
  .shuffle-button .icon { width: 16px; height: 16px; }
  .answers-header h2 { font-size: 11px; }
  .answers-header > span { font-size: 9px; }
  .words { --slot: clamp(11px, 3.5vw, 15px); gap: 3px; min-height: 0; }
  .word { min-height: 0; padding: 1px 2px; gap: 1px; }
  .entry-card { min-height: 0; padding-top: 2px; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: 44px; }
  .example-button .icon { width: 14px; height: 14px; }
  .guess-row { height: 44px; padding: 3px; }
  .guess-input { padding: 6px; font-size: 16px; }
  .guess-input::placeholder { font-size: 11px; }
  .submit-button, .erase-button { height: 36px; width: 38px; }
  .submit-button .icon { width: 18px; height: 18px; }
  /* Messages own their height; unused fixed rows belong to the answer grid. */
  .feedback-slot { height: auto; min-height: 0; }
  .feedback { font-size: 10px; line-height: 1.25; }
  .right-column { grid-column: 1; grid-row: 3; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; min-height: 0; }
  .ranking-card, .activity-card { padding: 7px 10px; min-width: 0; min-height: 0; }
  .panel-heading { height: 22px; gap: 4px; }
  .panel-heading h2 { font-size: 10px; gap: 4px; }
  .panel-heading h2 .icon { width: 12px; height: 12px; }
  .panel-heading .text-button { font-size: 8px; min-height: 22px; gap: 2px; }
  .panel-heading .text-button .icon { width: 10px; height: 10px; }
  .ranking-list, .activity-list { margin-top: 3px; }
  #ranking .rank-row { height: 22px; min-height: 0; padding: 2px 0; gap: 5px; }
  #ranking .rank-position { font-size: 9px; width: 10px; }
  #ranking .rank-avatar, #ranking .rank-extra, .ranking-footer { display: none; }
  #ranking .rank-name { font-size: 9px; }
  #ranking .rank-score { font-size: 10px; }
  .empty-state { min-height: 61px; gap: 7px; }
  .empty-state > .icon { width: 19px; height: 19px; }
  .empty-state p { font-size: 10px; line-height: 1.4; }
  .activity-row { padding: 3px 0; height: 33px; gap: 5px; }
  .activity-row:last-child { padding-bottom: 3px; }
  .source-icon { width: 20px; height: 20px; border-radius: 6px; }
  .source-icon .icon { width: 11px; height: 11px; }
  .activity-content strong { font-size: 9px; }
  .activity-content span { font-size: 9px; margin-top: 1px; }
  .activity-points { font-size: 10px; }
  .activity-bonus { font-size: 7px; margin-top: 1px; }
  .game-toolbar { grid-column: 1; grid-row: 4; padding: 0 3px; margin: 0; }
  .bonus-status { font-size: 10px; gap: 5px; }
  .bonus-status .icon { width: 12px; height: 12px; }
  .game-toolbar .text-button { height: 24px; min-height: 24px; max-width: 100%; padding: 0 8px; font-size: 10px; line-height: 1; white-space: nowrap; }
  dialog { padding: 22px; }
  dialog .rank-name { font-size: 12px; }
}
@media (max-width: 760px) and (min-height: 701px) {
  .identity strong { font-size: 13px; }
  .status { font-size: 11px; }
  .timer { font-size: 20px; }
  .board-kicker { font-size: 8px; }
  .letter { font-size: 28px; }
  .answers-header h2 { font-size: 13px; }
  .answers-header > span { font-size: 10px; }
  .guess-input::placeholder { font-size: 13px; }
  .feedback { font-size: 11px; }
  .panel-heading h2 { font-size: 11px; }
  .panel-heading .text-button { font-size: 9px; }
  #ranking .rank-name { font-size: 11px; }
  #ranking .rank-score { font-size: 12px; }
  .activity-content strong { font-size: 10px; }
  .activity-content span { font-size: 10px; }
  .activity-points { font-size: 11px; }
  .bonus-status { font-size: 11px; }
}
/* Short phones: reduce whitespace, never the number of visible answers. */
@media (max-width: 760px) and (max-height: 700px), (max-height: 600px) and (max-width: 1000px) {
  .topbar { flex-basis: 44px; height: 44px; }
  .shell { padding: 6px 8px; }
  .workspace { grid-template-rows: 34px minmax(0, 1fr) 78px 24px; gap: 6px; }
  .personal-stats .mobile-ranking { width: 28px; height: 28px; }
  .board { padding: 4px 6px 3px; gap: 4px; grid-template-rows: 24px 18px minmax(100px, 1fr) 58px auto; }
  .online-badge { height: 24px; border-radius: 7px; }
  .letter-zone { padding: 4px 7px; }
  .board-kicker { font-size: 7px; line-height: 1.2; letter-spacing: .5px; }
  .letter { height: 38px; font-size: 23px; }
  .word { gap: 1px; }
  .entry-card { grid-template-rows: 36px; }
  .guess-row { height: 36px; padding: 2px; }
  .submit-button, .erase-button { height: 30px; }
  .feedback { font-size: 9px; }
  .ranking-card, .activity-card { padding: 4px 8px; }
  .panel-heading { height: 18px; }
  .panel-heading .text-button { min-height: 18px; }
  .ranking-list, .activity-list { margin-top: 2px; }
  #ranking .rank-row { height: 17px; padding: 0; }
  .activity-row { height: 26px; padding: 1px 0; }
  .activity-row:last-child { padding-bottom: 1px; }
  .activity-content strong, .activity-content span { font-size: 8px; }
  .empty-state { min-height: 48px; }
  .empty-state p { font-size: 9px; }
}
@media (max-width: 350px) {
  nav { margin-left: auto; }
  .identity strong { max-width: 100px; }
  .letter { font-size: 22px; }
  .letter-controls { gap: 4px; }
  .letters { gap: 4px; }
  .shuffle-button { width: 28px; }
  .answers-suffix { display: none; }
  .bonus-status { font-size: 9px; }
}
/* In landscape, the scoreboard moves beside the board rather than below it. */
@media (max-height: 600px) and (min-width: 500px) and (max-width: 1000px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 220px; grid-template-rows: 40px minmax(0, 1fr) 24px; }
  .game-column { grid-column: 1; grid-row: 1 / -1; }
  .profile-card { grid-column: 2; grid-row: 1; }
  .right-column { grid-column: 2; grid-row: 2; grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
  .game-toolbar { grid-column: 2; grid-row: 3; }
  .bonus-status { font-size: 8px; }
  .game-toolbar .text-button { font-size: 7px; padding-inline: 5px; }
  .bonus-status .icon { display: none; }
  .personal-stats { gap: 9px; }
  .personal-stats strong { font-size: 14px; }
  .profile-card .identity strong { max-width: 85px; font-size: 10px; }
  .board { grid-template-rows: 27px 18px minmax(83px, 1fr) 56px auto; gap: 3px; padding: 7px 7px 3px; }
  .letter-zone { padding: 4px 8px; }
  .letter { height: 36px; }
  .words { --slot: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .word-letters { gap: 1px; }
  .word { flex-direction: row; gap: 2px; padding: 1px; }
  .word-owner { flex: 1; min-width: 0; font-size: 10px; }
  .ranking-card, .activity-card { display: flex; flex-direction: column; }
  .empty-state { min-height: 0; flex: 1; }
}
@media (max-height: 360px) and (min-width: 500px) and (max-width: 1000px) {
  .topbar { flex-basis: 36px; height: 36px; }
  .topbar .icon-button { width: 30px; height: 30px; }
  .topbar .brand-mark { width: 26px; height: 26px; }
  .topbar .brand { font-size: 11px; }
  .topbar .brand-small { font-size: 12px; }
  .workspace { grid-template-columns: minmax(0, 1fr) 185px; }
  .profile-card { padding: 4px 7px; gap: 5px; }
  .profile-card .identity strong { max-width: 64px; }
  .personal-stats { gap: 7px; }
  .personal-stats strong { font-size: 13px; }
  .personal-stats span { font-size: 7px; }
  .board { grid-template-rows: 26px 18px minmax(73px, 1fr) 50px auto; padding: 5px 5px 3px; gap: 2px; }
  .status { font-size: 8px; }
  .timer { font-size: 15px; }
  .timer .icon { display: none; }
  .letter-zone { padding: 4px 6px; }
  .letter-controls, .letters { gap: 4px; }
  .letter { height: 32px; font-size: 22px; }
  .shuffle-button { width: 26px; height: 32px; }
  .words { --slot: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(0, 1fr)); gap: 2px; }
  .word { flex-direction: row; gap: 2px; padding: 1px; }
  .word-owner { flex: 1; min-width: 0; font-size: 10px; }
  .entry-card { grid-template-rows: 32px; }
  .guess-row { height: 32px; padding: 2px; }
  .submit-button, .erase-button { height: 26px; }
  .bonus-status { font-size: 7px; }
  .game-toolbar .text-button { font-size: 7px; }
}
/* Browser chrome is already excluded from viewport units. Use the small viewport
   so expanding browser bars does not resize the board during a round. Safe-area
   padding is accounted for once; never subtract a guessed Instagram toolbar. */
@media (max-width: 760px) and (orientation: portrait) {
  body { height: auto; min-height: 100svh; }
  .shell { flex: 1 0 auto; }
  /* Split spare height above the tiles and on both sides of the label.
     All label states share the same centered space below the tile row. */
  .word { gap: 0; }
  .word-letters { margin-top: auto; }
  .word-owner { margin-block: auto; }
  /* Completed answers are readable words, not tiny filled placeholders.
     Hidden answers keep the shared square size and their letter-count label. */
  .word:is(.claimed, .revealed) .word-letters {
    gap: 0;
    font-size: clamp(13px, 3.8vw, 16px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: .04em;
    color: var(--revealed-text);
  }
  :root .word:is(.claimed, .revealed) .letter-slot {
    width: auto;
    height: auto;
    flex: none;
    display: block;
    border: 0;
    background: transparent;
    font: inherit;
    letter-spacing: inherit;
  }
  .word.claimed .word-letters { color: #2e501a; }
  .word.instagram .word-letters { color: #76355f; }
  [data-theme="dark"] .word.claimed .word-letters { color: #e2ffc4; }
  [data-theme="dark"] .word.instagram .word-letters { color: #ffe0f2; }
  .workspace {
    flex: none;
    min-height: calc(100svh - 68px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    grid-template-rows: 36px minmax(400px, 1fr) 24px;
  }
  .right-column { display: none; }
  .mobile-ranking { display: grid; }
  .game-toolbar { grid-row: 3; justify-content: center; }
  nav { margin-left: auto; }
}
@media (max-width: 760px) and (max-height: 700px) and (orientation: portrait) {
  .workspace {
    min-height: calc(100svh - 56px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    grid-template-rows: 34px minmax(350px, 1fr) 24px;
  }
}
/* Keep the board first, then the bonus and two compact cards on tall phones. */
@media (max-width: 760px) and (min-height: 780px) and (orientation: portrait) {
  .workspace { grid-template-rows: 36px minmax(400px, 1fr) 24px 108px; }
  .right-column { display: grid; grid-row: 4; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
