/* ===== BUNDLED DISPLAY FONT (Nunito, OFL — offline, no network) =====
   ONE variable woff2 (weight 200–1000) subset to full Latin + Latin Extended
   so it covers Turkish (ş ğ İ ı ö ü ç) AND every other supported language's
   diacritics (DE ä/ö/ü/ß · FR é/è/ç/à · ES ñ/á · IT à/è · NL ë/ï). No
   unicode-range is declared on purpose: the browser uses Nunito for glyphs it
   actually contains and falls back per-glyph to Segoe UI for anything missing
   (e.g. the ← back-arrow), so the previous "declared-but-missing-glyph → tofu"
   bug cannot recur. See CLAUDE.md for the license note + latin-ext requirement. */
@font-face {
  font-family: "Nunito";
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url("assets/fonts/nunito-latin-ext.woff2") format("woff2");
}

/* ===== THEME TOKENS =====
   Dark is the DEFAULT (no attribute needed). Every variable's dark value
   equals the literal it replaced, so the dark theme is byte-for-byte
   unchanged. S101: the light theme was REMOVED — dark only. The accent
   (#2bc8dc) is intentionally NOT tokenised — same hue in both themes
   (spec) — so it stays a literal across the sheet. */
:root {
  --bg: #04182c;
  --surface: #072a44;
  --surface-sunken: #031424;
  --surface-raised: #0b3a5a;
  --surface-hover: #0a3352;
  --border: #15506f;
  --text: #eaf9fc;
  --text-2: #d6eef4;
  --text-3: #c2dfe8;
  --text-soft: #9cc3d1;
  --text-dim: #7aa2b3;
  --text-faint: #5b8193;
  --text-fainter: #4a6d7e;
  --accent: #2bc8dc;
  --accent-bright: #5ad8ea;
  --font-display: "Nunito", "Segoe UI", system-ui, sans-serif;

  /* Game board + tiles (P2). Dark defaults = the original literals. */
  --board-bg: #041e33;
  --cell-bg-1: rgba(30, 120, 180, 0.2);
  --cell-bg-2: rgba(10, 70, 120, 0.3);
  /* S85: radial tile gradient — lighter CENTER fading to a darker EDGE. */
  --cell-grad-in: rgba(140, 230, 255, 0.16);
  --cell-grad-out: rgba(4, 36, 70, 0.55);
  /* S87 P2: glass-orb overlay tokens (specular highlight / inner shadow / rim). */
  --orb-spec: rgba(255, 255, 255, 0.55);
  --orb-spec-soft: rgba(255, 255, 255, 0.12);
  --orb-shade: rgba(0, 0, 0, 0.42);
  --orb-rim: rgba(255, 255, 255, 0.22);
  --orb-drop: rgba(0, 10, 25, 0.45);
  --orb-sprite: url("assets/orb/glass-empty.png"); /* S92 sprite overlay · S101: 7×7 = hollow glass (no water) */
  --cell-text: #f2feff;
  --cell-hover-1: rgba(60, 160, 215, 0.3);
  --cell-hover-2: rgba(6, 48, 88, 0.6);
  --cell-path-bg-1: #7eeaf8;
  --cell-path-bg-2: #22b5d8;
  --cell-path-text: #04324a;
  --cell-used-bg: rgba(3, 20, 36, 0.6);
  --cell-used-text: #5d7f95;
  --cell-hint-glow: rgba(255, 213, 74, 0.9);

  /* MP opponent panel/chip + Olası bonus rows (P1 S35): tokenised so light
     theme can override the otherwise-dark literals. Dark = original literals. */
  --mp-opp-bg: linear-gradient(135deg, #2e1d2c, #1e1428);
  --mp-opp-border: rgba(244, 143, 177, 0.35);
  --mp-opp-text: #f48fb1;
  --possible-bonus-bg: linear-gradient(135deg, #3a2d12, #241a08);
  --possible-bonus-border: rgba(240, 180, 41, 0.4);
  --possible-bonus-text: #f4cc6a;

  /* Chat bubbles + input (P4): tokenised so the opponent bubble + input field
     stay readable in BOTH themes. Dark = the original literals. Previously the
     opponent bubble used color:var(--text-2), which flips DARK in light mode and
     vanished on the dark #2a2a3e bubble background. */
  --chat-mine-bg: #0d4a63;
  --chat-mine-text: #e0f9fd;
  --chat-theirs-bg: #0b3048;
  --chat-theirs-text: #d6eef4;
  --chat-input-bg: rgba(255, 255, 255, 0.05);
  --chat-input-text: #eee;
  --chat-input-border: rgba(255, 255, 255, 0.1);
  /* S62 P3: chat sheet PANEL surface + chrome — the panel background was a
     hard-coded dark gradient, so the light theme's dark --text title
     ("Sohbet") vanished on it. Dark = the original literals. */
  --chat-panel-bg: linear-gradient(135deg, #062a44, var(--surface-sunken));
  --chat-head-border: rgba(255, 255, 255, 0.06);
  --chat-close-bg: rgba(255, 255, 255, 0.08);

  /* Move-notification toast: a top-down gradient — pink at the TOP → purple at
     the BOTTOM — with light text readable over both. */
  --move-toast-bg: linear-gradient(180deg, #ff5fa2 0%, #8e44ad 100%);
  --move-toast-text: #fff5fb;
  --move-toast-border: rgba(255, 95, 162, 0.55);
  --move-toast-accent: #ffd9ec;

  /* Profile card: top-down gradient — lilac tone at the TOP → background-like
     tone at the BOTTOM. Dark = muted lilac top → navy bottom. */
  --profile-card-grad: linear-gradient(180deg, #0f4a6e 0%, #061e33 100%);

  /* S63 P3: home-page top color — the menu background fades from this at the
     very top down into the theme bg (navy in dark, LightSkyBlue in light). */
  --menu-top: #0d5a82;

  /* S96 — Wordinal underwater identity (deep ocean). See the html/body
     ocean layers, the .game-grid glass panel and the orb sprite. */
  --ocean-depth: linear-gradient(180deg, #0a3a58 0%, #072c48 22%, #04182c 60%, #020b18 100%);
  --ray: rgba(150, 235, 255, 0.11);
  --ray-soft: rgba(150, 235, 255, 0.06);
  --board-panel:
    radial-gradient(120% 80% at 50% 0%, rgba(110, 225, 255, 0.16) 0%, rgba(110, 225, 255, 0) 60%),
    linear-gradient(180deg, rgba(8, 62, 96, 0.72) 0%, rgba(3, 28, 50, 0.82) 100%);
  --board-edge: rgba(120, 235, 255, 0.5);
  --board-glow: 0 0 22px rgba(43, 200, 230, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  --orb-letter-shadow: 0 1px 2px rgba(0, 20, 40, 0.55);
  --orb-sel-bg: radial-gradient(circle at 50% 40%, #ffffff 0%, #d4fcff 34%, #6fe6f7 72%, #1fb4d6 100%);
  --orb-sel-text: #03304a;
  --orb-path-bg: radial-gradient(circle at 50% 40%, #f0feff 0%, #a6f2fb 40%, #3fcde8 80%, #1a9fc6 100%);
  --orb-sel-glow: 0 0 0 1px rgba(255, 255, 255, 0.85), 0 0 0.45em rgba(170, 248, 255, 0.95), 0 0 1.1em rgba(43, 200, 240, 0.6);
  --orb-path-glow: 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 0.45em rgba(120, 236, 255, 0.75);
}

/* Light theme re-points the white-on-surface headings to dark text. The board
   + tiles are now themed via the --board/--cell vars above (P2), so no board
   override is needed here. */
/* Non-bonus found words only — bonus rows keep their dark gold treatment. */
/* White-tint round/pill controls need a dark tint on a light background.
   (mp-overlay-btn is intentionally excluded — its --primary variant would be
   clobbered; its secondary buttons read fine as outlined on a light card.) */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  /* P1: Android WebView paints a square highlight on tap; kill it globally. */
  -webkit-tap-highlight-color: transparent;
}

/* S62 P8: the app must never behave like a web page — a long-press anywhere
   must NOT enter text-selection mode or pop the callout. user-select:none on
   body propagates to every `auto` descendant; real text inputs re-enable
   selection so typing/editing still works. (.mp-room-code's user-select:all
   still wins — class rule, later in the sheet.) */
html,
body {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  /* S66 P1: touch-action:manipulation removes the double-tap-to-zoom gesture
     (and the 300ms tap delay) app-wide — double-tapping a button on iOS zoomed
     the page. Pan/scroll still work; pinch zoom is disabled by the viewport
     meta (user-scalable=no). */
  touch-action: manipulation;
}
input,
textarea,
[contenteditable="true"] {
  -webkit-user-select: text;
  user-select: text;
}

/* P1: tap-feedback + a11y focus ring for interactive controls. The square
   WebView highlight is gone (above); :active gives press feedback and
   :focus-visible gives a radius-matched ring (never a box). */
button,
.btn,
[role="button"],
a {
  -webkit-tap-highlight-color: transparent;
  outline: none;
  -webkit-touch-callout: none;
  user-select: none;
  touch-action: manipulation; /* S66 P1: no double-tap zoom on any control */
}

button:active,
.btn:active,
[role="button"]:active {
  transform: scale(0.96);
  filter: brightness(1.1);
}

button:focus-visible,
.btn:focus-visible,
[role="button"]:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  button:active,
  .btn:active,
  [role="button"]:active {
    transform: none;
  }
}

html, body {
  /* S45 P1: hard guard against horizontal overflow. Nothing in this app is meant
     to scroll sideways — the board page and the (full-screen) chat must never
     exceed the viewport width. Clipping here means a stray wide child can't force
     a horizontal scrollbar / push content off-screen at 100% zoom. */
  max-width: 100%;
  overflow-x: hidden;
}
/* S96 — Wordinal UNDERWATER identity. The theme bg lives on <html> (the
   canvas) and <body> is transparent, so two FIXED pseudo-layers behind every
   page show through: body::before = the depth gradient (light at the surface
   → deep below), body::after = static light rays fanning down from above,
   masked out with depth. Fixed + static: painted once, composited, never
   animated and never repainted on scroll (no background-attachment:fixed,
   which repaints on Android). dark = deep ocean, light = shallow lagoon. */
html {
  background: var(--bg);
}
body {
  background: transparent;
  color: var(--text);
  font-family: "Segoe UI", sans-serif;
  min-height: 100vh;
}
body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background: var(--ocean-depth);
}
body::after {
  background: conic-gradient(from 160deg at 38% -12%,
    transparent 0deg, var(--ray) 4deg, transparent 9deg,
    transparent 14deg, var(--ray-soft) 17deg, transparent 22deg,
    transparent 27deg, var(--ray) 30deg, transparent 36deg,
    transparent 41deg, var(--ray-soft) 45deg, transparent 52deg,
    transparent 360deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 80%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0, 0, 0, 0.45) 40%, transparent 80%);
}

/* P7: modern display font for app/page headings (body text stays Segoe UI). */
.menu-title,
.splash-game-title,
.splash-brand,
.settings-header h2,
.langmode-header h2,
.mp-header h2,
.profile-topbar-title,
.legal-title,
.game-topbar-title,
.game-over-title,
.auth-modal-title,
.auth-page-logo {
  font-family: var(--font-display);
}

/* ===== PAGE MANAGER ===== */

.page {
  display: block;
  min-height: 100vh;
  /* Base 20px gutter + device safe-area insets (notch / status bar / gesture
     bar) so content never sits under system UI in the Capacitor native build.
     env(safe-area-inset-*) is 0 on the web and on non-notched devices. */
  padding: 20px;
  padding-top: calc(20px + env(safe-area-inset-top));
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  padding-left: calc(20px + env(safe-area-inset-left));
  padding-right: calc(20px + env(safe-area-inset-right));
}

.page.hidden {
  display: none;
}

.hidden {
  display: none !important;
}

/* ===== FADE OVERLAY ===== */

.fade-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 200ms ease;
}

.fade-overlay--active {
  opacity: 1;
}

/* ===== SPLASH SCREEN (branded intro, ported from chess-ball) =====
   Staggered fade-in: brand → game title → tagline (.show toggles each).
   Colours are LITERAL (theme-independent) so the splash always renders
   light-on-dark even when the saved theme is light. */

.splash-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at center, #0d4a6e 0%, #14142a 72%); /* S96: ocean centre; edge kept = native splash colour (seamless handoff) */
  z-index: 10000;
  padding: 24px;
  padding-top: calc(24px + env(safe-area-inset-top));
}

.splash-brand {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #b9bdd0;
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 600ms ease,
    transform 600ms ease;
}
.splash-brand.show {
  opacity: 1;
  transform: none;
}

.splash-game-title {
  /* Responsive so the title always fits portrait width (~360–412px): the vw
     term shrinks it on narrow phones, the rem caps bound it. Modest
     letter-spacing + max-width:100% keep it from overflowing; if a device is
     unexpectedly narrow it wraps to a centered 2-line stack rather than
     clipping (no white-space:nowrap). */
  font-size: clamp(2rem, 10vw, 4.4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.08;
  color: #2bc8dc;
  text-shadow: 0 0 30px rgba(43, 200, 220, 0.4);
  max-width: 100%;
  text-align: center;
  overflow-wrap: break-word;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition:
    opacity 600ms ease 120ms,
    transform 600ms ease 120ms;
}
.splash-game-title.show {
  opacity: 1;
  transform: none;
}

.splash-tagline {
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  color: #9aa0b8;
  font-style: italic;
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0;
  transition: opacity 600ms ease 240ms;
}
.splash-tagline.show {
  opacity: 1;
}

.splash-screen--fade-out {
  opacity: 0;
  transition: opacity 400ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .splash-brand,
  .splash-game-title,
  .splash-tagline {
    transition: opacity 200ms ease;
    transform: none;
  }
}

/* ===== AUTH PAGE (initial login — shown once after splash) ===== */

#page-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#page-auth.hidden {
  display: none;
}

.auth-page {
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-page-logo {
  font-size: 2rem;
  font-weight: bold;
  color: #2bc8dc;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
  text-align: center;
}

.auth-page-tagline {
  font-size: 0.95rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-bottom: 48px;
  text-align: center;
}

.auth-page-card {
  width: 100%;
}

.auth-page-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.auth-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  border: 2px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.auth-page-btn:active {
  transform: scale(0.98);
}

.auth-page-btn--guest {
  background: transparent;
  color: #2bc8dc;
  border-color: #2bc8dc;
}

.auth-page-btn--guest:hover {
  background: rgba(43, 200, 220, 0.08);
}

.auth-page-btn--apple {
  background: #000;
  color: #fff;
}

.auth-page-btn--apple:hover {
  background: #222;
}

.auth-page-btn--google {
  background: #fff;
  color: #333;
  border-color: var(--text-2);
}

.auth-page-btn--google:hover {
  background: #f0f0f0;
}

.auth-page-btn--mail {
  background: transparent;
  color: var(--text-soft);
  border-color: #3a3a5a;
}

.auth-page-btn--mail:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-3);
}

.auth-page-btn--submit {
  background: #2bc8dc;
  color: #fff;
  border-color: transparent;
}

.auth-page-btn--submit:hover {
  background: #5ad8ea;
}

.auth-page-btn--signup {
  background: transparent;
  color: #2bc8dc;
  border-color: #2bc8dc;
}

.auth-page-btn--signup:hover {
  background: rgba(43, 200, 220, 0.08);
}

.auth-page-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
  color: var(--text-fainter);
  font-size: 14px;
}

.auth-page-divider::before,
.auth-page-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface-raised);
}

.auth-page-section-label {
  font-size: 11px;
  color: var(--text-faint);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 2px 0 0;
}

.auth-page-mail {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.auth-page-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.auth-page-input:focus {
  border-color: #2bc8dc;
}

.auth-page-error {
  color: #ef5350;
  font-size: 13px;
  min-height: 16px;
}

.auth-page-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
  text-align: center;
  align-self: center;
}

.auth-page-back:hover {
  color: #2bc8dc;
}

.auth-page-terms {
  font-size: 11px;
  color: var(--text-fainter);
  text-align: center;
  margin-top: 32px;
  line-height: 1.5;
}

/* ===== MENU PAGE ===== */

.menu-page {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* S63 P3: top-down tint — --menu-top (navy dark / LightSkyBlue light) at the
     very top, settled into the plain theme bg by ~300px so all content below
     the title reads exactly as before. STATIC background — no scroll-linked
     behavior (the S60 revert stands). */
  /* S96: transparent — the fixed ocean layers (body::before/::after) give the
     lit surface at the top and the depth below; --menu-top is unused now. */
  background: none;
}

/* S96: home-screen "sky" → UNDERWATER: a few glass bubbles rise slowly
   through the top band (both themes; replaced the S85/S86 clouds / stars /
   moon). Purely decorative: absolute, non-interactive, z-indexed below all
   real content (which gets its own stacking context via the `> *` rule
   below). transform + opacity only — compositor-cheap; hidden on the LOW
   effects level and frozen under prefers-reduced-motion. */
.menu-sky {
  position: absolute;
  inset: 0;
  height: 340px;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.menu-page > *:not(.menu-sky) {
  position: relative;
  z-index: 1;
}
.menu-bubble {
  position: absolute;
  bottom: -24px;
  border-radius: 50%;
  border: 1px solid rgba(200, 248, 255, 0.55);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75) 0 12%, rgba(160, 235, 255, 0.12) 40%, rgba(160, 235, 255, 0.04) 70%);
  opacity: 0;
  animation: menu-bubble-rise linear infinite;
}
.menu-bubble--0 { left: 7%;  width: 10px; height: 10px; animation-duration: 11s; }
.menu-bubble--1 { left: 18%; width: 6px;  height: 6px;  animation-duration: 9s;  animation-delay: -3s; }
.menu-bubble--2 { left: 29%; width: 14px; height: 14px; animation-duration: 14s; animation-delay: -8s; }
.menu-bubble--3 { left: 44%; width: 7px;  height: 7px;  animation-duration: 10s; animation-delay: -5s; }
.menu-bubble--4 { left: 57%; width: 11px; height: 11px; animation-duration: 12s; animation-delay: -1s; }
.menu-bubble--5 { left: 68%; width: 5px;  height: 5px;  animation-duration: 8s;  animation-delay: -6s; }
.menu-bubble--6 { left: 79%; width: 16px; height: 16px; animation-duration: 15s; animation-delay: -10s; }
.menu-bubble--7 { left: 90%; width: 8px;  height: 8px;  animation-duration: 10s; animation-delay: -2s; }
.menu-bubble--8 { left: 36%; width: 5px;  height: 5px;  animation-duration: 9s;  animation-delay: -7s; }
.menu-bubble--9 { left: 84%; width: 6px;  height: 6px;  animation-duration: 11s; animation-delay: -4s; }
@keyframes menu-bubble-rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { opacity: 0.9; }
  50%  { transform: translate3d(6px, -170px, 0); }
  85%  { opacity: 0.7; }
  100% { transform: translate3d(-4px, -360px, 0); opacity: 0; }
}
html[data-fx="low"] .menu-sky { display: none; }
@media (prefers-reduced-motion: reduce) {
  .menu-bubble { animation: none; opacity: 0.5; bottom: 120px; }
}

.menu-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0 12px;
}

/* Left cluster of top controls: ⚙️ settings + 🏆 leaderboard, sharing the
   round-icon style so the leaderboard sits up with the other top controls
   (it used to live in a bottom bar). */
.menu-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-settings-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.menu-settings-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.menu-auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-auth-chip:hover {
  background: rgba(255, 255, 255, 0.18);
}

.menu-title {
  text-align: center;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-top: 24px;
  /* Bolder + colored brand wordmark: aqua→foam→deep-blue gradient fill (S96; was teal→blue→violet). The
     bundled latin-ext --font-display (Nunito) keeps Turkish glyphs intact; a
     solid color fallback covers WebViews without background-clip:text. */
  color: #2bc8dc;
  background: linear-gradient(100deg, #2bc8dc 0%, #bff8ff 34%, #3a8ff0 64%, #2bc8dc 100%); /* S96: aqua → foam → deep blue */
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 10px rgba(43, 200, 220, 0.35));
  /* S63 P3: slow shimmer — the gradient (sized 200%) sweeps across the letters.
     background-position animates compositor-cheap on a single small element;
     the latin-ext Nunito fill is untouched, so Turkish glyphs stay intact. */
  background-size: 200% 100%;
  animation: menu-title-shimmer 7s ease-in-out infinite alternate;
}

/* S96 lagoon: the foam midtone vanishes on the bright background — deeper
   aqua → ocean-blue fill for the light theme. */

@keyframes menu-title-shimmer {
  from { background-position: 0% 50%; }
  to   { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .menu-title { animation: none; }
}

.menu-subtitle {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-dim);
  letter-spacing: 0.08em;
  margin-top: 4px;
  margin-bottom: 32px;
}

.menu-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: 20px 0;
}

.menu-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 24px 28px;
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 16px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    box-shadow 0.2s;
  text-align: left;
  width: 100%;
}

.menu-card:hover {
  transform: translateY(-2px);
  border-color: #2bc8dc;
  box-shadow: 0 6px 20px rgba(43, 200, 220, 0.25);
}

.menu-card-icon {
  font-size: 2rem;
}

/* S80 P1: back in NORMAL FLOW beneath the action tiles (the S79 absolute
   bottom pin overlapped the tiles' lower area on short screens). Safe-area
   bottom padding keeps it clear of the gesture bar; short screens scroll
   instead of clipping. */
/* Web build only (wordinal.web.app): link to the studio's /games/ hub,
   generated by wor-T-ris tools/studio-site/gen.js. */
.menu-moregames {
  display: block;
  width: max-content;
  margin: 14px auto 0;
  padding: 8px 14px;
  font-size: 0.85rem;
  color: var(--text-faint, #9aa3b5);
  text-decoration: none;
  border-radius: 999px;
}
.menu-moregames:hover { color: var(--text, #fff); }

.menu-version {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-fainter);
  padding-top: 8px;
  padding-bottom: calc(env(safe-area-inset-bottom) + 4px);
}

/* S78 P4: the S56 .menu-exit-btn styles were removed with the button —
   Android hardware back on root screens exits with confirm (S72 P8). */

.menu-chip-avatar {
  font-size: 16px;
}

/* ===== S41 P2 — HOME PROFILE CARD + ACTION TILES ===== */
.menu-title { margin-top: 10px; }
.menu-subtitle { margin-bottom: 12px; }

.menu-profile-card {
  /* Lilac top-down gradient (lilac top → background-like bottom) so the card pops. */
  background: var(--profile-card-grad);
  border: 1px solid rgba(150, 120, 220, 0.35);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}
.menu-profile-main {
  display: flex;
  align-items: center;
  gap: 14px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  color: inherit;
  font-family: inherit;
}
.menu-profile-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2bc8dc, #3a8c84);
  flex-shrink: 0;
}
.menu-profile-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.menu-profile-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-profile-hint { font-size: 0.78rem; color: var(--text-dim); }
/* S115: account-type mark LEFT of the name (Google / Apple / e-mail / guest)
   — replaced the e-mail line. */
.menu-profile-name-row { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; }
.menu-profile-acct { display: inline-flex; flex-shrink: 0; font-size: 1.05rem; line-height: 0; color: var(--text); }
.menu-profile-acct .wc-ico { width: 1em; height: 1em; }
.menu-profile-link { color: var(--accent-bright); font-weight: 700; cursor: pointer; }
/* S42 P2: overall win-rate line on the card. */
.menu-profile-winrate {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-bright);
}
/* S42 P1: on mobile, center the avatar + name/email/win-rate block. */
@media (max-width: 767px) {
  .menu-profile-main { flex-direction: column; text-align: center; gap: 10px; }
  .menu-profile-meta { align-items: center; text-align: center; }
  .menu-profile-name { max-width: 100%; }
}
.menu-profile-actions { display: flex; gap: 8px; }
/* S43 P4 (redesigned S55 P1): 3 action buttons share the row. Icon on TOP,
   label BENEATH in a smaller wrappable font — the old inline icon+label row
   overflowed on iOS with long labels (İstatistiklerim / Mijn statistieken /
   Le mie statistiche). min-width:0 lets each button shrink below the label's
   min-content width; the label wraps (anywhere-break backstop for unspaced
   Turkish) instead of painting outside the button. The Davetler pending-count
   badge sits in the button's top-right corner. */
.menu-profile-btn { position: relative; flex: 1 1 0; min-width: 0; }
.menu-profile-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ff5252;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.5);
}
.menu-profile-badge[hidden] { display: none; }

/* S43 P4 — Davetler row action buttons. */
.davetler-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.davetler-accept {
  background: #2bc8dc;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}
.davetler-accept:hover { background: #3da89e; }
.davetler-decline {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 82, 82, 0.15);
  color: #ff7676;
  font-size: 0.95rem;
  cursor: pointer;
}
.davetler-decline:hover { background: rgba(255, 82, 82, 0.3); }
.menu-profile-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px;
  background: rgba(43, 200, 220, 0.12);
  border: 1px solid rgba(43, 200, 220, 0.25);
  border-radius: 10px;
  color: var(--text);
  font-family: inherit;
  /* Scales down on narrow phones so the longest label (any language) fits. */
  font-size: clamp(0.66rem, 2.9vw, 0.78rem);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.menu-profile-btn:hover { background: rgba(43, 200, 220, 0.22); }
.menu-profile-btn:active { transform: scale(0.97); }
.menu-profile-btn-icon { font-size: 1.2rem; }
.menu-profile-btn-label {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere; /* backstop: never paint outside the button */
}

/* Action tiles: a compact 2-column grid below the profile card. */
.menu-cards.menu-tiles {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  /* S42 P1: equal-size 2×2 tiles. Both rows share the height (minmax floor keeps
     them tappable on short screens, 1fr lets them stretch to fill on tall ones),
     so every tile is identical W×H regardless of its content. S86 P3: floor
     trimmed 104→92px — on shorter phones (esp. with the weekly-button topbar +
     profile card above) the old floor could push the grid past 100vh, forcing
     a page scrollbar; 92px still comfortably meets a touch target. */
  grid-auto-rows: minmax(92px, 1fr);
  gap: 10px;
  padding: 0 0 4px;
}
.menu-tiles .menu-card {
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-align: center;
  position: relative;
  /* Fill the grid cell so all four tiles render at the same size. */
  width: 100%;
  height: 100%;
}
.menu-tiles .menu-card-icon { font-size: 1.8rem; }
/* S42 P1: the "your turn" count badge is a CORNER OVERLAY — absolutely positioned
   so it never adds to the tile's flow height (it used margin-left:auto + block
   flow, which stretched the Oyunlarım tile taller than the others). */
.menu-tiles .menu-card-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  font-size: 0.8rem;
}

.menu-chip-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== PROFILE PAGE ===== */

#page-profile,
#page-leaderboard {
  display: block;
  padding: 0;
}

#page-profile.hidden,
#page-leaderboard.hidden {
  display: none;
}

.profile-page,
.lb-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px 40px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar shared between profile and leaderboard */
.profile-topbar {
  display: flex;
  align-items: center;
  padding: 16px 0 12px;
  gap: 8px;
}

.profile-topbar-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.profile-topbar-spacer {
  width: 44px;
  flex-shrink: 0;
}

/* Override wc-back-btn margin/display for topbar use */
.profile-back-btn {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

/* ===== LEGAL PAGE (Terms / Privacy in-app text) ===== */
.legal-page {
  max-width: 720px;
  margin: 0 auto;
}

.legal-topbar {
  display: flex;
  align-items: center;
  padding: 16px 0 12px;
  gap: 8px;
}

.legal-title {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.legal-back-btn {
  margin: 0;
  flex-shrink: 0;
  white-space: nowrap;
}

.legal-topbar-spacer {
  width: 44px;
  flex-shrink: 0;
}

.legal-body {
  margin-top: 12px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: var(--text-2);
  /* P7: fine-print sizing for the Terms / Privacy bodies (still scrollable). */
  font-size: 0.7rem;
  line-height: 1.5;
  white-space: pre-wrap;       /* render \n\n paragraph breaks */
  max-height: calc(100vh - 160px);
  overflow-y: auto;
}

/* ── Avatar ── */
.profile-avatar-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 16px 0 24px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  user-select: none;
}

.profile-avatar--initials {
  background: #2bc8dc;
  color: #fff;
}

.profile-avatar--emoji {
  background: rgba(43, 200, 220, 0.12);
  border: 2px solid rgba(43, 200, 220, 0.3);
}

/* S43 P1 — photo avatars. Round containers clip a cover-fit <img>. */
.profile-avatar--photo,
.menu-profile-avatar--photo,
.menu-chip-avatar { overflow: hidden; }
.wc-avatar-img,
.profile-avatar-img,
.menu-profile-avatar-img,
.menu-chip-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.menu-chip-avatar-img { width: 20px; height: 20px; }

/* S82 — guest-locked controls: small "Kayıtlı hesap gerekir" hint + greyed
   disabled state (profile avatar/username, friends send-request). */
.wc-guest-hint {
  font-size: 0.72rem;
  color: var(--text-2, #888);
  opacity: 0.85;
  margin-top: 4px;
}
.profile-avatar-change-btn:disabled,
.profile-save-btn:disabled,
.profile-username-input:disabled,
.friends-add-btn:disabled,
.friends-code-input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profile-avatar-change-btn {
  background: none;
  border: none;
  color: #2bc8dc;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: background 0.2s;
}

.profile-avatar-change-btn:hover {
  background: rgba(43, 200, 220, 0.1);
}

.profile-emoji-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px;
  max-width: 280px;
}

.profile-emoji-btn {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.profile-emoji-btn:hover {
  background: rgba(43, 200, 220, 0.2);
  border-color: rgba(43, 200, 220, 0.4);
}

.profile-emoji-btn--reset {
  font-size: 14px;
  color: var(--text-dim);
}

/* ── Sections ── */
.profile-section {
  padding: 16px 0;
  border-top: 1px solid var(--surface-raised);
}

.profile-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.profile-username-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.profile-username-input {
  flex: 1;
  padding: 12px 14px;
  font-size: 14px;
}

.profile-save-btn {
  padding: 12px 18px;
  background: #2bc8dc;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  flex-shrink: 0;
}

.profile-save-btn:hover {
  background: #5ad8ea;
}

.profile-account-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.profile-account-btns {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-account-btns .auth-page-btn {
  padding: 10px 16px;
  font-size: 13px;
}

.profile-account-info {
  padding: 8px 0;
}

.profile-account-email {
  font-size: 14px;
  color: var(--text-soft);
}

.auth-page-btn--danger {
  background: #c62828;
  color: #fff;
  border-color: transparent;
}

.auth-page-btn--danger:hover {
  background: #d63939;
}

/* ── Stats ── */
.profile-tabs,
.lb-mode-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-tab {
  flex: 1;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.profile-tab--active {
  background: rgba(43, 200, 220, 0.15);
  color: #2bc8dc;
  border-color: #2bc8dc;
}

.profile-tab:hover:not(.profile-tab--active) {
  background: rgba(255, 255, 255, 0.05);
}

.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-raised);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}

.profile-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2bc8dc;
  margin-bottom: 4px;
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.profile-stat-rank {
  font-size: 14px;
  color: var(--text-soft);
  text-align: center;
  padding: 8px 0;
}

.profile-stat-rank strong {
  color: #2bc8dc;
}

/* S43 P5 — last-20 score chart + trend label. */
.stats-chart-card {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--surface-sunken);
  border: 1px solid rgba(43, 200, 220, 0.18);
  border-radius: 12px;
}
.stats-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.stats-chart-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.stats-trend {
  font-size: 0.8rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
}
.stats-trend--up   { color: #3ddc84; background: rgba(61, 220, 132, 0.14); }
.stats-trend--down { color: #ff6b6b; background: rgba(255, 107, 107, 0.14); }
.stats-trend--flat { color: var(--text-dim); background: rgba(255, 255, 255, 0.06); }
/* S66 P7: the 20-game average value (matches the dashed amber chart line). */
.stats-avg {
  font-size: 0.76rem;
  font-weight: 800;
  color: #f0b429;
  font-variant-numeric: tabular-nums;
  margin-left: auto;
  margin-right: 6px;
}
.stats-spark { display: block; }

.profile-stats-empty {
  color: var(--text-fainter);
  font-size: 14px;
  text-align: center;
  padding: 20px;
}

/* ===== LEADERBOARD PAGE ===== */

.lb-lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.lb-lang-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lb-lang-pill--active {
  background: rgba(43, 200, 220, 0.15);
  color: #2bc8dc;
  border-color: #2bc8dc;
}

.lb-lang-pill:hover:not(.lb-lang-pill--active) {
  background: rgba(255, 255, 255, 0.05);
}

.lb-header-row {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-fainter);
  border-bottom: 1px solid var(--surface-raised);
  margin-bottom: 4px;
}

.lb-header-label {
  font-size: 11px;
  color: var(--text-fainter);
}

.lb-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.lb-row {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s;
}

.lb-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.lb-row--me {
  background: rgba(43, 200, 220, 0.1);
  border: 1px solid rgba(43, 200, 220, 0.25);
}

.lb-row--me:hover {
  background: rgba(43, 200, 220, 0.14);
}

.lb-rank {
  width: 28px;
  font-size: 13px;
  color: var(--text-faint);
  flex-shrink: 0;
}

.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(43, 200, 220, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: #2bc8dc;
  flex-shrink: 0;
  margin-right: 10px;
}

.lb-name {
  flex: 1;
  font-size: 14px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-name em {
  font-style: normal;
  color: #2bc8dc;
  font-size: 12px;
}

.lb-score {
  font-size: 14px;
  font-weight: 700;
  color: #2bc8dc;
  flex-shrink: 0;
  min-width: 60px;
  text-align: right;
}

.lb-divider {
  height: 1px;
  background: var(--surface-raised);
  margin: 8px 0;
}

.lb-empty {
  color: var(--text-fainter);
  font-size: 14px;
  text-align: center;
  padding: 32px 20px;
}

/* ===== AUTH MODAL ===== */

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.auth-modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 16px;
  padding: 28px 24px 24px;
  width: 90%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.auth-modal-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  padding: 4px 10px;
}

.auth-modal-close:hover {
  color: #fff;
}

.auth-modal-title {
  text-align: center;
  color: #fff;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.auth-providers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: none;
  border-radius: 10px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.1s,
    background 0.2s;
  width: 100%;
  color: #fff;
  background: var(--surface-raised);
}

.auth-btn:hover {
  background: var(--border);
}

.auth-btn:active {
  transform: scale(0.98);
}

.auth-btn-icon {
  font-size: 18px;
}

.auth-btn--apple {
  background: #000;
}
.auth-btn--apple:hover {
  background: #222;
}
.auth-btn--google {
  background: #3c3c5c;
}
.auth-btn--mail {
  background: #2bc8dc;
}
.auth-btn--mail:hover {
  background: #5ad8ea;
}

.auth-btn--submit {
  background: #2bc8dc;
  margin-top: 4px;
}

.auth-btn--submit:hover {
  background: #5ad8ea;
}

.auth-btn--danger {
  background: #c62828;
  margin-top: 4px;
}

.auth-btn--danger:hover {
  background: #d63939;
}

.auth-mail-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-mail-form input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-sunken);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  outline: none;
}

.auth-mail-form input:focus {
  border-color: #2bc8dc;
}

.auth-mail-error {
  color: #ef5350;
  font-size: 13px;
  min-height: 16px;
}

.auth-mail-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.auth-mail-back:hover {
  color: #2bc8dc;
}

/* ===== TOAST (ported from zincirleme mp-toast) ===== */

.wc-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: white;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  z-index: 3000;
  opacity: 0;
  transition:
    opacity 0.3s,
    transform 0.3s;
  pointer-events: none;
  /* S86 P5: fit-to-window BANNER instead of a narrow shrink-to-fit pill —
     grows with the message (bonus/badge-earned text) up to a wide cap, then
     wraps, rather than tall-and-narrow. Short toasts stay compact. */
  width: max-content;
  max-width: min(90vw, 440px);
  text-align: center;
}

.wc-toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* S97: toasts live in ONE stacking container (toast.js _wcToastStack) so
   simultaneous toasts sit one above the other instead of on top of each
   other. The container owns the fixed position; each toast is in flow. */
.wc-toasts {
  position: fixed;
  left: 50%;
  bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: min(90vw, 440px);
  pointer-events: none;
}
.wc-toasts .wc-toast {
  position: relative;
  left: auto;
  bottom: auto;
  transform: translateY(12px);
}
.wc-toasts .wc-toast--visible {
  transform: translateY(0);
}

/* ===== BACK BUTTON (P5: standardized TOP-LEFT on every page) =====
   One shared style + position: a left-aligned "← Geri / ← Menü" button that
   sits at the top-left of the page, in normal flow as the FIRST child, so
   content flows below it. The page wrappers already add safe-area top padding
   (see the .settings-screen/.langmode-page/… block near the file end), so the
   button clears the status bar / notch. On the topbar pages (profile, legal,
   leaderboard) it's the first child of a flex topbar (back | centred title |
   spacer) — still top-left. The game/training screen keeps its integrated
   3-column .game-topbar back button, which is already top-left. */

.wc-back-btn {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;     /* left edge inside any column-flex container */
  margin: 0 0 16px 0;
  padding: 8px 14px 8px 0;
  font-size: 14px;
  font-weight: bold;
  color: var(--text-dim);
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.wc-back-btn:hover {
  color: #2bc8dc;
}

/* ===== SETTINGS SCREEN (ported from zincirleme, dark-adapted) ===== */

.settings-screen {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px;
}

.settings-header {
  text-align: center;
  margin-bottom: 20px;
}

.settings-header h2 {
  color: #2bc8dc;
  margin-top: 8px;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-sunken);
  border-radius: 12px;
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  font-weight: bold;
  color: var(--text);
  text-align: left;
  width: 100%;
  box-sizing: border-box;
}

.settings-item:hover {
  background: var(--surface-hover);
}

.settings-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.settings-arrow {
  margin-left: auto;
  color: var(--text-fainter);
  font-size: 16px;
}

.settings-item--toggle {
  cursor: default;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
}

.settings-item--select {
  cursor: default;
}

.settings-select {
  margin-left: auto;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--surface-sunken);
  color: var(--text);
  border: 1px solid #2bc8dc;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.settings-toggle {
  margin-left: auto;
  position: relative;
  width: 48px;
  min-width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-toggle-slider {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--text-fainter);
  border-radius: 26px;
  cursor: pointer;
  transition: background 0.3s;
}

.settings-toggle-slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s;
}

.settings-toggle input:checked + .settings-toggle-slider {
  background: #2bc8dc;
}

.settings-toggle input:checked + .settings-toggle-slider::before {
  transform: translateX(22px);
}

.settings-divider {
  height: 1px;
  background: var(--surface-raised);
  margin: 8px 0;
}

.settings-item--danger {
  color: #ef5350;
  justify-content: center;
}

/* ===== LANGMODE PAGE ===== */

.langmode-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.langmode-header {
  text-align: center;
  margin-bottom: 24px;
}

.langmode-header h2 {
  color: #2bc8dc;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.langmode-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.langmode-section {
  margin-bottom: 28px;
}

.langmode-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 4px;
}

.langmode-mode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.langmode-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px;
  border-radius: 16px;
  border: 1px solid rgba(43, 200, 220, 0.3);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    box-shadow 0.2s;
  text-align: center;
}

.langmode-mode:hover {
  transform: translateY(-2px);
  border-color: #2bc8dc;
  box-shadow: 0 6px 20px rgba(43, 200, 220, 0.2);
}

.langmode-mode--active {
  border-color: #2bc8dc;
  box-shadow:
    0 0 0 2px #2bc8dc inset,
    0 6px 20px rgba(43, 200, 220, 0.3);
}

.langmode-mode-icon {
  font-size: 2rem;
}

.langmode-mode-label {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #fff;
}

.langmode-mode-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

.langmode-start-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 8px auto 0;
  padding: 14px 24px;
  background: #2bc8dc;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition:
    background 0.2s,
    transform 0.1s;
}

.langmode-start-btn:hover {
  background: #5ad8ea;
}

.langmode-start-btn:active {
  transform: scale(0.98);
}

/* ===== GAME PAGE ===== */

.game-page {
  padding: 16px 20px;
  /* Clear the gesture bar + give the last panel breathing room so panel
     closings / list tails are fully visible when scrolled to the very bottom. */
  padding-bottom: calc(env(safe-area-inset-bottom) + 28px);
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 12px;
  border-bottom: 1px solid rgba(43, 200, 220, 0.15);
  margin-bottom: 14px;
}

/* P3: the in-game topbar no longer carries a "Wordy Crush" title (it wasted
   vertical space on the phone). The center slot now holds only the optional
   timer; keep the bar short so the board gets the freed height. */
.game-topbar--compact .game-topbar-center:empty {
  display: none;
}

.game-topbar-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.game-topbar-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.game-topbar-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.game-topbar-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #fff;
}

/* Static-mode countdown. Sits directly under the title in the top-center
   slot of the topbar. Tabular numerals so MM:SS doesn't jitter as digits
   change. Turns red and pulses once the remaining time drops under
   TIMER_WARNING_THRESHOLD_SEC (30s). */
.game-timer {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #2bc8dc;
  font-variant-numeric: tabular-nums;
  padding: 2px 12px;
  background: rgba(43, 200, 220, 0.1);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 8px;
  transition:
    color 0.2s,
    background 0.2s,
    border-color 0.2s;
}

.game-timer--low {
  color: #ff5366;
  background: rgba(255, 83, 102, 0.12);
  border-color: rgba(255, 83, 102, 0.45);
  animation: game-timer-pulse 1s ease-in-out infinite;
}

@keyframes game-timer-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 83, 102, 0));
  }
  50% {
    transform: scale(1.06);
    filter: drop-shadow(0 0 8px rgba(255, 83, 102, 0.6));
  }
}

.game-auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  background: rgba(43, 200, 220, 0.12);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 999px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  max-width: 220px;
}

.game-auth-chip-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: #2bc8dc;
  border-radius: 50%;
  font-size: 13px;
  flex-shrink: 0;
}

.game-auth-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.game-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 20px;
  align-items: stretch;
}

/* Between the tablet break and the full-desktop break, collapse the three
   columns to a single column but keep the full sidebars visible — the
   mobile tabbed layout only kicks in below 768px. */
@media (max-width: 1023px) and (min-width: 768px) {
  .game-layout {
    grid-template-columns: 1fr;
    /* S67 P7: stacked single column — hug the content (see the <768px note). */
    flex: 0 0 auto;
    align-content: start;
  }
}

/* Mobile-only helpers (compact bar + tabbed panel) default to hidden. */
.game-mobile-bar {
  display: none;
}
.game-mobile-tabs {
  display: none;
}

.game-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.game-badge {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  letter-spacing: 0.05em;
}

.game-badge-sep {
  color: #2bc8dc;
  margin: 0 4px;
}

.game-panel {
  background: var(--surface);
  border: 1px solid rgba(43, 200, 220, 0.2);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.game-panel--grow {
  flex: 1;
  min-height: 120px;
}

/* S65 P5: the Olası Kelimeler panel is a FIXED 3-row block — it hugs its
   content (exactly the top-3 non-empty length groups + tight padding) instead
   of growing toward the sidebar/screen bottom, and never scrolls internally. */
.game-panel--possible {
  flex: 0 0 auto;
  padding-bottom: 8px;
}

.game-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.game-score {
  /* S64 P5: compact refined score type (was 2rem) — board size untouched. */
  font-size: 1.45rem;
  font-weight: 800;
  color: #2bc8dc;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
}

.game-current-word {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 32px;
  align-items: center;
}

.game-current-placeholder {
  color: var(--text-fainter);
  font-size: 14px;
}

.game-letter-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 28px;
  padding: 0 6px;
  background: #2bc8dc;
  color: #fff;
  border-radius: 6px;
  font-weight: 700;
  font-size: 14px;
  animation: chip-in 0.18s ease-out;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    filter 0.15s ease;
}

/* Below the 3-letter minimum the chips read as "not yet a word": muted
   palette, desaturated, so the user can see they haven't crossed the
   validation threshold. Releases silently with no flash — see
   finalizePath()'s path.length < 3 early-out. */
.game-current-word--incomplete .game-letter-chip {
  background: #3a3a52;
  color: #8a8aa0;
  filter: grayscale(0.6);
}

@keyframes chip-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.game-found-list {
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-right: 4px;
}

.game-found-empty {
  color: var(--text-fainter);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.game-found-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-sunken);
  border-radius: 8px;
  font-size: 13px;
  animation: found-slide-in 0.25s ease-out;
}

/* 7+ letter word — gold tint + star. Matches the gold styling used for
   the Olası Kelimeler bonus rows so both panels share a visual language. */
.game-found-row--bonus {
  background: linear-gradient(135deg, #3a2d15, #261d10);
  border: 1px solid rgba(244, 204, 106, 0.45);
  box-shadow: 0 0 12px rgba(244, 204, 106, 0.15);
}
.game-found-row--bonus .game-found-word {
  color: #f4cc6a;
}
.game-found-row--bonus .game-found-word::before {
  content: "🌟 ";
}
.game-found-row--bonus .game-found-points {
  color: #f4cc6a;
}

@keyframes found-slide-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.game-found-word {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.05em;
}

.game-found-points {
  font-size: 12px;
  color: #2bc8dc;
  font-weight: 600;
}

/* Center column: grid */

.game-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.game-grid {
  display: grid;
  /* S87 P1: the board SIDE is fixed; the CELL size is derived from it —
     cell = board / N. `--grid-n` is set on the grid element by each screen
     (game/mpgame/asyncgame set it from state.grid.length; default 7 = GRID_MAX).
     A 3×3 board gets big orbs, a 7×7 small ones, same footprint. The grid is
     a size container so the cells' font-size / gap can use cqw units. */
  --grid-n: 7;
  grid-template-columns: repeat(var(--grid-n, 7), 1fr);
  grid-template-rows: repeat(var(--grid-n, 7), 1fr);
  /* Gap scales with the cell (≈16% of a cell). NOTE: cq units on the container
     ELEMENT resolve against an ancestor (or the viewport), so the gap uses a
     PERCENTAGE of the grid's own box instead (row-gap % resolves against the
     block size, which aspect-ratio makes definite). */
  gap: calc(16% / var(--grid-n, 7));
  position: relative; /* S87 P3: hosts the absolutely-positioned neon SVG */
  container-type: inline-size;
  width: 100%;
  /* P2: bound the board SIDE by the viewport height minus the screen chrome
     (topbar + actions bar + page padding ≈ ≤230px across solo/MP/async) so the
     whole game page fits at 100% zoom with NO vertical scroll — which is what
     pushed the fixed bottom-right chat FAB below the fold. Since the board is
     square (aspect-ratio 1/1), capping max-width also caps its height. On tall
     desktops this stays the old 560px; on short laptops (~720–768px) it shrinks
     to fit instead of overflowing. */
  max-width: min(560px, calc(100vh - 230px));
  aspect-ratio: 1 / 1;
  padding: 14px;
  /* S96: glowing aqua GLASS PANEL — two gradients + a hard edge + ONE static
     outer glow. No backdrop-filter and no blurred inset, so a cell repaint
     never has to re-rasterize a blur under it. */
  background: var(--board-panel);
  border: 1px solid var(--board-edge);
  border-radius: 22px;
  box-shadow: var(--board-glow);
  /* Block browser scroll/zoom/pan during touch drag and suppress the
     synthesized mouse events so onGridMouseDown doesn't double-fire. */
  touch-action: none;
}

/* Chain-break shake. Triggered from game.js triggerGridShake() when the
   drag hits the 12-cell maximum. 300ms total, applied only to the grid
   container so cells keep their own transforms. */
.game-grid.shaking {
  animation: game-grid-shake 0.32s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes game-grid-shake {
  10%,
  90% {
    transform: translateX(-2px);
  }
  20%,
  80% {
    transform: translateX(4px);
  }
  30%,
  50%,
  70% {
    transform: translateX(-6px);
  }
  40%,
  60% {
    transform: translateX(6px);
  }
}

/* Letter cells — S87 "GLASS ORB" (S85 rounded square → S86 circle → S87 orb).
   Fully ROUND, spherical and glossy: a radial body gradient lit from the
   upper-left, plus a ::before overlay that carries the SPECULAR highlight
   (top-left), a soft inner shade (bottom-right) and a thin rim light. The
   overlay is a separate layer so EVERY state fill (.selected/.path/.valid/
   .invalid/.hint/.bonus-glow/.wc-tile-opp …) keeps the glass look — those
   rules only swap the body gradient. Letters sit above the overlay
   (isolation + z-index) and keep their contrast (--cell-text + text-shadow).
   Size: the cell is the grid track (board / N); font-size follows via cqw
   (S87 P1) with the old clamp() as the px fallback.
   S92 P2 (PERFORMANCE — measured, see CLAUDE.md "Effects levels"): the S87
   overlay was 3 blurred INSET shadows + 1 blurred drop shadow + 2 runtime
   radial gradients PER CELL — ~98% of the cell's paint cost, paid 49× on
   every cascade repaint. It is now ONE pre-rendered PNG sprite
   (--orb-sprite, assets/orb/glass-{dark,light}.png, generated by
   scripts/gen-orb-sprite.js) drawn as a cached texture, plus a HARD
   (unblurred) 2px drop shadow. No filter, no blurred shadow, and NO
   box-shadow/filter/background transitions on the base cell (each one
   repainted the cell every frame for 150 ms). `html[data-fx="low"]` (wcFx,
   perf.js) swaps in the FLAT variant at the end of this block. */
.game-cell {
  position: relative;
  isolation: isolate;
  z-index: 1; /* above the neon connector SVG (z 0) */
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    120% 120% at 35% 30%,
    var(--cell-grad-in) 0%,
    var(--cell-bg-1) 45%,
    var(--cell-grad-out) 100%
  );
  color: var(--cell-text);
  font-family: var(--font-display);
  font-size: clamp(18px, 3.2vw, 30px);
  font-size: calc(42cqw / var(--grid-n, 7));
  font-weight: 800;
  text-shadow: var(--orb-letter-shadow);
  user-select: none;
  cursor: grab;
  border-radius: 50%;
  /* S92: a HARD drop shadow (no blur) under the orb; volume comes from the sprite. */
  box-shadow: 0 0.09em 0 var(--orb-drop);
  /* S87 P1: no square press artifact — the hit area IS the circle. */
  -webkit-tap-highlight-color: transparent;
  outline: none;
  background-clip: padding-box;
  transition: transform 0.12s ease;
}
/* Glass overlay — the S92 pre-rendered sprite (specular top-left, inner
   shade bottom-right, rim light), clipped to the circle by its own alpha.
   pointer-events none so hit-testing is the cell itself. */
.game-cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1; /* above the cell background, below the letter (isolation) */
  background: var(--orb-sprite) center / 100% 100% no-repeat;
}
.game-cell:active,
.game-cell:focus,
.game-cell:focus-visible {
  outline: none;
  box-shadow: 0 0.09em 0 var(--orb-drop);
}

.game-cell:hover {
  background: radial-gradient(
    120% 120% at 35% 30%,
    var(--cell-grad-in) 0%,
    var(--cell-hover-1) 45%,
    var(--cell-hover-2) 100%
  );
  transform: scale(1.04);
}

/* P6a — AUTO bonus-word marker (SOLO). The FIRST tile of the highest-scoring
   available 7+ word is RECOLORED with a persistent violet fill that pulses —
   clearly distinct from the gold hint, the teal selection/path, and the green
   valid flash. (A bare drop-shadow glow was invisible behind neighbouring tiles
   — the same lesson the hint learned — so this FILLS the tile.) Placed BEFORE
   .selected/.path/.hint/.valid so all of those override it during a drag / hint /
   flash; it still beats the base .game-cell gradient via higher specificity, so
   NO !important is needed (which would otherwise trap the tile violet mid-drag). */
.game-cell.bonus-glow {
  background: radial-gradient(130% 130% at 50% 42%, #c78ff7 0%, #7c3aed 100%);
  color: #fff;
}
/* S92: the pulse used to animate `filter: drop-shadow` on the cell (a blur
   re-rasterized EVERY frame, forever). Now a static glow on an ::after layer
   whose OPACITY pulses — compositor-only, zero repaint. */
.game-cell.bonus-glow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
  z-index: -2;
  box-shadow: 0 0 14px 4px rgba(150, 90, 240, 0.95);
  animation: wc-bonus-glow 1.4s ease-in-out infinite;
}
@keyframes wc-bonus-glow {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .game-cell.bonus-glow::after { animation: none; }
}

/* S87 P3 — NEON selection. The head orb (.selected) and the tail orbs
   (.path) glow in the brand neon (teal core → pink halo) via box-shadow —
   possible now that the cell is a plain border-radius circle (no clip-path).
   The connector line between the orbs is the wcNeon SVG (neon.js), drawn
   UNDER the cells; there are NO arrow glyphs on the cells anymore. */
/* S92: the glow is TWO blurred layers (was five incl. two blurred insets —
   the inset volume now comes from the sprite). */
/* S96: selected orbs glow BRIGHT WHITE-AQUA (the W/R/O of the brand art);
   unselected orbs stay calm clear glass. The pink halo is gone — the path
   and its neon connector are all aqua now. Glows are token-driven so the
   lagoon theme can add a deep-teal ring for contrast on the light board. */
.game-cell.selected {
  background: var(--orb-sel-bg);
  color: var(--orb-sel-text);
  text-shadow: none;
  z-index: 2;
  box-shadow: var(--orb-sel-glow);
  transform: scale(1.08);
}

.game-cell.path {
  background: var(--orb-path-bg);
  color: var(--cell-path-text);
  text-shadow: none;
  box-shadow: var(--orb-path-glow);
}

/* Neon connector SVG (neon.js) — fills the board, under the orbs. */
.game-grid > svg.wc-neon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
/* S92: the "glow" is a wide low-opacity stroke (no SVG blur filter — that was
   CPU-rasterized over the path's bounding box on every pointermove); the
   arrowheads lost their drop-shadow filter. */
.wc-neon .wc-neon-glow { opacity: 0.32; }
.wc-neon .wc-neon-core { opacity: 0.95; }
.wc-neon .wc-neon-inner { opacity: 0.85; }
/* S96 lagoon: the near-white aqua line would vanish on the bright board — a
   deeper aqua stroke (CSS `stroke` beats the gradient presentation attribute). */
.wc-neon .wc-neon-heads polygon {
  fill: #ffffff;
  stroke: rgba(20, 170, 215, 0.95); /* S96: aqua (was pink) */
  stroke-width: 1;
}

/* Static-mode "burned" cells. */
.game-cell.used {
  opacity: 0.28;
  cursor: default;
  background: var(--cell-used-bg);
  color: var(--cell-used-text);
}

/* Hint reveal — every tile of a chosen longest unfound word is filled gold so it
   reads clearly on device (a bare drop-shadow glow on the octagon clip-path was
   too subtle / could be lost behind neighbours). !important beats the base cell
   gradient the same way .valid/.invalid/.duplicate do. */
.game-cell.hint {
  background: radial-gradient(130% 130% at 50% 42%, #ffe388 0%, #f6b21a 100%) !important;
  color: #2a1c00 !important;
  box-shadow: 0 0 12px 3px var(--cell-hint-glow) !important; /* S92: was filter: drop-shadow */
  animation: game-cell-hint 0.9s ease-in-out 3;
}
@keyframes game-cell-hint {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-cell.hint {
    animation: none;
  }
}

/* Training-only 1-second target reveal: lights the FULL intended path so the
   player sees it once, then it clears. Teal fill (vs the hint's gold) to read
   as a "here's the path" teaching cue, not the in-game first-tile hint. */
.game-cell.training-target {
  background: radial-gradient(130% 130% at 50% 42%, #6fd0c6 0%, #2e8b82 100%) !important;
  color: #04221f !important;
  box-shadow: 0 0 12px 3px rgba(43, 200, 220, 0.85) !important; /* S92: was filter */
  animation: game-cell-hint 0.5s ease-in-out 2;
}
@media (prefers-reduced-motion: reduce) {
  .game-cell.training-target {
    animation: none;
  }
}

.game-cell.empty {
  visibility: hidden;
}

/* Vertical gravity: BOTH modes now use JS-driven per-cell translateY
   transitions (game.js animateFloatingFall / animateStaticFall + the mpgame
   mirrors) so only actually-moving cells animate — the S62 P7 static fix
   removed the old `.falling` whole-column keyframe hop (tremor source). */

/* Validation flashes. Each overrides .selected/.path so the whole
   path lights up uniformly for the ~400ms feedback window. S92: glows are
   box-shadow (the cell is a plain circle since S85 — no clip-path — and
   `filter: drop-shadow` rasterizes the whole cell to an offscreen + blur). */
.game-cell.valid {
  background: radial-gradient(130% 130% at 50% 42%, #6ff0a8 0%, #2ebf6f 100%) !important;
  color: #0b2a15 !important;
  box-shadow: 0 0 12px 3px rgba(61, 220, 132, 0.75) !important;
  animation: game-cell-flash 0.4s ease-out;
}

.game-cell.invalid {
  background: radial-gradient(130% 130% at 50% 42%, #f4718a 0%, #c9344d 100%) !important;
  color: #fff !important;
  box-shadow: 0 0 12px 3px rgba(233, 69, 96, 0.7) !important;
  animation: game-cell-shake 0.4s ease-out;
}

.game-cell.duplicate {
  background: radial-gradient(130% 130% at 50% 42%, #f7ce6b 0%, #d19516 100%) !important;
  color: #2a1c00 !important;
  box-shadow: 0 0 12px 3px rgba(240, 180, 41, 0.7) !important;
  animation: game-cell-flash 0.4s ease-out;
}

/* ── S92 LOW effects level (`html[data-fx="low"]`, perf.js wcFx) ───────────
   FLAT cells: one linear gradient, no sprite, no glow, no text-shadow, no
   hover scale; state fills keep their colours with a plain ring instead of a
   blurred glow; the neon connector keeps only its core line + arrowheads;
   particles are skipped in effects.js. Same geometry, so nothing shifts when
   the level flips live from Settings. */
html[data-fx="low"] .game-cell {
  background: linear-gradient(160deg, var(--cell-grad-in) 0%, var(--cell-bg-1) 55%, var(--cell-grad-out) 100%);
  box-shadow: none;
  text-shadow: none;
}
html[data-fx="low"] .game-cell::before { display: none; }
html[data-fx="low"] .game-cell:hover { transform: none; }
html[data-fx="low"] .game-cell.selected {
  background: linear-gradient(160deg, #ffffff 0%, #9ff3fc 50%, #22b5d8 100%);
  box-shadow: 0 0 0 2px #bff8ff;
  transform: scale(1.06);
}
html[data-fx="low"] .game-cell.path {
  background: linear-gradient(160deg, #e6fdff 0%, var(--cell-path-bg-1) 50%, var(--cell-path-bg-2) 100%);
  box-shadow: 0 0 0 2px rgba(160, 245, 255, 0.8);
}
html[data-fx="low"] .game-grid {
  box-shadow: none; /* S96: no panel glow on the low level */
}
html[data-fx="low"] .game-cell.bonus-glow::after { display: none; }
html[data-fx="low"] .game-cell.hint,
html[data-fx="low"] .game-cell.training-target,
html[data-fx="low"] .game-cell.valid,
html[data-fx="low"] .game-cell.invalid,
html[data-fx="low"] .game-cell.duplicate {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.6) !important;
}
html[data-fx="low"] .wc-neon .wc-neon-glow,
html[data-fx="low"] .wc-neon .wc-neon-inner { display: none; }

@keyframes game-cell-flash {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.12);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes game-cell-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-3px);
  }
  75% {
    transform: translateX(3px);
  }
}

/* ── "Hamle: Tık" tap-to-build control bar (tapinput.js) ─────────────────────
   In tap mode the ✕ Temizle / ✓ Onayla buttons appear once at least one tile is
   tapped. They are taken OUT of the layout flow (position:fixed) so the BOARD
   renders identically in draw vs tap mode — turning tap mode on no longer shrinks
   or shifts the grid. The bar is an intentional floating pill anchored to the
   bottom-center of the viewport (safe-area aware): it sits in free space below
   the board and never overlaps the score panel/chips (the MP/async top bar shows
   BOTH players' scores, so there is no free side to overlay) — so every score
   stays fully readable. Hidden (display:none via [hidden]) in draw mode or with
   an empty path. */
.wc-tapbar {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 16px);
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.wc-tapbar[hidden] { display: none; }
.wc-tapbar-btn {
  min-height: 46px;
  min-width: 104px;
  padding: 10px 22px;
  border-radius: 13px;
  border: 1px solid var(--border);
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: filter 0.15s, transform 0.08s, background 0.15s;
}
.wc-tapbar-btn:active { transform: scale(0.96); }
.wc-tapbar-ok {
  background: #2bc8dc;
  color: #06302c;
  border-color: #2bc8dc;
}
.wc-tapbar-ok:hover { filter: brightness(1.08); }
.wc-tapbar-clear {
  background: var(--surface-raised);
  color: var(--text-2);
}
.wc-tapbar-clear:hover { background: var(--surface-hover); }

/* Right column: possible words */

/* S62 P6: the Olası Kelimeler title renders AS AUTHORED ("Olası Kelimeler",
   not CSS-uppercased "OLASI KELIMELER" — uppercase also mangles Turkish dotted
   i), one size smaller than the other panel titles. */
.game-panel-title--possible {
  text-transform: none;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.game-possible {
  display: flex;
  flex-direction: column;
  gap: 4px; /* S64 P4 (was 5px) */
  min-width: 0;
  overflow: hidden;
  /* S65 P5: NO internal scroll and no excess bottom padding — the list is a
     fixed 3-row display (top-3 non-empty length groups, all screens), so the
     panel's bottom edge sits right under the last row. */
  padding-bottom: 0;
  /* S67 P1: anchor for the loading-spinner overlay (it floats over the 3
     filler slots so loading and loaded states are the same height). */
  position: relative;
}

/* S67 P1: the loading spinner no longer defines the panel height — it overlays
   the 3 reserved filler slots, so loading → loaded never moves the board. */
.game-possible-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 12px;
}

.game-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--surface-raised);
  border-top-color: #2bc8dc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.game-possible-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* S62 P6 → S64 P4: smaller refined type + tighter rows so the panel fits
     small phones. */
  padding: 5px 9px;
  background: var(--surface-sunken);
  /* S67 P1: EVERY row carries a 1px border box (transparent on plain rows) so
     bonus rows (real 1px border) are pixel-identical in height — a 7+ group
     toggling in/out must not change the panel height by the border. */
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  transition: background 0.2s;
}

.game-possible-row--bonus {
  background: var(--possible-bonus-bg);
  border: 1px solid var(--possible-bonus-border);
  color: var(--possible-bonus-text);
}

.game-possible-row--bonus .game-possible-count {
  color: var(--possible-bonus-text);
}

/* Zero-count rows stay in the DOM (so count pulses can target them) but
   collapse out of layout until their count becomes nonzero. */
.game-possible-row--hidden {
  display: none;
}

/* S67 P1 — STRUCTURAL height lock: invisible placeholder rows pad the panel to
   exactly 3 laid-out slots at all times (same box as a real row, content
   hidden). Replaces the S46/S65 #page-game min-height reserve — the fillers
   hold the height on EVERY screen (solo, MP, async), not just solo, and track
   the real row height across breakpoints instead of a magic pixel value. */
.game-possible-row--filler {
  visibility: hidden;
}

.game-possible-label {
  letter-spacing: 0.03em;
}

.game-possible-bonus {
  font-size: 11px; /* S64 P4 (was 12px) */
}

.game-possible-count {
  font-weight: 700;
  color: #2bc8dc;
  font-variant-numeric: tabular-nums;
  transition: transform 0.2s;
}

.game-possible-count--pulse {
  animation: count-pulse 0.35s ease-out;
}

@keyframes count-pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
    color: #fff;
  }
  100% {
    transform: scale(1);
  }
}

/* Subtle "recomputing" hint while computePossibleCounts is running. */
.game-possible--computing {
  position: relative;
}
.game-possible--computing::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(43, 200, 220, 0.2);
  border-top-color: #2bc8dc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ── Mobile (<768px) layout ─────────────────────────────────────────────
   Under 768px:
   · Hide the left+right sidebars.
   · Show a compact bar (score + current word chips) above the grid.
   · Show a tabbed panel (Bulunan | Olası) below the grid.
   Render functions target [data-*-target] elements, so the mobile copies
   stay in sync for free. */
@media (max-width: 767px) {
  .game-page {
    padding: 6px 12px 10px;
  }

  .game-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    /* S67 P7 — the phone gap-above-AND-below-the-board fix: .game-page is a
       min-height:100vh flex column and .game-layout had flex:1, so the single
       visible grid row (.game-center) STRETCHED to the leftover viewport
       height and align-items:center floated the board mid-screen — dead space
       between the score bar and the board (red) and between the board and the
       Olası panel (green). On one column the layout must hug its content; any
       leftover viewport space falls harmlessly BELOW the last panel. Applies
       to all three screens (solo/MP/async share .game-layout). */
    flex: 0 0 auto;
    align-content: start;
  }

  .game-side {
    display: none;
  }

  .game-topbar {
    padding-bottom: 8px;
    margin-bottom: 10px;
  }
  .game-topbar-center {
    gap: 2px;
  }
  .game-topbar-title {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }
  .game-timer {
    font-size: 1rem;
    padding: 1px 8px;
  }
  .game-topbar-btn {
    padding: 6px 10px;
    font-size: 13px;
  }
  .game-auth-chip {
    padding: 4px 10px 4px 4px;
    font-size: 12px;
    max-width: 140px;
  }
  .game-auth-chip-avatar {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }

  .game-mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 12px; /* S64 P5 (was 10px 14px) */
    background: var(--surface);
    border: 1px solid rgba(43, 200, 220, 0.25);
    border-radius: 12px;
    margin-bottom: 10px;
  }

  .game-mobile-bar-score {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
  }
  .game-mobile-bar-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
  }
  .game-mobile-bar .game-score {
    font-size: 1.1rem; /* S64 P5 (was 1.4rem) */
  }

  .game-mobile-bar-current {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: flex-end;
    align-items: center;
    min-height: 28px;
    overflow: hidden;
  }
  .game-mobile-bar-current .game-letter-chip {
    min-width: 20px;
    height: 22px;
    font-size: 12px;
    padding: 0 5px;
  }

  .game-grid {
    /* P3: bound the board by viewport HEIGHT too (not just width) so on tall
       phones it doesn't push the panels below the fold — keeps scrolling minimal
       while still using as much space as fits. Centered when height-bound. */
    max-width: min(100%, 58vh);
    margin: 0 auto;
    padding: 8px;
    gap: calc(16% / var(--grid-n, 7));
  }
  .game-cell {
    font-size: clamp(15px, 5vw, 24px);
    font-size: calc(44cqw / var(--grid-n, 7));
  }

  .game-mobile-tabs {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    background: var(--surface);
    border: 1px solid rgba(43, 200, 220, 0.2);
    border-radius: 12px;
    overflow: hidden;
    max-height: 44vh;
  }

  .game-mobile-tab-bar {
    display: flex;
    border-bottom: 1px solid rgba(43, 200, 220, 0.18);
    flex-shrink: 0;
  }

  .game-mobile-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 12px 0;
    cursor: pointer;
    transition:
      color 0.2s,
      background 0.2s;
  }
  .game-mobile-tab-btn--active {
    color: #2bc8dc;
    background: rgba(43, 200, 220, 0.08);
    box-shadow: inset 0 -2px 0 #2bc8dc;
  }

  .game-mobile-tab-panel {
    display: none;
    padding: 10px 12px;
    /* Last list row clears the gesture bar at max scroll. */
    padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
    overflow-y: auto;
  }
  .game-mobile-tab-panel--active {
    display: block;
  }

  /* Scale panel content for the tab host. */
  .game-mobile-tab-panel .game-found-list,
  .game-mobile-tab-panel .game-possible {
    gap: 6px;
  }
  .game-mobile-tab-panel .game-possible-row,
  .game-mobile-tab-panel .game-found-row {
    padding: 8px 10px;
  }
}

/* ── Game over overlay ─────────────────────────────────────────────────── */

.game-over-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 24, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.25s ease-out;
  padding: 20px;
}

.game-over-overlay--visible {
  opacity: 1;
}

.game-over-modal {
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid rgba(43, 200, 220, 0.35);
  border-radius: 16px;
  padding: 28px 26px 22px;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(43, 200, 220, 0.15);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}

.game-over-overlay--visible .game-over-modal {
  transform: translateY(0) scale(1);
}

.game-over-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #fff;
  text-align: center;
  text-transform: uppercase;
}

.game-over-score {
  margin-top: 4px;
  font-size: 44px;
  font-weight: 900;
  color: #2bc8dc;
  text-align: center;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 18px rgba(43, 200, 220, 0.45);
}

.game-over-meta {
  text-align: center;
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: 14px;
}

/* A qualifying score auto-saves under the player's username (no name prompt) —
   this badge just announces the Top-10 entry. */
.game-over-qualify-badge {
  margin: 0 auto 14px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #2e2a4e, var(--surface));
  border: 1px solid rgba(255, 200, 80, 0.45);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: #f0b429;
  letter-spacing: 0.04em;
}

.game-over-lb-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.game-over-lb {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 16px;
  padding-right: 4px;
}

.game-over-lb-empty {
  color: var(--text-fainter);
  font-size: 13px;
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

.game-over-lb-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  background: var(--surface-sunken);
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-3);
}

.game-over-lb-row--me {
  background: linear-gradient(135deg, #1d3a2a, #14261d);
  border: 1px solid rgba(61, 220, 132, 0.55);
  color: #7fe8a0;
  font-weight: 700;
}

.game-over-lb-rank {
  color: var(--text-faint);
  font-weight: 700;
  text-align: right;
}
.game-over-lb-row--me .game-over-lb-rank {
  color: #7fe8a0;
}

.game-over-lb-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-over-lb-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: #2bc8dc;
}
.game-over-lb-row--me .game-over-lb-score {
  color: #7fe8a0;
}

.game-over-actions {
  display: flex;
  gap: 10px;
  justify-content: stretch;
}

.game-over-btn {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition:
    background 0.15s,
    transform 0.1s,
    border-color 0.15s;
}
.game-over-btn:hover {
  background: #34345a;
  border-color: #2bc8dc;
}
.game-over-btn:active {
  transform: scale(0.97);
}

.game-over-btn--primary {
  background: linear-gradient(135deg, #2bc8dc, #3fa79c);
  border-color: #2bc8dc;
  color: #0b2a25;
}
.game-over-btn--primary:hover {
  background: linear-gradient(135deg, #5dc7bd, #2bc8dc);
}

.game-over-btn--save {
  background: linear-gradient(135deg, #f0b429, #d19516);
  border-color: #f0b429;
  color: #2a1c00;
}
.game-over-btn--save:hover {
  background: linear-gradient(135deg, #ffc94a, #f0b429);
}

/* ===== MULTIPLAYER LOBBY ===== */

.mp-page {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px;
}

.mp-header {
  text-align: center;
  margin-bottom: 24px;
}

.mp-header h2 {
  color: #2bc8dc;
  font-size: 1.6rem;
  letter-spacing: 0.08em;
}

.mp-subtitle {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.mp-section {
  margin-bottom: 24px;
}

.mp-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-left: 4px;
}

.mp-mode-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mp-mode {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 18px 14px;
  border-radius: 16px;
  border: 1px solid rgba(43, 200, 220, 0.3);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    box-shadow 0.2s;
  text-align: center;
}
.mp-mode:hover {
  transform: translateY(-2px);
  border-color: #2bc8dc;
  box-shadow: 0 6px 20px rgba(43, 200, 220, 0.2);
}
.mp-mode--active {
  border-color: #2bc8dc;
  box-shadow:
    0 0 0 2px #2bc8dc inset,
    0 6px 20px rgba(43, 200, 220, 0.3);
}
.mp-mode-icon {
  font-size: 1.8rem;
}
.mp-mode-label {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #fff;
}

.mp-match-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.mp-match-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 22px 16px;
  border-radius: 16px;
  border: 1px solid rgba(43, 200, 220, 0.35);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 0.15s,
    border-color 0.2s,
    box-shadow 0.2s;
  letter-spacing: 0.05em;
}
.mp-match-card:hover {
  transform: translateY(-2px);
  border-color: #2bc8dc;
  box-shadow: 0 6px 20px rgba(43, 200, 220, 0.25);
}
.mp-match-icon {
  font-size: 2rem;
}
.mp-match-label {
  text-align: center;
}

/* ===== S89: WAITING-MATCHES POOL (Karşılıklı page) ===== */
.mp-pool-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mp-pool-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(43, 200, 220, 0.3);
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.mp-pool-row:hover {
  transform: translateY(-1px);
  border-color: #2bc8dc;
  box-shadow: 0 4px 14px rgba(43, 200, 220, 0.22);
}
.mp-pool-avatar {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 800;
  background: rgba(43, 200, 220, 0.18);
  overflow: hidden;
}
.mp-pool-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}
.mp-pool-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mp-pool-name {
  font-weight: 800;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-pool-meta {
  font-size: 0.74rem;
  color: var(--text-2);
}
.mp-pool-join {
  flex: 0 0 auto;
  font-weight: 800;
  font-size: 0.85rem;
  color: #2bc8dc;
  white-space: nowrap;
}
.mp-pool-empty {
  padding: 14px 12px;
  border-radius: 14px;
  border: 1px dashed rgba(43, 200, 220, 0.35);
  color: var(--text-2);
  font-size: 0.9rem;
  text-align: center;
}

/* ===== MULTIPLAYER OVERLAY (matchmaking / room UI) ===== */

.mp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 24, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  opacity: 0;
  transition: opacity 0.2s ease-out;
  padding: 20px;
}
.mp-overlay--visible {
  opacity: 1;
}

.mp-overlay-card {
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid rgba(43, 200, 220, 0.35);
  border-radius: 16px;
  padding: 26px 24px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  transform: translateY(10px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.mp-overlay--visible .mp-overlay-card {
  transform: translateY(0) scale(1);
}

.mp-overlay-title {
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.mp-overlay-spinner {
  font-size: 2.4rem;
  margin: 8px 0 10px;
  animation: mp-spin-wobble 1.4s ease-in-out infinite;
}

@keyframes mp-spin-wobble {
  0%,
  100% {
    transform: rotate(-6deg);
  }
  50% {
    transform: rotate(6deg);
  }
}

.mp-overlay-meta {
  color: var(--text-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-bottom: 14px;
}

.mp-overlay-meta-sub {
  color: var(--text-faint);
  font-size: 11px;
  letter-spacing: 0.12em;
  margin: -6px 0 14px;
  text-transform: uppercase;
}

.mp-overlay-btn {
  display: inline-block;
  padding: 11px 18px;
  min-width: 110px;
  min-height: 48px;
  margin: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.2s;
}
.mp-overlay-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: #2bc8dc;
}

.mp-overlay-btn--primary {
  background: linear-gradient(135deg, #2bc8dc, #3fa79c);
  color: #0b2a25;
  border-color: #2bc8dc;
}
.mp-overlay-btn--primary:hover {
  background: linear-gradient(135deg, #5dc7bd, #2bc8dc);
}

.mp-overlay-btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-soft);
}

.mp-overlay-btn--small {
  padding: 6px 12px;
  min-width: 0;
  font-size: 12px;
  margin: 6px 0 10px;
}

.mp-room-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 12px;
}

.mp-room-or {
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mp-room-join-row {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.mp-room-code-input {
  flex: 1;
  max-width: 180px;
  padding: 11px 14px;
  background: #0f0f20;
  color: #fff;
  border: 1px solid rgba(43, 200, 220, 0.35);
  border-radius: 10px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-align: center;
  text-transform: uppercase;
  outline: none;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
.mp-room-code-input:focus {
  border-color: #2bc8dc;
  box-shadow: 0 0 0 2px rgba(43, 200, 220, 0.3);
}

.mp-room-code {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 0.3em;
  color: #2bc8dc;
  text-shadow: 0 0 18px rgba(43, 200, 220, 0.45);
  padding: 10px 0 4px;
  user-select: all;
}

/* ===== MULTIPLAYER IN-GAME ===== */

.mp-room-chip {
  font-size: 12px !important;
  color: var(--text-dim) !important;
  letter-spacing: 0.06em;
}
.mp-room-chip strong {
  color: #2bc8dc;
  letter-spacing: 0.18em;
  margin-left: 4px;
}

.mp-opponent-panel {
  border: 1px solid var(--mp-opp-border);
  background: var(--mp-opp-bg);
}

.mp-opponent-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--mp-opp-text);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-opponent-score {
  font-size: 1.45rem; /* S64 P5 (was 2rem) */
  font-weight: 900;
  color: var(--mp-opp-text);
  text-shadow: 0 0 14px rgba(244, 143, 177, 0.4);
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}

.mp-opponent-last-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.mp-opponent-last {
  margin-top: 2px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.08em;
  min-height: 18px;
}

/* S45 P4: opponent avatar to the LEFT of the name+score, tappable → stats modal. */
.mp-opponent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.mp-opponent-head-info { min-width: 0; flex: 1; }
.mp-opponent-head-info .mp-opponent-name { margin-bottom: 2px; }
.mp-opponent-head-info .mp-opponent-score { margin-bottom: 0; font-size: 1.3rem; } /* S64 P5 */
.mp-opponent-avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--mp-opp-border);
  background: var(--surface-raised);
  color: var(--mp-opp-text);
  font-size: 1.2rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.mp-opponent-avatar:hover { border-color: var(--accent); }
.mp-opponent-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* S45 P4: opponent stats modal (bigger avatar + wins/losses/win%). */
.opp-stats-overlay {
  position: fixed;
  inset: 0;
  z-index: 9600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 8, 20, 0.66);
  backdrop-filter: blur(2px);
}
.opp-stats-card {
  position: relative;
  width: 100%;
  max-width: 320px;
  box-sizing: border-box;
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid var(--surface-raised);
  border-radius: 18px;
  padding: 26px 20px 22px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.opp-stats-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
  font-size: 15px;
  cursor: pointer;
}
.opp-stats-close:hover { background: rgba(255, 255, 255, 0.16); }
.opp-stats-avatar {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--surface-raised);
  color: var(--text);
  font-size: 2.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.opp-stats-avatar-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.opp-stats-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 16px;
  word-break: break-word;
}
.opp-stats-loading { color: var(--text-dim); font-size: 0.9rem; padding: 8px 0; }
.opp-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.opp-stat {
  background: var(--surface-sunken);
  border: 1px solid var(--surface-raised);
  border-radius: 12px;
  padding: 12px 6px;
}
.opp-stat-v { font-size: 1.4rem; font-weight: 900; color: var(--accent-bright); font-variant-numeric: tabular-nums; }
.opp-stat-l { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }

/* S64 P2: optional primary action under the stats (friends page "Oyun İsteği
   Gönder" → async friend invite). */
.opp-stats-action {
  margin-top: 14px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2bc8dc, #3a9c92);
  color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: filter 0.15s;
}
.opp-stats-action:active { filter: brightness(1.15); }
.opp-stats-action:disabled { opacity: 0.6; cursor: default; }

/* S64 P2: friend rows open the profile modal on tap. */
.friends-row--tappable { cursor: pointer; }
.friends-row--tappable:active { filter: brightness(1.1); }

/* P1: mobile-only MP score bar (both scores). Hidden on desktop/tablet where
   the sidebars are visible; shown under 767px where .game-side is display:none.
   Without it the local score would be invisible on a phone (the opponent panel
   survives via .mpgame-right{display:flex!important}, the left sidebar does not). */
.mpgame-mobile-bar {
  display: none;
}
@media (max-width: 767px) {
  .mpgame-mobile-bar {
    display: flex;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 10px;
  }
  /* Tappable score chips → per-player word-history modal (P2 S28). Reset the
     native <button> chrome so they read as the cards they replaced. */
  .mpgame-mobile-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 6px 10px; /* S64 P5 (was 8px 12px) */
    background: var(--surface);
    border: 1px solid rgba(43, 200, 220, 0.25);
    border-radius: 12px;
    min-width: 0;
    font-family: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: filter 0.15s, border-color 0.15s;
  }
  .mpgame-mobile-cell:active {
    filter: brightness(1.12);
  }
  .mpgame-mobile-cell--opp {
    border-color: var(--mp-opp-border);
    background: var(--mp-opp-bg);
    /* P4: row layout — [avatar] [label + score column]. */
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  /* P4: opponent avatar on the mobile score chip. Its own tap opens the stats
     modal (the surrounding chip opens word history). */
  .mpgame-mobile-avatar {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    color: var(--text);
    font-weight: 800;
    font-size: 0.85rem;
    cursor: pointer;
  }
  .mpgame-mobile-avatar .mp-opponent-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .mpgame-mobile-opp-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
    gap: 2px;
    flex: 1;
    min-width: 0;
  }
  .mpgame-mobile-cue {
    opacity: 0.6;
    font-size: 11px;
  }
  .mpgame-mobile-label {
    font-size: 10px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .mpgame-mobile-bar .game-score {
    font-size: 1.1rem; /* S64 P5 (was 1.5rem) */
  }
  .mpgame-mobile-bar .mpgame-mobile-opp {
    color: var(--mp-opp-text);
  }

  /* P1 (S28): drop the below-board opponent block on mobile — the opponent
     SCORE already lives in the top .mpgame-mobile-bar, and the last word / full
     history now live in the tap-to-open word modals. With it gone the Olası
     Kelimeler panel (the other child of .mpgame-right) reflows up, no gap.
     Async reuses the same MP layout, so the same hide applies there. */
  #page-mpgame .mp-opponent-panel,
  #page-asyncgame .mp-opponent-panel {
    display: none;
  }
}

/* MP game-over screen (shared overlay, custom inner layout) */

.mp-over-headline {
  font-size: 18px;
  font-weight: 700;
  color: #f0b429;
  text-align: center;
  margin: 6px 0 14px;
  letter-spacing: 0.04em;
}

.mp-over-scores {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  padding: 12px 8px;
  margin-bottom: 16px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 12px;
}

.mp-over-col {
  text-align: center;
}

.mp-over-col-label {
  font-size: 11px;
  color: var(--text-dim);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mp-over-col-score {
  font-size: 1.8rem;
  font-weight: 900;
  color: #2bc8dc;
  font-variant-numeric: tabular-nums;
}

.mp-over-vs {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  letter-spacing: 0.1em;
}

/* ── MP game: right panel with chat ────────────────────────────────────── */

/* Override: mpgame right side uses flex-column so chat grows to fill space */
.mpgame-right {
  display: flex !important;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

/* Chat panel */
.mp-chat-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: var(--chat-panel-bg);
  border: 1px solid rgba(43, 200, 220, 0.2);
  border-radius: 12px;
  overflow: hidden;
}

.mp-chat-header {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mp-chat-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.mp-chat-body::-webkit-scrollbar { width: 4px; }
.mp-chat-body::-webkit-scrollbar-track { background: transparent; }
.mp-chat-body::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

.mp-chat-msg {
  display: flex;
  /* S45 P1: cap a bubble at 80% of the chat body (not of any wider containing
     block) and allow the flex item to shrink so a long token can't push it out. */
  max-width: 80%;
  min-width: 0;
}

.mp-chat-msg--mine   { align-self: flex-end;   flex-direction: row-reverse; }
.mp-chat-msg--theirs { align-self: flex-start; }

.mp-chat-bubble {
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 0.83rem;
  line-height: 1.4;
  min-width: 0;
  /* S46 P1: a bubble can never exceed its (already ≤80%) message wrapper. */
  max-width: 100%;
  box-sizing: border-box;
  /* S45 P1: break even a long unbroken token (URL / mashed letters) instead of
     letting it stretch the bubble past the viewport. overflow-wrap:anywhere is the
     standard property; word-break:break-word is kept as a fallback. */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mp-chat-msg--mine .mp-chat-bubble {
  background: var(--chat-mine-bg);
  color: var(--chat-mine-text);
  border-bottom-right-radius: 4px;
}

.mp-chat-msg--theirs .mp-chat-bubble {
  background: var(--chat-theirs-bg);
  color: var(--chat-theirs-text);
  border-bottom-left-radius: 4px;
}

.mp-chat-sender {
  font-size: 0.7rem;
  font-weight: 700;
  color: #2bc8dc;
  margin-bottom: 2px;
}

/* S67 P3 — a blocked user's PRE-block messages stay in the history but render
   as muted gray bubbles (post-block messages are hidden entirely). Literal
   grays so it reads "muted" in BOTH themes. */
.mp-chat-msg--blocked .mp-chat-bubble {
  background: #63636c;
  color: #c9c9cf;
}
.mp-chat-msg--blocked .mp-chat-sender {
  color: #a3a3ab;
}
.mp-chat-msg--blocked {
  opacity: 0.75;
}

.mp-chat-footer {
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.mp-chat-input {
  flex: 1;
  min-width: 0;
  background: var(--chat-input-bg);
  border: 1px solid var(--chat-input-border);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.82rem;
  color: var(--chat-input-text);
  outline: none;
  font-family: inherit;
}

.mp-chat-input:focus { border-color: #2bc8dc; }
.mp-chat-input::placeholder { color: var(--text-fainter); }

.mp-chat-send {
  background: #2bc8dc;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.mp-chat-send:hover { background: #3da89e; }

/* ===== MP CHAT POPUP (P6) — toggle FAB + dismissible bottom sheet =========
   Replaces the always-open sidebar chat. The sheet is position:fixed bottom:0,
   so under Capacitor's default NATIVE keyboard resize the webview shrinks and
   the input sits above the keyboard automatically (no manual translate, which
   would double-offset). The keyboard listener just re-scrolls the message list.
   --mp-kb-height is set by the listener for any future fine-tuning. */
.mp-chat-toggle {
  position: fixed;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #2bc8dc;
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  /* P3: high z-index so no game-screen panel/sidebar can ever cover it. The FAB
     is position:fixed to the VIEWPORT — no game-page ancestor sets a transform/
     filter/contain that would turn it into the containing block — so an oversized
     (scrolling) page can't push it off-screen; it stays pinned bottom-right. */
  z-index: 1200;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, background 0.15s ease;
}
.mp-chat-toggle:hover   { background: #3da89e; }
.mp-chat-toggle:active  { transform: scale(0.92); }

.mp-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9px;
  background: #e94560;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--bg, #14142a);
}
.mp-chat-badge[hidden] { display: none; }

.mp-chat-sheet {
  position: fixed;
  inset: 0;
  /* P3 (web horizontal-overflow fix): the sheet is viewport-sized (inset:0) but
     had NO horizontal clip, so a child wider than the viewport (a long unbroken
     message, or a panel sized to a wider containing block) extended the document
     and forced a horizontal scrollbar — the right edge of the chat fell off
     screen. Pin to viewport width + clip overflow so opening chat can never
     widen the page. */
  width: 100%;
  /* S46 P1: cap to 100% (the containing block / viewport CONTENT width), NOT
     100vw — on desktop 100vw includes the vertical-scrollbar gutter (~15px), so a
     100vw-wide panel sits wider than the usable area and its right edge (padding
     included) falls past the viewport. 100% + border-box keeps it fully inside. */
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  z-index: 1210; /* P3: above the FAB (1200) so the open sheet sits over everything */
  pointer-events: none;
}
.mp-chat-sheet--open { pointer-events: auto; }

.mp-chat-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.mp-chat-sheet--open .mp-chat-backdrop { opacity: 1; }

.mp-chat-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  /* P3/S46 P1: keep the panel inside the viewport CONTENT width (100%, not 100vw
     — see .mp-chat-sheet) regardless of containing block. */
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(70vh, 460px);
  background: var(--chat-panel-bg);
  border-top: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.45);
  padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.mp-chat-sheet--open .mp-chat-sheet-panel { transform: translateY(0); }

/* S43 P2 — FULL-SCREEN chat variant (both chats since S62). The panel fills
   the screen as a STATIC flex column (header / list flex:1 / input row).
   S65 P1 (iOS first-open fix): the open animation is an OPACITY fade, NOT the
   base rule's translateY transform — WKWebView composites position:fixed
   subtrees with animated transforms lazily, which left the freshly-opened
   sheet mis-laid-out until a random tap forced a repaint (the exact reported
   iOS symptom; Android never showed it). Sizing: top:0 + bottom:0 by default;
   wcChatApplyKb (mpgame.js) pins top/height to the visualViewport when the
   keyboard occludes instead of resizing the webview. */
.mp-chat-sheet--full .mp-chat-sheet-panel {
  top: 0;
  max-height: none;
  border-radius: 0;
  border-top: none;
  padding-top: env(safe-area-inset-top);
  transform: none;
  opacity: 0;
  transition: opacity 0.18s ease;
}
.mp-chat-sheet--full.mp-chat-sheet--open .mp-chat-sheet-panel {
  transform: none;
  opacity: 1;
}
.mp-chat-sheet--full .mp-chat-grip-area { display: none; } /* no swipe-grip when full */

/* S43 P2 — header actions (Arkadaş Ekle + close). */
.mp-chat-head-actions { display: flex; align-items: center; gap: 8px; }
.mp-chat-addfriend {
  background: rgba(43, 200, 220, 0.16);
  color: var(--accent-bright);
  border: 1px solid rgba(43, 200, 220, 0.4);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.mp-chat-addfriend:hover { background: rgba(43, 200, 220, 0.28); }
.mp-chat-addfriend[hidden] { display: none; }

/* S66 P2: "Engelle" (block the opponent) in the async chat header — same pill
   shape as the add-friend button, red-toned. */
.mp-chat-block {
  background: rgba(255, 82, 82, 0.14);
  color: #ff7676;
  border: 1px solid rgba(255, 82, 82, 0.38);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}
.mp-chat-block:hover { background: rgba(255, 82, 82, 0.26); }
.mp-chat-block[hidden] { display: none; }
/* Narrow phones: the head row now carries 3 buttons — the block button drops
   to icon-only (🚫) so the row can never overflow the sheet width. */
@media (max-width: 400px) {
  .mp-chat-block-label { display: none; }
}

.mp-chat-grip-area {
  display: flex;
  justify-content: center;
  padding: 8px 0 2px;
  cursor: grab;
  touch-action: none;
}
.mp-chat-grip {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
}

/* S67 P4 — app-standard header order: [← Geri] top-LEFT, title beside it,
   actions (🚫 Engelle / ➕ Arkadaş, async only) pushed to the right. */
.mp-chat-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 14px 8px;
  border-bottom: 1px solid var(--chat-head-border);
}
.mp-chat-sheet-title {
  font-size: 0.95rem;
  font-weight: 700;
  /* S66 P2: the head actions grew (🚫 Engelle) — the title yields, never wraps. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.mp-chat-head-actions { margin-left: auto; }
/* S67 P4: the old ✕ close is now a "← Geri" back button (same close handler). */
.mp-chat-back {
  background: var(--chat-close-bg);
  color: var(--text-2);
  border: none;
  border-radius: 8px;
  height: 30px;
  padding: 0 12px;
  font-size: 0.82rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}
.mp-chat-back:hover { background: rgba(255, 255, 255, 0.16); }

/* The sheet body grows/scrolls; min-height keeps the input reachable. */
.mp-chat-sheet-panel .mp-chat-body { min-height: 120px; }

/* Win/lose color variants for headline */
.mp-over-headline--win  { color: #2bc8dc !important; }
.mp-over-headline--lose { color: #e57373 !important; }

/* Reason line (e.g. "Opponent disconnected") under the headline */
.mp-over-reason {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin: -8px 0 10px;
}

/* Rematch waiting status */
.mp-rematch-status {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-top: 8px;
  min-height: 16px;
}

/* P2: Evet/Hayır rematch prompt shown to the OPPONENT when one player requests a
   rematch. Reuses the found-modal overlay/card; this just centres the copy. The
   overlay sits above the game-over overlay (found-modal-overlay z-index). */
.mp-rematch-card {
  text-align: center;
  max-width: 320px;
}
.mp-rematch-prompt-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  word-break: break-word;
}
.mp-rematch-prompt-text {
  font-size: 0.9rem;
  color: var(--text-2);
  margin-bottom: 14px;
}

/* ── Wordlist loading overlay ───────────────────────────────────────────── */
.wordlist-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 24, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: all;
  backdrop-filter: blur(2px);
}

.wordlist-loading-overlay--visible {
  opacity: 1;
}

.wordlist-loading-card {
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid var(--surface-raised);
  border-radius: 16px;
  padding: 32px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  box-shadow:
    0 16px 48px rgba(0, 0, 0, 0.6),
    0 0 24px rgba(43, 200, 220, 0.15);
  min-width: 260px;
}

.wordlist-loading-spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--surface-raised);
  border-top-color: #2bc8dc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.wordlist-loading-text {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.wordlist-loading-lang {
  color: #2bc8dc;
  font-family: "SF Mono", Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  opacity: 0.85;
}

/* ===== P6: TOP SAFE-AREA — clear the status bar + a little breathing room =====
   These page roots set their own padding shorthand (which would otherwise
   wipe the .page safe-area top), so re-assert a top inset = device safe-area
   + a small extra so headers/top bars never graze the phone indicators. */
.menu-page,
.settings-screen,
.langmode-page,
.play-page,
.arcade-page,
.mp-page,
.profile-page,
.lb-page,
.legal-page {
  padding-top: calc(env(safe-area-inset-top) + 28px);
}
/* S85: these same page roots' padding shorthand ALSO wiped the .page
   safe-area BOTTOM inset — on a Redmi-style gesture nav bar the last list
   row (Settings especially) sat under/behind the system bar. Re-assert it
   here; env(...) is 0 on devices without a gesture bar, so this never adds
   visible space where none is needed. */
.menu-page,
.settings-screen,
.langmode-page,
.play-page,
.arcade-page,
.mp-page,
.profile-page,
.lb-page,
.legal-page {
  padding-bottom: calc(env(safe-area-inset-bottom) + 28px);
}
/* S86 P3: .menu-page's own last child (.menu-version) already carries its own
   safe-area-bottom padding — stacking the shared +28px on TOP of that doubled
   up the bottom gap and helped push the page past 100vh (page-level scrollbar
   on shorter phones). A smaller reassertion here is enough since the page
   itself doesn't end in a hard edge (the version label's own padding covers
   the gesture bar). */
.menu-page {
  padding-bottom: calc(env(safe-area-inset-bottom) + 8px);
}
.game-page {
  /* P3: trimmed from +22px so the board sits higher and the screen needs less
     scroll. Still clears the status bar via the safe-area inset. */
  padding-top: calc(env(safe-area-inset-top) + 12px);
}
#page-auth {
  padding-top: calc(env(safe-area-inset-top) + 20px);
}

/* ===== P5: VISUAL JUICE — particles, bursts, score pulse ===================
   The particle layer hosts short-lived nodes spawned by effects.js (Web
   Animations API drives the motion + removes the node on finish, so no DOM
   leak). prefers-reduced-motion is honoured in effects.js (it spawns fewer /
   no particles) and by the score-pulse fallback below. */

/* S92: particles are drawn on ONE fixed canvas (effects.js) — no per-particle
   DOM nodes / layers anymore. Hidden by effects.js while idle. */
.wc-fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 8000;
}

/* Score count-up pulse — added briefly by game.js on every award. */
.game-score--pop {
  animation: wc-score-pop 0.32s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes wc-score-pop {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18);
    text-shadow: 0 0 16px rgba(43, 200, 220, 0.6);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-score--pop {
    animation: none;
  }
}

/* ===== GAME ACTIONS BAR — found modal opener + hint lamps + undo (P3/P4/P5) = */
.game-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.game-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  min-height: 44px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.15s,
    border-color 0.15s,
    opacity 0.15s;
}
.game-action-btn:hover {
  border-color: var(--accent);
  background: var(--surface-hover);
}
.game-action-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.game-found-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

/* Hint lamps — 3 jokers, spent left-to-right; pulse when idle. */
.game-hints {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  min-height: 44px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.game-hint-lamp {
  font-size: 20px;
  line-height: 1;
  transition:
    filter 0.2s,
    opacity 0.2s,
    transform 0.2s;
}
.game-hint-lamp--used {
  filter: grayscale(1) brightness(0.7);
  opacity: 0.35;
}
.game-hints--pulse .game-hint-lamp:not(.game-hint-lamp--used) {
  animation: hint-lamp-pulse 1.1s ease-in-out infinite;
}
@keyframes hint-lamp-pulse {
  0%,
  100% {
    transform: scale(1);
    filter: drop-shadow(0 0 0 rgba(255, 213, 74, 0));
  }
  50% {
    transform: scale(1.18);
    filter: drop-shadow(0 0 8px rgba(255, 213, 74, 0.85));
  }
}
@media (prefers-reduced-motion: reduce) {
  .game-hints--pulse .game-hint-lamp {
    animation: none;
  }
}

/* No-moves / time-up reason line under the game-over title (P1). */
.game-over-reason {
  text-align: center;
  color: var(--accent);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ===== FOUND-WORDS MODAL (P3) ============================================== */
.found-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: rgba(10, 10, 24, 0.7);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.found-modal-overlay--visible {
  opacity: 1;
}
.found-modal-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 60px);
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid rgba(43, 200, 220, 0.35);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  transform: translateY(10px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.found-modal-overlay--visible .found-modal-card {
  transform: none;
}
.found-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
  flex-shrink: 0;
}
.found-modal-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text);
}
.found-modal-count {
  color: var(--accent);
  margin-left: 4px;
}
.found-modal-close {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 6px;
}
.found-modal-close:hover {
  color: var(--text);
}
.found-modal-list {
  padding: 0 16px 16px;
  overflow-y: auto;
}

/* ===== Mobile-only always-visible Olası panel (P3) ========================= */
.game-mobile-possible {
  display: none;
}
@media (max-width: 767px) {
  .game-mobile-possible {
    display: block;
    margin-top: 8px;
  }
  /* S65 P5: no max-height cap — the panel is exactly its 3 rows now. */
  .game-actions-bar {
    gap: 6px;
    margin-bottom: 10px;
  }
  .game-action-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  .game-hints {
    padding: 4px 6px;
    gap: 4px;
  }
  .game-hint-lamp {
    font-size: 18px;
  }
}

/* ===== Training (Antrenman) ================================================= */
/* Task banner — sits above the game topbar inside page-game during training. */
.training-banner {
  margin: 0 0 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(43, 200, 220, 0.18), var(--surface));
  border: 1px solid rgba(43, 200, 220, 0.4);
  border-radius: 14px;
  text-align: center;
}
.training-banner-progress {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
.training-banner-title {
  margin-top: 4px;
  font-family: var(--font-display, inherit);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.training-banner-desc {
  margin-top: 4px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text-dim);
}

/* Success / done overlay — reuses the found-modal visual language. */
.training-overlay {
  position: fixed;
  inset: 0;
  z-index: 9300;
  background: rgba(10, 10, 24, 0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.training-overlay--visible {
  opacity: 1;
}
.training-overlay-card {
  width: 100%;
  /* S86 P5: wider fit-to-window banner (was 360px) — not edge-to-edge, but
     wide enough that the tip copy reads as a flat banner, not a tall column. */
  max-width: min(92vw, 460px);
  padding: 28px 24px;
  background: linear-gradient(160deg, var(--surface), var(--surface-sunken));
  border: 1px solid rgba(43, 200, 220, 0.4);
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  transform: translateY(10px) scale(0.96);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.3, 1.2);
}
.training-overlay--visible .training-overlay-card {
  transform: none;
}
.training-overlay-icon {
  font-size: 3rem;
  line-height: 1;
}
.training-overlay-title {
  margin-top: 12px;
  font-family: var(--font-display, inherit);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}
.training-overlay-body {
  margin-top: 8px;
  font-size: 0.95rem;
  color: var(--text-dim);
}
.training-overlay-btn {
  margin-top: 20px;
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #2bc8dc, #3a9d94);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}
.training-overlay-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(43, 200, 220, 0.35);
}

/* ════════════════════════════════════════════════════════════════════════
   ASYNC FLOATING MP — Oyunlarım list + async game screen
   ════════════════════════════════════════════════════════════════════════ */

/* "Your turn" badge on the Oyunlarım menu card. */
.menu-card {
  position: relative;
}
.menu-card-badge {
  margin-left: auto;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 12px;
  background: #ff5252;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(255, 82, 82, 0.5);
}

/* ── Oyunlarım page ─────────────────────────────────────────────────────── */
.mygames-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  /* Match every other page's top inset (P6 safe-area block): clear the status
     bar + the same breathing room. This rule is defined after the P6 block, so
     its `padding` shorthand would otherwise wipe the top inset — re-assert it. */
  padding-top: calc(env(safe-area-inset-top) + 28px);
  /* Clear the gesture bar + breathing room so the LAST list row is fully
     visible at max scroll (was showing only halfway). */
  padding-bottom: calc(env(safe-area-inset-bottom) + 32px);
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}
.mygames-header {
  text-align: center;
  margin-top: 8px;
}
.mygames-header h2 {
  margin: 0;
  color: var(--accent-bright);
}
/* P4: Aktif | Bitenler tab switcher. */
.mygames-tabs {
  display: flex;
  gap: 8px;
  padding: 4px;
  background: var(--surface-sunken);
  border-radius: 12px;
}
.mygames-tab {
  flex: 1;
  padding: 10px 12px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mygames-tab--active {
  background: var(--surface-raised);
  color: var(--accent-bright);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
/* S65 P3: language filter chips (shown only when >1 language has games).
   Default = the current Settings language; picking one filters BOTH tabs. */
.mygames-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.mygames-langs[hidden] { display: none; }
.mygames-lang-chip {
  border: 1px solid rgba(43, 200, 220, 0.25);
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 4px 11px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.mygames-lang-chip--active {
  background: rgba(43, 200, 220, 0.18);
  border-color: rgba(43, 200, 220, 0.55);
  color: var(--accent-bright);
}
.mygames-tab-panel {
  display: none;
}
.mygames-tab-panel--active {
  display: block;
}
.mygames-section-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 6px 2px;
}
.mygames-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mygames-empty,
.mygames-empty-row {
  text-align: center;
  color: var(--text-dim);
  padding: 18px;
  background: var(--surface-sunken);
  border-radius: 12px;
}
.mygames-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.mygames-empty-icon {
  font-size: 2.4rem;
}
.mygames-loading {
  display: flex;
  justify-content: center;
  padding: 20px;
}
/* S62 P9: refined list rows — one notch smaller type, tighter consistent
   spacing, aligned badges/icons. */
.mygames-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-raised);
  border: 1px solid rgba(43, 200, 220, 0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s, border-color 0.2s, background 0.2s;
}
.mygames-row:hover {
  transform: translateY(-1px);
  border-color: var(--accent);
}
/* P3: my-turn rows are tinted green-ish so "your move" reads at a glance. */
.mygames-row--you {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(43, 200, 220, 0.4) inset;
  background: linear-gradient(135deg, rgba(43, 200, 220, 0.16), rgba(43, 200, 220, 0.06));
}
.mygames-row--done {
  opacity: 0.78;
  cursor: pointer;
}
.mygames-avatar {
  font-size: 1.5rem;
  width: 36px;
  height: 36px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* P5: photo avatar fills the round slot (wcAvatarMarkup <img>). */
.mygames-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.mygames-main {
  flex: 1;
  min-width: 0;
}
.mygames-opp {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mygames-flag {
  font-size: 0.85em;
}
.mygames-status {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 2px;
}
.mygames-status--you {
  color: var(--accent-bright);
  font-weight: 700;
}
.mygames-time {
  margin-left: 6px;
  opacity: 0.8;
}
.mygames-score {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  flex-shrink: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mygames-score-sep {
  color: var(--text-dim);
  margin: 0 2px;
}
.mygames-forfeit {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 82, 82, 0.15);
  color: #ff7676;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mygames-forfeit:hover {
  background: rgba(255, 82, 82, 0.3);
}

/* P6→P3: win/loss/draw indicator on finished rows — a prominent, bold, COLORED
   badge (filled background + white glyph) that's distinguishable at a glance. */
.mygames-result {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}
.mygames-result--win  { background: linear-gradient(135deg, #3ddc84, #1faa5d); }
.mygames-result--lose { background: linear-gradient(135deg, #ff6b6b, #d93a4a); }
.mygames-result--draw { background: linear-gradient(135deg, #9aa0b3, #6b7186); }

/* P5: chat-unread count badge on a game row (active + finished; hidden at 0). */
.mygames-chat-badge {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 10px;
  background: #e94560;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.4;
  white-space: nowrap;
}
.mygames-chat-badge[hidden] { display: none; }

/* ── P7: swipe-to-delete on finished rows ───────────────────────────────────
   The row sits ABOVE a "Sil" (delete) button; swiping the row left (mobile) or
   hovering it (web) reveals the button. The container clips the slide and the
   row is opaque + solid so the red action stays hidden until revealed. */
.mygames-swipe {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.mygames-swipe .mygames-row {
  position: relative;
  z-index: 1;
  border-radius: 12px;
  /* Finished rows were translucent (.mygames-row--done opacity:0.78), which would
     let the red delete button bleed through. Keep them opaque + a muted SOLID
     background so the action stays hidden until the row slides. */
  opacity: 1;
  background: var(--surface-sunken);
}
.mygames-del {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 0;
  width: 84px; /* must match REVEAL in wireFinishedSwipe() */
  border: none;
  background: #d93a4a;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.mygames-del:hover { background: #c5303f; }
.mygames-swipe .mygames-row--swiped { transform: translateX(-84px) !important; }
/* Web fallback: reveal the delete action on hover (no swipe). */
@media (hover: hover) {
  .mygames-swipe:hover .mygames-row:not(.mygames-row--swiped) {
    transform: translateX(-84px);
  }
}

/* ── Async game screen ──────────────────────────────────────────────────── */
.async-loading {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 50vh;
}
.async-banner {
  text-align: center;
  padding: 8px 14px;
  margin: 8px auto;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  max-width: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.async-banner--you {
  background: rgba(43, 200, 220, 0.18);
  color: var(--accent-bright);
}
.async-banner--wait {
  background: var(--surface-sunken);
  color: var(--text-dim);
}
.async-banner--done {
  background: rgba(255, 193, 7, 0.15);
  color: #ffca28;
}
.async-deadline {
  font-size: 0.8rem;
  color: var(--text-dim);
}
.async-claim-btn {
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  background: var(--accent);
  color: #06231f;
  font-weight: 800;
  cursor: pointer;
}
.async-claim-btn:hover {
  background: var(--accent-bright);
}
/* Read-only board (not your turn): dim + block pointer interaction. */
.game-grid.async-readonly {
  opacity: 0.72;
  pointer-events: none;
  filter: saturate(0.8);
}

/* P2 (S35): small turn chip next to the "Oyunlarım" back entry — replaces the
   old big fixed async banner. */
.async-topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.async-turn-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.async-turn-chip[hidden] { display: none; }
.async-turn-chip--you {
  background: rgba(43, 200, 220, 0.18);
  color: var(--accent-bright);
}
.async-turn-chip--wait {
  background: var(--surface-sunken);
  color: var(--text-dim);
}
/* S62 P4: the chip no longer holds a claim BUTTON — it shows a muted
   "⏱️ Süre doldu" label while the auto-claim transaction resolves. */
.async-turn-chip--claim {
  background: rgba(240, 180, 41, 0.16);
  color: #f0b429;
}
.async-turn-chip--result { padding: 0; background: none; }
.async-claim-btn--sm { padding: 4px 10px; font-size: 0.72rem; }
/* P2: when it's your turn the chip holds the label + a Pas button. */
.async-turn-chip--you { gap: 6px; }
.async-pass-btn {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 2px 9px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.async-pass-btn:hover { background: rgba(255, 255, 255, 0.16); }
.async-pass-btn:disabled { opacity: 0.5; cursor: default; }

/* P1 (S36): reworked async end dialog — title/reason/✕-close. The modal reuses
   .game-over-modal; these add the top-right close button + the reason subtitle
   and make room for the absolute ✕. */
.ag-result-modal { position: relative; }
.ag-result-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}
.ag-result-close:hover { background: rgba(229, 115, 115, 0.2); color: #e57373; }
.ag-result-title { margin-top: 6px; }
.ag-result-reason {
  margin: 6px 0 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

/* P4 (S35): opponent's just-played tiles — recolor briefly, then fade out.
   Reusable via wcEffects.fadeOutCells (skipped under prefers-reduced-motion). */
.game-cell.wc-tile-opp {
  background: radial-gradient(130% 130% at 50% 42%, #f8a9c4 0%, #c2185b 100%) !important;
  color: #2a0e1c !important;
  transition: opacity 0.6s ease, background 0.2s ease;
}
.game-cell.wc-tile-fade { opacity: 0 !important; }

/* P3/P5 (S35): transient TOP move notifications (word + score). Stack newest
   below; non-blocking; slide in/out from the top. */
.wc-move-toasts {
  position: fixed;
  top: calc(env(safe-area-inset-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 9500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 24px);
  pointer-events: none;
}
/* S66 P5 REDESIGN: translucent purple→pink gradient, rounded-SQUARE shape,
   two lines — line 1 (small): "cakirmehm oynadı:", line 2 (normal):
   "KAR (23)". White text on the translucent gradient reads in BOTH themes
   (the gradient is opaque enough to not depend on the page behind). */
.wc-move-toast {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 9px 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(124, 58, 237, 0.82), rgba(236, 72, 153, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  opacity: 0;
  transform: translateY(-16px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.wc-move-toast--visible { opacity: 1; transform: translateY(0); }
.wc-move-toast--mine { border-color: rgba(255, 255, 255, 0.55); }
.wc-move-toast-who {
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62vw;
}
.wc-move-toast-line2 {
  display: flex;
  align-items: center;
  gap: 6px;
}
.wc-move-toast-word {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.wc-move-toast-pts { color: rgba(255, 255, 255, 0.9); font-variant-numeric: tabular-nums; }
/* P7: tappable move toast (opens that match). Cursor + a chevron cue.
   S45 P6 FIX: the container .wc-move-toasts is pointer-events:none (so it never
   blocks the page beneath it), which means children get NO pointer events unless
   they opt back in. The tappable toast must re-enable pointer-events or every tap
   passes straight through and openAsyncMatch never fires (the dead-tap bug). */
.wc-move-toast--tappable { cursor: pointer; pointer-events: auto; }
.wc-move-toast--tappable:active { transform: translateY(0) scale(0.97); }
.wc-move-toast-go { color: #fff; font-weight: 800; margin-left: 2px; }
@media (prefers-reduced-motion: reduce) {
  .wc-move-toast { transition: opacity 0.2s ease; transform: none; }
  .wc-move-toast--visible { transform: none; }
}

/* ===== S41 P1 — FIRST-RUN LANGUAGE SELECT (page-langselect) ===== */
.langselect-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, #232347 0%, var(--bg) 72%);
}
.langselect-inner {
  width: 100%;
  max-width: 440px;
  text-align: center;
}
.langselect-brand {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 6px;
}
.langselect-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--text);
  margin: 0 0 4px;
}
.langselect-subtitle {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0 0 22px;
}
.langselect-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.langselect-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--surface-raised), var(--surface));
  border: 1px solid rgba(43, 200, 220, 0.3);
  border-radius: 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.15s, box-shadow 0.15s;
}
.langselect-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 6px 18px rgba(43, 200, 220, 0.22); }
.langselect-card:active { transform: scale(0.97); }
.langselect-card--current { border-color: var(--accent); box-shadow: 0 0 0 1px rgba(43, 200, 220, 0.45) inset; }
.langselect-flag { font-size: 1.7rem; }
.langselect-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== S41 P4 — FRIENDS (page-friends) ===== */
.friends-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px;
  padding-top: calc(env(safe-area-inset-top) + 28px);
  min-height: 100vh;
}
.friends-header { text-align: center; margin: 8px 0 18px; }
.friends-header h2 { font-family: var(--font-display); color: var(--text); }
.friends-section { margin-bottom: 18px; }
.friends-section-title {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.friends-code-row { display: flex; align-items: center; gap: 10px; }
.friends-my-code {
  flex: 1;
  font-family: monospace;
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: var(--accent-bright);
  background: var(--surface-sunken);
  border: 1px dashed rgba(43, 200, 220, 0.4);
  border-radius: 10px;
  padding: 10px 14px;
  text-align: center;
}
.friends-copy-btn, .friends-add-btn {
  flex-shrink: 0;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}
.friends-copy-btn:active, .friends-add-btn:active { transform: scale(0.97); }
.friends-add-row { display: flex; gap: 10px; }
.friends-code-input {
  flex: 1;
  min-width: 0;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: monospace;
  font-size: 1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  outline: none;
}
.friends-code-input:focus { border-color: var(--accent); }
.friends-list { display: flex; flex-direction: column; gap: 8px; }
.friends-empty-row {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.88rem;
  padding: 14px;
}
.friends-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.friends-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, #2bc8dc, #3a8c84);
  flex-shrink: 0;
}
.friends-name {
  flex: 1;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friends-row-actions { display: flex; gap: 8px; flex-shrink: 0; }
.friends-accept, .friends-decline, .friends-remove {
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.friends-accept { background: rgba(61, 220, 132, 0.18); color: #3ddc84; }
.friends-decline { background: rgba(255, 82, 82, 0.16); color: #ff6b6b; }
.friends-remove {
  width: 30px; height: 30px; padding: 0; border-radius: 50%;
  background: rgba(255, 82, 82, 0.15); color: #ff7676;
  display: flex; align-items: center; justify-content: center;
}

/* S66 P2 — Engellenenler (blocked users): collapsible section, small font,
   internal scroll (the list can grow). */
.friends-blocked-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 0 0 8px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-dim);
  cursor: pointer;
}
.friends-blocked-caret { transition: transform 0.15s ease; }
.friends-blocked-toggle--open .friends-blocked-caret { transform: rotate(180deg); }
.friends-blocked-list {
  max-height: 200px;
  overflow-y: auto;
  font-size: 0.82rem;
}
.friends-row--blocked { padding: 7px 12px; opacity: 0.9; }
.friends-row--blocked .friends-avatar {
  width: 30px; height: 30px; font-size: 0.85rem;
}
.friends-row--blocked .friends-name { font-size: 0.82rem; }
.friends-unblock {
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  background: rgba(255, 82, 82, 0.14);
  color: #ff7676;
  white-space: nowrap;
}

/* ===== S55 P4 — BACKGROUND MATCH-SEARCH CHIP ===== */
/* Persistent "🔍 Rakip aranıyor…" pill, fixed bottom-left on document.body so
   it survives page navigation. Tapping the text reopens the search overlay;
   ✕ cancels the search. Kept clear of the bottom-CENTER tap-mode ✕/✓ pill. */
.wc-search-chip {
  position: fixed;
  left: 12px;
  bottom: calc(env(safe-area-inset-bottom) + 14px);
  z-index: 8500; /* under the move toasts (9500) + mp-overlay, above page content */
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 4px 6px 4px 10px;
  border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid rgba(43, 200, 220, 0.45);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.wc-search-chip[hidden] { display: none; }
/* S66 P6: while a chat sheet is open the chat is TOP-MOST — the search chip
   overlapped the chat input row. Body class set/cleared by wcChatKbOpen/Close
   (mpgame.js, shared by both sheets), so the chip reappears on chat close. */
body.wc-chat-open .wc-search-chip { display: none; }
.wc-search-chip-txt {
  border: none;
  background: none;
  padding: 2px 4px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  animation: wc-search-pulse 2.2s ease-in-out infinite;
}
.wc-search-chip-x {
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  background: rgba(255, 82, 82, 0.15);
  color: #ff7676;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.wc-search-chip-x:hover { background: rgba(255, 82, 82, 0.3); }
@keyframes wc-search-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}
@media (prefers-reduced-motion: reduce) {
  .wc-search-chip-txt { animation: none; }
}

/* ===== "BU KELİMEYİ ÖNER" SUGGESTION COLLECTOR (S63 P1 · S64 P3, suggest.js) ===== */

/* S64 P3: the suggestion affordance is a CONTENT SWAP inside the existing
   top-right topbar chip (solo auth chip / MP room chip / async deadline).
   The host element's box is size-locked inline by suggest.js, so showing the
   "➕ WORD" button causes ZERO layout shift — the board never moves. */
.wc-suggest-chip-host {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-width: 0;
}
.wc-suggest-chip {
  max-width: 100%;
  padding: 2px 6px;
  background: none;
  border: none;
  color: var(--accent);
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  animation: wc-suggest-chip-in 0.25s ease-out;
}
.wc-suggest-chip:active { opacity: 0.7; }

/* S65 P4: MP/async variant — the suggest label temporarily REPLACES the async
   "Sıra sende"+Pas turn chip / MP room chip content FULL-LENGTH for 3s (no
   width lock, no ellipsis): a refined amber pill in the same fixed topbar
   area, then the original chip content is restored. */
.wc-suggest-chip--turn {
  overflow: visible;
  text-overflow: clip;
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(240, 180, 41, 0.16);
  color: #f0b429;
}
/* While hosting the timed swap, the async turn chip drops its own pill skin so
   the suggest pill isn't drawn inside a second pill. */
.async-turn-chip.wc-suggest-chip-host {
  background: none;
  padding: 0;
}
@keyframes wc-suggest-chip-in {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .wc-suggest-chip { animation: none; }
}

/* S64 P6: "Eski Oyuna Devam" | "Yeni Oyun" choice (reuses the suggest card). */
.wc-resume-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.wc-resume-btns .game-over-btn { width: 100%; }

/* "Sent for review" info modal at game end. Sits ABOVE the game-over modal
   (9000) and below the toasts (9500+). */
.wc-suggest-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 9400;
  opacity: 0;
  transition: opacity 0.25s;
}
.wc-suggest-overlay--visible { opacity: 1; }

.wc-suggest-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px 20px 20px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}
.wc-suggest-card-icon { font-size: 34px; margin-bottom: 8px; }
.wc-suggest-card-text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.45;
}
.wc-suggest-card-words {
  color: var(--accent);
  font-weight: 800;
  font-size: 15px;
  margin: 10px 0 16px;
  overflow-wrap: anywhere;
}

/* ── "Şikayet Et" report sheet (report.js, S68) — reuses the suggest overlay/
   card shell; z 9700 so it layers above the opponent-stats modal (9600). ── */
.wc-report-overlay { z-index: 9700; }
.wc-report-title {
  color: var(--text);
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 6px;
}
.wc-report-quote {
  color: var(--text-2);
  font-style: italic;
  font-size: 13px;
  margin: 2px 0 10px;
  overflow-wrap: anywhere;
}
.wc-report-reasons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 6px 0 16px;
}
.wc-report-reason {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.wc-report-reason--sel {
  border-color: var(--accent);
  background: rgba(43, 200, 220, 0.14);
}
.wc-report-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.wc-report-btn {
  flex: 1;
  border: none;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}
.wc-report-btn--cancel {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-2);
}
.wc-report-btn--send {
  background: linear-gradient(135deg, #ff5fa2, #8e44ad);
  color: #fff;
}
.wc-report-btn--send:disabled { opacity: 0.45; cursor: default; }

/* small muted report action under the opponent-stats modal body (S68 P2) */
.opp-stats-report {
  display: block;
  margin: 10px auto 0;
  background: none;
  border: none;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── Hesabı Sil (S69 — account deletion, bottom of the Profile page). Small,
   muted, destructive-styled: a quiet outlined red button, deliberately less
   prominent than the logout button above it. ─────────────────────────────── */
.profile-danger-zone {
  margin-top: 30px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 95, 110, 0.18);
  text-align: center;
}
.profile-delete-account-btn {
  background: none;
  border: 1px solid rgba(255, 95, 110, 0.4);
  border-radius: 10px;
  padding: 8px 18px;
  color: #ff5f6e;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.85;
}
.profile-delete-account-btn:hover { opacity: 1; background: rgba(255, 95, 110, 0.08); }
.profile-delete-account-btn:disabled { opacity: 0.45; cursor: default; }

/* ---------- Badges page (S74 — ported verbatim from Wor-T-ris Pack Z) ------ */
/* The page scrolls (allowed here — 8 sections). Medallions are one visual
   family: circular glass discs, category emoji + tier value; earned = vivid
   gold, unearned = greyed same emblem (filter, not different art). */
/* S75 P3: the page root `.page` already applies the safe-area top padding —
   the old extra `calc(env(safe-area-inset-top) + 28px)` here DOUBLED it
   (excessive top gap). Same shape as .lb-page: no top/side padding of its own
   (the .page 20px gutter is the horizontal spacing), width fits the page. */
.badges-page {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 28px;
}
.bdg-count {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin: 2px 0 6px;
}
.bdg-section {
  margin-top: 16px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}
.bdg-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 10px;
  opacity: 0.75;
}
.bdg-sub-label {
  font-size: 0.66rem;
  color: var(--text-2);
  opacity: 0.7;
  margin: 8px 0 4px;
}
.bdg-row {
  display: flex;
  flex-wrap: wrap;      /* 10-tier rows wrap instead of shrinking below 44px */
  gap: 8px;
}
.bdg-medal {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 0;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(165deg,
    rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04) 60%);
  color: var(--text);
}
.bdg-medal .bdg-medal-icon {
  font-size: 17px;
  line-height: 1;
  filter: grayscale(1) brightness(0.75);
  opacity: 0.55;
}
.bdg-medal .bdg-medal-t {
  font-size: 0.62rem;
  line-height: 1;
  color: var(--text-2);
  font-weight: 700;
  opacity: 0.8;
}
.bdg-medal--on {
  border-color: rgba(255, 215, 0, 0.65);
  background: radial-gradient(circle at 50% 32%,
    rgba(255, 226, 130, 0.38), rgba(180, 120, 20, 0.22) 70%);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.bdg-medal--on .bdg-medal-icon { filter: none; opacity: 1; }
.bdg-medal--on .bdg-medal-t { color: #b8860b; opacity: 1; }
html[data-theme="dark"] .bdg-medal--on .bdg-medal-t { color: #ffe08a; }
.bdg-medal--tipped { outline: 2px solid rgba(128, 128, 160, 0.55); }
.bdg-medal:active { transform: scale(0.94); }
.bdg-tip {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(20, 20, 40, 0.92);
  color: #eee;
  font-size: 0.85rem;
}
.bdg-tip-name { font-weight: 800; }
.bdg-tip-req { opacity: 0.75; margin-top: 3px; font-size: 0.76rem; }
.bdg-tip-progress { margin-top: 4px; font-size: 0.76rem; }
.bdg-tip-progress--done { color: #4caf50; font-weight: 800; }
.bdg-note {
  margin-top: 18px;
  text-align: center;
  font-size: 0.66rem;
  color: var(--text-2);
  opacity: 0.7;
}

/* Badge count line in the opponent/friend stats modal (S74 P3) — sits under
   the win-rate grid; same quiet weight as the Wor-T-ris original. */
.ag-profile-badges {
  margin-top: 6px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-2);
  opacity: 0.85;
}

/* ===== S76 — WEEKLY CONTEST ("Haftanın Bulmacası") ===== */

/* Menu topbar entry — the pill that replaced the top-right auth chip: the
   label with a tiny live "N kişi çözdü" line stacked beneath it. */
.menu-weekly-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
  max-width: 200px;
}
.menu-weekly-btn:hover { background: rgba(255, 255, 255, 0.18); }
.menu-weekly-label {
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}
.menu-weekly-count {
  font-size: 0.64rem;
  color: var(--text-2);
  white-space: nowrap;
}

/* Contest page — .page root already applies the safe-area top padding
   (same lesson as .badges-page, S75 P3: no own top padding). */
.contest-page {
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 28px;
}

.contest-card {
  margin: 0 16px 18px;
  padding: 18px 16px;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  text-align: center;
}
.contest-week {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-2);
  margin-bottom: 8px;
}
.contest-desc {
  font-size: 0.92rem;
  line-height: 1.45;
  margin-bottom: 10px;
}
.contest-ends,
.contest-count {
  font-size: 0.8rem;
  color: var(--text-2);
  margin-bottom: 6px;
}
.contest-play-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 13px 0;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2bc8dc, #3b82c4);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}
.contest-play-btn:hover { filter: brightness(1.08); }
/* S80 P5: guest gate — the button renders disabled with a sign-in label. */
.contest-play-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}
.contest-guest-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-2);
}

.contest-board { margin: 0 16px; }
.contest-board-title {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 8px;
}
/* S77: "Haftalık | Tüm Zamanlar" board tabs. */
.contest-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.contest-tab {
  flex: 1;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.contest-tab--active {
  border-color: #2bc8dc;
  background: rgba(43, 200, 220, 0.14);
  color: var(--text);
}
.contest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.contest-row--me {
  border-color: #2bc8dc;
  background: rgba(43, 200, 220, 0.12);
}
.contest-row--muted {
  justify-content: center;
  color: var(--text-2);
}
.contest-row-rank { width: 24px; font-weight: 700; color: var(--text-2); }
.contest-row-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contest-row-score { font-weight: 800; font-variant-numeric: tabular-nums; }
.contest-myscore {
  margin-top: 10px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #2bc8dc;
}

/* Weekly line on the solo game-over modal (replaces the local top-10 block). */
.game-over-weekly {
  margin: 12px 0 4px;
  font-size: 0.95rem;
  font-weight: 800;
}
.game-over-weekly-note {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-2);
}

/* ═══ S84 — UI/content batch ═══════════════════════════════════════════════ */

/* P5: mode descriptions under the Karşılıklı FLOATING/STATIC buttons (same
   copy + look as the Yeni Oyun mode cards). */
.mp-mode-desc {
  font-size: 12px;
  color: var(--text-soft);
  line-height: 1.4;
}

/* P7: finished-row result tints — win = green, lose = pink (semi-transparent
   over the row surface; layered over a solid base inside .mygames-swipe so
   the hidden delete action can't bleed through). The ✓/✗ badges are gone. */
.mygames-row--rwin,
.mygames-swipe .mygames-row.mygames-row--rwin {
  background: linear-gradient(135deg, rgba(76, 175, 80, 0.22), rgba(76, 175, 80, 0.10)),
    var(--surface-sunken);
  border-color: rgba(76, 175, 80, 0.35);
}
.mygames-row--rlose,
.mygames-swipe .mygames-row.mygames-row--rlose {
  background: linear-gradient(135deg, rgba(240, 98, 146, 0.22), rgba(240, 98, 146, 0.10)),
    var(--surface-sunken);
  border-color: rgba(240, 98, 146, 0.35);
}

/* P9: weekly-champion trophy mark on the All-Time standings — gold. */
.contest-champ {
  color: #ffc107;
  font-weight: 800;
  font-size: 0.78rem;
  white-space: nowrap;
}

/* P10: week-elapsed progress bar. */
.contest-progress {
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-bottom: 6px;
}
.contest-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #9ff3ff, #2bc8dc 55%, #1a8fd0); /* S99: ocean palette (was teal→violet) */
}

/* P14: in-game input-mode toggle (👆🏽) — lights up while TAP mode is on. */
.game-action-btn--input {
  min-width: 44px;
}

/* S85: clean undo glyph (replaced the ↩️ emoji) — transparent, inherits the
   button's themed text color. */
.wc-undo-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}
.game-action-btn--input-active {
  box-shadow: 0 0 0 2px #2bc8dc inset;
  background: rgba(43, 200, 220, 0.18);
}

/* P15/P16: static info pages (Sürüm Notları · Kelime Öneri Listesi). */
.infopage {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: calc(env(safe-area-inset-bottom) + 24px);
}
.infopage-body {
  padding: 0 16px;
}
.infopage-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.infopage-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.infopage-version {
  font-weight: 800;
  color: var(--accent, #2bc8dc);
}
.infopage-date {
  font-size: 0.76rem;
  color: var(--text-2);
}
.infopage-list {
  margin: 0;
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.infopage-list li {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text);
}
.infopage-words {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 8px;
}
.infopage-note {
  font-size: 0.78rem;
  color: var(--text-2);
  line-height: 1.45;
  margin-bottom: 6px;
}


/* ═══ S88 — ARCADE mode + Oyna play menu ═══════════════════════════════════ */
.play-page, .arcade-page { max-width: 560px; margin: 0 auto; padding: 20px; }

/* ===== S94: ONE back-button offset for EVERY page ==========================
   Audit (S94) found three vertical families for the top-left "← Geri":
   plain list pages at safe-area+28px, topbar pages (profile / leaderboard /
   stats / legal — `.profile-topbar` / `.legal-topbar` added 16px of their own)
   at +44px, and the S76–S88 pages (contest / badges / relnotes / suggestlist /
   play / arcade — inheriting the `.page` 20px base, or a `padding` shorthand
   that wiped the 28px) at +20/+36px. Standard from here: the back button's top
   edge sits at env(safe-area-inset-top) + 28px on every page. Id selectors so
   no later class shorthand can undo it; the topbars carry no top padding of
   their own (their bottom padding stays). Style is `.wc-back-btn` everywhere
   (the game screens' `.game-topbar-btn` is the deliberate in-game exception). */
#page-play, #page-arcade, #page-contest, #page-badges,
#page-relnotes, #page-suggestlist {
  padding-top: calc(env(safe-area-inset-top) + 28px);
}
.profile-topbar, .legal-topbar { padding-top: 0; }
/* Horizontal: the same 20px gutter too (mygames / davetler roots had 16px). */
#page-mygames, #page-davetler { padding-left: 20px; padding-right: 20px; }

.play-cards { display: flex; flex-direction: column; gap: 14px; }
.play-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 22px 18px; border-radius: 18px; cursor: pointer; text-align: center;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-display);
}
.play-card:hover { border-color: #2bc8dc; }
.play-card-icon { font-size: 2.4rem; line-height: 1; }
.play-card-title { font-size: 1.25rem; font-weight: 900; letter-spacing: 0.04em; }
.play-card-desc { font-size: 0.85rem; color: var(--text-dim); }
.play-progress { width: 100%; margin-top: 8px; }
.play-progress-bar { height: 8px; border-radius: 6px; background: rgba(127, 127, 160, 0.25); overflow: hidden; }
.play-progress-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, #9ff3ff, #2bc8dc 55%, #1a8fd0); transition: width 0.4s ease; }
.play-progress-label { margin-top: 6px; font-size: 0.78rem; color: var(--text-dim); font-variant-numeric: tabular-nums; }

.arcade-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.arcade-tab {
  flex: 1; padding: 10px 6px; border-radius: 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-display); font-weight: 800; font-size: 0.95rem;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.arcade-tab-sub { font-size: 0.7rem; font-weight: 600; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.arcade-tab--active { border-color: #2bc8dc; box-shadow: 0 0 0 1px #2bc8dc inset; }
.arcade-tab--locked { opacity: 0.6; }
.arcade-lock-note {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; text-align: center;
  background: rgba(43, 200, 220, 0.1); border: 1px solid rgba(43, 200, 220, 0.35);
  font-size: 0.85rem; color: var(--text);
}
.arcade-stage--locked .arcade-levels { opacity: 0.35; filter: grayscale(1); }
.arcade-block { margin-bottom: 20px; }
.arcade-block-title { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }
.arcade-levels { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 96px)); justify-content: center; }
.arcade-levels--3 { grid-template-columns: repeat(3, minmax(0, 104px)); }
.arcade-levels--4 { grid-template-columns: repeat(4, minmax(0, 100px)); }
.arcade-levels--5 { grid-template-columns: repeat(5, minmax(0, 96px)); }
.arcade-level {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  aspect-ratio: 1 / 1; border-radius: 14px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-family: var(--font-display);
}
.arcade-level:disabled { cursor: default; }
.arcade-level--done { border-color: rgba(120, 236, 255, 0.6); background: linear-gradient(160deg, rgba(120, 236, 255, 0.2), rgba(26, 143, 208, 0.14)); }
.arcade-level-num { font-size: 1.15rem; font-weight: 900; }
.arcade-level-stars { font-size: 0.72rem; letter-spacing: 0.05em; color: var(--text-dim); }
.arcade-level-stars--on { color: #f0b429; }
@media (max-width: 480px) {
  .arcade-levels--5 { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .arcade-level-num { font-size: 1rem; }
  .arcade-level-stars { font-size: 0.62rem; }
}

/* Arcade game-over: stars + target/best lines. */
.game-over-stars { font-size: 2.2rem; letter-spacing: 0.1em; color: #f0b429; margin: 4px 0; text-shadow: 0 0 12px rgba(240, 180, 41, 0.5); }
.game-over-stars--none { color: var(--text-dim); text-shadow: none; }
.game-over-arcade { margin: 10px 0 6px; font-size: 0.92rem; font-weight: 700; display: flex; flex-direction: column; gap: 4px; }
.game-over-arcade-fail { font-size: 0.8rem; font-weight: 500; color: var(--text-2); }

/* ═════════════════════════════════════════════════════════════════════════
   S97 — PREMIUM SURFACE LAYER (Wordinal underwater identity, both themes)
   ONE design language for cards, buttons, tabs, chips, toggles, modals and
   tooltips, appended LAST so it wins over the per-component visuals at
   equal specificity. It only re-skins VISUAL properties (background,
   border, radius, shadow, colour, type) — layout/size rules stay with the
   components. Tokens live here (dark = :root, lagoon = light block below).
   • Surfaces: glass gradient + hairline edge + inset top highlight +
     two-layer soft elevation.
   • Primary action: aqua gradient with depth (dark) / deep-ocean gradient
     with white text (lagoon). Secondary: glass.
   • Tabs: segmented control (sunken track, raised active pill).
   • Tooltips / toasts: dark ocean glass in BOTH themes.
   • LAGOON = DARKER FOREGROUND: tiles + primary buttons are deep ocean
     blue with white text, panels are teal-tinted glass, letter orbs are
     deep teal glass with white letters — the light theme reads as bright
     water with solid objects in it, not pale-on-pale.
   Perf: these are static elements (no per-frame paint); the board cells
   are NOT touched here beyond theme tokens (S92 rules still apply).
   ═════════════════════════════════════════════════════════════════════════ */
:root {
  --pm-radius: 16px;
  --pm-radius-sm: 12px;
  --pm-card: linear-gradient(180deg, rgba(24, 92, 132, 0.5) 0%, rgba(7, 38, 64, 0.78) 100%);
  --pm-tile: linear-gradient(165deg, rgba(36, 122, 165, 0.62) 0%, rgba(9, 48, 80, 0.86) 100%);
  --pm-tile-text: #f2feff;
  --pm-sunk: rgba(1, 14, 28, 0.5);
  --pm-line: rgba(130, 228, 255, 0.2);
  --pm-line-strong: rgba(130, 228, 255, 0.42);
  --pm-hi: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  --pm-elev-1: 0 1px 2px rgba(0, 8, 20, 0.35), 0 6px 18px rgba(0, 8, 20, 0.28);
  --pm-elev-2: 0 2px 6px rgba(0, 8, 20, 0.4), 0 18px 44px rgba(0, 8, 20, 0.5);
  --pm-primary: linear-gradient(180deg, #6ae8f7 0%, #27c3de 46%, #1192bf 100%);
  --pm-primary-text: #032536;
  --pm-primary-edge: rgba(190, 248, 255, 0.7);
  --pm-primary-glow: 0 6px 18px rgba(18, 160, 205, 0.38);
  --pm-ghost: linear-gradient(180deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%);
  --pm-ghost-text: var(--text);
  --pm-accent-text: #7fe9ff;
  --pm-tip-bg: linear-gradient(180deg, rgba(10, 52, 82, 0.97) 0%, rgba(3, 24, 44, 0.97) 100%);
  --pm-tip-line: rgba(130, 228, 255, 0.35);
  --pm-tip-text: #eaf9fc;
  --pm-row: rgba(255, 255, 255, 0.035);
}

/* ── Surfaces: cards & panels ─────────────────────────────────────────── */
.menu-profile-card,
.game-panel,
.settings-list,
.play-card,
.contest-card,
.stats-chart-card,
.profile-stat-card,
.wordlist-loading-card,
.legal-body {
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  border-radius: var(--pm-radius);
  box-shadow: var(--pm-hi), var(--pm-elev-1);
}
.game-panel { border-radius: 14px; }

/* Primary navigation tiles (home grid, versus mode cards, play cards,
   language cards): the most solid objects on screen. */
.menu-card,
.mp-match-card,
.langselect-card {
  background: var(--pm-tile);
  border: 1px solid var(--pm-line-strong);
  border-radius: 20px;
  color: var(--pm-tile-text);
  box-shadow: var(--pm-hi), var(--pm-elev-1);
  transition: transform 0.15s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.menu-card:hover,
.mp-match-card:hover,
.langselect-card:hover,
.play-card:hover {
  border-color: var(--pm-primary-edge);
  box-shadow: var(--pm-hi), var(--pm-elev-2);
}
.menu-card-icon {
  filter: drop-shadow(0 3px 6px rgba(0, 20, 40, 0.35));
}

/* Rows inside lists (settings, leaderboards, games, friends, pool). */
.settings-list { gap: 0; overflow: hidden; }
.settings-item {
  background: transparent;
  border-bottom: 1px solid var(--pm-line);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.settings-list > .settings-item:last-child { border-bottom: none; }
.settings-item:hover { background: var(--pm-row); }
.lb-row,
.contest-row,
.friends-row,
.mp-pool-row,
.game-possible-row,
.game-found-row {
  background: var(--pm-row);
  border-color: var(--pm-line);
}
.game-possible-row { border: 1px solid var(--pm-line); border-radius: 9px; font-family: var(--font-display); font-weight: 700; }
.mygames-row {
  border: 1px solid var(--pm-line);
  border-radius: 14px;
  box-shadow: var(--pm-hi);
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
/* Primary actions */
.game-over-btn--primary,
.langmode-start-btn,
.contest-play-btn,
.mp-overlay-btn--primary,
.auth-page-btn--submit,
.auth-btn--submit,
.profile-save-btn,
.training-overlay-btn,
.wc-report-btn--send,
.friends-add-btn,
.async-claim-btn,
.wc-suggest-card-ok,
.wc-resume-btns .game-over-btn--primary {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border: 1px solid var(--pm-primary-edge);
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-shadow: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), var(--pm-primary-glow);
}
.game-over-btn--primary:hover,
.langmode-start-btn:hover,
.contest-play-btn:hover,
.mp-overlay-btn--primary:hover {
  filter: brightness(1.06);
}

/* Secondary / ghost actions */
.game-over-btn:not(.game-over-btn--primary),
.mp-overlay-btn:not(.mp-overlay-btn--primary),
.game-action-btn,
.wc-report-btn--cancel,
.async-pass-btn,
.friends-copy-btn,
.profile-avatar-change-btn,
.wc-tapbar-btn {
  background: var(--pm-ghost);
  color: var(--pm-ghost-text);
  border: 1px solid var(--pm-line-strong);
  border-radius: 14px;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: var(--pm-hi), 0 2px 8px rgba(0, 10, 25, 0.12);
}
.game-action-btn { border-radius: 13px; }
.game-action-btn:disabled { opacity: 0.45; box-shadow: none; }
.game-action-btn--input-active {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border-color: var(--pm-primary-edge);
}

/* Round icon buttons (menu topbar ⚙️ 🏆 🏅, in-game topbar) */
.menu-settings-btn,
.game-topbar-btn,
.menu-weekly-btn,
.menu-auth-chip,
.game-auth-chip {
  background: var(--pm-ghost);
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-hi), 0 2px 8px rgba(0, 10, 25, 0.16);
  color: var(--pm-ghost-text);
}
.menu-weekly-btn { font-family: var(--font-display); font-weight: 800; }

/* Profile-card shortcut buttons (Arkadaşlar / Davetler / İstatistiklerim) */
.menu-profile-btn {
  background: var(--pm-sunk);
  border: 1px solid var(--pm-line);
  border-radius: 13px;
  font-family: var(--font-display);
  box-shadow: var(--pm-hi);
}
.menu-profile-btn:hover { background: var(--pm-row); border-color: var(--pm-line-strong); }

/* Back button: a quiet chevron pill instead of bare text */
.wc-back-btn {
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--pm-ghost);
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-hi);
  color: var(--pm-ghost-text);
  font-family: var(--font-display);
  font-weight: 800;
}

/* ── Tabs: segmented controls ─────────────────────────────────────────── */
.profile-tabs,
.lb-mode-tabs,
.mygames-tabs,
.contest-tabs,
.arcade-tabs {
  padding: 4px;
  gap: 4px;
  background: var(--pm-sunk);
  border: 1px solid var(--pm-line);
  border-radius: 14px;
}
.profile-tab,
.mygames-tab,
.contest-tab,
.arcade-tab {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text-dim);
  font-family: var(--font-display);
  font-weight: 800;
  box-shadow: none;
}
.profile-tab--active,
.mygames-tab--active,
.contest-tab--active,
.arcade-tab--active {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border-color: var(--pm-primary-edge);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 3px 10px rgba(0, 20, 40, 0.25);
}
.profile-tab:hover:not(.profile-tab--active) { background: var(--pm-row); }
.arcade-tab--active .arcade-tab-sub { color: inherit; opacity: 0.8; }

/* Chips */
.async-turn-chip,
.mp-room-chip,
.mygames-lang-chip,
.wc-search-chip {
  border: 1px solid var(--pm-line-strong);
  box-shadow: var(--pm-hi), 0 2px 8px rgba(0, 10, 25, 0.18);
  font-family: var(--font-display);
  font-weight: 800;
}
.mygames-lang-chip--active {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border-color: var(--pm-primary-edge);
}

/* ── Toggle + select ──────────────────────────────────────────────────── */
.settings-toggle-slider {
  background: var(--pm-sunk);
  border: 1px solid var(--pm-line-strong);
  box-shadow: inset 0 1px 3px rgba(0, 10, 25, 0.35);
}
.settings-toggle-slider::before {
  bottom: 2px;
  left: 2px;
  background: linear-gradient(180deg, #ffffff, #dbe9ee);
  box-shadow: 0 1px 3px rgba(0, 10, 25, 0.4);
}
.settings-toggle input:checked + .settings-toggle-slider {
  background: var(--pm-primary);
  border-color: var(--pm-primary-edge);
}
.settings-select {
  background: var(--pm-ghost);
  color: var(--pm-ghost-text);
  border: 1px solid var(--pm-line-strong);
  border-radius: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  box-shadow: var(--pm-hi);
}
.settings-select option { background: var(--surface); color: var(--text); }

/* ── Modals & sheets ──────────────────────────────────────────────────── */
.game-over-modal,
.wc-suggest-card,
.training-overlay-card,
.mp-overlay-card,
.found-modal-card,
.auth-modal-card,
.opp-stats-card,
.mp-rematch-card {
  background: var(--pm-card), var(--surface);
  border: 1px solid var(--pm-line-strong);
  border-radius: 22px;
  box-shadow: var(--pm-hi), var(--pm-elev-2);
}

/* ── Tooltips & toasts: dark ocean glass in BOTH themes ───────────────── */
.bdg-tip,
.wc-toast {
  background: var(--pm-tip-bg);
  color: var(--pm-tip-text);
  border: 1px solid var(--pm-tip-line);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 28px rgba(0, 10, 25, 0.4);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.wc-toast { padding: 12px 20px; font-size: 15px; }
.bdg-tip-progress--done { color: #5ee6a0; }
/* Move / action toasts: the purple→pink gradient (S66) becomes ocean glass
   with an aqua edge; no backdrop-filter (it re-blurred the page under the
   toast every frame of its slide-in). */
.wc-move-toast {
  background: var(--pm-tip-bg);
  border: 1px solid var(--pm-tip-line);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 28px rgba(0, 10, 25, 0.4);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font-family: var(--font-display);
}
.wc-move-toast-pts,
.wc-move-toast-go { color: #7fe9ff; }

/* Accent text that sat on the old teal (labels, counters) */
.game-panel-title,
.menu-profile-btn-label { letter-spacing: 0.02em; }

/* Mode pickers (Yeni Oyun / Karşılıklı): glass cards; the active one is
   lifted with the primary edge + glow. */
.langmode-mode,
.mp-mode {
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  border-radius: 18px;
  box-shadow: var(--pm-hi), var(--pm-elev-1);
}
.langmode-mode--active,
.mp-mode--active {
  border-color: var(--pm-primary-edge);
  box-shadow: var(--pm-hi), 0 0 0 2px rgba(43, 200, 220, 0.55), var(--pm-elev-2);
}
/* Score bars (solo / MP / async mobile) */
.game-mobile-bar,
.mpgame-mobile-bar {
  background: var(--pm-card);
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-hi), var(--pm-elev-1);
}
/* Leaderboard language pills */
.lb-lang-pill {
  background: var(--pm-ghost);
  border: 1px solid var(--pm-line);
  color: var(--pm-ghost-text);
  font-family: var(--font-display);
  font-weight: 800;
}
.lb-lang-pill--active {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border-color: var(--pm-primary-edge);
}

/* S97 follow-up — LAGOON earned badges: the translucent gold vanished on the
   light water. Earned = a SOLID warm amber→orange coin (the complementary
   colour of the aqua background) with a dark rim, white tier label and a
   soft glow; locked medals stay pale grey, so earned vs locked is obvious. */

/* ── S99 DAILY CONTEST ("Günün Bulmacası") ───────────────────────────────── */
/* Menu (S100): the two contests are ROUND buttons, right-aligned — ☀️ daily
   and the localized weekly initial ("H"). They reuse .menu-settings-btn
   (same size/glass as ⚙️ 🏅); a corner chip shows how many played (> 0). */
.menu-contests {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.menu-contest-btn {
  position: relative;
  overflow: visible;
}
.menu-contest-letter {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1;
  background: linear-gradient(180deg, #bff8ff 0%, #2bc8dc 60%, #1a8fd0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: #2bc8dc;
}
.menu-contest-chip {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border: 1.5px solid var(--bg);
  box-shadow: 0 2px 6px rgba(0, 10, 25, 0.35);
  font-family: var(--font-display);
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  -webkit-text-fill-color: currentColor;
  pointer-events: none;
}
.menu-contest-chip[hidden] { display: none; }

/* S100 — DARK theme profile-card shortcuts (Arkadaşlar / Davetler /
   İstatistiklerim): were a sunken near-black fill. Now RAISED glass —
   translucent light-from-above gradient, hairline light edge, top sheen and
   a soft drop so they read as convex buttons sitting ON the card. Light
   theme keeps its own tinted style. */
html[data-theme="dark"] .menu-profile-btn {
  background: linear-gradient(180deg, rgba(160, 230, 255, 0.2) 0%, rgba(120, 210, 245, 0.08) 55%, rgba(80, 180, 230, 0.05) 100%);
  border: 1px solid rgba(170, 236, 255, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(0, 20, 40, 0.25),
    0 4px 12px rgba(0, 10, 25, 0.35);
}
html[data-theme="dark"] .menu-profile-btn:hover {
  background: linear-gradient(180deg, rgba(170, 236, 255, 0.28) 0%, rgba(120, 210, 245, 0.12) 55%, rgba(80, 180, 230, 0.07) 100%);
  border-color: rgba(190, 245, 255, 0.5);
}
html[data-theme="dark"] .menu-profile-btn:active {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 4px rgba(0, 10, 25, 0.3);
}

/* Daily page (reuses the contest-page skeleton/classes). */
.contest-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.15rem, 5.4vw, 1.5rem);
  white-space: nowrap;
  color: var(--pm-accent-text);
  margin-bottom: 2px;
}
.daily-oneshot {
  font-weight: 800;
  color: #f5b544;
}
.daily-played {
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: 14px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  background: var(--pm-sunk);
  border: 1px solid var(--pm-line-strong);
  box-shadow: var(--pm-hi);
}
.daily-champ {
  margin-top: 10px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 800;
  color: #f0b429;
}
.daily-board-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--text-dim);
  margin: 4px 2px 8px;
}
/* A player whose attempt is still running. */
.daily-live {
  color: #5ee6a0;
  font-size: 0.6rem;
  vertical-align: middle;
  animation: daily-live-pulse 1.6s ease-in-out infinite;
}
@keyframes daily-live-pulse { 50% { opacity: 0.25; } }
@media (prefers-reduced-motion: reduce) { .daily-live { animation: none; } }

/* S101 — the WATER orb sprite is kept for the smaller Arcade boards only;
   every 7×7 board (solo / MP / async / training / contests) uses the hollow
   glass sprite set as the :root default. game/mpgame/asyncgame stamp
   data-n on the grid. */
.game-grid:is([data-n="3"], [data-n="4"], [data-n="5"], [data-n="6"]) {
  --orb-sprite: url("assets/orb/glass-dark.png");
}

/* S101 — MP/async score bar: the S97 card skin gave the OUTER bar a
   background but square corners hugging the rounded score chips. Give it
   a small inset and a radius concentric with the chips (12px + 5px). */
@media (max-width: 767px) {
  .mpgame-mobile-bar {
    padding: 5px;
    gap: 6px;
    border-radius: 17px;
  }
}

/* S101 — PREMIUM ARCADE RESULT ("Seviye Tamamlandı"). Centred star
   medallions (middle one larger, earned ones pop in sequence), level chip,
   gradient title (authored case — CSS uppercase broke Turkish İ), big score,
   and wide equal-width buttons. */
.game-over-modal--arcade {
  position: relative;
  overflow: hidden;
  text-align: center;
  padding: 22px 22px 20px;
  border-radius: 24px;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(43, 200, 220, 0.18) 0%, rgba(43, 200, 220, 0) 60%),
    linear-gradient(180deg, #0d2f4f 0%, #071c33 100%);
  border: 1px solid rgba(150, 230, 250, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 24px 60px rgba(0, 6, 18, 0.6);
}
.game-over-modal--won::before {
  /* soft golden halo behind the stars */
  content: "";
  position: absolute;
  left: 50%;
  top: 70px;
  width: 260px;
  height: 120px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 196, 64, 0.28), rgba(255, 196, 64, 0));
  pointer-events: none;
}
.go-arc-level {
  display: inline-block;
  margin: 0 auto 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(43, 200, 220, 0.12);
  border: 1px solid rgba(43, 200, 220, 0.3);
  color: #9ff1ff;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.game-over-modal--arcade .game-over-title {
  text-transform: none;
  letter-spacing: 0.01em;
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 900;
  background: linear-gradient(180deg, #ffffff 0%, #bff8ff 55%, #5ad8ea 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.go-stars {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  margin: 14px 0 6px;
  line-height: 1;
}
.go-star {
  font-size: 2.6rem;
  color: rgba(160, 200, 230, 0.22);
  -webkit-text-stroke: 1px rgba(170, 220, 245, 0.35);
}
.go-star--mid { font-size: 3.4rem; transform: translateY(-6px); }
.go-star--on {
  color: #ffc940;
  -webkit-text-stroke: 1px #ffe9a8;
  text-shadow: 0 0 14px rgba(255, 190, 50, 0.65), 0 3px 0 #b3740a;
  animation: go-star-pop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.4) both;
  animation-delay: calc(0.25s + var(--i) * 0.22s);
}
.go-star--mid.go-star--on { animation-name: go-star-pop-mid; }
@keyframes go-star-pop {
  0% { opacity: 0; transform: scale(0.2) rotate(-25deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes go-star-pop-mid {
  0% { opacity: 0; transform: translateY(-6px) scale(0.2) rotate(-25deg); }
  100% { opacity: 1; transform: translateY(-6px) scale(1) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .go-star--on { animation: none; }
}
.game-over-modal--arcade .game-over-score {
  margin-top: 6px;
  font-family: var(--font-display);
  font-size: 3rem;
}
.game-over-modal--arcade .game-over-meta { margin-bottom: 18px; }
.game-over-modal--arcade .game-over-arcade { margin: -6px 0 16px; }
.game-over-modal--arcade .game-over-actions { gap: 10px; }
.game-over-modal--arcade .game-over-btn {
  flex: 1 1 0;
  min-height: 50px;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
}

/* ── S102: SEA-MINE ARCADE ─────────────────────────────────────────────────
   Placeholder mine art (mineVisuals.js builds the SVG; final renders replace
   it there). Everything here is either static or animates opacity/transform
   only (S92 rules); the LOW effects level drops the pulses + glows. */
.game-center--arcade { flex-direction: column; gap: 8px; }
.game-center--arcade .game-grid { max-width: min(560px, calc(100vh - 280px)); }
.arc-hud {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; max-width: min(560px, calc(100vh - 280px)); box-sizing: border-box;
  padding: 6px 10px; border-radius: 14px;
  background: var(--pm-card); border: 1px solid var(--pm-line);
}
.arc-hud-mines { display: flex; align-items: center; gap: 6px; min-width: 0; }
.arc-hud-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.arc-hud-label { font-size: 0.74rem; color: var(--text-dim); }
.arc-mine-chip {
  position: relative; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font: 800 0.8rem var(--font-display); font-variant-numeric: tabular-nums;
  background: #22364a; color: #d9e6f2; border: 1.5px solid #5d6f82;
}
.arc-mine-chip--next { background: #ffc94a; color: #3a2200; border-color: #ff4d4d; box-shadow: 0 0 8px rgba(255, 77, 77, 0.7); }
.arc-mine-chip--done { opacity: 0.45; }
.arc-mine-chip--done::after {
  content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 2px;
  background: #ff6b5a; transform: rotate(-40deg);
}
.arc-hud-stat { display: flex; align-items: baseline; gap: 6px; font-size: 0.74rem; color: var(--text-dim); white-space: nowrap; }
.arc-hud-stat b { font: 900 1rem var(--font-display); color: var(--text); font-variant-numeric: tabular-nums; }
.arc-hud-finish {
  padding: 6px 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--pm-primary); color: #04283c; font: 800 0.85rem var(--font-display);
}
.arc-hud-finish[hidden] { display: none; }

/* Mine orb: no glass sprite / letter styling; the SVG fills the cell. */
.game-cell.mine { background: radial-gradient(circle at 50% 55%, rgba(4, 20, 36, 0.55) 0%, rgba(4, 20, 36, 0) 68%); box-shadow: none; cursor: default; }
.game-cell.mine::before { display: none; }
.game-cell.mine:hover { transform: none; }
.mine-svg { width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.mine-horns line { stroke: #6d8296; stroke-width: 5; stroke-linecap: round; }
.mine-horns circle { fill: #9fb1c3; }
.mine-horns--hot { opacity: 0; }
.mine-horns--hot line { stroke: #ff4d4d; }
.mine-horns--hot circle { fill: #ff7a66; }
.game-cell.mine--next .mine-horns--hot { animation: mine-hot 0.8s ease-in-out infinite alternate; }
.game-cell.mine--next { box-shadow: 0 0 0.45em rgba(255, 77, 77, 0.55); }
@keyframes mine-hot { from { opacity: 0.1; } to { opacity: 1; } }
.mine-body { fill: url(#wcMineBody); stroke: #0b1622; stroke-width: 1.5; }
.mine-gloss { fill: rgba(255, 255, 255, 0.32); }
.mine-badge { fill: url(#wcMineBadge); stroke: rgba(255, 236, 170, 0.95); stroke-width: 2; }
.mine-num { font: 900 21px var(--font-display); fill: #3a2200; text-anchor: middle; dominant-baseline: central; }
.mine-chain path { stroke: #a9bccd; stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mine-chain .mine-anchor { stroke: #cfdbe6; stroke-width: 3.5; }
.game-cell.mine--locked .mine-badge { fill: #9fb1c3; stroke: #d9e6f2; }
.game-cell.mine--blast .mine-svg { animation: mine-pop 0.3s ease-out forwards; }
@keyframes mine-pop { to { transform: scale(1.6); opacity: 0; } }
.game-cell.arc-blasted { animation: arc-blasted 0.3s ease-in forwards; }
@keyframes arc-blasted { to { transform: scale(0.5); opacity: 0; } }
.mine-shock {
  position: fixed; z-index: 9000; pointer-events: none; border-radius: 50%;
  transform: translate(-50%, -50%) scale(0.15);
  border: 3px solid rgba(190, 244, 255, 0.95);
  box-shadow: 0 0 18px rgba(120, 220, 255, 0.6), inset 0 0 18px rgba(120, 220, 255, 0.5);
  animation: mine-shock 0.6s ease-out forwards;
}
@keyframes mine-shock { to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
html[data-fx="low"] .game-cell.mine--next .mine-horns--hot { animation: none; opacity: 1; }
html[data-fx="low"] .game-cell.mine--next,
html[data-fx="low"] .mine-shock { box-shadow: none; }
@media (prefers-reduced-motion: reduce) {
  .game-cell.mine--next .mine-horns--hot { animation: none; opacity: 1; }
  .mine-shock, .game-cell.mine--blast .mine-svg, .game-cell.arc-blasted { animation-duration: 0.01s; }
}
.arc-tip-step { font-size: 0.75rem; color: var(--text-dim); margin: -4px 0 6px; font-variant-numeric: tabular-nums; }
.arc-tip-card .wc-suggest-card-text { line-height: 1.45; }

/* ── S103: BIG mine blast (mineVisuals.js fireball / quake) ─────────────── */
.mine-fire {
  position: fixed; z-index: 9001; pointer-events: none;
  width: var(--s); height: var(--s); transform: translate(-50%, -50%);
}
.mine-fire > i { position: absolute; left: 50%; top: 50%; display: block; border-radius: 50%; }
.mine-flash {
  width: 70%; height: 70%; margin: -35% 0 0 -35%;
  background: radial-gradient(circle, #ffffff 0%, #fff7c2 35%, rgba(255, 220, 120, 0) 70%);
  animation: mine-flash 0.28s ease-out forwards;
}
@keyframes mine-flash { 0% { transform: scale(0.3); opacity: 1; } 100% { transform: scale(1.5); opacity: 0; } }
.mine-ball {
  width: 100%; height: 100%; margin: -50% 0 0 -50%;
  background: radial-gradient(circle, #fff3b0 0%, #ffc23d 22%, #ff7a1a 45%, rgba(214, 48, 20, 0.85) 62%, rgba(120, 20, 10, 0) 74%);
  animation: mine-ball 0.75s cubic-bezier(0.2, 0.8, 0.3, 1) forwards;
}
@keyframes mine-ball {
  0% { transform: scale(0.15); opacity: 1; }
  45% { transform: scale(1); opacity: 0.95; }
  100% { transform: scale(1.25); opacity: 0; }
}
.mine-flame {
  width: calc(16% * var(--w)); height: 46%; margin: -46% 0 0 calc(-8% * var(--w));
  transform-origin: 50% 100%; /* base at the blast centre → tongues lick OUTWARD */
  border-radius: 50% 50% 45% 45% / 65% 65% 35% 35%;
  background: radial-gradient(ellipse at 50% 85%, #fff1a8 0%, #ffb02e 30%, #ff5a1f 58%, rgba(200, 30, 10, 0) 78%);
  opacity: 0;
  transform: rotate(var(--a)) translateY(0) scale(0.4);
  animation: mine-flame 0.7s ease-out var(--t) forwards;
}
@keyframes mine-flame {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(0.6, 0.3); }
  60% { opacity: 0.95; }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(-45% * var(--d))) scale(1, calc(1.1 + 0.5 * var(--d))); }
}
.mine-spark {
  width: 6px; height: 6px; margin: -3px 0 0 -3px;
  background: #ffe28a; box-shadow: 0 0 6px #ffb02e;
  transform: rotate(var(--a)) translateY(0);
  animation: mine-spark 0.8s ease-out forwards;
}
@keyframes mine-spark {
  0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateY(calc(var(--s) * -0.85 * var(--d))) scale(0.3); }
}
.mine-smoke {
  width: 90%; height: 90%; margin: -45% 0 0 -45%;
  background: radial-gradient(circle, rgba(70, 80, 92, 0.7) 0%, rgba(40, 48, 58, 0.45) 45%, rgba(30, 36, 44, 0) 70%);
  opacity: 0;
  animation: mine-smoke 1.2s ease-out 0.25s forwards;
}
@keyframes mine-smoke {
  0% { opacity: 0; transform: translateY(0) scale(0.5); }
  30% { opacity: 0.85; }
  100% { opacity: 0; transform: translateY(-60%) scale(1.5); }
}
.game-grid.mine-quake { animation: mine-quake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both; }
@keyframes mine-quake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(4px, -2px); }
  30%, 50%, 70% { transform: translate(-6px, 2px); }
  40%, 60% { transform: translate(6px, -1px); }
}
html[data-fx="low"] .mine-flame,
html[data-fx="low"] .mine-spark,
html[data-fx="low"] .mine-smoke { display: none; }
@media (prefers-reduced-motion: reduce) {
  .mine-flame, .mine-spark, .mine-smoke { display: none; }
  .game-grid.mine-quake { animation: none; }
}

/* ── S103: Arcade page bottom gap. The S88 `.arcade-page { padding: 20px }`
   shorthand (later in the sheet) wiped the S85 safe-area bottom reassertion,
   so on a Redmi gesture bar the last tile row sat under the system bar. */
.play-page, .arcade-page { padding-bottom: calc(env(safe-area-inset-bottom) + 72px); }

/* ── S103: PREMIUM CHAT (live MP + async — shared .mp-chat-* classes) ──────
   The S97 premium layer skipped the chat sheet. Same language as the rest:
   ocean-glass panel, ghost back pill, glass bubbles (mine = aqua primary,
   theirs = glass card), sunken input, primary send + FAB. Visual only. */
.mp-chat-sheet-panel {
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(43, 200, 220, 0.14) 0%, rgba(43, 200, 220, 0) 60%),
    linear-gradient(180deg, #0a3552 0%, #052338 55%, #021526 100%);
  border-top: 1px solid var(--pm-line);
  box-shadow: var(--pm-elev-2);
}
.mp-chat-sheet-head {
  padding: 10px 14px 12px;
  border-bottom: 1px solid var(--pm-line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0));
}
.mp-chat-sheet-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--pm-accent-text);
  letter-spacing: 0.01em;
}
.mp-chat-back {
  height: auto;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: var(--pm-ghost);
  border: 1px solid var(--pm-line);
  box-shadow: var(--pm-hi);
  color: var(--pm-ghost-text);
  font-family: var(--font-display);
  font-weight: 800;
}
.mp-chat-back:hover { background: var(--pm-row); border-color: var(--pm-line-strong); }
.mp-chat-addfriend,
.mp-chat-block {
  border-radius: 999px;
  padding: 6px 12px;
  font-family: var(--font-display);
  box-shadow: var(--pm-hi);
}
.mp-chat-body { padding: 14px 12px; gap: 8px; scrollbar-color: rgba(130, 228, 255, 0.25) transparent; }
.mp-chat-body::-webkit-scrollbar-thumb { background: rgba(130, 228, 255, 0.25); }
.mp-chat-bubble {
  padding: 8px 13px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.42;
  box-shadow: var(--pm-hi), 0 2px 8px rgba(0, 8, 20, 0.3);
}
.mp-chat-msg--mine .mp-chat-bubble {
  background: linear-gradient(180deg, #2fc9e0 0%, #1597c2 100%);
  color: #03263a;
  font-weight: 600;
  border: 1px solid var(--pm-primary-edge);
  border-bottom-right-radius: 5px;
}
.mp-chat-msg--theirs .mp-chat-bubble {
  background: var(--pm-tile);
  color: var(--pm-tile-text);
  border: 1px solid var(--pm-line);
  border-bottom-left-radius: 5px;
}
.mp-chat-sender { color: var(--pm-accent-text); font-family: var(--font-display); font-weight: 800; }
.mp-chat-msg--blocked .mp-chat-bubble { background: #4a5562; color: #c3ccd6; border-color: transparent; }
.mp-chat-footer {
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--pm-line);
  background: rgba(1, 14, 28, 0.55);
}
.mp-chat-sheet-panel .mp-chat-footer { padding-bottom: 10px; } /* the panel already pads the safe area */
.mp-chat-input {
  background: var(--pm-sunk);
  border: 1px solid var(--pm-line);
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 0.92rem;
  color: var(--pm-tile-text);
  box-shadow: inset 0 2px 4px rgba(0, 8, 20, 0.45);
}
.mp-chat-input:focus { border-color: var(--pm-line-strong); box-shadow: inset 0 2px 4px rgba(0, 8, 20, 0.45), 0 0 0 3px rgba(43, 200, 220, 0.18); }
.mp-chat-send {
  background: var(--pm-primary);
  color: var(--pm-primary-text);
  border: 1px solid var(--pm-primary-edge);
  border-radius: 999px;
  padding: 0 18px;
  font-family: var(--font-display);
  font-weight: 900;
  box-shadow: var(--pm-hi), var(--pm-primary-glow);
}
.mp-chat-send:hover { background: var(--pm-primary); filter: brightness(1.06); }
.mp-chat-toggle {
  background: var(--pm-primary);
  border: 1px solid var(--pm-primary-edge);
  box-shadow: var(--pm-hi), var(--pm-primary-glow), 0 4px 14px rgba(0, 8, 20, 0.45);
}
.mp-chat-toggle:hover { background: var(--pm-primary); }
.mp-chat-badge { background: linear-gradient(180deg, #ff6b81, #e5304d); box-shadow: 0 0 0 2px #04253c; }

/* ═══ S104 — WIDE SCREENS (web desktop + iPad) ═══════════════════════════
   Phones (< 768px) are untouched. The app was designed phone-first, so on a
   desktop / iPad every page sat in a 440–560px column in the middle of an
   empty screen. Rules:
   · list pages: ~88% of an iPad, ≥ HALF of a desktop (52vw, 720–980px);
   · the game screen: a bigger board, and the page is only as wide as
     board + sidebars, so the topbar / actions bar stay with the content
     instead of drifting to the screen corners. */
@media (min-width: 768px) {
  :root { --wc-page-w: min(92vw, 720px); }
  .menu-page, .settings-screen, .langmode-page, .mp-page, .mygames-page,
  .friends-page, .badges-page, .contest-page, .infopage, .play-page,
  .arcade-page, .profile-page, .lb-page, .langselect-inner, .legal-page {
    max-width: var(--wc-page-w);
    width: 100%;
  }
  .arcade-levels--50 { grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
  .play-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

}
@media (min-width: 1100px) {
  :root { --wc-page-w: clamp(720px, 52vw, 980px); }
  html { font-size: 17px; }
}
/* S107 HOME: on wide screens the 2×2 action tiles no longer stretch to fill
   the viewport height (that is the PHONE layout — flex:1 + 1fr rows); they
   get a fixed, comfortable height instead. */
@media (min-width: 768px) {
  .menu-cards.menu-tiles { flex: 0 0 auto; grid-auto-rows: 150px; gap: 14px; margin-top: 4px; }
  .menu-tiles .menu-card { font-size: 1.08rem; }
  .menu-tiles .menu-card-icon { font-size: 2rem; }
}

/* ── GAME SCREEN ──────────────────────────────────────────────────────────
   S107: TABLET = 768–1023px OR any width ≥768 held in PORTRAIT (an iPad Pro
   portrait is 1024px wide — it used to get the desktop three-column grid
   and a ~370px board squeezed between the sidebars). DESKTOP = ≥1024px
   LANDSCAPE. Phones (< 768px) match neither. */
@media (min-width: 768px) and (max-width: 1023px), (min-width: 768px) and (orientation: portrait) {
  .game-layout { grid-template-columns: 1fr; flex: 0 0 auto; align-content: start; gap: 16px; }
  .game-actions-bar { justify-content: center; gap: 14px; }
  /* solo: the left sidebar is ONE row (badge · score · drawn word) */
  #page-game .game-side--left { display: grid; grid-template-columns: auto 1fr 1.4fr; align-items: stretch; }
  #page-game .game-side--left .game-badge { display: flex; align-items: center; justify-content: center; }
  /* MP/async: the 4 left panels as a 2×2 grid */
  #page-mpgame .game-side--left, #page-asyncgame .game-side--left { display: grid; grid-template-columns: 1fr 1fr; }
  #page-mpgame .game-side--left .game-badge, #page-asyncgame .game-side--left .game-badge { display: flex; align-items: center; justify-content: center; }
  /* the board takes the screen: width- AND height-bounded */
  #page-game .game-grid { max-width: min(900px, calc(100vw - 48px), calc(100vh - 430px)); }
  .game-center--arcade .game-grid,
  .game-center--arcade .arc-hud { max-width: min(900px, calc(100vw - 48px), calc(100vh - 480px)); }
  #page-mpgame .game-grid,
  #page-asyncgame .game-grid { max-width: min(900px, calc(100vw - 48px), max(460px, calc(100vh - 560px))); }
  .game-side .game-panel-title { font-size: 12px; }
  .game-side .game-score { font-size: 1.9rem; }
  .game-side .game-badge { font-size: 14px; }
}
@media (min-width: 1024px) and (orientation: landscape) {
  :root { --wc-board: min(820px, calc(100vh - 190px)); }
  .game-page { max-width: calc(var(--wc-board) + 680px); }
  .game-layout { grid-template-columns: 280px minmax(0, 1fr) 280px; gap: 28px; }
  .game-grid { max-width: var(--wc-board); }
  .game-center--arcade .game-grid,
  .game-center--arcade .arc-hud { max-width: calc(var(--wc-board) - 52px); }
  .game-actions-bar { justify-content: center; gap: 14px; }
  /* side panels were phone-sized (11px labels) next to a 700px board */
  .game-side .game-panel { padding: 16px 18px; }
  .game-side .game-panel-title { font-size: 12.5px; }
  .game-side .game-score { font-size: 2.3rem; }
  .game-side .game-badge { font-size: 14px; padding: 12px 14px; }
  .game-side .game-current-word { min-height: 40px; }
  .game-side .game-possible-row { font-size: 14px; padding: 8px 12px; }
  .game-side .game-letter-chip { font-size: 1.1rem; }
}


/* ═══ S105 — RISING BUBBLES ON EVERY SCREEN ════════════════════════════════
   One FIXED layer behind all pages (z -1: above body::before's depth
   gradient, below every page) + its own set inside the opaque splash.
   Replaced the home-only .menu-sky. transform/opacity only (compositor);
   hidden on the LOW effects level, frozen under reduced motion. */
.wc-ocean-bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.wc-ocean-bubbles--splash { position: absolute; z-index: 0; }
.splash-screen > :not(.wc-ocean-bubbles) { position: relative; z-index: 1; }
.wc-bubble {
  position: absolute;
  bottom: -30px;
  border-radius: 50%;
  border: 1px solid rgba(200, 248, 255, 0.5);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.75) 0 12%, rgba(160, 235, 255, 0.12) 40%, rgba(160, 235, 255, 0.04) 70%);
  opacity: 0;
  animation: wc-bubble-rise linear infinite;
  will-change: transform, opacity;
}
.wc-bubble--0  { left: 4%;  width: 10px; height: 10px; animation-duration: 17s; }
.wc-bubble--1  { left: 12%; width: 6px;  height: 6px;  animation-duration: 13s; animation-delay: -5s; }
.wc-bubble--2  { left: 21%; width: 14px; height: 14px; animation-duration: 22s; animation-delay: -12s; }
.wc-bubble--3  { left: 30%; width: 7px;  height: 7px;  animation-duration: 15s; animation-delay: -7s; }
.wc-bubble--4  { left: 38%; width: 5px;  height: 5px;  animation-duration: 12s; animation-delay: -2s; }
.wc-bubble--5  { left: 47%; width: 11px; height: 11px; animation-duration: 19s; animation-delay: -15s; }
.wc-bubble--6  { left: 55%; width: 6px;  height: 6px;  animation-duration: 14s; animation-delay: -9s; }
.wc-bubble--7  { left: 63%; width: 16px; height: 16px; animation-duration: 24s; animation-delay: -4s; }
.wc-bubble--8  { left: 71%; width: 8px;  height: 8px;  animation-duration: 16s; animation-delay: -11s; }
.wc-bubble--9  { left: 79%; width: 5px;  height: 5px;  animation-duration: 12s; animation-delay: -6s; }
.wc-bubble--10 { left: 86%; width: 12px; height: 12px; animation-duration: 20s; animation-delay: -17s; }
.wc-bubble--11 { left: 93%; width: 7px;  height: 7px;  animation-duration: 15s; animation-delay: -1s; }
.wc-bubble--12 { left: 26%; width: 9px;  height: 9px;  animation-duration: 18s; animation-delay: -14s; }
.wc-bubble--13 { left: 67%; width: 4px;  height: 4px;  animation-duration: 11s; animation-delay: -8s; }
/* the splash is short (≈2.5 s): faster, already mid-flight when it shows */
.wc-ocean-bubbles--splash .wc-bubble { animation-duration: 6s; }
.wc-ocean-bubbles--splash .wc-bubble:nth-child(2n) { animation-duration: 4.5s; }
@keyframes wc-bubble-rise {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  8%   { opacity: 0.85; }
  50%  { transform: translate3d(8px, -55vh, 0); }
  88%  { opacity: 0.6; }
  100% { transform: translate3d(-6px, -112vh, 0); opacity: 0; }
}
html[data-fx="low"] .wc-ocean-bubbles { display: none; }
@media (prefers-reduced-motion: reduce) {
  .wc-bubble { animation: none; opacity: 0.4; bottom: 30%; }
}

/* ═══ S106 — PREMIUM SEA MINES (sprite layers from gen-mine-sprite.js) ═══
   The art box overhangs the cell by 8% so the horns read bigger than the
   letter orbs. Layers: body · hot horns (NEXT: opacity pulse only) · chain +
   anchor (LOCKED). The number is live text glowing amber in the porthole.
   The canvas blast (effects.js blastAt) replaces the CSS fireball. */
.game-cell.mine { background: none; }
.game-cell.mine--next { box-shadow: none; }
.mine-art { position: absolute; inset: -15%; pointer-events: none; }
.mine-l { position: absolute; inset: 0; background: center / 100% 100% no-repeat; }
.mine-l--body { background-image: url("assets/mine/mine-body.png"); }
.mine-l--hot { background-image: url("assets/mine/mine-hot.png"); opacity: 0; }
.mine-l--locked { background-image: url("assets/mine/mine-locked.png"); }
.game-cell.mine--next .mine-l--hot { animation: mine-hot 0.75s ease-in-out infinite alternate; }
.mine-num {
  position: absolute; left: 50%; top: 48.6%;
  transform: translate(-50%, -50%);
  font: 900 0.62em/1 var(--font-display);
  color: #ffd76a;
  text-shadow: 0 0 0.18em rgba(255, 196, 70, 0.95), 0 0 0.5em rgba(255, 140, 30, 0.65);
  font-variant-numeric: tabular-nums;
}
.game-cell.mine--next .mine-num { color: #fff1c4; }
.game-cell.mine--locked .mine-num { color: #a9c3d8; text-shadow: 0 0 0.2em rgba(120, 200, 255, 0.5); }
.game-cell.mine--locked .mine-l--body { filter: saturate(0.7) brightness(0.85); }
.game-cell.mine--blast .mine-art { animation: mine-pop 0.25s ease-out forwards; }
.mine-flash-screen {
  position: fixed; inset: 0; z-index: 8999; pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(255, 236, 190, var(--p, 0.35)) 0%, rgba(255, 160, 70, 0) 70%);
  animation: mine-flash-scr 0.4s ease-out forwards;
}
@keyframes mine-flash-scr { from { opacity: 1; } to { opacity: 0; } }
html[data-fx="low"] .game-cell.mine--next .mine-l--hot { animation: none; opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .game-cell.mine--next .mine-l--hot { animation: none; opacity: 1; }
  .mine-flash-screen { display: none; }
}

/* ═══ S108 — PREMIUM ICONS (icons.js wcIcon) — replaced the button emoji ══
   Duotone: aqua glass fill + foam→aqua gradient line (gradients defined once
   in #wc-ico-defs). Sized by the surrounding font-size (1.2em). Variants:
   --gold (daily sun, hint lamp, badges), --red (delete / block / report). */
.wc-ico {
  width: 1.2em; height: 1.2em;
  display: inline-block; vertical-align: -0.24em; flex-shrink: 0;
  overflow: visible;
}
.wc-ico .i-f { fill: url(#wcIcoFill); }
.wc-ico .i-s { fill: none; stroke: url(#wcIcoLine); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wc-ico .i-d { fill: url(#wcIcoLine); }
.wc-ico--gold .i-f { fill: url(#wcIcoFillGold); }
.wc-ico--gold .i-s { stroke: url(#wcIcoLineGold); }
.wc-ico--gold .i-d { fill: url(#wcIcoLineGold); }
.wc-ico--red .i-f { fill: url(#wcIcoFillRed); }
.wc-ico--red .i-s { stroke: url(#wcIcoLineRed); }
.wc-ico--red .i-d { fill: url(#wcIcoLineRed); }
/* A soft glow lifts the icon off glass surfaces (static — no animation). */
.menu-card-icon .wc-ico, .play-card-icon .wc-ico, .langmode-mode-icon .wc-ico,
.mp-mode-icon .wc-ico, .mp-match-icon .wc-ico, .menu-settings-btn .wc-ico,
.menu-profile-btn-icon .wc-ico {
  filter: drop-shadow(0 0 0.2em rgba(200, 255, 70, 0.45)); /* S109 neon lime */
}
.menu-settings-btn .wc-ico--gold { filter: drop-shadow(0 0 0.2em rgba(255, 190, 60, 0.5)); }
/* bigger strokes read better at large sizes */
.menu-card-icon .wc-ico .i-s, .play-card-icon .wc-ico .i-s,
.langmode-mode-icon .wc-ico .i-s, .mp-mode-icon .wc-ico .i-s, .mp-match-icon .wc-ico .i-s { stroke-width: 1.5; }
.menu-card-icon .wc-ico, .play-card-icon .wc-ico, .langmode-mode-icon .wc-ico, .mp-mode-icon .wc-ico { width: 1.35em; height: 1.35em; }
.settings-icon .wc-ico { width: 1.3em; height: 1.3em; }
.game-hint-lamp .wc-ico { width: 1.35em; height: 1.35em; }
.game-hint-lamp--used .wc-ico { filter: grayscale(1); opacity: 0.45; }
.mp-chat-toggle .wc-ico { width: 26px; height: 26px; }
.mp-chat-toggle .wc-ico .i-s { stroke: #03263a; }
.mp-chat-toggle .wc-ico .i-f { fill: rgba(255, 255, 255, 0.55); }
.mp-chat-toggle .wc-ico .i-d { fill: #03263a; }
.wc-ico--brand { vertical-align: -0.2em; }
.auth-page-btn--apple .wc-ico--brand { color: #fff; }

/* S109 — badge medallions use the premium icon set (gold when earned,
   greyed when locked via the existing .bdg-medal-icon filter). */
.bdg-medal .bdg-medal-icon .wc-ico { width: 21px; height: 21px; vertical-align: 0; }
.bdg-medal--on .bdg-medal-icon .wc-ico { filter: drop-shadow(0 0 3px rgba(255, 196, 60, 0.6)); }
.profile-topbar-title .wc-ico--gold, .ag-profile-badges .wc-ico { vertical-align: -0.2em; }

/* S110 — icons inside toasts / info cards / status chips (app-generated
   text runs through wcEmojiHtml / wcEmojiIcons). */
.wc-toast .wc-ico, .wc-move-toast .wc-ico { width: 1.25em; height: 1.25em; margin-right: 0.15em; }
.wc-suggest-card-icon .wc-ico, .training-overlay-icon .wc-ico { width: 1.4em; height: 1.4em; filter: drop-shadow(0 0 0.2em rgba(200, 255, 70, 0.45)); }
.mp-overlay-spinner .wc-ico { width: 1.3em; height: 1.3em; animation: wc-ico-spin 2.2s ease-in-out infinite; }
@keyframes wc-ico-spin { 0%, 40% { transform: rotate(0); } 50%, 90% { transform: rotate(180deg); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mp-overlay-spinner .wc-ico { animation: none; } }

/* ═══ S111 — PEACH accents (user: one neon colour repeated everywhere
   drowned the screen; add a peachpuff-style tone + gradients) ═════════════
   · icons: the base line is now peach → chartreuse (icons.js); a PEACH
     variant alternates with it on repeated groups (checkerboard tiles,
     every other settings row, the middle profile button, 2nd cards);
   · page titles: peach → aqua gradient text; section labels: peach. */
:root { --pm-peach: #ffd3ad; --pm-peach-deep: #ffa877; }
.wc-ico--peach .i-f,
.menu-tiles .menu-card:nth-child(2) .wc-ico .i-f, .menu-tiles .menu-card:nth-child(3) .wc-ico .i-f,
.menu-profile-btn:nth-child(2) .wc-ico .i-f,
.settings-item:nth-child(even) .settings-icon .wc-ico .i-f,
.langmode-mode:nth-child(2) .wc-ico .i-f, .mp-mode:nth-child(2) .wc-ico .i-f, .mp-match-card:nth-child(2) .wc-ico .i-f,
.play-card:nth-child(2) .wc-ico .i-f { fill: url(#wcIcoFillPeach); }
.wc-ico--peach .i-s,
.menu-tiles .menu-card:nth-child(2) .wc-ico .i-s, .menu-tiles .menu-card:nth-child(3) .wc-ico .i-s,
.menu-profile-btn:nth-child(2) .wc-ico .i-s,
.settings-item:nth-child(even) .settings-icon .wc-ico .i-s,
.langmode-mode:nth-child(2) .wc-ico .i-s, .mp-mode:nth-child(2) .wc-ico .i-s, .mp-match-card:nth-child(2) .wc-ico .i-s,
.play-card:nth-child(2) .wc-ico .i-s { stroke: url(#wcIcoLinePeach); }
.wc-ico--peach .i-d,
.menu-tiles .menu-card:nth-child(2) .wc-ico .i-d, .menu-tiles .menu-card:nth-child(3) .wc-ico .i-d,
.menu-profile-btn:nth-child(2) .wc-ico .i-d,
.settings-item:nth-child(even) .settings-icon .wc-ico .i-d,
.mp-match-card:nth-child(2) .wc-ico .i-d, .play-card:nth-child(2) .wc-ico .i-d { fill: url(#wcIcoLinePeach); }
.menu-tiles .menu-card:nth-child(2) .menu-card-icon .wc-ico, .menu-tiles .menu-card:nth-child(3) .menu-card-icon .wc-ico,
.menu-profile-btn:nth-child(2) .wc-ico, .langmode-mode:nth-child(2) .wc-ico, .mp-mode:nth-child(2) .wc-ico,
.mp-match-card:nth-child(2) .wc-ico, .play-card:nth-child(2) .wc-ico {
  filter: drop-shadow(0 0 0.2em rgba(255, 170, 120, 0.45));
}
/* page titles: peach → aqua gradient text */
.settings-header h2, .langmode-header h2, .mp-header h2, .mygames-header h2,
.friends-header h2, .profile-topbar-title, .contest-title {
  background: linear-gradient(100deg, var(--pm-peach) 0%, #ffe9d6 35%, #7fe9ff 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.profile-topbar-title .wc-ico, .mygames-header h2 .wc-ico, .friends-header h2 .wc-ico, .contest-title .wc-ico { -webkit-text-fill-color: initial; }
/* section labels */
.mp-section-title, .arcade-block-title, .profile-section-title, .langmode-section-title { color: var(--pm-peach); }

/* S111 — word meanings (Vikisözlük, Turkish games) in the found-words lists */
.game-found-row--tappable { cursor: pointer; }
.game-found-row--tappable .game-found-word::after { content: " ›"; color: var(--pm-peach); font-weight: 700; opacity: 0.8; }
.game-found-row--open .game-found-word::after { content: " ▾"; }
.game-found-meaning {
  margin: -2px 4px 8px; padding: 9px 12px; border-radius: 10px;
  background: rgba(255, 211, 173, 0.08); border: 1px solid rgba(255, 211, 173, 0.25);
  font-size: 0.86rem; line-height: 1.45; color: var(--text);
}
.game-found-meaning-def + .game-found-meaning-def { margin-top: 4px; }
.game-found-meaning-src { margin-top: 6px; font-size: 0.7rem; color: var(--text-dim); }
.game-found-meaning-none { color: var(--text-dim); font-style: italic; }
.game-found-meaning-hint { font-size: 0.74rem; color: var(--pm-peach); margin: -4px 0 8px; padding: 0 34px; opacity: 0.85; }

/* S118 — meaning card ABOVE the Olası Kelimeler panel (meaning.js
   wcMeaningCard): stays until its ✕ is tapped or the next meaning replaces
   it. It sits below the board on phones, so the board never moves. */
.wc-meaning-card {
  position: relative;
  margin: 0 0 10px; padding: 9px 38px 8px 12px; border-radius: 12px;
  background: linear-gradient(180deg, rgba(10, 52, 82, 0.92), rgba(3, 24, 44, 0.92));
  border: 1px solid rgba(255, 211, 173, 0.35);
  box-shadow: 0 4px 12px rgba(0, 8, 20, 0.35);
  color: #f4fbff; text-align: left;
  animation: wc-meaning-in 0.25s ease-out;
}
@keyframes wc-meaning-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.wc-meaning-card-word { font-weight: 800; font-size: 0.9rem; color: var(--pm-peach); line-height: 1.3; }
.wc-meaning-card-word .wc-ico { margin-right: 0.2em; }
.wc-meaning-card-def { margin-top: 3px; font-size: 0.84rem; line-height: 1.4; }
.wc-meaning-card-src { margin-top: 4px; font-size: 0.68rem; color: var(--text-dim); }
.wc-meaning-card-close {
  position: absolute; top: 5px; right: 5px;
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18); background: rgba(255, 255, 255, 0.08);
  color: #f4fbff; font-size: 0.8rem; line-height: 1; cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
}
@media (prefers-reduced-motion: reduce) { .wc-meaning-card { animation: none; } }

/* ═══ S113 — WORDINAL logo art (splash + home), replaces the text wordmark.
   Transparent WebP (scripts/gen-wordmark.js); the source glow was lost in the
   cut-out, so a soft aqua glow is added back with drop-shadow (static). */
.splash-game-title--art, .menu-title--art {
  background: none !important; -webkit-text-fill-color: initial; color: inherit;
  animation: none !important; line-height: 0; margin-left: auto; margin-right: auto;
}
.wc-wordmark { display: block; height: auto; max-width: 100%; user-select: none; -webkit-user-drag: none;
  filter: drop-shadow(0 0 14px rgba(80, 220, 240, 0.32)) drop-shadow(0 4px 10px rgba(0, 10, 25, 0.45)); }
/* S114: smaller (the S113 size pushed the home page into a scroll on some
   phones) and also HEIGHT-bounded so short screens never overflow. */
.wc-wordmark--splash { width: min(80vw, 520px); max-height: 34vh; object-fit: contain; margin: 0 auto; }
/* S115: smaller again and pulled UP under the topbar; the slogan line is
   gone, so the profile card follows right beneath the logo. */
.wc-wordmark--menu { width: min(52vw, 230px); max-height: 15vh; object-fit: contain; margin: 0 auto; }
@media (min-width: 768px) { .wc-wordmark--menu { width: 280px; max-height: 18vh; } }
.menu-title.menu-title--art { margin-top: -10px; margin-bottom: 10px; }
html[data-fx="low"] .wc-wordmark { filter: none; }

/* S113 — word-meaning notes in the TOP stack (wcTopNote). Newest below;
   a leaving note collapses (max-height/padding/margin → 0) so the rest
   slides up instead of jumping. Premium dark glass, peach accent. */
.wc-top-note {
  max-width: min(520px, calc(100vw - 24px));
  padding: 9px 16px;
  background: linear-gradient(180deg, rgba(10, 52, 82, 0.95), rgba(3, 24, 44, 0.95));
  border: 1px solid rgba(255, 211, 173, 0.35);
  box-shadow: 0 6px 18px rgba(0, 8, 20, 0.45);
  backdrop-filter: none; -webkit-backdrop-filter: none;
  overflow: hidden;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.35s ease, padding 0.35s ease, margin 0.35s ease, border-width 0.35s ease;
}
.wc-top-note-txt { font-size: 0.86rem; font-weight: 600; line-height: 1.4; text-align: center; color: #f4fbff; }
.wc-top-note-txt .wc-ico { margin-right: 0.25em; }
.wc-top-note--leaving { opacity: 0; max-height: 0 !important; padding-top: 0; padding-bottom: 0; margin-top: -8px; border-width: 0; }

/* S114 — word-meaning notes back in the LOWER part of the screen (user: the
   top never worked). A column anchored from the TOP of the lower area: the
   newest goes below, a leaving note collapses → the others slide up.
   ~3 notes fit above the bottom toasts. */
.wc-note-stack {
  position: fixed;
  left: 50%; transform: translateX(-50%);
  top: calc(100dvh - 232px - env(safe-area-inset-bottom));
  z-index: 9400;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  width: max-content; max-width: calc(100vw - 24px);
  pointer-events: none;
}
.wc-note-stack .wc-top-note { transform: translateY(12px); }
.wc-note-stack .wc-top-note.wc-move-toast--visible { transform: translateY(0); }

/* S119 — Arcade tier tabs: one fixed-height head slot (star meter / lock) so
   every tab's name + count sit on the same line. */
.arcade-tab { justify-content: flex-start; }
.arcade-tab-head {
  height: 1.05rem; display: inline-flex; align-items: center; justify-content: center;
  font-size: 0.9rem; line-height: 1;
}
.arcade-tab-head .wc-ico, .arcade-tab-head svg { width: 1em; height: 1em; }
.arcade-tab-name { line-height: 1.2; }
.arcade-star-meter { position: relative; letter-spacing: 0.08em; font-family: "Segoe UI", system-ui, sans-serif; }
.arcade-star-meter-base { color: rgba(160, 180, 200, 0.35); }
.arcade-star-meter-fill {
  position: absolute; left: 0; top: 0; height: 100%; overflow: hidden; white-space: nowrap;
  color: #f0b429; text-shadow: 0 0 6px rgba(240, 180, 41, 0.45);
  display: inline-flex; align-items: center;
}
.arcade-tab--active .arcade-star-meter-base { color: rgba(0, 30, 50, 0.3); }
.arcade-tab--active .arcade-star-meter-fill { color: #ffc93c; text-shadow: 0 0 4px rgba(0, 0, 0, 0.35); }
html[data-fx="low"] .arcade-star-meter-fill { text-shadow: none; }

/* S119 — Günün Kelimesi (wotd.js): contest-page card + in-game chip. */
.wotd-card {
  margin: 12px 0; padding: 12px 14px; border-radius: 16px; text-align: center;
  background: var(--pm-card, rgba(20, 60, 90, 0.5));
  border: 1px solid rgba(240, 180, 41, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 14px rgba(240, 180, 41, 0.12);
}
.wotd-card-title { font-family: var(--font-display); font-weight: 800; font-size: 0.9rem; color: #f0c45a; }
.wotd-card-word {
  margin: 6px 0 4px; font-family: var(--font-display); font-weight: 900; font-size: 1.7rem;
  letter-spacing: 0.14em; color: var(--text);
}
.wotd-card-desc { font-size: 0.8rem; color: var(--text-dim); }
.wotd-chip {
  display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
  margin: 4px auto 6px; padding: 5px 12px; width: fit-content; max-width: 100%;
  border-radius: 999px; font-size: 0.8rem;
  background: rgba(240, 180, 41, 0.12); border: 1px solid rgba(240, 180, 41, 0.5); color: var(--text);
}
.wotd-chip-label { color: #f0c45a; font-weight: 700; }
.wotd-chip-word { font-family: var(--font-display); font-weight: 900; letter-spacing: 0.1em; }
.wotd-chip-pts { font-weight: 800; color: #f0c45a; font-variant-numeric: tabular-nums; }
.wotd-chip--found { background: rgba(60, 200, 120, 0.15); border-color: rgba(60, 200, 120, 0.55); }
.wotd-chip--found .wotd-chip-pts { color: #5fe08f; }

/* S119 — Günün Kelimesi card, centred in the home topbar between the
   ⚙️🏅 and ☀️H pairs (both 96px wide, so space-between centres it). Two
   lines, max 44px tall = the round buttons' height → the topbar does not
   grow and the home screen does not scroll. */
.menu-topbar { gap: 6px; }
.menu-wotd {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0;
  flex: 0 1 auto; min-width: 0; max-width: 170px; height: 44px; box-sizing: border-box;
  padding: 3px 10px; overflow: hidden;
  border-radius: 14px; cursor: pointer; font: inherit; color: var(--text);
  background: var(--pm-card, rgba(20, 60, 90, 0.5));
  border: 1px solid rgba(240, 180, 41, 0.5);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 12px rgba(240, 180, 41, 0.12);
  -webkit-tap-highlight-color: transparent;
}
.menu-wotd[hidden] { display: none; }
.menu-wotd:active { transform: scale(0.97); }
.menu-wotd-label {
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
  font-size: 0.62rem; font-weight: 700; line-height: 1.2; color: #f0c45a;
}
.menu-wotd-label .wc-ico, .menu-wotd-label svg { font-size: 0.8rem; width: 1em; height: 1em; flex: none; }
.menu-wotd-row { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.menu-wotd-word {
  font-family: var(--font-display); font-weight: 900; font-size: 0.95rem;
  letter-spacing: 0.06em; line-height: 1.2;
}
.menu-wotd-pts { font-size: 0.68rem; font-weight: 800; color: #f0c45a; font-variant-numeric: tabular-nums; }
html[data-fx="low"] .menu-wotd { box-shadow: none; }

/* S119 — NO HOME SCROLL on short phones (≤ 720px tall, e.g. 360×640 /
   375×667): the tiles' 20px vertical padding held each row at ~116px
   (content min beats the 92px grid floor) and pushed the page past 100vh. */
@media (max-width: 767px) and (max-height: 720px) {
  .menu-tiles .menu-card { padding: 8px 10px; gap: 4px; }
  .menu-cards.menu-tiles { gap: 8px; }
  .menu-profile-card { margin-bottom: 8px; }
}
