:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #040712;
  color: #f8fbff;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 15%, rgba(0, 214, 255, .16), transparent 28rem),
    radial-gradient(circle at 82% 12%, rgba(255, 35, 151, .15), transparent 30rem),
    linear-gradient(155deg, #050916 0%, #090d1c 55%, #040611 100%);
}

button { font: inherit; }

.game-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: clamp(16px, 3vw, 32px);
}

.game-header,
.score-strip,
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-lockup { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-lockup img { width: 54px; height: 54px; object-fit: contain; }
.brand-lockup h1 { margin: -2px 0 0; font-size: clamp(1.45rem, 4vw, 2.2rem); letter-spacing: .16em; font-style: italic; }
.eyebrow, .panel-tag { color: #82ebff; font-size: .68rem; font-weight: 900; letter-spacing: .2em; }

.icon-button,
.primary-button {
  border: 1px solid rgba(112, 224, 255, .42);
  color: #f8fbff;
  background: rgba(13, 19, 39, .84);
  border-radius: 10px;
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: .08em;
  cursor: pointer;
}

.icon-button { padding: 10px 14px; }
.icon-button[aria-pressed="false"] { color: #8992a7; border-color: rgba(137, 146, 167, .25); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.activity-mode,
.account-button {
  color: #a9f7ff;
  font-size: .63rem;
  font-weight: 900;
  letter-spacing: .12em;
}
.activity-mode { padding: 8px 10px; border: 1px solid rgba(104, 235, 255, .2); border-radius: 999px; }
.arcade-account {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 12px 15px;
  border: 1px solid rgba(130, 235, 255, .17);
  border-radius: 14px;
  background: rgba(7, 12, 28, .78);
}
.arcade-player { display: flex; align-items: center; gap: 11px; min-width: 0; }
.arcade-player > div { display: grid; gap: 2px; min-width: 0; }
.arcade-player strong, .arcade-player span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arcade-player span { color: #8f9ab1; font-size: .74rem; }
.player-avatar {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #05101a;
  background: linear-gradient(135deg, #7ef5e6, #7ac7ff);
  font-weight: 950;
}
.player-avatar img { width: 100%; height: 100%; object-fit: cover; }
.account-button {
  flex: 0 0 auto;
  padding: 10px 13px;
  border: 1px solid rgba(107, 232, 255, .34);
  border-radius: 9px;
  text-decoration: none;
  background: rgba(41, 67, 120, .34);
}

.score-strip {
  margin: 22px 0 12px;
  padding: 13px clamp(14px, 3vw, 28px);
  border: 1px solid rgba(130, 235, 255, .17);
  border-radius: 14px;
  background: rgba(7, 12, 28, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}

.score-strip div { display: grid; min-width: 76px; text-align: center; }
.score-strip span { color: #8791a8; font-size: .64rem; font-weight: 800; letter-spacing: .16em; }
.score-strip strong { margin-top: 2px; font-size: clamp(1.3rem, 4vw, 2rem); font-variant-numeric: tabular-nums; }

.arcade-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; min-width: 0; }

.court-wrap {
  position: relative;
  min-width: 0;
  width: 100%;
  overflow: hidden;
  border: 1px solid rgba(79, 212, 255, .26);
  border-radius: 20px;
  background: #060a16;
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45), 0 0 44px rgba(0, 205, 255, .06);
}

canvas { display: block; width: 100%; max-width: 100%; height: auto; touch-action: none; user-select: none; }

.game-panel {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(520px, calc(100% - 32px));
  transform: translate(-50%, -50%);
  padding: clamp(24px, 5vw, 42px);
  text-align: center;
  border: 1px solid rgba(115, 227, 255, .28);
  border-radius: 18px;
  background: rgba(5, 9, 22, .93);
  box-shadow: 0 22px 70px rgba(0,0,0,.64), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(12px);
}

.game-panel h2 { margin: 10px 0; font-size: clamp(1.55rem, 4vw, 2.35rem); }
.game-panel p { margin: 0 auto 24px; max-width: 430px; color: #bac4d9; line-height: 1.55; }
.game-panel .submit-status { margin: 8px auto 13px; min-height: 1.25em; color: #87f3e4; font-size: .76rem; }
.earned-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.earned-badges span { padding: 5px 8px; border-radius: 999px; color: #07101d; background: #82f3d4; font-size: .62rem; font-weight: 900; }
.primary-button {
  padding: 14px 20px;
  border: 0;
  color: #030711;
  background: linear-gradient(110deg, #80f551 0%, #55edcf 44%, #55d6ff 100%);
  box-shadow: 0 10px 30px rgba(75, 226, 211, .22);
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hidden { display: none; }

.callout {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translate(-50%, -8px) scale(.95);
  opacity: 0;
  color: #fff;
  font-size: clamp(1.25rem, 4vw, 2.2rem);
  font-weight: 1000;
  font-style: italic;
  letter-spacing: .08em;
  text-shadow: 0 0 18px #16e5ff, 0 4px 0 rgba(0,0,0,.35);
  pointer-events: none;
  transition: opacity .15s ease, transform .18s ease;
}
.callout.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

.game-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 9px 14px;
  border: 1px solid rgba(107, 244, 245, .32);
  border-radius: 8px;
  color: #bafcff;
  background: rgba(4, 8, 20, .78);
  font-size: .67rem;
  font-weight: 900;
  letter-spacing: .14em;
  pointer-events: none;
}

footer { padding: 14px 3px 0; color: #7f8aa2; font-size: .76rem; }
footer p { margin: 0; }
footer strong { color: #cbd5e8; }

.leaderboard-card {
  min-height: 100%;
  padding: 20px 17px;
  border: 1px solid rgba(79, 212, 255, .22);
  border-radius: 20px;
  background: rgba(6, 10, 25, .86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .34);
}
.leaderboard-card h2 { margin: 7px 0 17px; font-size: 1.15rem; }
.leaderboard-card ol { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.leaderboard-card li { display: grid; grid-template-columns: 28px 32px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 9px; border-radius: 10px; background: rgba(255,255,255,.035); }
.leaderboard-card li > img,
.leaderboard-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.leaderboard-avatar { display: grid; place-items: center; color: #06101d; background: #78ebdb; font-weight: 900; }
.leaderboard-rank { color: #778299; font-weight: 900; }
.leaderboard-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .76rem; }
.leaderboard-score { color: #83f4d3; font-size: 1rem; }
.leaderboard-card .leaderboard-empty { display: block; color: #8994aa; font-size: .78rem; }
.leaderboard-card > p { margin: 18px 0 0; color: #7e899f; font-size: .7rem; line-height: 1.45; }

@media (max-width: 680px) {
  .game-shell { padding: 12px; }
  .brand-lockup img { width: 44px; height: 44px; }
  .score-strip { gap: 4px; }
  .score-strip div { min-width: 0; }
  .game-panel { padding: 13px 14px; }
  .game-panel h2 { margin: 6px 0; font-size: 1.32rem; }
  .game-panel p { margin-bottom: 12px; font-size: .76rem; line-height: 1.35; }
  .panel-tag { font-size: .58rem; }
  .primary-button { padding: 10px 13px; font-size: .68rem; }
  .game-hint { bottom: 8px; padding: 6px 9px; font-size: .52rem; }
  .header-actions { gap: 5px; }
  .activity-mode { display: none; }
  .arcade-account { align-items: stretch; flex-direction: column; gap: 9px; }
  .account-button { text-align: center; }
  .arcade-layout { grid-template-columns: minmax(0, 1fr); }
  .leaderboard-card { min-height: 0; }
  footer { align-items: flex-start; flex-direction: column; gap: 4px; }
}

@media (min-width: 681px) and (max-width: 1050px) {
  .arcade-layout { grid-template-columns: minmax(0, 1fr); }
  .leaderboard-card { min-height: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
