@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700;800&family=Fredoka:wght@500;600;700&display=swap');

:root {
  color-scheme: light;
  --ink: #252343;
  --muted: #79778e;
  --paper: #f7f4ed;
  --purple: #7155e8;
  --purple-dark: #5c42d2;
  --line: #e8e3d8;
  --mint: #b7f0d3;
  --yellow: #ffd869;
  font-family: 'DM Sans', 'Trebuchet MS', sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { min-width: 320px; margin: 0; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button { color: inherit; }
.topbar { height: 76px; padding: 0 max(5vw, calc((100vw - 1400px) / 2)); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(55, 47, 92, .08); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-family: 'Fredoka', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -.9px; line-height: .9; }
.brand-pop { color: var(--purple); }
.brand small { display: block; margin-top: 5px; font: 800 8px 'DM Sans', sans-serif; letter-spacing: 3px; color: #9390a5; }
.brand-mark { width: 34px; height: 34px; border-radius: 12px; display: flex; gap: 2px; align-items: center; justify-content: center; background: var(--yellow); transform: rotate(-8deg); }
.brand-mark i { display: block; width: 5px; height: 14px; border-radius: 6px; background: var(--ink); transform: rotate(8deg); }
.brand-mark i:first-child, .brand-mark i:last-child { height: 9px; }
.topbar-right { display: flex; align-items: center; gap: 17px; }
.online-pill { display: flex; align-items: center; gap: 8px; color: #69677c; font-size: 12px; font-weight: 600; }
.online-dot, .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #5ccc92; box-shadow: 0 0 0 3px #5ccc9223; }
.sound-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--purple); font-size: 18px; cursor: pointer; }
.page { width: min(1320px, 90vw); margin: 0 auto; }
.intro { min-height: 256px; display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden; }
.intro-copy { padding: 28px 0 26px; position: relative; z-index: 1; }
.eyebrow, .section-kicker { color: var(--purple); font-size: 10px; font-weight: 800; letter-spacing: 1.65px; }
.eyebrow span { color: #f5a941; margin-right: 5px; }
h1, h2, p { margin-top: 0; }
h1 { margin: 13px 0 8px; font: 700 clamp(37px, 4vw, 53px)/.99 'Fredoka', sans-serif; letter-spacing: -1.1px; }
h1 span { color: var(--purple); }
.intro-copy p { margin: 12px 0 17px; max-width: 420px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.quick-facts { display: flex; flex-wrap: wrap; gap: 17px; }
.quick-facts span { color: #66647a; font-size: 11px; font-weight: 600; }
.quick-facts b { margin-right: 4px; color: var(--purple); font-size: 13px; }
.mascot { width: 286px; height: 230px; position: absolute; right: 45px; bottom: -3px; }
.mascot-body { width: 136px; height: 126px; position: absolute; left: 71px; top: 51px; border: 5px solid #5542bc; border-radius: 47% 47% 40% 40%; background: #8a73f3; transform: rotate(-5deg); box-shadow: inset 0 -12px 0 #6f57dc; animation: bob 2.8s ease-in-out infinite; }
.mascot-body:before, .mascot-body:after { content: ''; position: absolute; width: 38px; height: 25px; top: 48px; border-radius: 50%; background: #8a73f3; border-bottom: 4px solid #5542bc; }
.mascot-body:before { left: -28px; transform: rotate(40deg); }.mascot-body:after { right: -28px; transform: rotate(-40deg); }
.mascot-eye { position: absolute; width: 10px; height: 14px; top: 42px; border-radius: 50%; background: #252343; }
.eye-left { left: 41px; }.eye-right { right: 40px; }
.mascot-mouth { position: absolute; width: 13px; height: 7px; left: 57px; top: 65px; border-bottom: 3px solid #252343; border-radius: 50%; }
.mascot-cheek { position: absolute; width: 17px; height: 9px; top: 63px; border-radius: 50%; background: #f79ac0; opacity: .85; }
.cheek-left { left: 23px; }.cheek-right { right: 22px; }
.mascot-shadow { width: 150px; height: 17px; position: absolute; left: 63px; bottom: 30px; border-radius: 50%; background: #d9d2c4; }
.mascot-tag { position: absolute; top: 13px; right: 1px; padding: 7px 10px; border: 1px solid #e9d7a0; border-radius: 7px; background: #fff5cf; color: #756535; font-size: 9px; font-weight: 800; letter-spacing: .8px; transform: rotate(4deg); }
.mascot-tag b { margin-left: 5px; color: #ed9d43; }
.mascot-spark { position: absolute; z-index: 1; color: #f4b44c; font-size: 24px; }
.spark-one { top: 53px; left: 29px; }.spark-two { right: 22px; bottom: 57px; font-size: 19px; color: var(--purple); }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-5deg); } 50% { transform: translateY(-8px) rotate(-2deg); } }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(300px, .82fr); gap: 19px; align-items: stretch; }
.arena-card { overflow: hidden; border: 1px solid #e5e0d6; border-radius: 17px; background: #fff; box-shadow: 0 8px 24px #322b5210; }
.arena-topline { height: 49px; padding: 0 17px; display: flex; align-items: center; justify-content: space-between; }
.arena-title { display: flex; align-items: center; gap: 9px; color: #737087; font-size: 9px; font-weight: 800; letter-spacing: 1.35px; }
.live-dot { width: 7px; height: 7px; }
.match-clock { min-width: 83px; padding: 6px 10px; display: flex; justify-content: center; gap: 6px; border-radius: 7px; background: #f3f0ff; color: var(--purple); font-size: 12px; }
.match-clock strong { font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.canvas-wrap { width: 100%; position: relative; aspect-ratio: 2 / 1; overflow: hidden; background: #a4e0f2; }
canvas { width: 100%; height: 100%; display: block; }
.game-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: #241e3e47; transition: opacity .22s ease, visibility .22s ease; }
.game-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.overlay-card { width: min(300px, 80%); padding: 20px 22px 19px; text-align: center; border: 1px solid #ffffffb0; border-radius: 14px; background: #fffefa; box-shadow: 0 9px 30px #34275932; }
.overlay-icon { display: block; margin: 0 auto 6px; font-size: 26px; }
.overlay-kicker { color: #9692a7; font-size: 8px; font-weight: 800; letter-spacing: 1.5px; }
.overlay-card h2 { margin: 7px 0 5px; font: 600 22px 'Fredoka', sans-serif; }
.overlay-card p { margin: 0 auto 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.primary-button { width: 100%; padding: 11px 14px; border: 0; border-radius: 8px; background: var(--purple); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 4px 0 #5239c2; cursor: pointer; transition: transform .14s, background .14s; }
.primary-button:hover { background: var(--purple-dark); transform: translateY(-1px); }.primary-button span { float: right; font-size: 16px; line-height: 13px; }
.arena-footer { min-height: 42px; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
.player-pips { display: flex; align-items: center; gap: 5px; }
.player-pip { width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #dedbe6; }
.arena-hint { color: #9692a3; font-size: 10px; }.arena-hint span { margin-left: 4px; color: var(--purple); }
.toast { position: absolute; left: 50%; bottom: 12px; padding: 7px 12px; border-radius: 20px; color: #fff; background: #282344df; font-size: 11px; font-weight: 700; opacity: 0; pointer-events: none; transform: translate(-50%, 8px); transition: .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.side-panel { display: grid; grid-template-rows: auto 1fr; gap: 12px; }
.how-card, .play-card { padding: 15px 17px; border: 1px solid #e5e0d6; border-radius: 14px; background: #fff; }
.section-kicker { color: #9691a7; font-size: 9px; letter-spacing: 1.35px; }
.how-card h2 { margin: 7px 0 11px; font: 600 21px/1.04 'Fredoka', sans-serif; }
.rule { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.rule-icon { width: 29px; height: 29px; display: grid; place-items: center; border-radius: 9px; font-size: 14px; font-weight: 800; }
.move-icon { background: #e7e1ff; color: #755ee0; }.jump-icon { background: #dff6e8; color: #39a56a; }.bomb-icon { background: #fff0c8; color: #d59623; }
.rule strong, .rule small { display: block; }.rule strong { font-size: 10px; }.rule small { margin-top: 1px; color: var(--muted); font-size: 9px; }
.play-card { padding-bottom: 13px; }.mode-button { width: 100%; min-height: 49px; padding: 7px 9px; display: flex; align-items: center; gap: 9px; text-align: left; border: 1px solid #eeeaf4; border-radius: 9px; background: #fff; cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
.mode-button:hover { border-color: #c5b9fa; background: #fcfbff; transform: translateY(-1px); }
.mode-local { margin-top: 9px; border-color: #d8d0ff; background: #f5f2ff; }.mode-emoji { width: 29px; height: 29px; display: grid; flex: 0 0 auto; place-items: center; border-radius: 8px; background: #e7e1ff; font-size: 15px; }
.mode-button strong, .mode-button small { display: block; }.mode-button strong { font-size: 10px; }.mode-button small { margin-top: 2px; color: var(--muted); font-size: 9px; }
.mode-arrow { margin-left: auto; color: var(--purple); font-size: 16px; }
.room-divider { height: 28px; display: flex; align-items: center; gap: 9px; color: #a4a0b2; font-size: 8px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; }
.room-divider:before, .room-divider:after { height: 1px; flex: 1; content: ''; background: #eeeaf0; }
.mode-room .mode-emoji { color: #d79728; background: #fff2d2; }
.join-row { display: flex; gap: 6px; margin-top: 7px; }
.join-row input { width: 0; min-width: 0; flex: 1; padding: 8px 10px; border: 1px solid #eeeaf4; border-radius: 7px; outline: none; color: var(--ink); font-size: 10px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; }
.join-row input:focus { border-color: #a999f2; }.join-row input::placeholder { color: #b2afbd; }
.join-row button { min-width: 66px; padding: 0 12px; border: 0; border-radius: 7px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; cursor: pointer; }
.room-code-display { margin-top: 9px; padding: 8px 10px; border: 1px dashed #d6cdfd; border-radius: 7px; background: #f8f6ff; color: #8d87a4; font-size: 8px; font-weight: 800; letter-spacing: 1px; }
.room-code-display strong { margin-left: 7px; color: var(--purple); font-size: 13px; letter-spacing: 2px; }
.room-code-display button { float: right; border: 0; background: transparent; color: var(--purple); cursor: pointer; font-size: 15px; line-height: 11px; }
.controls-strip { min-height: 63px; margin-top: 15px; padding: 10px 17px; display: flex; align-items: center; gap: 23px; border: 1px solid #e5e0d6; border-radius: 12px; background: #fff; }
.controls-title { display: flex; align-items: center; gap: 8px; padding-right: 17px; border-right: 1px solid #eeeaf0; }
.controls-title > span { color: var(--purple); font-size: 21px; }.controls-title strong, .controls-title small { display: block; }.controls-title strong { font-size: 10px; }.controls-title small { color: var(--muted); font-size: 9px; }
.control-tip { display: flex; align-items: center; gap: 4px; color: #77748a; font-size: 10px; }
kbd { min-width: 21px; padding: 4px 5px; text-align: center; border: 1px solid #e9e6ed; border-radius: 4px; background: #fbfafc; color: #5f5b73; font: 700 9px 'DM Sans', sans-serif; box-shadow: 0 1px 0 #dedbe4; }
.control-tip span { margin-left: 3px; }.mobile-note { display: none; margin-left: auto; color: var(--muted); font-size: 10px; }
.page-footer { min-height: 42px; display: flex; align-items: center; justify-content: space-between; color: #aaa6b4; font-size: 8px; font-weight: 700; letter-spacing: .6px; }.page-footer b { color: #f08ea9; }.page-footer span:last-child { font-size: 9px; font-weight: 500; letter-spacing: 0; }
.touch-controls { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (min-width: 1500px) { .page { width: min(1320px, 86vw); } }
@media (max-width: 950px) {
  .page { width: min(760px, 92vw); }.intro { min-height: 234px; }.mascot { right: 0; transform: scale(.83); transform-origin: right bottom; }
  .game-layout { grid-template-columns: 1fr; }.side-panel { grid-template-columns: 1fr 1.25fr; grid-template-rows: 1fr; }.how-card h2 { margin-bottom: 8px; }.rule { display: inline-flex; width: 32%; margin-top: 3px; gap: 5px; }.rule-icon { width: 24px; height: 24px; }.rule small { font-size: 8px; }
  .play-card { padding-top: 15px; }.controls-strip { gap: 17px; }.mobile-note { display: block; }
}
@media (max-width: 600px) {
  .topbar { height: 61px; padding: 0 5vw; }.brand { font-size: 19px; }.brand-mark { width: 30px; height: 30px; }.online-pill { font-size: 0; }.online-dot { width: 9px; height: 9px; }.topbar-right { gap: 11px; }
  .page { width: 92vw; }.intro { min-height: 195px; align-items: flex-start; }.intro-copy { max-width: 70%; padding: 25px 0 19px; }.eyebrow { font-size: 8px; letter-spacing: 1px; }.intro-copy p { max-width: 280px; margin: 10px 0 12px; font-size: 11px; }.quick-facts { gap: 7px 11px; }.quick-facts span { font-size: 9px; }
  h1 { font-size: clamp(35px, 9vw, 45px); }.mascot { right: -23px; bottom: -8px; transform: scale(.62); transform-origin: right bottom; }
  .game-layout { gap: 10px; }.arena-card { border-radius: 12px; }.arena-topline { height: 39px; padding: 0 11px; }.arena-title { font-size: 8px; letter-spacing: .9px; }.match-clock { min-width: 70px; padding: 5px 7px; font-size: 10px; }.overlay-card { padding: 12px 14px; }.overlay-icon { margin-bottom: 3px; font-size: 20px; }.overlay-kicker { font-size: 7px; }.overlay-card h2 { margin: 4px 0; font-size: 17px; }.overlay-card p { margin-bottom: 8px; font-size: 9px; }.primary-button { padding: 8px 12px; font-size: 10px; }.arena-footer { min-height: 33px; padding: 0 10px; }.arena-hint { font-size: 8px; }.player-pip { width: 12px; height: 12px; }
  .side-panel { grid-template-columns: 1fr; gap: 9px; }.how-card, .play-card { padding: 12px; border-radius: 11px; }.how-card h2 { margin: 5px 0 7px; font-size: 18px; }.rule { width: 32%; gap: 4px; }.rule-icon { width: 22px; height: 22px; font-size: 11px; }.rule strong { font-size: 9px; }.rule small { font-size: 7px; }.play-card { padding-bottom: 11px; }.mode-button { min-height: 43px; }.mode-emoji { width: 25px; height: 25px; }.mode-button strong { font-size: 9px; }.mode-button small { font-size: 8px; }.room-divider { height: 24px; }
  .controls-strip { min-height: 54px; margin-top: 10px; padding: 8px 9px; gap: 10px; justify-content: space-between; }.controls-title { gap: 4px; padding-right: 8px; }.controls-title > span { font-size: 17px; }.controls-title strong { font-size: 9px; }.controls-title small { font-size: 7px; }.control-tip { gap: 2px; font-size: 0; }.control-tip kbd { min-width: 18px; padding: 4px 3px; font-size: 8px; }.control-tip span { display: none; }.mobile-note { font-size: 0; }.mobile-note span { font-size: 15px; }
  .page-footer { min-height: 35px; font-size: 7px; }.page-footer span:last-child { font-size: 8px; }
  .touch-controls { position: fixed; z-index: 5; right: 0; bottom: max(10px, env(safe-area-inset-bottom)); left: 0; padding: 0 18px; justify-content: space-between; pointer-events: none; }.touch-controls.visible { display: flex; }.touch-move, .touch-actions { display: flex; gap: 9px; }.touch-controls button { width: 51px; height: 51px; border: 1px solid #ffffff8c; border-radius: 50%; background: #312855bd; color: #fff; font-size: 22px; font-weight: 800; box-shadow: 0 3px 12px #1c17333b; pointer-events: auto; touch-action: none; }.touch-controls button[data-key="fire"] { background: #f0ad3eeb; color: #3d2a11; font-size: 21px; }
}
