/* The web client: a desktop product first. Three columns on the moving black page. */
html, body { min-height: 100%; }
#bg { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; background: #050506; }
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-left) minmax(0, 1fr) var(--rail-right); min-height: 100vh; }

/* ---------- left rail ---------- */
.rail-left { position: sticky; top: 0; height: 100vh; padding-block: 28px 22px; padding-inline: 22px 18px; display: flex; flex-direction: column; gap: 6px; }
.brand { display: block; font-size: 25px; padding: 4px 8px 22px; }
.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a { display: flex; align-items: center; gap: 14px; height: 48px; padding: 0 16px; border-radius: 16px; font-weight: 900; font-size: 15.5px; color: var(--soft); transition: background 0.15s, color 0.15s; }
.nav a:hover { color: var(--white); background: rgba(255, 255, 255, 0.06); }
.nav a[aria-current='page'] { color: #252525; background: linear-gradient(180deg, #fff, var(--pill-face)); box-shadow: 0 3px 0 #858585, 0 8px 16px rgba(0, 0, 0, 0.4); }
.nav a:active { transform: translateY(2px); }
.rail-spacer { flex: 1; }
.acct { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.acct .who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar { position: relative; flex: none; width: 44px; height: 44px; border-radius: 50%; background: #060607; border: 2px solid var(--white); display: grid; place-items: center; }
.avatar .pip-ball { width: 20px; height: 20px; }
.avatar.me { border-color: var(--me); } .avatar.op { border-color: var(--op); } .avatar.p3 { border-color: var(--p3); } .avatar.p4 { border-color: var(--p4); }
.acct .nm { font-weight: 900; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct .sub { font-size: 12.5px; color: var(--soft); font-weight: 700; }
.acct .stats { display: flex; gap: 8px; flex-wrap: wrap; }
.conn { display: flex; align-items: center; gap: 10px; padding: 10px 10px 0; color: var(--soft); font-weight: 700; font-size: 13px; }

/* ---------- centre ---------- */
.center { min-width: 0; padding: 28px 28px 80px; }
.center-in { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; animation: rise 0.45s var(--ease-out); }
.page-title { font-size: 30px; line-height: 1.1; }
.page-sub { color: var(--soft); font-weight: 700; margin-top: 6px; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { padding: 20px; min-height: 144px; display: flex; flex-direction: column; gap: 8px; }
.card .ico { height: 26px; display: flex; align-items: center; }
.card h3 { font-size: 18px; margin-top: 6px; }
.card p { color: var(--soft); font-weight: 700; font-size: 13.5px; }
.weekend { border-color: rgba(255, 194, 51, 0.5); }
.weekend .until { color: var(--p4); font-weight: 900; font-size: 13px; margin-top: auto; }
.progress { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 12px; }
.progress .k { font-size: 24px; font-weight: 900; }
.progress .l { color: var(--soft); font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.bar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); overflow: hidden; margin-top: 12px; }
.bar > i { display: block; height: 100%; border-radius: 4px; background: var(--me); }
.notice { border-radius: 18px; padding: 14px 18px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.05); font-weight: 700; color: var(--soft); }
.notice.warn { border-color: rgba(255, 194, 51, 0.5); color: var(--p4); }
.notice .row { margin-top: 12px; }

/* ---------- right rail ---------- */
.rail-right { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding-block: 28px 22px; padding-inline: 6px 22px; display: flex; flex-direction: column; gap: 20px; scrollbar-width: none; }
.rail-right::-webkit-scrollbar { display: none; }
.rail-right .panel { padding: 18px 18px 16px; }
.pan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.pan-head a, .link { color: var(--soft); font-weight: 900; font-size: 13px; background: none; border: 0; padding: 0; transition: color 0.15s; }
.pan-head a:hover, .link:hover { color: var(--white); }
.lrow { display: flex; align-items: center; gap: 10px; min-height: 46px; border-top: 1px solid rgba(255, 255, 255, 0.09); }
.lrow:first-of-type { border-top: 0; }
.lrow .nm { font-weight: 900; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.25; }
.lrow .nm small { display: block; color: var(--soft); font-weight: 700; font-size: 12.5px; }
.lrow .rt { color: var(--soft); font-weight: 700; font-size: 13px; width: 44px; text-align: end; }
.lrow .tc { color: var(--soft); font-weight: 700; font-size: 12.5px; width: 46px; text-align: end; }
.lrow .rk { width: 22px; color: var(--faint); font-weight: 900; font-size: 13px; }
.lrow.me-row { color: var(--me); }
.lrow.compact { min-height: 36px; }
.joincode { display: flex; gap: 8px; margin-top: 12px; }
.joincode .field { height: 40px; font-size: 14px; border-radius: 14px; }
.online { display: flex; align-items: center; gap: 10px; color: var(--soft); font-weight: 700; font-size: 14px; padding: 0 6px; }

/* ---------- ranked / computer / friend pages ---------- */
.stat-line { display: flex; flex-wrap: wrap; gap: 28px; }
.stat-line .k { font-size: 30px; font-weight: 900; }
.stat-line .l { color: var(--soft); font-weight: 700; font-size: 13px; }
.opt-group { display: flex; flex-direction: column; gap: 10px; }
.search-box { text-align: center; padding: 40px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.search-box .big { font-size: 38px; font-weight: 900; }
.orbit { position: relative; width: 120px; height: 120px; }
.orbit .ball { width: 26px; height: 26px; left: 47px; top: 47px; animation: orb 2.4s linear infinite; }
.orbit .ball.op { animation-delay: -1.2s; }
@keyframes orb { from { transform: rotate(0) translateX(40px) rotate(0); } to { transform: rotate(360deg) translateX(40px) rotate(-360deg); } }
.found { display: grid; grid-template-columns: 1fr auto 1fr; align-items: start; gap: 24px; text-align: center; padding: 36px 24px; }
.found .vs { font-weight: 900; color: var(--faint); font-size: 18px; align-self: center; }
.found .pl { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.found .pl .ball { position: relative; width: 56px; height: 56px; }
.found .pl .n { font-size: 22px; font-weight: 900; }
.found.four { grid-template-columns: repeat(4, 1fr); }
.found.four .vs { display: none; }
.code-big { font-size: 64px; font-weight: 900; letter-spacing: 0.16em; text-align: center; padding: 8px 0; }
.invite { display: flex; gap: 8px; }
.invite .field { font-size: 14px; font-weight: 700; color: var(--soft); }
.seats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.seat { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.03); min-height: 66px; }
.seat.empty { border-style: dashed; color: var(--faint); font-weight: 700; }
.seat .pip-ball { width: 28px; height: 28px; }
.seat .nm { font-weight: 900; } .seat .sub { color: var(--soft); font-size: 13px; font-weight: 700; }
.diff { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.diff .chip { height: auto; padding: 14px 8px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
.diff .chip small { font-weight: 700; font-size: 11.5px; color: var(--faint); }
.diff .chip[aria-pressed='true'] small { color: var(--soft); }

/* leaderboard */
.lb .table td, .lb .table th { padding-inline-start: 16px; padding-inline-end: 16px; }
.lb .rk { width: 56px; color: var(--soft); }
.lb .rt { font-weight: 900; }
.pinned { margin-top: 12px; padding-top: 16px; border-top: 1px dashed var(--hairline); }

/* how to play */
.how-step { display: grid; grid-template-columns: 220px 1fr; gap: 28px; align-items: center; padding: 22px 24px; }
.how-step canvas { width: 220px; height: 220px; display: block; }
.how-step .n { color: var(--faint); font-weight: 900; font-size: 13px; letter-spacing: 0.12em; }
.how-step h2 { font-size: 24px; margin: 6px 0 8px; }
.how-step p { color: var(--soft); font-weight: 700; max-width: 40ch; }

/* ---------- match ---------- */
.app.in-match { grid-template-columns: minmax(0, 1fr); }
.app.in-match .rail-left, .app.in-match .rail-right, .app.in-match .dock { display: none; }
.app.in-match .center { padding: 0; }
.app.in-match .center-in { max-width: none; margin: 0; animation: none; gap: 0; }
.match { height: 100vh; display: grid; grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(300px, 360px); gap: 24px; padding: 14px 24px 16px; align-items: stretch; }
.m-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; height: 40px; }
.m-top .brand { padding: 0; font-size: 20px; }
.m-top .mt { font-weight: 900; font-size: 17px; }
.m-top .ms { color: var(--soft); font-weight: 700; }
.m-top .space { flex: 1; }
.m-left, .m-right { display: flex; flex-direction: column; gap: 14px; min-height: 0; min-width: 0; }
.m-board { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; min-height: 0; gap: 12px; }
.boardwrap { position: relative; width: min(100%, calc(100vh - 150px), 720px); aspect-ratio: 1; }
.boardwrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; cursor: pointer; }
/* keyboard play (W9): the board frame lights up while it has keyboard focus; the cursor itself is painted on the board */
.boardwrap canvas:focus { outline: none; }
.boardwrap canvas:focus-visible { outline: 2px solid var(--hairline-selected); outline-offset: 5px; border-radius: 26px; }
.statusline { text-align: center; font-weight: 700; color: var(--soft); min-height: 22px; }
.statusline b { color: var(--white); font-weight: 900; }
.backlive { position: absolute; left: 50%; top: -6px; transform: translate(-50%, -100%); z-index: 3; }
.panel.facts { padding: 16px 18px; }
.facts dl { margin: 10px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: 14px; }
.facts dt { color: var(--soft); font-weight: 700; } .facts dd { margin: 0; font-weight: 900; text-align: end; }
.chat { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; padding: 14px 16px; }
.chat .log { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 8px 0; font-size: 14px; scrollbar-width: thin; }
.chat .log .m b { font-weight: 900; margin-inline-end: 6px; }
.chat .log .m.react { color: var(--soft); font-style: normal; }
.chat form { display: flex; gap: 8px; }
.chat .field { height: 40px; font-size: 14px; border-radius: 14px; }
.chat .none { color: var(--faint); font-weight: 700; font-size: 13.5px; margin: auto 0; text-align: center; }
.c-me { color: var(--me); } .c-op { color: var(--op); } .c-p3 { color: var(--p3); } .c-p4 { color: var(--p4); }

.strip { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 22px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline); box-shadow: 0 5px 0 var(--slab), 0 12px 24px rgba(0, 0, 0, 0.4); transition: border-color 0.2s; }
.strip.turn { border-color: var(--white); border-width: 1.6px; padding: 13.4px 15.4px; }
.strip .av { width: 46px; height: 46px; border-radius: 50%; background: #060607; border: 2px solid var(--hairline); display: grid; place-items: center; }
.strip .av.me { border-color: var(--me); } .strip .av.op { border-color: var(--op); } .strip .av.p3 { border-color: var(--p3); } .strip .av.p4 { border-color: var(--p4); }
.strip .av .pip-ball { width: 24px; height: 24px; }
.strip .nm { font-weight: 900; font-size: 16px; display: flex; align-items: center; gap: 4px 8px; min-width: 0; flex-wrap: wrap; }
.strip .nm span.t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip .meta { color: var(--soft); font-weight: 700; font-size: 13px; margin-top: 2px; }
.strip .wl { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; font-weight: 700; color: var(--soft); white-space: nowrap; }
.pips { display: flex; gap: 3px; }
.pips i { width: 5px; height: 14px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.pips i.on.me { background: var(--me); } .pips i.on.op { background: var(--op); } .pips i.on.p3 { background: var(--p3); } .pips i.on.p4 { background: var(--p4); }
.clock { min-width: 90px; text-align: center; padding: 10px 12px; border-radius: 20px; background: rgba(255, 255, 255, 0.05); border: 1.2px solid var(--hairline); font-size: 30px; font-weight: 900; line-height: 1; }
.strip.turn .clock { background: var(--pill-face); color: #252525; border-color: transparent; }
.clock.low, .strip.turn .clock.low { color: var(--op); }
.strip.turn .clock.low { background: rgba(255, 92, 138, 0.16); color: var(--op); border-color: var(--op); }
.strip.out { opacity: 0.5; }
.strip .state { font-size: 12px; font-weight: 700; color: var(--p4); margin-top: 6px; }
.strip.compact { padding: 9px 12px; gap: 10px; border-radius: 18px; box-shadow: 0 3px 0 var(--slab); }
.strip.compact .av { width: 34px; height: 34px; } .strip.compact .av .pip-ball { width: 18px; height: 18px; }
.strip.compact .nm { font-size: 14px; } .strip.compact .meta { font-size: 12px; margin: 0; }
.strip.compact .clock { min-width: 66px; font-size: 20px; padding: 7px 10px; border-radius: 14px; }
.strip.compact .wl { display: none; }
.strips4 { display: flex; flex-direction: column; gap: 8px; }
.bubble { position: absolute; inset-inline-end: 8px; top: -34px; background: var(--pill-face); color: #252525; font-weight: 900; padding: 7px 14px; border-start-start-radius: 16px; border-start-end-radius: 16px; border-end-end-radius: 4px; border-end-start-radius: 16px; box-shadow: 0 3px 0 #858585; animation: rise 0.3s var(--ease-back); z-index: 4; white-space: nowrap; }

.moves { flex: 1 1 auto; min-height: 90px; display: flex; flex-direction: column; padding: 14px 14px 10px; }
.moves .lst { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: thin; margin-top: 8px; }
.mv-row { display: grid; grid-template-columns: 32px repeat(var(--cols, 2), 1fr); gap: 4px; align-items: center; }
.mv-row .rn { color: var(--faint); font-weight: 900; font-size: 12.5px; padding-inline-start: 4px; }
.mv-row .mv { border: 0; background: none; text-align: start; padding: 4px 8px; border-radius: 10px; font-weight: 900; font-size: 14.5px; transition: background 0.12s; min-height: 28px; }
.mv-row .mv:hover { background: rgba(255, 255, 255, 0.09); }
.mv-row .mv.cur { background: rgba(255, 255, 255, 0.16); }
.mv-row .mv.sel { background: var(--white); color: #151515; }
.moves .empty { margin: auto; font-size: 13.5px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 0; min-width: 0; padding: 0 12px; }
.actions .ask { width: 100%; display: flex; align-items: center; gap: 10px; font-weight: 900; }
.actions .ask .grow { white-space: nowrap; }
.actions .claim { width: 100%; }
.picker { position: absolute; left: 0; right: 0; bottom: calc(100% + 10px); z-index: 20; padding: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.actions-wrap { position: relative; }
.recon { position: fixed; z-index: 70; top: 0; left: 0; right: 0; text-align: center; padding: 7px; font-weight: 900; font-size: 13.5px; background: var(--p4); color: #2a2200; }

/* result */
.result-back { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(5, 5, 6, 0.72); padding: 16px; animation: fade 0.3s; overflow-y: auto; }
.result { width: min(460px, 100%); text-align: center; padding: 30px 28px 24px; animation: rise 0.45s var(--ease-back); max-height: calc(100vh - 32px); overflow-y: auto; }
.result .big-ball { position: relative; width: 64px; height: 64px; margin: 0 auto 14px; }
.result .big-ball.pip-ball { width: 64px; height: 64px; }
.result h1, .result .res-title { font-size: 40px; line-height: 1.05; }
.result .why { color: var(--soft); font-weight: 700; margin-top: 8px; }
.result .sm { margin-top: 4px; font-weight: 700; }
.ratingbox { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 18px 0 8px; border-radius: 20px; background: #050506; border: 1px solid var(--hairline); text-align: start; }
.ratingbox .nums { flex: 1; display: flex; align-items: baseline; gap: 12px; }
.ratingbox .old { color: var(--soft); font-size: 22px; font-weight: 900; } .ratingbox .new { font-size: 32px; font-weight: 900; }
.delta { padding: 6px 14px; border-radius: 999px; font-weight: 900; border: 1.5px solid var(--good); color: var(--good); background: rgba(70, 220, 130, 0.12); }
.delta.neg { border-color: var(--bad); color: var(--bad); background: rgba(255, 84, 84, 0.12); }
.protect { color: var(--soft); font-size: 13px; font-weight: 700; margin: 4px 0 8px; }
.earned { text-align: start; border-radius: 18px; background: #060607; border: 1px solid rgba(255, 255, 255, 0.18); padding: 12px 16px; margin: 12px 0; }
.earned .tot { display: flex; justify-content: space-between; font-weight: 900; margin-bottom: 6px; }
.earned .why-l { display: flex; justify-content: space-between; gap: 12px; color: var(--soft); font-weight: 700; font-size: 13.5px; padding: 3px 0; }
.places { text-align: start; margin: 16px 0 6px; display: flex; flex-direction: column; gap: 6px; }
.place { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; border: 1px solid var(--hairline); font-weight: 900; }
.place.mine { border-color: var(--me); background: rgba(70, 214, 255, 0.08); }
.place .o { width: 34px; color: var(--soft); }
.place .st { margin-inline-start: auto; color: var(--soft); font-weight: 700; font-size: 13px; }
.result .btns { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }

/* skeleton blocks */
.sk-card { height: 144px; border-radius: var(--panel-radius); }

/* ---------- phone dock ---------- */
.dock { display: none; }

@media (max-width: 1279px) and (min-width: 1100px) {
  .match { grid-template-columns: 220px minmax(0, 1fr) 310px; gap: 16px; padding: 12px 16px 14px; }
  .clock { min-width: 80px; font-size: 26px; }
  .facts dl { font-size: 13px; gap: 6px 10px; }
  .facts dd { white-space: normal; }
}
@media (max-width: 1099px) {
  .app { grid-template-columns: var(--rail-left) minmax(0, 1fr); }
  .rail-right { grid-column: 2; position: static; height: auto; padding: 0 28px 60px; overflow: visible; }
  .rail-left { grid-row: 1 / span 2; }
  .match { height: auto; grid-template-columns: minmax(0, 1fr); padding: 12px 16px 40px; gap: 14px; display: flex; flex-direction: column; }
  .m-board { order: 2; } .m-right { display: contents; } .m-left { order: 9; }
  .m-top { order: 0; }
  .m-right .strips-opp { order: 1; } .m-right .strips-me { order: 3; } .m-right .actions-wrap { order: 4; } .m-right .moves { order: 5; flex: none; max-height: 240px; }
  /* stacked layout: the board is the smaller of the width and what the height leaves after the strips and actions (audit W8) */
  .boardwrap { width: min(100%, max(280px, calc(100vh - 430px)), 640px); }
}
@media (max-width: 759px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail-left { display: none; }
  .center { padding: 16px 16px 110px; }
  .rail-right { grid-column: 1; padding: 0 16px 120px; }
  .cards, .cards.two { grid-template-columns: 1fr; }
  .card { min-height: 0; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .progress { grid-template-columns: 1fr 1fr; }
  .hero .mark { width: 84px; } .hero .title { font-size: 24px; } .hero { padding-inline-end: 24px; }
  .how-step { grid-template-columns: 1fr; justify-items: center; text-align: center; } .how-step p { max-width: none; }
  .code-big { font-size: 44px; }
  .seats { grid-template-columns: 1fr; }
  .diff { grid-template-columns: repeat(3, 1fr); }
  .found { grid-template-columns: 1fr; } .found.four { grid-template-columns: 1fr 1fr; }
  .dock { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: fixed; z-index: 40; left: 16px; right: 16px; bottom: 14px; padding: 8px; border-radius: 28px; background: linear-gradient(180deg, var(--panel-top), var(--panel-bottom)); border: 1px solid var(--hairline); box-shadow: 0 5px 0 var(--slab), 0 14px 28px rgba(0, 0, 0, 0.55); }
  .dock a, .dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 54px; border-radius: 22px; font-weight: 900; font-size: 12px; color: var(--soft); background: none; border: 0; }
  .dock a[aria-current='page'] { color: #252525; background: linear-gradient(180deg, #fff, var(--pill-face)); box-shadow: 0 3px 0 #858585; }
  .match { padding: 8px 12px 24px; }
  .match .m-top .ms { display: none; }
  .strips4 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .strips4 .strip.compact { grid-template-columns: auto 1fr; } .strips4 .strip.compact .clock { grid-column: 1 / -1; }
  .strip { padding: 10px 12px; gap: 10px; border-radius: 20px; } .strip .av { width: 38px; height: 38px; } .strip .av .pip-ball { width: 20px; height: 20px; }
  .clock { font-size: 24px; min-width: 78px; padding: 8px 10px; }
  .m-board .statusline { font-size: 14px; }
  .result { padding: 24px 18px 18px; }
}
@media (max-height: 760px) and (min-width: 1100px) {
  .boardwrap { width: min(100%, calc(100vh - 140px), 720px); }
}

/* ---------- round 2a: puzzles, profile, replay, review ---------- */
.acct-link { color: inherit; text-decoration: none; transition: border-color 0.15s, transform 0.2s var(--ease-back); }
.acct-link:hover { border-color: var(--hairline-selected); }
.acct-link:active { transform: translateY(2px); }
.acct a.who { color: inherit; }
.m-right > .after { order: 5; }
.pz-hero { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: stretch; padding: 22px; }
.pz-board canvas { width: 100%; aspect-ratio: 1; display: block; }
.pz-info { display: flex; flex-direction: column; gap: 12px; padding-block: 6px 6px; padding-inline: 0 4px; min-width: 0; }
.pz-info h2 { font-size: 26px; line-height: 1.1; }
.pz-row { text-decoration: none; color: inherit; padding: 0 4px; border-radius: 14px; transition: background 0.15s; }
.pz-row:hover { background: rgba(255, 255, 255, 0.05); }
.pf-head { padding: 24px 28px; background-size: cover; background-position: center; overflow: hidden; }
.pf-head .avatar { flex: none; }
.pf-sub { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--hairline); font-weight: 700; }
.pf-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: stretch; }
.pf-table th, .pf-table td { padding-inline-start: 10px; padding-inline-end: 10px; }
.pf-table td { vertical-align: middle; }
.gdot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-inline-end: 7px; flex: none; }
.rv-cols { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.rv-acc { font-size: 34px; line-height: 1.1; margin-top: 4px; }
.rv-g { padding: 5px 0; font-weight: 900; }
.rv-g > :nth-child(2) { min-width: 110px; text-align: center; }
.rv-graph svg { display: block; border-radius: 10px; }
.rv-mom { width: 100%; background: none; border: 0; text-align: start; color: inherit; min-height: 44px; border-radius: 12px; padding: 0 6px; }
.rv-mom:hover { background: rgba(255, 255, 255, 0.06); }
.bar .indet { animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { 0% { margin-inline-start: -40%; } 100% { margin-inline-start: 100%; } }
.rp-bar { padding: 14px 16px; }
@media (max-width: 1099px) { .m-right > .after { order: 5; } .pf-cols { grid-template-columns: 1fr; } }
@media (max-width: 759px) {
  .pz-hero { grid-template-columns: 1fr; padding: 18px; }
  .pz-board { max-width: 360px; width: 100%; margin: 0 auto; }
  .pf-head .row { flex-wrap: wrap; } .pf-head [style*='text-align:end'] { text-align: start !important; }
  .progress[style*='repeat(4'] { grid-template-columns: 1fr 1fr 1fr 1fr !important; } .progress .k { font-size: 20px; }
  .rv-acc { font-size: 28px; }
}

.solo { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.solo .panel { width: min(520px, 100%); }
.m-right { overflow-y: auto; scrollbar-width: none; padding-bottom: 6px; }
.m-right::-webkit-scrollbar { display: none; }
.m-right > .panel { flex: none; }
.m-right > .moves { flex: 1 0 220px; }
.pf-cols { align-items: start; }
.pf-table td:nth-child(5) { white-space: nowrap; }
.acct.guest .nm { white-space: normal; }
.rv-graph svg { height: 96px; }
@media (max-width: 1099px) { .m-right { overflow: visible; } }

.m-top .mt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 759px) { .m-top .mt { max-width: 38vw; font-size: 15px; } .m-top .brand { font-size: 17px; } }

/* ---------- round 2b: shop, pass, daily, achievements ---------- */
.app.wide { grid-template-columns: var(--rail-left) minmax(0, 1fr); }
.app.wide .rail-right { display: none; }
.app.wide .center-in { max-width: 1180px; }
.navdot { margin-inline-start: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--op); box-shadow: 0 0 8px rgba(255, 92, 138, 0.7); }
.nav a[aria-current='page'] .navdot { box-shadow: none; }
.head-row { gap: 20px; }
.coinbox { display: flex; align-items: baseline; gap: 10px; padding: 12px 20px; white-space: nowrap; }
.shop-tabs { margin-top: 0; }
.shop-tabs .chip { display: inline-flex; align-items: center; text-decoration: none; }
.shop-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.shop-tile { position: relative; padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 4px; align-items: stretch; }
/* a name may take two lines (long names, and every language is longer than English somewhere); never cut mid-word off screen */
.shop-tile .nm { font-weight: 900; font-size: 15px; line-height: 1.2; margin-top: 8px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow-wrap: anywhere; }
.shop-tile .st { font-size: 13px; font-weight: 700; color: var(--soft); }
.shop-tile .st.on { color: var(--me); } .shop-tile .st.own { color: var(--good); }
.shop-tile.eq { border-color: var(--me); }
.rdot { position: absolute; top: 14px; inset-inline-end: 14px; width: 10px; height: 10px; border-radius: 50%; z-index: 2; }
.rdot.inl { position: static; display: inline-block; margin-inline-end: 8px; }
.pv { position: relative; width: 100%; aspect-ratio: 1.15; border-radius: 16px; background: #060607; border: 1px solid rgba(255, 255, 255, 0.1); overflow: hidden; display: grid; place-items: center; }
.pv canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pv.big { aspect-ratio: 1.3; max-width: 380px; margin: 0 auto; }
.pv.small { aspect-ratio: 1.5; border-radius: 12px; }
.pv-avatar .avatar { border-width: 2px; }
.detail .bigpv { margin-bottom: 14px; }
.modal-actions .hero { width: auto; min-width: 250px; min-height: 52px; }
.modal-actions .btn.buying { min-width: 200px; }
.rows .lrow { border-top: 1px solid rgba(255, 255, 255, 0.09); }
.pass-head { display: flex; align-items: center; gap: 28px; padding: 24px 28px; flex-wrap: wrap; }
.pass-head .grow { min-width: 260px; }
.track-wrap { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 8px; padding-block: 20px 16px; padding-inline: 22px 20px; }
.trk-labels { display: flex; flex-direction: column; gap: 8px; padding-top: 0; }
.trk-labels span { display: flex; align-items: center; font-size: 11px; font-weight: 900; letter-spacing: 0.12em; text-transform: uppercase; color: var(--soft); height: 128px; }
.trk-labels span:nth-child(2) { height: 40px; }
.track { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent; }
.tcol { display: flex; flex-direction: column; gap: 8px; width: 138px; flex: none; }
.tcol.cur .tnum, .tcol.cur.reached .tnum { color: #252525; background: var(--pill-face); box-shadow: 0 2px 0 #858585; }
.tcol.cur .tnum small { display: none; }
.tnum { height: 40px; display: grid; place-items: center; font-weight: 900; border-radius: 20px; background: rgba(255, 255, 255, 0.07); color: var(--soft); }
.tcol.reached .tnum { color: var(--white); }
.tcol.cur .pcell { border-color: var(--me); }
.pcell { height: 128px; border-radius: 18px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 10px 8px; text-align: center; }
.pcell .coinv { font-size: 24px; font-weight: 900; color: var(--coin); line-height: 1; }
.pcell .nm { font-size: 12.5px; font-weight: 700; line-height: 1.2; }
.pcell.item { padding: 8px; gap: 4px; } .pcell.item .pv { width: 100%; max-height: 56px; aspect-ratio: auto; height: 56px; }
.pcell.done { opacity: 0.6; } .pcell.lockd { background: rgba(255, 255, 255, 0.015); border-style: dashed; }
.pcell .tag { height: 22px; font-size: 11px; padding: 0 8px; } .pcell .btn.small { min-height: 30px; padding: 0 16px; }
.ladder { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.lcell { border-radius: 18px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.03); padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.lcell.today { border-color: #fff; background: rgba(255, 255, 255, 0.09); } .lcell.done { opacity: 0.6; }
.mis { padding: 8px 0; }
.mis .tick { display: inline-block; width: 7px; height: 12px; border: solid var(--good); border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); margin-inline-end: 10px; position: relative; top: -2px; }
.missions.big .mis { padding: 12px 0; border-top: 1px solid rgba(255, 255, 255, 0.09); } .missions.big .mis:first-child { border-top: 0; }
.today .login { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 8px; }
.today .seasonrow { color: inherit; margin-top: 8px; min-height: 52px; }
.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.ach { padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.ach.complete { opacity: 0.85; }
.tiers { display: flex; gap: 8px; }
.tstep { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 14px; border: 1px solid var(--hairline); color: var(--soft); text-align: center; }
.tstep b { font-size: 14px; color: var(--white); } .tstep small { font-size: 11px; font-weight: 700; color: var(--coin); }
.tstep.got { border-color: rgba(70, 220, 130, 0.55); background: rgba(70, 220, 130, 0.08); } .tstep.now { border-color: var(--white); }
.pf-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.pf-links .panel { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 1279px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1099px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .app.wide .center { padding-bottom: 60px; } .ach-grid { grid-template-columns: 1fr 1fr; } .pf-links { grid-template-columns: 1fr 1fr; } }
@media (max-width: 759px) {
  .shop-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline-end: -16px; padding-inline-end: 16px; scrollbar-width: none; } .shop-tabs .chip { flex: none; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .shop-tile { padding: 10px 10px 14px; } .coinbox { padding: 10px 14px; }
  .head-row { flex-direction: column; align-items: flex-start; }
  .ladder { grid-template-columns: repeat(4, minmax(0, 1fr)); } .lcell:nth-child(7) { grid-column: span 2; }
  .ach-grid { grid-template-columns: 1fr; } .tstep b { font-size: 13px; }
  .pf-links { grid-template-columns: 1fr 1fr; }
  .pass-head { padding: 18px; gap: 16px; } .pass-head .hero { width: 100%; }
  .track-wrap { grid-template-columns: 1fr; padding: 14px; } .trk-labels { display: none; }
  .track { flex-direction: column; overflow: visible; gap: 8px; padding: 0; }
  .tcol { width: auto; display: grid; grid-template-columns: 44px 1fr 1fr; gap: 6px; align-items: stretch; }
  .tcol .tnum { order: -1; height: auto; border-radius: 14px; } .tcol .tnum small { display: none; }
  .pcell { height: auto; min-height: 74px; } .pcell.item .pv { height: 40px; }
  .modal-actions { flex-direction: column-reverse; align-items: stretch; } .modal-actions .hero, .modal-actions .btn, .modal-actions .ghost { width: 100%; }
  .modal-back { align-items: end; padding: 10px; } .modal { max-height: calc(100vh - 24px); overflow-y: auto; }
}
@media (max-width: 759px) {
  .app.wide { grid-template-columns: minmax(0, 1fr); }
  .pass-head > div:last-child { width: 100%; }
  .pass-head .hero { min-height: 56px; height: 56px; }
}
.pass-head .hero.center { align-items: center; justify-content: center; padding: 0 24px; line-height: 1; }
@media (max-width: 759px) { .pass-head .hero.center { display: flex; height: 56px; min-height: 56px; box-sizing: border-box; } .pass-head > div:last-child { display: block; } }

/* phones: the last control of every page clears the dock (dock height + 16px + the safe-area inset) */
@media (max-width: 759px) {
  .center, .app.wide .center { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .pan-head a, .pan-head .link, .link { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; }
  .m-top .brand, .brand { display: inline-flex; align-items: center; min-height: 40px; padding: 0; }
  .rail-right { padding-bottom: calc(112px + env(safe-area-inset-bottom, 0px)); }
  .dock { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .btn, .btn.small, .ghost, .ghost.small, .seg button, .chip, .link, .rv-mom, .mv-row .mv, .mv { min-height: 40px; }
  .btn.small, .ghost.small { padding-inline-start: 18px; padding-inline-end: 18px; }
  .seg button { height: 40px; min-width: 40px; }
  .pcell .btn.small { min-height: 40px; }
  .brand { display: inline-block; padding: 8px 0; }
  .tstep { min-height: 40px; }
}

/* ---------- round 3: share your win ---------- */
.share-page .m-board { justify-content: flex-start; padding-top: 4px; gap: 12px; }
.stage-wrap { position: relative; height: min(calc(100vh - 150px), 760px); aspect-ratio: 9 / 16; max-width: 100%; border-radius: 28px; overflow: hidden; border: 1px solid var(--hairline-selected); box-shadow: 0 8px 0 var(--slab), 0 24px 50px rgba(0, 0, 0, 0.55); background: #050506; flex: none; }
.stage-wrap canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.clip-ctl { display: flex; align-items: center; gap: 10px; width: min(100%, calc(min(calc(100vh - 150px), 760px) * 9 / 16 + 120px)); }
.seg-bar { flex: 1 1 auto; display: flex; gap: 3px; height: 14px; align-items: center; cursor: pointer; min-width: 80px; }
.seg-bar i { display: block; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); overflow: hidden; transition: height 0.15s; }
.seg-bar:hover i { height: 9px; }
.seg-bar i b { display: block; height: 100%; width: 0; background: #fff; }
.seg-bar i[data-k=reveal] b { background: var(--me); }
.shareline { font-size: 22px; font-weight: 900; line-height: 1.25; margin-top: 8px; }
.recdot { width: 12px; height: 12px; border-radius: 50%; background: var(--bad); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.35; } }
@media (max-width: 1099px) {
  .share-page .m-board { order: 1; } .share-page .m-right { order: 2; display: flex; } .share-page .m-left { order: 3; }
  .stage-wrap { height: auto; width: min(100%, 460px); }
  .clip-ctl { width: min(100%, 460px); }
}
@media (max-width: 759px) { .stage-wrap { width: 100%; } .clip-ctl { width: 100%; } .clip-ctl .btn, .clip-ctl .ghost { padding: 0 14px; } #tm { display: none; } .share-page .m-right .panel { width: 100%; } }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255, 255, 255, 0.16); }
.dots i.on { background: var(--p4); }

@media (max-width: 759px) { .m-top .mt { max-width: 46vw; font-size: 14px; } }

/* ---------- round 3c: weekly tournament and season ---------- */
.ladder-tabs { align-self: flex-start; max-width: 100%; }
.ladder-tabs a { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 20px; border-radius: 999px; color: var(--soft); font-weight: 900; font-size: 13.5px; white-space: nowrap; transition: background 0.15s, color 0.15s; }
.ladder-tabs a:hover { color: var(--white); }
.ladder-tabs a[aria-pressed='true'] { background: var(--pill-face); color: #252525; box-shadow: 0 2px 0 #858585; }
.mepanel { border-color: rgba(70, 214, 255, 0.45); }
.prize-table td { padding-top: 12px; padding-bottom: 12px; }
.weekpanel { display: block; color: inherit; padding: 16px 18px; transition: border-color 0.15s, transform 0.2s var(--ease-back); }
.weekpanel:hover { border-color: var(--hairline-selected); } .weekpanel:active { transform: translateY(2px); }
.weekpanel .pan-head { margin-bottom: 8px; }
.tick { display: inline-block; width: 7px; height: 12px; border: solid var(--good); border-width: 0 2.5px 2.5px 0; transform: rotate(40deg); margin-inline-end: 10px; position: relative; top: -2px; }
@media (max-width: 759px) {
  .ladder-tabs { display: flex; overflow-x: auto; width: 100%; scrollbar-width: none; } .ladder-tabs a { flex: none; min-height: 40px; height: 40px; }
  .lb-table thead, .prize-table thead { display: none; }
  .lb-table, .lb-table tbody, .lb-table tr, .lb-table td { display: block; }
  .lb-table tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.1); }
  .lb .lb-table td, .lb-table td { border: 0; padding: 0 !important; } .lb-table td.rk { width: 30px; flex: none; }
  .lb-table td:nth-child(2) { flex: 1 1 0; min-width: 0; font-weight: 900; } .lb-table td:nth-child(3) { flex: none; text-align: end; font-size: 18px; }
  .lb-table tr::after { content: ''; order: 1; flex-basis: 100%; height: 0; }
  .lb-table td:nth-child(n+4) { flex: none; order: 2; font-size: 12.5px; text-align: start; }
  .lb-table td:nth-child(4) { margin-inline-start: 40px; }
  .lb-table td:nth-child(2) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .lb-table td[data-l]::after { content: ' ' attr(data-l); }
  .lb-table td[data-l] { margin-inline-end: 4px; }
  .lb-table tr.mine td:first-child, .lb-table tr.mine td:last-child { border-radius: 0; }
  .lb-table tr.mine { background: rgba(70, 214, 255, 0.09); border-radius: 14px; }
  .lb-table tr.mine td { background: none !important; }
  .ev-head .head-row { flex-direction: column; } .ev-head .head-row > div:last-child { text-align: start !important; }
  .stat-line { gap: 18px 24px; } .collect { width: 100%; }
}
.prize-table td.r { white-space: nowrap; }

/* ---------- round 3d: rivalries ---------- */
.vsline { text-align: center; font-weight: 900; font-size: 20px; margin-top: -4px; }
.form { display: inline-flex; gap: 4px; align-items: center; }
.fd { width: 10px; height: 10px; border-radius: 50%; background: var(--soft); display: inline-block; }
.fd.win { background: var(--me); } .fd.loss { background: var(--op); } .fd.draw { background: var(--soft); }
.fd.big { width: 16px; height: 16px; margin: 0 2px; }
.rvn { display: flex; align-items: center; gap: 10px; min-width: 0; } .rvn .pip-ball { width: 22px; height: 22px; } .rvn .nm { font-weight: 900; overflow: hidden; text-overflow: ellipsis; }
.rvrow { cursor: pointer; } .rvrow:hover td { background: rgba(255, 255, 255, 0.05); } .rvrow:focus-visible { outline-offset: -2px; }
.h2h { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 6px 0 4px; }
.h2h .side { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 15px; } .h2h .side.op { justify-content: flex-end; text-align: end; }
.h2h .side b { overflow: hidden; text-overflow: ellipsis; } .h2h .big { font-size: 48px; font-weight: 900; line-height: 1; } .h2h .dash { color: var(--faint); margin: 0 6px; }
.stat-line { display: flex; flex-wrap: wrap; gap: 20px 28px; }
@media (max-width: 759px) {
  .stat-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px 12px; } .stat-line .k { font-size: 26px; }
  .rv-table thead { display: none; } .rv-table, .rv-table tbody, .rv-table tr, .rv-table td { display: block; }
  .rv-table tr { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 4px; border-top: 1px solid rgba(255,255,255,.1); align-items: center; min-height: 56px; }
  .rv-table td { border: 0; padding: 0 !important; text-align: start !important; } .rv-table td:nth-child(1) { grid-column: 1; } .rv-table td:nth-child(3) { grid-column: 2; grid-row: 1; text-align: end !important; font-size: 18px; }
  .rv-table td:nth-child(2) { grid-column: 1; font-size: 12.5px; } .rv-table td:nth-child(2)::before { content: 'Rating '; } .rv-table td:nth-child(4) { grid-column: 1; } .rv-table td:nth-child(5) { grid-column: 2; grid-row: 2; text-align: end !important; font-size: 12.5px; }
  .h2h .big { font-size: 38px; }
}

/* ---------- round 3e: comeback ---------- */
[style*="--ret:1"] { animation: retsweep 7s linear infinite; }
@keyframes retsweep { from { background-position: -60% 100%, 0 100%, 0 0; } to { background-position: 160% 100%, 0 100%, 0 0; } }
.tag.ret { color: #fff; border: 1px solid transparent; background: linear-gradient(#0d0d10, #0d0d10) padding-box, linear-gradient(90deg, var(--me), var(--op)) border-box; }
.cbmodal { width: min(460px, 100%); text-align: center; animation: cbin 0.7s var(--ease-back); }
@keyframes cbin { from { opacity: 0; transform: translateY(22px) scale(0.97); } }
.cbmodal h2 { font-size: 34px; }
.cbmodal .modal-actions { justify-content: center !important; }
.cbmodal .modal-actions .hero { min-width: 220px; }
.gifts { list-style: none; margin: 0 0 18px; padding: 0; display: flex; justify-content: center; gap: 28px; }
.gifts li { display: flex; flex-direction: column; align-items: center; } .gifts .gk { font-size: 42px; font-weight: 900; line-height: 1.05; }
.gifts li span:last-child { color: var(--soft); font-weight: 700; font-size: 14px; }
.evt-edge { position: relative; width: min(300px, 100%); margin: 0 auto; padding: 3px; border-radius: 24px; background: linear-gradient(135deg, var(--me), var(--op)); box-shadow: 0 0 34px rgba(120, 150, 255, 0.35); }
.evt-inner { background: #060607; border-radius: 21px; padding: 14px; }
.evt-inner .pv { aspect-ratio: 1.45; border: 0; background: transparent; }
.evt-edge.wide { width: min(360px, 100%); }
.evt-edge.wide .evt-inner { padding: 34px 20px; }
.evt-strip { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; border: 1px solid rgba(255, 255, 255, 0.14); text-align: start; }
.evt-strip .nm { flex: 1; min-width: 0; font-weight: 900; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evt-strip .lbl { color: var(--soft); font-weight: 700; font-size: 12.5px; }
.cb .earned { text-align: start; }
.cbbanner { display: flex; align-items: center; gap: 14px; border-color: rgba(70, 214, 255, 0.5); }
.cbbanner .grow b { display: block; }
@media (max-width: 759px) {
  .cbmodal { max-height: calc(100vh - 24px); overflow-y: auto; } .cbmodal h2 { font-size: 28px; }
  .cbmodal .modal-actions { flex-direction: column-reverse !important; align-items: stretch !important; } .cbmodal .modal-actions .hero { width: 100%; }
  .gifts .gk { font-size: 34px; } .evt-edge { width: min(250px, 100%); }
  .cbbanner { flex-wrap: wrap; } .cbbanner .btn { width: 100%; }
}

/* ---------- audit fixes (15 Nov) ---------- */
/* even rows in the game lists: the action buttons never wrap, every row is one line high */
.pf-table td { vertical-align: middle; }
.pf-table td:last-child { white-space: nowrap; }
.pf-table td:last-child .ghost { margin-inline-start: 4px; }
.pf-table tbody tr { height: 62px; }
.lrow.game { min-height: 52px; }
/* facts that wrap: values may break inside the narrow left column, labels never do */
.facts dt { white-space: nowrap; } .facts dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 1279px) and (min-width: 1100px) { .facts dl { font-size: 12.5px; gap: 6px 8px; } .facts dd { text-align: end; line-height: 1.25; } }
/* four stat tiles wrap 2 + 2, five wrap 3 + 2 */
@media (max-width: 759px) {
  .stat-line:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .m-top .mt { max-width: none; flex: 1 1 0; min-width: 0; white-space: normal; overflow: visible; text-overflow: clip; font-size: 14px; line-height: 1.15; }
  .m-top { height: auto; min-height: 40px; }
  .m-top .space { flex: 0 0 0; } /* the title takes the free room, so short titles stay on one line */
  .result .btns .link { align-self: center; justify-content: center; text-align: center; width: 100%; display: inline-flex; min-height: 40px; align-items: center; }
}
/* small phones: logo + three buttons fill the bar, so the game title would run into the sound button.
   The title keeps its words ("Knockout, round 2", "Daily bracket, round 1") on a line of its own under the
   bar, full width, never beside the buttons */
@media (max-width: 479px) {
  .m-top { gap: 10px; flex-wrap: wrap; row-gap: 2px; }
  .m-top .space { flex: 1; }
  .m-top .mt { order: 10; flex: 0 0 100%; max-width: 100%; font-size: 13.5px; line-height: 1.2; color: var(--soft);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- parity phase 1: the guide and tips (coach.js), top-bar icons, the goal label ---------- */
.coach-slot { flex: none; }
.coach-slot[hidden] { display: none; }
.coach { padding: 16px 18px 18px; border-color: var(--hairline-selected); animation: rise 0.4s var(--ease-back); }
.coach .coach-top { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.coach .coach-top .space { flex: 1; }
.coach .coach-k { color: var(--soft); font-weight: 700; font-size: 13px; }
.coach h3 { font-size: 18px; font-weight: 900; margin: 0 0 4px; }
.coach p { color: var(--soft); font-weight: 700; font-size: 14px; line-height: 1.4; margin: 0; }
.coach.tip { border-color: rgba(255, 194, 51, 0.55); }
.coach.tip .coach-k { color: var(--p4); }
.m-top .icon-btn { width: 40px; padding: 0; display: inline-grid; place-items: center; }
.m-top .icon-btn[aria-pressed="false"] { color: var(--soft); }
.goal-tag { position: absolute; left: 17%; top: 7.3%; transform: translate(-50%, -50%); background: var(--pill-face); color: #151515; font-weight: 900; font-size: 13px; padding: 5px 12px; border-radius: 999px; box-shadow: 0 3px 0 #858585; pointer-events: none; animation: rise 0.4s var(--ease-back); z-index: 3; }
@media (max-width: 1099px) { .coach-slot { order: 2; } }
@media (max-width: 759px) { .goal-tag { font-size: 12px; padding: 4px 10px; } .m-top .icon-btn { width: 40px; } }
/* settings (settings.js) and sign-up prompts (signup.js) */
.settings { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 6px; }
.set-row { display: flex; align-items: center; gap: 18px; padding: 14px 0; border-bottom: 1px solid var(--hairline); }
.set-row:last-child { border-bottom: 0; }
.set-row .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-row b { font-weight: 900; font-size: 15.5px; }
.set-row .soft { font-size: 13px; line-height: 1.35; }
/* the language picker: as wide as its longest name needs, the full row on a phone */
.set-row select.lang-pick { width: auto; min-width: 200px; flex: none; }
@media (max-width: 759px) { .set-row select.lang-pick { width: 100%; } }
.signup { display: flex; align-items: center; gap: 16px; border-color: rgba(70, 214, 255, 0.45); }
.signup .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: start; }
.signup b { font-weight: 900; font-size: 15.5px; }
.signup .soft { font-size: 13px; line-height: 1.35; }
.signup.compact { padding: 14px 16px; }
@media (max-width: 759px) { .set-row { flex-direction: column; align-items: flex-start; gap: 10px; } .signup { flex-direction: column; align-items: stretch; } }
.newcomer { display: flex; align-items: center; gap: 16px; }
.newcomer .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.newcomer b { font-weight: 900; font-size: 15.5px; }
.newcomer .soft { font-size: 13px; line-height: 1.35; }
@media (max-width: 759px) { .newcomer { flex-direction: column; align-items: stretch; } }
/* phone wall buttons (match.js renderWallbar): narrow screens only */
.wallbar { display: none; }
@media (max-width: 759px) {
  .wallbar { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; width: 100%; min-height: 48px; }
  .wallbar:empty { display: none; }
  .wallseg button { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px; font-size: 14px; }
  .wallbar .btn.small, .wallbar .ghost.small { min-height: 44px; }
  .wb-glyph { display: inline-block; border-radius: 3px; background: currentColor; flex: none; }
  .wb-glyph.h { width: 22px; height: 6px; } .wb-glyph.v { width: 6px; height: 20px; }
  .wb-glyph.me { color: var(--me); } .wb-glyph.op { color: var(--op); } .wb-glyph.p3 { color: var(--p3); } .wb-glyph.p4 { color: var(--p4); }
  .wb-left { font-size: 13px; }
}
@media (max-width: 759px) {
  .wallbar.picking .wallseg { flex: 1 1 100%; display: flex; }
  .wallbar.picking .wallseg button { flex: 1; justify-content: center; }
  .wallbar.picking .btn.small, .wallbar.picking .ghost.small { flex: 1; }
}
/* ad slots (ads.js): only drawn when /config.ads.enabled; the banner floats, the page gets matching room */
body.has-ad-banner { --ad-h: 101px; padding-bottom: var(--ad-h); }
body.has-ad-banner .app.in-match .match { height: calc(100vh - var(--ad-h)); }
.ad-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: var(--ad-h, 101px); box-sizing: border-box; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 5px 12px; background: rgba(5, 5, 6, 0.94); border-top: 1px solid var(--hairline); }
.ad-remove { color: var(--soft); font-weight: 900; font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.ad-remove:hover { color: var(--white); }
.ad-fill { flex: none; overflow: hidden; border-radius: 6px; }
.ad-test { width: 100%; height: 100%; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 1px dashed var(--hairline-selected); border-radius: 6px; color: var(--soft); font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, 0.03); }
.ad-test b { color: var(--white); font-weight: 900; font-size: 13.5px; }
.ad-card { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 16px 16px; align-self: center; }
.ad-card[hidden] { display: none; }
.ad-search { margin: 16px auto 0; }     /* the search screen's card, under the search box once the search has run a moment */
.ad-card .ad-k { color: var(--faint, #787b84); font-weight: 700; font-size: 11.5px; }
@media (max-width: 759px) {
  body.has-ad-banner { --ad-h: 74px; }
  .ad-banner { flex-direction: column; gap: 2px; padding: 3px 8px; }
  body.has-ad-banner .dock { bottom: calc(14px + var(--ad-h)); }
  .ad-remove { font-size: 11px; }
}
/* end screen (match.js resultInner): the ad card sits beside the result when ads are on; the free-account prompt for guests */
.result-row { display: flex; align-items: center; justify-content: center; gap: 20px; max-width: 100%; }
.result-row > .result { flex: 0 1 auto; }
/* the result's small links (the analysis board, the board itself), side by side when they fit; a line under Review */
.result .res-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; margin-top: 2px; }
.result .res-note { margin: -6px 0 0; font-size: 13px; line-height: 1.4; text-align: center; }
.res-signup { display: flex; flex-direction: column; align-items: stretch; gap: 6px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--hairline); }
.res-signup b { font-weight: 900; font-size: 16px; }
.res-signup .soft { font-size: 13px; line-height: 1.4; margin-bottom: 6px; }
body.has-ad-banner .result-back { bottom: var(--ad-h); }
@media (max-width: 899px) { .result-row { flex-direction: column-reverse; align-items: center; } .result-row .ad-card { margin-top: 4px; } }
body.has-ad-banner .result { max-height: calc(100vh - 32px - var(--ad-h)); }
.btn.danger { background: var(--bad); color: #fff; box-shadow: 0 4px 0 #8f2b2b; }
.ghost.danger { color: rgb(255, 140, 140); }
/* safety (safety.js): report or block from a name, the block list, the suspended screen */
.strip-more { display: inline-grid; place-items: center; width: 30px; height: 26px; margin-inline-start: 2px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--soft); cursor: pointer; transition: background 0.15s, color 0.15s; }
.strip-more:hover, .strip-more:focus-visible { background: rgba(255, 255, 255, 0.08); color: var(--white); }
.res-report { display: block; margin: 12px auto 0; font-size: 12.5px; color: var(--faint); }
.report-reasons { flex-wrap: wrap; gap: 8px; }
.block-list { margin-top: 10px; display: flex; flex-direction: column; }
.block-list .lrow { min-height: 48px; }
.block-list .nm small { display: block; color: var(--soft); font-weight: 700; font-size: 12px; }
.banned-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(5, 5, 6, 0.94); }
.banned-box { width: min(460px, 100%); text-align: center; padding: 30px 28px; animation: rise 0.4s var(--ease-back); }
.banned-box h1 { font-size: 28px; margin-bottom: 10px; }
@media (max-width: 759px) { .strip-more { width: 40px; height: 40px; } }
/* live username check (account.js) */
.claim-hint { min-height: 18px; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--soft); }
.claim-hint.ok { color: var(--good); } .claim-hint.bad { color: var(--bad); }
.claim-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.claim-sug:empty { display: none; }
.update-bar { display: flex; align-items: center; gap: 12px; background: #fff; color: #151515; }
.update-bar .link { color: #444; }
/* public profile (user.js) */
.ulink { color: inherit; text-decoration: none; font-weight: 900; }
.ulink:hover { text-decoration: underline; text-underline-offset: 3px; }
.tag.prem { color: var(--p4); border-color: rgba(255, 194, 51, 0.5); background: rgba(255, 194, 51, 0.1); vertical-align: middle; font-size: 12px; }
.chart-head { display: flex; justify-content: flex-end; margin: 18px 0 8px; }
.rchart { position: relative; height: 190px; }
.rchart canvas { width: 100%; height: 100%; display: block; }
.rchart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.c-good { color: var(--good); } .c-bad { color: var(--bad); }
.ugames td { vertical-align: middle; }
.country-pick { max-width: 240px; }
@media (max-width: 759px) { .ugames th:nth-child(3), .ugames td:nth-child(3), .ugames th:nth-child(5), .ugames td:nth-child(5) { display: none; } .country-pick { max-width: none; width: 100%; } }
.rchart.empty { height: 64px; }
/* a new tier on the result (match.js tierLine) */
.tierup { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 12px; padding: 14px 16px 16px; border-radius: 18px; border: 1px solid var(--hairline-selected); background: rgba(255, 255, 255, 0.04); animation: tierin 0.7s var(--ease-back) 0.25s both; }
.tierup::after { content: ''; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%); transform: translateX(-120%); animation: tiershine 1.6s ease-out 0.9s; pointer-events: none; }
.tierup .tu-k { color: var(--soft); font-weight: 700; font-size: 12.5px; }
.tierup .tu-name { font-size: 30px; font-weight: 900; line-height: 1.1; }
.divup { margin-top: 10px; font-weight: 900; color: var(--good); }
@keyframes tierin { from { opacity: 0; transform: translateY(14px) scale(0.92); } }
@keyframes tiershine { to { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) { .tierup, .tierup::after { animation: none; } }
/* real-money store (store.js): honest "Coming soon", sale prices struck through */
.store-group { display: flex; flex-direction: column; margin-top: 10px; }
.store-group .label { margin: 6px 0 2px; }
.store-row { min-height: 60px; gap: 14px; }
.store-row .price { margin-inline-start: auto; white-space: nowrap; }
.price .now { font-weight: 900; }
.price .was { color: var(--faint); font-weight: 700; margin-inline-end: 4px; }
.not-final { font-size: 12.5px; margin-top: 10px; }
.sale-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 14px; border: 1px solid rgba(255, 194, 51, 0.5); background: rgba(255, 194, 51, 0.08); color: var(--p4); font-weight: 700; font-size: 13.5px; }
.sale-bar b { font-weight: 900; }
.starter { display: flex; align-items: center; gap: 16px; }
.starter .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.starter b { font-weight: 900; font-size: 15.5px; }
.starter .soft { font-size: 13px; }
@media (max-width: 759px) { .starter { flex-wrap: wrap; } .store-row { flex-wrap: wrap; } }
/* the premium badge (ui.js premiumBadge) */
.pbadge { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-inline-start: 5px; color: var(--p4); vertical-align: -2px; flex: none; }
.strip .nm .pbadge { margin-inline-start: 0; }
/* where a flag goes (countries.js countryMark): a two-letter chip for now */
.cflag { display: inline-grid; place-items: center; min-width: 22px; height: 15px; padding: 0 3px; margin-inline-start: 6px; border-radius: 4px; border: 1px solid var(--hairline-selected); background: rgba(255, 255, 255, 0.06); color: var(--soft); font-size: 9.5px; font-weight: 900; letter-spacing: 0.04em; line-height: 1; vertical-align: 2px; flex: none; }
.strip .nm .cflag { margin-inline-start: 0; }
/* WallOut TV (tv.js) */
.tag.live { color: var(--op); border-color: rgba(255, 92, 138, 0.55); background: rgba(255, 92, 138, 0.1); }
.tag.live::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--op); margin-inline-end: 6px; display: inline-block; animation: livepulse 1.6s ease-in-out infinite; }
@keyframes livepulse { 50% { opacity: 0.35; } }
.tv-facts p { line-height: 1.45; }
/* friends (friends.js) */
.fcode { display: flex; align-items: center; gap: 12px; }
.fcode .code-txt { font-size: 22px; letter-spacing: 0.12em; }
.lrow.friend { gap: 12px; }
.fstat { color: var(--faint); font-weight: 700; font-size: 12.5px; white-space: nowrap; }
.fstat.on { color: var(--good); } .fstat.busy { color: var(--p4); }
.fstat.on::before, .fstat.busy::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: currentColor; margin-inline-end: 6px; vertical-align: 1px; }
@media (max-width: 759px) { .lrow.friend { flex-wrap: wrap; } .fcode { width: 100%; } }
/* streak (streak.js) */
.streak-head.risk { border-color: rgba(255, 194, 51, 0.55); }
.cal { display: flex; gap: 4px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.cw { display: flex; flex-direction: column; gap: 4px; }
.cd { display: inline-block; width: 16px; height: 16px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.06); }
.cd.on { background: var(--me); border-color: transparent; box-shadow: 0 0 8px rgba(70, 214, 255, 0.35); }
.cd.fut { opacity: 0.25; }
.cd.today { outline: 1.5px solid var(--hairline-selected); outline-offset: 1px; }
.cal-key { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; }
.cal-key .cd { width: 12px; height: 12px; margin-inline-start: 8px; }
.plink { color: inherit; text-decoration: none; }
.plink:hover .l { color: var(--white); }
.streakup .link { margin-top: 6px; }
.cal { justify-content: center; gap: 6px; }
.cw { gap: 6px; }
.cal .cd { width: 26px; height: 26px; border-radius: 6px; }
.cal-key { justify-content: center; }
@media (max-width: 759px) { .cal .cd { width: 18px; height: 18px; border-radius: 4px; } .cal, .cw { gap: 4px; } }
.ach-skill { display: block; margin-top: 3px; color: var(--soft); font-weight: 700; font-size: 12px; }
/* medals (medals.js) */
.medal { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -2px; flex: none; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.35); }
.medal.gold { background: radial-gradient(circle at 35% 30%, #ffe9a3, #ffc233 55%, #c98a10); }
.medal.silver { background: radial-gradient(circle at 35% 30%, #ffffff, #c9ccd4 55%, #8a8f99); }
.medal.bronze { background: radial-gradient(circle at 35% 30%, #ffd2a6, #d9894a 55%, #8f4f1f); }
.medal.top10 { background: radial-gradient(circle at 35% 30%, #c9f3ff, #46d6ff 55%, #1b7fa3); }
.medal.champion { background: radial-gradient(circle at 35% 30%, #ffd1df, #ff5c8a 55%, #a3264b); }
.medals { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 4px; }
.mrow { display: inline-flex; align-items: center; gap: 7px; }
.mrow b { font-weight: 900; }
.mrow .soft { font-size: 13px; }
.medal-list .lrow { gap: 10px; min-height: 44px; }
.new-medals { display: flex; flex-direction: column; gap: 12px; }
.nm-row { display: flex; align-items: center; gap: 12px; text-align: start; }
.nm-row .medal { width: 28px; height: 28px; }
.nm-row b { display: block; }
.nm-row .soft { font-size: 13px; }

/* puzzle archive and votes */
.pz-arch { display: flex; flex-direction: column; }
.pz-day { display: flex; align-items: center; gap: 16px; padding: 10px 4px; border-top: 1px solid var(--hairline); }
.pz-day:first-child { border-top: 0; padding-top: 2px; }
.pz-date { width: 120px; flex: none; font-weight: 800; }
.pz-date small { display: block; font-weight: 700; font-size: 12.5px; color: var(--soft); margin-top: 2px; }
.pz-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.pz-chip { width: 48px; height: 48px; border-radius: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: rgba(255, 255, 255, 0.05); border: 1.5px solid rgba(255, 255, 255, 0.12); color: #fff; text-decoration: none; transition: background 0.15s, transform 0.15s var(--ease-out); }
.pz-chip b { font-size: 16px; line-height: 1; font-weight: 900; }
.pz-chip:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.pz-chip:focus-visible { outline: 2px solid var(--me); outline-offset: 2px; }
.pz-chip.good { border-color: var(--good); color: var(--good); background: rgba(70, 220, 130, 0.08); }
.pz-chip.bad { border-color: var(--bad); color: var(--bad); background: rgba(255, 84, 84, 0.07); }
.pz-chip.part { border-color: var(--me); color: var(--me); }
.pz-lv { display: flex; gap: 2px; }
.pz-lv s { width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pz-chip.mini { display: inline-block; width: 11px; height: 11px; border-radius: 4px; vertical-align: -1px; margin-block: 0 0; margin-inline: 8px 3px; transform: none; }
.pz-key { font-size: 12.5px; }
.pz-practice { margin-inline-start: 8px; vertical-align: 2px; }
.vote { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding-block: 0 0; padding-inline: 12px 15px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); border: 1.5px solid rgba(255, 255, 255, 0.14); color: #fff; font: inherit; font-weight: 800; cursor: pointer; transition: background 0.15s, border-color 0.15s, transform 0.15s var(--ease-back); }
.vote:hover:not(:disabled) { background: rgba(255, 255, 255, 0.1); }
.vote:active:not(:disabled) { transform: scale(0.95); }
.vote:disabled { opacity: 0.6; cursor: default; }
.vote .ic { width: 19px; height: 19px; }
.vote.on { border-color: var(--me); color: var(--me); background: rgba(70, 214, 255, 0.1); }
.vote.on.down { border-color: var(--op); color: var(--op); background: rgba(255, 92, 138, 0.1); }
@media (max-width: 560px) {
  .pz-day { flex-direction: column; align-items: flex-start; gap: 8px; }
  .pz-date { width: auto; display: flex; gap: 10px; align-items: baseline; }
  .pz-date small { margin-top: 0; }
}

/* puzzle rush */
.rush-hero { display: grid; grid-template-columns: auto 1fr; gap: 18px 36px; align-items: center; }
.rush-hero > .row { grid-column: 1 / -1; }
.rush-stats { display: flex; gap: 32px; align-items: flex-end; }
.rush-big { font-size: 64px; line-height: 1; }
.rush-rules { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; font-size: 14.5px; }
.rush-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.rush-board .lrow b, .rush-recent .lrow .rush-strikes { margin-inline-start: auto; }
.rush-board .lrow.mine .ulink { color: var(--me); }
.rush-strikes { display: inline-flex; gap: 5px; }
.rush-strikes i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, 0.25); }
.rush-strikes i.on { background: var(--bad); border-color: var(--bad); }
.rush-strikes.big { gap: 7px; }
.rush-strikes.big i { width: 15px; height: 15px; transition: background 0.2s, transform 0.25s var(--ease-back); }
.rush-strikes.big i.on { transform: scale(1.08); box-shadow: 0 0 10px rgba(255, 84, 84, 0.45); }
.rush-side { text-align: start; }
.rs-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.rs-left { margin-top: 2px; }
.rush-clock { font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -1px; transition: color 0.2s; }
.rush-clock.low { color: var(--bad); animation: rushpulse 1s ease-in-out infinite; }
@keyframes rushpulse { 50% { opacity: 0.55; } }
.rush-score { font-size: 28px; display: inline-block; transition: transform 0.25s var(--ease-back), color 0.25s; }
.rush-score.pop { transform: scale(1.3); color: var(--good); }
.rush-final { font-size: 72px; line-height: 1; margin-top: 8px; }
.rush-miss-board { max-width: 220px; margin-top: 10px; }
.rush-miss-board canvas { width: 100%; aspect-ratio: 1; display: block; }
@media (max-width: 1099px) {
  .rush-match .m-left { order: 1; }
  .rush-side { display: flex; flex-direction: row; align-items: center; gap: 20px; padding: 12px 18px; }
  .rush-side hr, .rs-left, .rs-best { display: none; }
  .rush-side .rush-clock { font-size: 34px; }
  .rs-clock { margin-inline-end: auto; }
  .rs-row { margin-top: 0; gap: 10px; }
}
@media (max-width: 860px) {
  .rush-cols { grid-template-columns: 1fr; }
  .rush-hero { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .rush-clock.low { animation: none; } }

/* knockouts */
.ko-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.ko-form { display: grid; grid-template-columns: auto 1fr; gap: 12px 16px; align-items: center; }
.ko-form .field { max-width: 160px; }
.ko-mine { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; border-color: rgba(70, 214, 255, 0.45); }
.ko-mine .grow { display: flex; flex-direction: column; gap: 4px; }
.ko-code { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ko-code .grow { display: flex; flex-direction: column; gap: 4px; }
.ko-codetext { font-size: 34px; letter-spacing: 6px; line-height: 1.1; }
.ko-bracket { overflow-x: auto; }
.ko-rounds { display: grid; grid-template-columns: repeat(var(--rounds), minmax(200px, 1fr)); gap: 22px; min-width: calc(var(--rounds) * 214px); }
.ko-round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }
.ko-round > .label { margin-bottom: 2px; }
.ko-match { border-radius: 16px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.04); padding: 6px; display: flex; flex-direction: column; gap: 2px; position: relative; }
.ko-match.playing { border-color: rgba(255, 92, 138, 0.55); }
.ko-match.tbd { opacity: 0.55; }
.ko-p { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 10px; font-weight: 700; min-width: 0; }
.ko-p .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ko-p.win { background: rgba(255, 255, 255, 0.07); font-weight: 900; color: #fff; }
.ko-p.lose { color: var(--soft); opacity: 0.7; }
.ko-p.me .nm, .ko-p.me .nm .ulink { color: var(--me); }
.ko-p.bye { color: var(--soft); font-style: italic; font-weight: 600; }
.ko-seed { width: 16px; font-size: 12px; color: var(--soft); text-align: end; flex: none; }
.ko-rt { font-size: 12.5px; flex: none; }
.ko-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 4px 8px 2px; font-size: 12.5px; font-weight: 700; }
.ko-foot .tag { font-size: 11.5px; padding: 2px 8px; }
.ko-champ { border-color: rgba(255, 194, 51, 0.5); }
.notice.good { color: #fff; border-color: rgba(70, 214, 255, 0.5); background: rgba(70, 214, 255, 0.08); }
@media (max-width: 860px) { .ko-cols { grid-template-columns: 1fr; } }

/* settings: promo code */
.promo-in { width: 170px; text-transform: uppercase; letter-spacing: 1.5px; }
.promo-msg { display: block; margin-top: 6px; font-size: 13.5px; }
@media (max-width: 560px) { .promo-row { flex-wrap: wrap; } .promo-row > .row { width: 100%; } .promo-in { flex: 1; width: auto; } }

/* ---------- the phone app bar: under 760px the left rail is hidden, so the brand and the account sit here.
   Wordmark on the left (the brand/final art, as a background), level, coins and settings on the right, one
   centre line. The hub's "Play" heading stays for screen readers only. ---------- */
.appbar { display: none; }
.dock-shade { display: none; }
@media (max-width: 759px) {
  .appbar { display: flex; align-items: center; gap: 8px; height: 44px; max-width: 760px; margin: 0 auto 16px; }
  .appbar .brand { padding: 0; font-size: 20px; }
  .appbar > :nth-child(2) { margin-inline-start: auto; }
  .appbar .ab-ls { display: none; }
  .appbar .tag { height: 30px; padding: 0 12px; border-radius: 15px; font-size: 13px; font-weight: 900; }
  .appbar .icon-btn { width: 40px; height: 40px; min-height: 40px; padding: 0; display: inline-grid; place-items: center; flex: none; }   /* the game bar's icon buttons on phones: 40 x 40 */
  .appbar .tag { position: relative; }
  .appbar .tag::after { content: ''; position: absolute; inset: -5px 0; }   /* a 40px tall tap area round the 30px pill */
  .appbar .icon-btn svg { width: 20px; height: 20px; }
  .appbar .ab-skel { width: 128px; height: 30px; border-radius: 15px; }
  .hub-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  /* the tab bar floats 14px off the bottom: this shade fills the strip under it and fades out above it,
     so the page never shows through under the bar */
  .dock-shade { display: block; position: fixed; z-index: 39; left: 0; right: 0; bottom: 0; height: 118px; pointer-events: none;
    background: linear-gradient(180deg, rgba(5, 5, 6, 0) 0, rgba(5, 5, 6, 0.9) 36px, #050506 60px); }
  .app.in-match .appbar, .app.in-match .dock-shade { display: none; }
}
@media (max-width: 399px) { .appbar .brand { font-size: 18px; } }
@media (max-width: 359px) { .appbar .brand { font-size: 16px; } .appbar .tag { padding: 0 10px; } .appbar .ab-lw { display: none; } .appbar .ab-ls { display: inline; } }
@media (max-width: 759px) { .appbar .ab-coins::before { content: ''; flex: none; width: 10px; height: 10px; margin-inline-end: 6px; border-radius: 50%; background: var(--coin); box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.28); } }
/* recent games on the hub: the mode sits under the opponent's name, so a narrow phone keeps the name readable */
.lrow.game .g-len { flex: none; font-size: 13px; text-align: end; }
/* shop rows: the pack's line ("500 coins and the Starter wall") wraps instead of being cut */
.store-row .nm { white-space: normal; }

/* ---------- spacing and alignment pass (web/tools/layout.mjs): fixes for what the audit found ---------- */
/* a long name in the profile head wraps instead of pushing the page wider than the phone */
.pf-head .grow { min-width: 0; }
.pf-head .page-title { overflow-wrap: anywhere; }
/* promo code: the field shrinks so Redeem stays inside the panel on small phones */
.promo-in { min-width: 0; }
/* puzzle rows: the level line wraps rather than being cut */
.pz-row .nm { white-space: normal; }
/* friend requests: on small phones the name takes its own line, Accept and Decline under it */
@media (max-width: 479px) { .lrow.req { flex-wrap: wrap; row-gap: 8px; padding: 10px 0; } .lrow.req .nm { flex: 1 0 100%; } }
/* your pinned leaderboard row on phones: tighter cells, and the division (shown above) gives way below 420px */
@media (max-width: 759px) { .lb .pinned .table td { padding-inline-start: 8px; padding-inline-end: 8px; } .pinned td.rk { width: 30px; } .pinned td:nth-child(2) { overflow-wrap: anywhere; } }
@media (max-width: 419px) { .pinned td.soft { display: none; } }
/* replay controls fit a 320px phone */
@media (max-width: 359px) { .rp-bar .ghost.small { padding: 0 12px; } }
/* the shop tile names fit their tile on the smallest phones */
@media (max-width: 379px) { .shop-tile .nm { font-size: 14px; } }
/* profile links: five tiles as three over two until there is room for five in a row; two columns on phones,
   the last one full width, so no tile is left alone or squeezed */
@media (max-width: 1439px) { .pf-links { grid-template-columns: repeat(6, minmax(0, 1fr)); } .pf-links > :nth-child(-n+3) { grid-column: span 2; } .pf-links > :nth-child(n+4) { grid-column: span 3; } }
@media (max-width: 759px) { .pf-links { grid-template-columns: 1fr 1fr; } .pf-links > :nth-child(n) { grid-column: auto; } .pf-links > :last-child { grid-column: 1 / -1; } }

/* game tables (your profile, a player's page): when the panel is too narrow for the columns (phones, and the
   tablet width where the left rail takes room) each game becomes a card row: the result tag on the left; the
   opponent on one line; mode, clock or rating, moves or accuracy and when on a wrapping line under it; the
   buttons under that. One left edge for everything after the tag. Sized by the panel, not the window. */
.panel:has(> .pf-table), .panel:has(> .ugames) { container-type: inline-size; }
@container (max-width: 660px) {
  .pf-table thead, .ugames thead { display: none; }
  .pf-table, .pf-table tbody, .ugames, .ugames tbody { display: block; }
  .pf-table tbody tr, .ugames tbody tr { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; height: auto; padding-block: 12px 12px; padding-inline: 64px 0; border-top: 1px solid rgba(255,255,255,.1); }
  .pf-table td, .ugames td { display: block; border: 0; padding: 0; text-align: start !important; white-space: normal; }
  .pf-table td:empty, .ugames td:empty { display: none; }
  .pf-table td:nth-child(1), .ugames td:nth-child(1) { position: absolute; inset-inline-start: 0; top: 12px; }
  .pf-table td:nth-child(2), .ugames td:nth-child(2) { flex: 1 0 100%; font-weight: 900; min-width: 0; overflow-wrap: anywhere; }
  .pf-table td:nth-child(n+3):nth-child(-n+6), .ugames td:nth-child(n+3):nth-child(-n+6) { display: block; flex: none; font-size: 13px; color: var(--soft); }
  .ugames td:nth-child(4).c-good { color: var(--good); } .ugames td:nth-child(4).c-bad { color: var(--bad); }
  .pf-table td:nth-child(7) { flex: 1 0 100%; display: flex; flex-wrap: wrap; gap: 8px; padding-top: 6px; }
  .ugames td:nth-child(7) { flex: none; margin-inline-start: auto; font-size: 13px; }
}
@container (max-width: 660px) { .pf-table td:nth-child(7) .ghost { margin-inline-start: 0; } }
/* a button and the error line under it are one block: the empty line takes no room (and adds no gap of its
   own in the page column); an error, when it comes, opens under the button */
.act-group { display: flex; flex-direction: column; min-width: 0; }
.act-group > .err-text:empty { min-height: 0; margin-top: 0; }
/* a panel head wraps its control (a seg, a link) under the title when both do not fit, never out of the panel */
.pan-head { flex-wrap: wrap; row-gap: 10px; }
.rush-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 860px) { .rush-cols { grid-template-columns: minmax(0, 1fr); } }
/* under 1100px the right rail's panels stack under the page: they continue its column, so the seam between the
   two is the page's own 22px gap (the rail keeps the room for the tab bar at the bottom), the rail's panels are
   22px apart like the page's, and their insides start where the page panels' do */
@media (max-width: 1099px) {
  .app:not(.wide):not(.in-match) .center { padding-bottom: 22px; }
  .rail-right { gap: 22px; }
  .rail-right .panel { padding: 24px; }
}
/* one inner edge per column: the page's panels all start their text 24px in (the profile head and the puzzle
   hero had 28 and 18); the game screens' side panels all start 18px in (facts, chat, moves, replay bar) */
.pz-hero, .pf-head { padding-inline-start: 24px; padding-inline-end: 24px; }
.m-left > .panel, .m-right > .panel { padding-inline-start: 18px; padding-inline-end: 18px; }

/* Send feedback (feedback.js): the note, its count, and the optional 1-5 */
/* a text box with the field look grows with its rows (.field is a 48px one-line input) */
textarea.field { height: auto; line-height: 1.4; padding-top: 12px; padding-bottom: 12px; }
.fb-text { min-height: 120px; resize: vertical; }
.fb-count { text-align: end; font-size: 12.5px; margin-top: 6px; }
.fb-rate { display: flex; width: 100%; margin-top: 8px; }
.fb-rate button { flex: 1 1 0; padding: 0; }
/* Install the app (install.js): a slim row on the hub, a set-row in Settings; the iPhone how-to opens under the line */
.install-row { display: flex; align-items: center; gap: 16px; padding: 18px 24px; }
.install-row .grow, .install-set .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.install-row b { font-weight: 900; font-size: 15.5px; }
.install-row .soft { font-size: 13px; line-height: 1.35; }
.install-how { margin-top: 6px; }
.install-how b { color: var(--white); }
@media (max-width: 759px) { .install-row { flex-direction: column; align-items: flex-start; gap: 12px; } }     /* as the Settings rows: the button under the line, its own width */

/* ---------- rank badges (ranks.js; web/img/ranks) ---------- */
.rank-badge { display: inline-block; flex: none; vertical-align: middle; object-fit: contain; }
.rank-pips { display: inline-flex; align-items: center; gap: 3px; margin-inline-start: 7px; vertical-align: middle; }
.rank-pips i { display: block; width: 9px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
.rank-pips i.on { background: var(--white); }
.rank-pips.big { gap: 5px; margin-inline-start: 10px; }
.rank-pips.big i { width: 16px; height: 5px; border-radius: 3px; }
.rank-words { white-space: nowrap; }
/* a name with its badge in a row */
.with-badge { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; vertical-align: middle; }
.with-badge > :last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* a profile's big badge beside the rating */
.rank-hero { display: flex; align-items: center; gap: 18px; min-width: 0; }
.rank-hero .rank-badge { filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55)); }
/* the tier-up moment: the new badge arrives with a pop and settles; on a division-up the new pip fills in */
.rank-up { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; }
.rank-up .rank-badge { margin-bottom: 8px; }
.rank-pop { animation: rankPop 0.95s var(--ease-back) 0.15s both; }
@keyframes rankPop { 0% { transform: scale(0.35) rotate(-8deg); opacity: 0; filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0)); } 55% { transform: scale(1.1) rotate(2deg); opacity: 1; filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.45)); } 78% { transform: scale(0.96) rotate(0); } 100% { transform: scale(1); filter: drop-shadow(0 6px 18px rgba(0, 0, 0, 0.55)); } }
.rank-div { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-weight: 900; }
.rank-pips i.fill { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.2); }
.rank-pips i.fill::after { content: ''; position: absolute; inset: 0; background: var(--white); transform-origin: left center; animation: pipFill 0.6s var(--ease-out) 0.5s both; }
@keyframes pipFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .rank-pop, .rank-pips i.fill::after { animation: none; } }
.rank-line { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.meta .rank-badge.in-meta { margin-inline-end: 6px; vertical-align: -4px; }
.tierup.rank-up { padding-top: 24px; }
td .rank-badge.in-cell { margin-inline-end: 6px; vertical-align: -5px; }
/* the ranked screen's stats on small phones: your rating with its badge takes the first row, the rest share the next */
@media (max-width: 479px) { .stat-line > .rank-hero { grid-column: 1 / -1; } }
/* the hub's card titles are h2 (heading order h1 -> h2), sized as before */
.card h2.card-t { font-size: 18px; margin-top: 6px; }
/* under 1100px the right rail stacks under the page: it stays out until the page is drawn, so it appears below the
   page's content instead of painting first at the top and being pushed down when the page arrives (layout shift) */
/* under 1100px the right rail sits under the page: it appears once the page has settled (router.js adds .rail-on), so
   a page that is still filling in can never push a visible rail (layout shift) */
@media (max-width: 1099px) { .app:not(.rail-on) .rail-right { display: none; } }
/* the tab bar has its final height before the shell fills it (it is anchored to the bottom, so an empty bar that
   grows would move up: a layout shift) */
@media (max-width: 759px) { .app:not(.in-match) .dock { min-height: 72px; } }
/* the keyboard shortcuts (keys.js) */
.modal.keys-modal { width: min(560px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; }
.keys-group + .keys-group { margin-top: 18px; }
.keys-group h3 { margin-bottom: 8px; }
.keys { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.keys-row { display: grid; grid-template-columns: 172px 1fr; gap: 14px; align-items: center; }
.keys-row dt { display: flex; flex-wrap: wrap; gap: 6px; }
.keys-row dd { margin: 0; color: var(--soft); font-weight: 700; font-size: 14px; }
kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--hairline); border-bottom-width: 2px; font: 900 13px var(--font); color: var(--white); }
@media (max-width: 479px) { .keys-row { grid-template-columns: 112px 1fr; gap: 10px; } .keys-row dd { font-size: 13px; } kbd { min-width: 26px; height: 26px; padding: 0 6px; font-size: 12px; } }
/* use on another device (link.js) */
.modal.link-modal { width: min(480px, 100%); }
.link-show { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 6px 0 2px; }
.link-code { display: flex; gap: 18px; font: 900 44px/1 var(--font); letter-spacing: 0.14em; color: var(--white); padding: 18px 22px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hairline); user-select: all; }
.link-code span + span { position: relative; }
.link-code.is-out { color: var(--soft); opacity: 0.55; text-decoration: line-through; text-decoration-thickness: 3px; }
.link-left { font-size: 15px; color: var(--soft); margin: 0; }
.link-acts { justify-content: center; gap: 8px; }
.link-how { margin: 6px 0 0; font-weight: 800; font-size: 15px; line-height: 1.45; color: var(--white); max-width: 380px; }
.link-small { font-size: 13px; margin: 0; max-width: 380px; }
.link-lbl { display: block; margin: 16px 0 6px; }
.link-in { width: 100%; font: 900 26px/1 var(--font); letter-spacing: 0.18em; text-align: center; text-transform: uppercase; padding: 14px 12px; }
.link-in::placeholder { letter-spacing: 0.18em; opacity: 0.35; }
.link-count { margin: 6px 0 0; font-size: 13px; text-align: end; }
.link-warn { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 196, 64, 0.1); border: 1px solid rgba(255, 196, 64, 0.35); color: #ffd877; font-size: 14px; line-height: 1.4; }
.link-err { margin: 10px 0 0; color: var(--bad, #ff6b6b); font-size: 14px; line-height: 1.4; min-height: 0; }
.link-err:empty { display: none; }
@media (max-width: 479px) { .link-code { font-size: 34px; gap: 12px; padding: 14px 16px 12px; } .link-in { font-size: 22px; } }
/* the review's accuracy, chess-site style (review.js) */
.rv-accs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.rv-acc-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px 14px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.04); border: 1px solid var(--hairline); min-width: 0; }
.rv-acc-card.me { box-shadow: inset 0 3px 0 rgba(70, 214, 255, 0.9); }
.rv-acc-card.op { box-shadow: inset 0 3px 0 rgba(255, 92, 138, 0.9); align-items: flex-end; text-align: end; }
.rv-who { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.rv-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rv-acc-card .rv-acc { font: 900 42px/1 var(--font); letter-spacing: -0.02em; margin: 2px 0 0; color: var(--white); }
.rv-acc-card .rv-acc small { font-size: 20px; margin-inline-start: 2px; color: var(--soft); font-weight: 900; }
.rv-acc-card .label { margin: 0; }
@media (max-width: 479px) { .rv-acc-card .rv-acc { font-size: 34px; } .rv-acc-card .rv-acc small { font-size: 17px; } }
/* watching by link (tv.js #/watch, match.js, friend.js) */
.watch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.watch-row > span { font-size: 13px; }
.fr-watch { margin-top: 16px; }
.lrow.friend [data-watch] { margin-inline-start: 4px; }
/* recovery codes (recovery.js) */
.modal.rec-modal { width: min(480px, 100%); }
.rec-show { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.rec-code { font: 900 26px/1 ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; letter-spacing: 0.08em; text-align: center; color: var(--white); padding: 20px 12px; border-radius: 16px; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--hairline); user-select: all; overflow-wrap: anywhere; }
.rec-warn { margin: 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 196, 64, 0.1); border: 1px solid rgba(255, 196, 64, 0.35); color: #ffd877; font-size: 14px; line-height: 1.4; }
.rec-saved { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 15px; color: var(--white); cursor: pointer; }
.rec-saved input { width: 20px; height: 20px; accent-color: var(--good, #3ddc84); }
.rec-in { font-size: 20px; letter-spacing: 0.1em; }
@media (max-width: 479px) { .rec-code { font-size: 20px; padding: 16px 8px; } .rec-in { font-size: 17px; } }
/* download my data (export.js) */
.export-msg { display: block; margin-top: 6px; font-size: 13px; }
/* the game screens' title is the page h1 (boardview.js, match.js): it keeps the small top-bar look */
h1.mt { margin: 0; font-size: 17px; line-height: 1.2; letter-spacing: normal; }
/* a disabled button that says something ("Coming soon", "Equipped", "Locked"): still not pressable, but readable */
.btn.info:disabled { color: var(--soft); }
/* disabled buttons: still plainly off (dimmer than any live text), but legible: 5.0:1 on their face (was 3.75) */
.btn:disabled { color: rgb(142, 145, 154); }

/* Right to left (Arabic): the layout follows the page direction through logical properties (margin-inline-start…).
   Arrows that point "onwards" mirror; the board's own language stays left to right: moves (e2, d6h), the move list,
   room and recovery codes, clocks and scores read the same in every language. */
[dir="rtl"] .chev, [dir="rtl"] .seasonrow > [aria-hidden="true"] { transform: scaleX(-1); display: inline-block; }
.lst, .mv-row, .code-big, .rec-code, .link-code, .ko-codetext, .clock, .rush-clock, .rk { direction: ltr; unicode-bidi: isolate; }

/* ---------- Other languages: room for longer words. Every language runs longer than English somewhere (German and
   Russian words, Spanish and French phrases), and Thai and Arabic stand taller. Controls grow instead of spilling:
   buttons and chips take a second line when a label needs it, tags grow with their text, titles, headings and labels
   wrap, and a word longer than its box breaks (hyphenated where the language allows) only when it would otherwise
   stick out. English keeps its approved one-line look: none of this applies to it. */
:root:not(:lang(en)) .btn, :root:not(:lang(en)) .ghost, :root:not(:lang(en)) .chip { white-space: normal; text-align: center; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
:root:not(:lang(en)) .btn, :root:not(:lang(en)) .ghost { padding-block: 6px; }
:root:not(:lang(en)) .chip { height: auto; min-height: 40px; padding-block: 5px; }
:root:not(:lang(en)) .tag { height: auto; min-height: 22px; padding-block: 2px; max-width: 100%; line-height: 1.25; text-align: center; overflow-wrap: anywhere; hyphens: auto; }
:root:not(:lang(en)) .actions .ask .grow { white-space: normal; }
:root:not(:lang(en)) .strip .nm span.t { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
:root:not(:lang(en)) .m-top .mt { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.15; }
:root:not(:lang(en)) .card h2.card-t, :root:not(:lang(en)) .pz-info h2, :root:not(:lang(en)) .stat-line .l, :root:not(:lang(en)) .page-title,
:root:not(:lang(en)) .lrow .nm small, :root:not(:lang(en)) .set-row b { overflow-wrap: break-word; hyphens: auto; min-width: 0; }
/* (the profile's streak line: the count, its link beside it, the note under both; it wraps instead of colliding) */
.pf-streak { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; }
.pf-streak > .soft { flex-basis: 100%; }
:root:not(:lang(en)) .tag, :root:not(:lang(en)) .seg button, :root:not(:lang(en)) .ladder-tabs a { white-space: normal; }
:root:not(:lang(en)) .btn, :root:not(:lang(en)) .ghost, :root:not(:lang(en)) .chip, :root:not(:lang(en)) .seg button { overflow-wrap: anywhere; }
:root:not(:lang(en)) .seg button { height: auto; min-height: 34px; padding-inline: 12px; line-height: 1.15; }
:root:not(:lang(en)) .diff { grid-template-columns: repeat(auto-fit, minmax(min(100%, 104px), 1fr)); }
:root:not(:lang(en)) .progress { grid-template-columns: repeat(auto-fit, minmax(min(100%, 118px), 1fr)); }
:root:not(:lang(en)) .progress .l { overflow-wrap: anywhere; hyphens: auto; }
:root:not(:lang(en)) .ladder { grid-template-columns: repeat(auto-fill, minmax(min(100%, 84px), 1fr)); }
:root:not(:lang(en)) .lcell:nth-child(7) { grid-column: auto; }
:root:not(:lang(en)) .fcode { flex-wrap: wrap; }
/* (the game lists, stacked: in other languages the result word can outgrow the strip kept for it on the left, so it
   comes first in the row instead, and the opponent's name follows it) */
@container (max-width: 660px) {
  :root:not(:lang(en)) .pf-table tbody tr, :root:not(:lang(en)) .ugames tbody tr { padding-inline-start: 0; }
  :root:not(:lang(en)) .pf-table td:nth-child(1), :root:not(:lang(en)) .ugames td:nth-child(1) { position: static; flex: none; }
  :root:not(:lang(en)) .pf-table td:nth-child(2), :root:not(:lang(en)) .ugames td:nth-child(2) { flex: 1 1 0; min-width: 8em; }
}
/* (list rows: a name may take a second line rather than be cut) */
:root:not(:lang(en)) .lrow.game .nm { white-space: normal; overflow-wrap: anywhere; }
/* Help, the legal pages and the version (scoreboard #9): small links under the side menu, and a row of them in Settings */
.rail-left { overflow-y: auto; scrollbar-width: none; }     /* a short screen can still reach the links at its foot */
.rail-left::-webkit-scrollbar { display: none; }
.rail-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 6px 0; font-size: 12px; font-weight: 700; }
.rail-foot a { color: var(--soft); text-decoration: none; }
.rail-foot a:hover, .rail-foot a:focus-visible { color: var(--white); text-decoration: underline; }
.rail-foot .ver { color: var(--soft); flex-basis: 100%; }
.about-links { display: flex; flex-wrap: wrap; gap: 8px 22px; padding: 14px 0 4px; font-weight: 900; font-size: 14px; }
.about-links a { color: var(--soft); text-decoration: underline; text-underline-offset: 3px; min-height: 32px; display: inline-flex; align-items: center; }
.about-links a:hover { color: var(--white); }
/* Beat the Cast (contract 2ai): the six computer players, weakest first, as a ladder; the next one stands out, the
   beaten ones keep their record, the locked ones say who comes first. Names and play styles only: no faces. */
.cast-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cast-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 18px; border: 1px solid var(--hairline); background: rgba(255, 255, 255, 0.03); }
.cast-row.next { border-color: #fff; background: rgba(255, 255, 255, 0.08); }
.cast-row.locked .cast-nm b { color: var(--soft); }
.cast-row .grow { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cast-n { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: 14px; border: 1.5px solid var(--hairline); color: var(--soft); }
.cast-row.next .cast-n, .cast-row.beaten .cast-n { color: #fff; border-color: #fff; }
.cast-nm { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.cast-nm b { font-size: 17px; font-weight: 900; }
.cast-meta { font-size: 12.5px; }
.cast-row > .btn, .cast-row > .ghost { flex: none; }
.cast-lock { flex: none; font-size: 12.5px; max-width: 10em; text-align: end; }
/* phone: the number beside the name and line, the button (or who comes first) under them across the row */
@media (max-width: 559px) {
  .cast-row { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: start; column-gap: 14px; row-gap: 12px; }
  .cast-row > .btn, .cast-row > .ghost { grid-column: 1 / -1; width: 100%; }
  .cast-lock { grid-column: 2; max-width: none; text-align: start; }
}
.cast-done { color: var(--good); }
/* Invite a friend (contract 2ae): the link with Copy / Share, and who joined from it */
.invite-link { display: flex; gap: 8px; align-items: center; margin: 12px 0 4px; }
.invite-link .field { flex: 1; min-width: 0; font-size: 13.5px; }
.invite-link .btn, .invite-link .ghost { flex: none; }
.invite-list { list-style: none; margin: 10px 0 0; padding: 0; }
.invite-list .lrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@media (max-width: 419px) { .invite-link { flex-wrap: wrap; } .invite-link .field { flex-basis: 100%; } .invite-link .btn, .invite-link .ghost { flex: 1; } }
/* "WallOut is very busy" (contract 2aj): one calm line at the top while the server asks for a few seconds */
.busy-note { position: fixed; inset-block-start: max(10px, env(safe-area-inset-top)); inset-inline: 0; margin-inline: auto; width: max-content; max-width: calc(100% - 32px); z-index: 60; padding: 10px 16px; border-radius: 14px; background: rgba(20, 21, 26, 0.94); border: 1px solid var(--hairline); color: #fff; font-weight: 700; font-size: 13.5px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); }
.busy-note:has(button) { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: center; }
