:root {
  color-scheme: light;
  --bg: #f4f2ff;
  --surface: #ffffff;
  --surface-soft: #f8f7ff;
  --ink: #181723;
  --muted: #68667a;
  --line: #ddd9ed;
  --primary: #5b45f5;
  --primary-dark: #4432cf;
  --primary-soft: #ece9ff;
  --accent: #ffb21d;
  --success: #138a63;
  --danger: #cf3f53;
  --shadow: 0 22px 70px rgba(48, 36, 115, 0.13);
  --radius: 24px;
  --font-size: 18px;
  --focus: 0 0 0 4px rgba(91, 69, 245, 0.24);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 195, 76, 0.20), transparent 28rem),
    radial-gradient(circle at 90% 12%, rgba(91, 69, 245, 0.16), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: var(--font-size);
  line-height: 1.48;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

body.large-type { --font-size: 21px; }
body.high-contrast {
  --bg: #fff;
  --surface-soft: #fff;
  --ink: #000;
  --muted: #292929;
  --line: #000;
  --primary: #3420da;
  --primary-dark: #2110b0;
  --shadow: 0 0 0 3px #000;
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: none; box-shadow: var(--focus); }
button:disabled { opacity: 0.52; cursor: not-allowed; transform: none !important; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: fixed; left: 12px; top: -80px; z-index: 1000; background: #fff; padding: 12px 18px; border-radius: 12px; color: var(--ink); }
.skip-link:focus { top: 12px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 12px clamp(16px, 4vw, 56px);
  background: rgba(244, 242, 255, 0.82);
  border-bottom: 1px solid rgba(221, 217, 237, 0.7);
  backdrop-filter: blur(16px);
}
.brand-button { display: flex; align-items: center; gap: 10px; border: 0; background: transparent; font-weight: 900; font-size: 1.15rem; cursor: pointer; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; background: var(--primary); color: #fff; font-size: 1.4rem; transform: rotate(-7deg); box-shadow: 0 8px 18px rgba(91, 69, 245, 0.3); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.connection-pill { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.78); color: var(--muted); cursor: pointer; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #a8a6b3; box-shadow: 0 0 0 4px rgba(168,166,179,.16); }
.connection-pill.connected .status-dot { background: var(--success); box-shadow: 0 0 0 4px rgba(19,138,99,.16); }
.connection-pill.connecting .status-dot { background: var(--accent); animation: pulse 1.3s infinite; }
.connection-pill.error .status-dot { background: var(--danger); }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--surface); cursor: pointer; font-size: 1.2rem; }
.icon-button.outlined { border: 1px solid var(--line); }

.offline-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 100; padding: 8px 16px; background: #231f20; color: #fff; text-align: center; font-size: .86rem; }
.offline-banner:not(.hidden) + .app-header { top: 38px; }

.app-main { width: min(1480px, 100%); margin: 0 auto; padding: clamp(18px, 4vw, 50px); }
.screen { display: none; min-height: calc(100vh - 160px); align-items: center; justify-content: center; }
.screen.active { display: flex; animation: screenIn .3s ease-out both; }
.panel, .hero-card { width: 100%; background: rgba(255,255,255,.94); border: 1px solid rgba(221,217,237,.9); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: clamp(24px, 4vw, 46px); }
.narrow-panel { max-width: 620px; }

.hero-card { position: relative; overflow: hidden; max-width: 900px; padding: clamp(36px, 7vw, 78px); text-align: center; }
.hero-card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(rgba(91,69,245,.10) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(to bottom, #000, transparent 68%); }
.hero-card > * { position: relative; z-index: 1; }
.hero-art { position: relative; width: 112px; height: 92px; margin: 0 auto 12px; }
.hero-pencil { position: absolute; inset: 6px 24px auto auto; display: grid; place-items: center; width: 70px; height: 70px; border-radius: 25px; background: var(--primary); color: #fff; font-size: 2.5rem; transform: rotate(-8deg); box-shadow: 0 18px 36px rgba(91,69,245,.30); }
.scribble { position: absolute; border: 5px solid var(--accent); border-radius: 50%; opacity: .9; }
.scribble-one { width: 72px; height: 30px; left: 0; bottom: 2px; transform: rotate(15deg); border-left-color: transparent; border-bottom-color: transparent; }
.scribble-two { width: 34px; height: 34px; right: 0; top: 0; border-color: #e95d72; border-left-color: transparent; }
.eyebrow { margin: 0 0 8px; color: var(--primary); text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 900; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(2rem, 6vw, 4.6rem); line-height: 1.02; letter-spacing: -.055em; }
h1 span { color: var(--primary); }
h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.2rem); line-height: 1.12; letter-spacing: -.035em; }
h3 { margin: 0 0 12px; font-size: 1.08rem; }
.hero-copy { max-width: 620px; margin: 24px auto 30px; color: var(--muted); font-size: 1.08rem; }
.primary-button, .secondary-button, .premium-button, .text-button, .back-button, .tool-button {
  min-height: 52px;
  padding: 12px 20px;
  border-radius: 15px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary-button { color: #fff; background: var(--primary); box-shadow: 0 10px 22px rgba(91,69,245,.24); }
.primary-button:hover:not(:disabled), .premium-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(91,69,245,.28); }
.secondary-button { background: var(--surface); border: 1px solid var(--line); }
.secondary-button:hover:not(:disabled), .tool-button:hover:not(:disabled) { transform: translateY(-1px); background: var(--surface-soft); }
.premium-button { color: #241a00; background: linear-gradient(135deg, #ffd865, #ffae1a); box-shadow: 0 10px 22px rgba(216,143,0,.22); }
.premium-button.small { min-height: 40px; padding: 8px 14px; font-size: .88rem; }
.text-button, .back-button { min-height: 44px; padding: 8px 10px; background: transparent; color: var(--primary); }
.back-button { margin: -8px 0 24px -8px; }
.hero-button { min-width: 240px; font-size: 1.1rem; }
.divider { display: flex; align-items: center; gap: 12px; max-width: 520px; margin: 28px auto 18px; color: var(--muted); font-size: .82rem; }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.join-form { max-width: 520px; margin: 0 auto; text-align: left; }
label { display: block; font-weight: 800; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); padding: 13px 15px; min-height: 52px; }
input::placeholder, textarea::placeholder { color: #9a97a9; }
textarea { resize: vertical; }
.input-action-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; margin-top: 7px; }
.field-help { margin: 7px 0 0; color: var(--muted); font-size: .82rem; font-weight: 500; }
.field-help.centered, .centered { text-align: center; }
.trust-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px 24px; margin-top: 30px; color: var(--muted); font-size: .84rem; font-weight: 700; }
.stack-form { display: grid; gap: 14px; margin-top: 28px; }
.inline-status { margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--primary-soft); color: var(--primary-dark); }

.lobby-layout { width: 100%; display: grid; grid-template-columns: minmax(320px, .8fr) minmax(420px, 1.2fr); gap: clamp(18px, 3vw, 32px); align-items: stretch; }
.room-panel { text-align: center; }
.room-code-card { display: flex; justify-content: space-between; align-items: center; gap: 15px; max-width: 480px; margin: 28px auto 18px; padding: 16px 18px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 18px; text-align: left; }
.small-label { display: block; color: var(--muted); font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.room-code { display: block; margin-top: 3px; font-size: clamp(1.65rem, 5vw, 2.6rem); letter-spacing: .13em; font-variant-numeric: tabular-nums; }
.qr-code { display: grid; place-items: center; width: 236px; min-height: 236px; margin: 20px auto 10px; padding: 12px; border-radius: 24px; background: #fff; border: 1px solid var(--line); }
.qr-code img, .qr-code canvas { max-width: 100%; height: auto !important; }
.qr-placeholder { display: grid; place-items: center; width: 210px; height: 210px; padding: 20px; border: 4px dashed var(--line); border-radius: 12px; color: var(--muted); font-weight: 800; }
.scan-copy { margin: 0 0 18px; color: var(--muted); }
.share-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading.compact { align-items: center; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 4px 10px; border-radius: 999px; background: var(--primary-soft); color: var(--primary-dark); font-size: .73rem; font-weight: 900; }
.premium-badge { background: #fff0c3; color: #805300; }
.players-list { display: grid; gap: 10px; margin-top: 24px; }
.player-row { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 15px; background: var(--surface-soft); border: 1px solid var(--line); }
.player-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.player-name { font-weight: 900; }
.player-meta { display: block; color: var(--muted); font-size: .76rem; }
.player-ready { color: var(--success); font-size: .76rem; font-weight: 900; }
.empty-state { display: grid; place-items: center; gap: 4px; min-height: 220px; color: var(--muted); text-align: center; }
.empty-icon { font-size: 2.4rem; }
.host-controls { margin-top: 28px; padding-top: 26px; border-top: 1px solid var(--line); }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.settings-grid label { font-size: .82rem; }
.settings-grid select { margin-top: 6px; }
.custom-words-details { margin: 18px 0; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-soft); }
.custom-words-details summary { cursor: pointer; font-weight: 900; }
.custom-words-details label { margin: 12px 0 6px; }
.start-button { width: 100%; }
.player-waiting { display: grid; place-items: center; text-align: center; padding: 36px 0 12px; color: var(--muted); }
.pulse-ring { width: 58px; height: 58px; margin-bottom: 12px; border: 5px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin 1.1s linear infinite; }

.game-screen.active { display: block; }
.game-topbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; padding: 0 4px; }
.game-topbar h1 { font-size: clamp(1.8rem, 4vw, 3rem); }
.timer-wrap { position: relative; display: grid; place-items: center; width: 82px; height: 82px; flex: 0 0 auto; }
.timer-ring { position: absolute; inset: 0; width: 100%; transform: rotate(-90deg); }
.timer-track, .timer-progress { fill: none; stroke-width: 5; }
.timer-track { stroke: var(--line); }
.timer-progress { stroke: var(--primary); stroke-linecap: round; stroke-dasharray: 125.66; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear; }
.timer-wrap strong { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; }
.canvas-column { min-width: 0; }
.word-hint, .drawer-word { min-height: 50px; margin-bottom: 10px; padding: 10px 16px; border-radius: 14px; background: rgba(255,255,255,.88); border: 1px solid var(--line); text-align: center; font-size: 1.4rem; font-weight: 900; letter-spacing: .13em; }
.drawer-word { letter-spacing: normal; color: var(--primary-dark); background: var(--primary-soft); }
.canvas-frame { position: relative; overflow: hidden; width: 100%; aspect-ratio: 4 / 3; min-height: 320px; border-radius: 24px; border: 2px solid var(--line); background: #fff; box-shadow: var(--shadow); }
#drawing-canvas { display: block; width: 100%; height: 100%; background: #fff; touch-action: none; cursor: crosshair; }
.canvas-overlay { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(255,255,255,.82); backdrop-filter: blur(5px); }
.overlay-card { display: grid; place-items: center; gap: 12px; max-width: 360px; padding: 24px; border-radius: 20px; background: #fff; box-shadow: 0 16px 40px rgba(30,24,72,.15); text-align: center; }
.spinner { display: inline-block; width: 28px; height: 28px; border: 4px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
.drawing-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding: 10px; border-radius: 18px; background: rgba(255,255,255,.92); border: 1px solid var(--line); }
.tool-group { display: flex; gap: 7px; }
.tool-button { min-height: 46px; padding: 9px 13px; border: 1px solid var(--line); background: #fff; }
.tool-button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-dark); }
.danger-tool { color: var(--danger); }
.color-tools { display: flex; flex-wrap: wrap; gap: 7px; }
.color-button { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #fff; background: var(--swatch); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.color-button.active { box-shadow: 0 0 0 3px var(--primary); }
.brush-label { display: grid; grid-template-columns: auto 110px; align-items: center; gap: 7px; margin-left: auto; font-size: .82rem; }
.brush-label select { min-height: 44px; padding: 8px 10px; }
.guess-form { margin-top: 12px; padding: 14px; border-radius: 18px; background: rgba(255,255,255,.94); border: 1px solid var(--line); }
.guess-feedback { min-height: 26px; margin-top: 5px; font-weight: 800; color: var(--muted); }
.guess-feedback.near { color: #9b6500; }
.guess-feedback.correct { color: var(--success); }
.game-sidebar { display: grid; align-content: start; gap: 14px; }
.sidebar-card { padding: 18px; border-radius: 20px; background: rgba(255,255,255,.94); border: 1px solid var(--line); box-shadow: 0 12px 35px rgba(48,36,115,.08); }
.sidebar-card h2 { font-size: 1.2rem; }
.scoreboard { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.score-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 12px; background: var(--surface-soft); }
.score-rank { color: var(--muted); font-weight: 900; }
.score-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 900; }
.score-value { color: var(--primary-dark); font-weight: 900; }
.score-row.drawer { outline: 2px solid var(--accent); }
.score-row.solved .score-name::after { content: " ✓"; color: var(--success); }
.guesses-card { min-height: 190px; }
.guess-feed { display: grid; align-content: start; gap: 8px; max-height: 300px; margin-top: 12px; overflow-y: auto; }
.guess-bubble { padding: 8px 10px; border-radius: 12px; background: var(--surface-soft); font-size: .84rem; }
.guess-bubble strong { margin-right: 5px; }
.guess-bubble.correct { background: #e7f8f1; color: #0d6b4b; }
.host-button-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.danger-outline { color: var(--danger); border-color: rgba(207,63,83,.35); }

.results-panel { max-width: 840px; text-align: center; }
.results-panel h1 { font-size: clamp(2rem, 5vw, 3.6rem); }
.winner-card, .champion-card { margin: 26px auto; padding: 22px; border-radius: 20px; background: var(--primary-soft); }
.champion-card { background: linear-gradient(135deg, #fff4cd, #fff); border: 1px solid #f0d170; }
.champion-name { display: block; font-size: 2rem; font-weight: 950; }
.large-scoreboard { max-width: 600px; margin: 22px auto; }
.large-scoreboard .score-row { padding: 13px 15px; }
.results-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.confetti { font-size: 3.2rem; color: var(--accent); animation: float 2s ease-in-out infinite; }
.premium-cta { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; margin: 26px 0; padding: 18px; border-radius: 20px; background: #fff8dc; border: 1px solid #f1d271; text-align: left; }
.premium-cta p { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.premium-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 15px; background: #ffd85d; color: #6d4900; font-size: 1.5rem; }

.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(24,23,35,.56); backdrop-filter: blur(8px); }
.modal-card { width: min(760px, 100%); max-height: min(90vh, 900px); overflow-y: auto; padding: clamp(22px, 4vw, 38px); border-radius: 24px; background: #fff; box-shadow: 0 32px 90px rgba(0,0,0,.25); animation: modalIn .2s ease-out both; }
.narrow-modal { width: min(520px, 100%); }
.modal-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 18px; }
.word-choice-card { width: min(640px, 100%); text-align: center; }
.word-options { display: grid; gap: 12px; margin: 24px 0; }
.word-option-button { min-height: 70px; padding: 14px 20px; border: 2px solid var(--line); border-radius: 18px; background: var(--surface-soft); font-weight: 900; font-size: 1.25rem; cursor: pointer; }
.word-option-button:hover { border-color: var(--primary); background: var(--primary-soft); }
.settings-sections { display: grid; gap: 26px; }
.settings-sections section + section { padding-top: 22px; border-top: 1px solid var(--line); }
.toggle-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.toggle-row small { display: block; color: var(--muted); font-weight: 500; }
.toggle-row input { width: 48px; height: 28px; accent-color: var(--primary); }
.section-copy, .privacy-copy { color: var(--muted); font-size: .9rem; }
.kit-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kit-controls.locked { opacity: .55; pointer-events: none; }
.kits-list { grid-column: 1 / -1; display: grid; gap: 9px; margin-top: 4px; }
.kit-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); }
.kit-actions { display: flex; gap: 6px; }
.kit-actions button { min-height: 38px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-weight: 800; cursor: pointer; }
.price-card { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 24px 0; padding: 18px; border-radius: 18px; background: #fff7d6; border: 1px solid #f1d271; }
.price-card strong { font-size: 2.2rem; }
.price-card span { color: var(--muted); }
.error-symbol { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 18px; border-radius: 50%; background: #ffe7eb; color: var(--danger); font-size: 2rem; font-weight: 900; }
#error-modal .modal-card { text-align: center; }

.toast-region { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 200; display: grid; gap: 9px; width: min(360px, calc(100vw - 36px)); }
.toast { padding: 13px 16px; border-radius: 14px; background: #211f2d; color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.22); animation: toastIn .2s ease-out; }

@media (max-width: 1050px) {
  .game-layout { grid-template-columns: 1fr; }
  .game-sidebar { grid-template-columns: 1fr 1fr; }
  .host-round-controls { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .app-header { min-height: 62px; padding: 9px 14px; }
  .connection-pill span:last-child { display: none; }
  .app-main { padding: 15px; }
  .screen { min-height: calc(100vh - 92px); }
  .lobby-layout { grid-template-columns: 1fr; }
  .room-panel { order: 2; }
  .players-panel { order: 1; }
  .qr-code { width: 210px; min-height: 210px; }
  .game-topbar { position: sticky; top: 64px; z-index: 15; margin: -15px -15px 10px; padding: 10px 15px; background: rgba(244,242,255,.92); backdrop-filter: blur(12px); }
  .timer-wrap { width: 66px; height: 66px; }
  .canvas-frame { min-height: 260px; border-radius: 18px; }
  .drawing-toolbar { position: sticky; bottom: 0; z-index: 18; justify-content: center; margin-left: -5px; margin-right: -5px; border-radius: 18px 18px 0 0; box-shadow: 0 -10px 30px rgba(31,25,72,.12); }
  .brush-label { margin-left: 0; }
  .tool-button span { display: none; }
  .game-sidebar { grid-template-columns: 1fr; }
  .guesses-card { min-height: 120px; }
  .premium-cta { grid-template-columns: auto 1fr; }
  .premium-cta button { grid-column: 1 / -1; width: 100%; }
}

@media (max-width: 560px) {
  h1 { letter-spacing: -.04em; }
  .hero-card, .panel { border-radius: 20px; padding: 24px 18px; }
  .hero-art { transform: scale(.9); }
  .hero-copy { margin: 18px auto 22px; }
  .input-action-row { grid-template-columns: 1fr; }
  .input-action-row .primary-button, .input-action-row .secondary-button { width: 100%; }
  .share-buttons, .settings-grid, .kit-controls { grid-template-columns: 1fr; }
  .room-code { font-size: 1.55rem; }
  .game-topbar h1 { font-size: 1.55rem; }
  .timer-wrap { width: 58px; height: 58px; }
  .timer-wrap strong { font-size: 1.1rem; }
  .word-hint, .drawer-word { font-size: 1rem; min-height: 44px; }
  .canvas-frame { min-height: 230px; aspect-ratio: 1 / 1; }
  .drawing-toolbar { gap: 7px; padding: 8px; }
  .color-button { width: 34px; height: 34px; }
  .tool-button { min-width: 42px; min-height: 42px; padding: 7px 9px; }
  .brush-label { grid-template-columns: 1fr; gap: 2px; }
  .brush-label select { width: 92px; }
  .modal { padding: 10px; }
  .modal-card { border-radius: 20px; padding: 22px 17px; }
  .kit-controls .secondary-button { width: 100%; }
}

@media (display-mode: standalone) {
  .app-header { padding-top: max(10px, env(safe-area-inset-top)); }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

@keyframes screenIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes float { 50% { transform: translateY(-8px) rotate(8deg); } }
