:root {
  color-scheme: dark;
  --bg: #05091d;
  --panel: rgba(9, 18, 50, 0.82);
  --panel-2: rgba(19, 15, 58, 0.78);
  --line: rgba(76, 208, 255, 0.38);
  --cyan: #31d9ff;
  --blue: #3977ff;
  --purple: #9f4bff;
  --orange: #ff8a00;
  --orange-2: #ffc15d;
  --danger: #ff4869;
  --good: #36f1a2;
  --text: #f7fbff;
  --muted: #9db1cc;
  --shadow: 0 22px 70px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body, #root { min-height: 100%; margin: 0; }
body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 75% 12%, rgba(92, 45, 255, .22), transparent 28%),
    radial-gradient(circle at 20% 65%, rgba(0, 180, 255, .18), transparent 34%),
    linear-gradient(180deg, #030615 0%, #07122f 55%, #040717 100%);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.app-shell { min-height: 100vh; display: flex; flex-direction: column; position: relative; isolation: isolate; }
.app-shell::before,
.app-shell::after {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: -1;
}
.app-shell::before {
  background-image:
    linear-gradient(rgba(49,217,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49,217,255,.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 24%, #000 88%, transparent 100%);
}
.app-shell::after {
  background: radial-gradient(ellipse at center bottom, rgba(0, 139, 255, .15), transparent 55%);
}

.topbar {
  width: min(1500px, calc(100% - 34px));
  margin: 14px auto 0;
  min-height: 70px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 10px 14px 10px 18px;
  border: 1px solid rgba(63,202,255,.22);
  background: linear-gradient(90deg, rgba(2,8,25,.86), rgba(13,20,55,.72));
  box-shadow: 0 15px 45px rgba(0,0,0,.24), inset 0 0 28px rgba(51,184,255,.045);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-logo { width: clamp(150px, 18vw, 300px); height: 48px; object-fit: contain; object-position: left center; filter: drop-shadow(0 0 14px rgba(255,138,0,.24)); }
.brand-version { padding: 4px 9px; border-radius: 999px; background: rgba(255,138,0,.12); border: 1px solid rgba(255,138,0,.32); color: #ffbe61; font-weight: 800; letter-spacing: .06em; font-size: 12px; white-space: nowrap; }
.top-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; justify-content: flex-end; }
.nav-btn, .icon-btn, .primary-btn, .secondary-btn, .card-btn {
  border: 0; cursor: pointer; user-select: none; transition: .2s ease; position: relative; overflow: hidden;
}
.nav-btn {
  min-height: 42px; padding: 0 15px; border-radius: 12px; font-weight: 800; letter-spacing: .02em;
  background: rgba(8,21,58,.86); border: 1px solid rgba(75,205,255,.42); box-shadow: inset 0 0 16px rgba(49,217,255,.06);
}
.nav-btn:hover { transform: translateY(-2px); border-color: var(--cyan); box-shadow: 0 8px 24px rgba(49,217,255,.15), inset 0 0 20px rgba(49,217,255,.12); }
.nav-btn.sponsor { color: #ffe0ad; border-color: rgba(255,138,0,.54); background: rgba(56,27,6,.72); }
.nav-btn.sponsor:hover { border-color: var(--orange-2); box-shadow: 0 8px 26px rgba(255,138,0,.18); }

.main-content { width: 100%; flex: 1; display: flex; flex-direction: column; }
.home {
  width: min(1500px, calc(100% - 34px)); margin: 18px auto 0; flex: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr); gap: 30px; align-items: center;
  min-height: 710px; padding: 30px clamp(16px, 3vw, 50px) 28px;
  border: 1px solid rgba(66,205,255,.18); border-radius: 28px;
  background:
    radial-gradient(circle at 78% 35%, rgba(65, 97, 255, .19), transparent 34%),
    linear-gradient(120deg, rgba(7,13,38,.88), rgba(12,12,47,.78));
  box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.home::before { content:""; position:absolute; width:560px; height:560px; right:-90px; top:-130px; border-radius:50%; border:1px solid rgba(101,78,255,.16); box-shadow: 0 0 100px rgba(74,103,255,.16), inset 0 0 90px rgba(92,43,255,.12); }
.home-copy { position: relative; z-index: 2; }
.eyebrow { display:inline-flex; gap:8px; align-items:center; color:#82e8ff; font-weight:900; letter-spacing:.18em; text-transform:uppercase; font-size:13px; margin-bottom:16px; }
.eyebrow::before { content:""; width:42px; height:2px; background:linear-gradient(90deg,var(--cyan),transparent); }
.game-title { margin: 0; font-size: clamp(48px, 5.2vw, 88px); line-height: .98; letter-spacing: -.055em; font-weight: 950; filter: drop-shadow(0 8px 28px rgba(44,109,255,.17)); }
.game-title span:first-child { display:block; background:linear-gradient(180deg,#fff 0%,#86d8ff 62%,#3676ff 100%); -webkit-background-clip:text; color:transparent; }
.game-title span:last-child { display:block; margin-top:5px; background:linear-gradient(180deg,#fff3c6 0%,#ffb53d 42%,#ff7200 100%); -webkit-background-clip:text; color:transparent; }
.tagline { margin: 22px 0 7px; font-size: clamp(20px,2vw,31px); font-weight: 800; letter-spacing:.08em; color:#edf7ff; }
.english-title { margin:0 0 24px; color:#62cfff; letter-spacing:.18em; font-size:13px; }
.intro { max-width: 720px; color:var(--muted); line-height:1.8; margin:0 0 27px; font-size:15px; }
.hero-actions { display:flex; gap:13px; flex-wrap:wrap; }
.primary-btn { min-width:220px; min-height:62px; padding:0 30px; border-radius:16px; font-size:22px; font-weight:950; letter-spacing:.08em; color:#251000; background:linear-gradient(180deg,#ffd984,#ff9a16 55%,#ef6700); border:1px solid #ffe7b0; box-shadow:0 0 0 5px rgba(255,138,0,.09),0 18px 40px rgba(255,106,0,.2),inset 0 2px 0 rgba(255,255,255,.7); }
.primary-btn:hover { transform:translateY(-3px) scale(1.012); box-shadow:0 0 0 6px rgba(255,138,0,.12),0 22px 52px rgba(255,106,0,.3); }
.secondary-btn { min-height:62px; padding:0 22px; border-radius:16px; font-weight:850; background:rgba(8,22,58,.72); border:1px solid rgba(75,205,255,.35); }
.secondary-btn:hover { transform:translateY(-2px); border-color:var(--cyan); background:rgba(9,31,77,.78); }
.home-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin-top:28px; max-width:730px; }
.stat { padding:14px; border:1px solid rgba(96,203,255,.18); border-radius:14px; background:rgba(7,20,49,.55); }
.stat strong { display:block; font-size:20px; color:#fff; }
.stat span { font-size:12px; color:var(--muted); }

.hero-visual { min-height:600px; position:relative; display:grid; place-items:center; }
.orbit { width:min(42vw,590px); aspect-ratio:1; border-radius:50%; position:relative; display:grid; place-items:center; }
.orbit::before, .orbit::after { content:""; position:absolute; border-radius:50%; border:1px solid rgba(68,214,255,.26); inset:8%; animation:spin 16s linear infinite; box-shadow:0 0 54px rgba(49,217,255,.12); }
.orbit::after { inset:22%; border-color:rgba(167,70,255,.4); animation-direction:reverse; animation-duration:11s; }
.energy-ball { width:35%; aspect-ratio:1; border-radius:50%; background:radial-gradient(circle at 40% 35%,#fff 0 4%,#70eeff 8%,#268cff 20%,#111c5c 43%,#050919 70%); box-shadow:0 0 22px #80efff,0 0 70px rgba(34,129,255,.75),0 0 120px rgba(115,44,255,.45),inset -22px -18px 42px rgba(0,0,0,.65); position:relative; z-index:3; animation:float 3.2s ease-in-out infinite; }
.energy-ball::before { content:""; position:absolute; inset:10%; border-radius:50%; border:2px solid rgba(178,238,255,.55); background:repeating-conic-gradient(from 0deg,transparent 0 14deg,rgba(135,225,255,.18) 15deg 17deg); }
.energy-ball::after { content:""; position:absolute; inset:-28%; border-radius:50%; border:2px solid rgba(87,213,255,.38); box-shadow:inset 0 0 30px rgba(93,176,255,.2); }
.brick-cloud { position:absolute; inset:0; pointer-events:none; }
.floating-brick { position:absolute; width:92px; height:44px; border-radius:9px; border:1px solid rgba(255,255,255,.28); background:linear-gradient(145deg,rgba(42,218,255,.5),rgba(44,72,220,.35)); box-shadow:0 0 25px rgba(45,189,255,.25),inset 0 0 16px rgba(255,255,255,.16); transform:rotate(var(--r)); animation:drift var(--d) ease-in-out infinite alternate; }
.floating-brick:nth-child(2n){background:linear-gradient(145deg,rgba(169,72,255,.54),rgba(66,38,184,.35));box-shadow:0 0 25px rgba(160,70,255,.28)}
.floating-brick:nth-child(3n){background:linear-gradient(145deg,rgba(255,149,42,.55),rgba(205,58,0,.32));box-shadow:0 0 25px rgba(255,118,22,.23)}
.paddle-art { position:absolute; bottom:10%; width:56%; height:62px; border-radius:25px; background:linear-gradient(180deg,#c7eaff 0%,#2d5784 20%,#08101e 53%,#203b61 78%,#82dfff 100%); border:2px solid rgba(105,222,255,.65); box-shadow:0 0 35px rgba(46,194,255,.4),inset 0 0 22px rgba(255,255,255,.15); transform:perspective(600px) rotateX(58deg); }
.paddle-art::after { content:""; position:absolute; inset:13px 16%; border-radius:999px; background:linear-gradient(90deg,#ff7c00,#34dfff,#8a4dff,#ff7c00); filter:blur(1px); box-shadow:0 0 18px rgba(61,218,255,.8); }

.feature-row { width:min(1500px,calc(100% - 34px)); margin:16px auto 0; display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.feature-card { padding:20px; border-radius:18px; display:flex; align-items:center; gap:15px; border:1px solid rgba(69,206,255,.25); background:linear-gradient(135deg,rgba(9,26,66,.92),rgba(7,13,42,.83)); box-shadow:0 14px 40px rgba(0,0,0,.2); min-height:112px; cursor:pointer; transition:.22s ease; }
.feature-card:nth-child(2){border-color:rgba(159,75,255,.36);background:linear-gradient(135deg,rgba(41,17,75,.9),rgba(14,12,48,.84))}
.feature-card:nth-child(3){border-color:rgba(255,138,0,.36);background:linear-gradient(135deg,rgba(69,34,7,.9),rgba(24,14,31,.84))}
.feature-card:hover { transform:translateY(-4px); box-shadow:0 18px 48px rgba(0,0,0,.32); }
.feature-icon { width:62px; height:62px; border-radius:18px; flex:0 0 auto; display:grid; place-items:center; font-size:31px; background:rgba(40,181,255,.12); border:1px solid rgba(78,211,255,.32); }
.feature-card:nth-child(2) .feature-icon { background:rgba(145,66,255,.14); border-color:rgba(170,80,255,.35); }
.feature-card:nth-child(3) .feature-icon { background:rgba(255,138,0,.14); border-color:rgba(255,151,39,.36); }
.feature-card h3 { margin:0 0 5px; font-size:21px; }
.feature-card p { margin:0; color:var(--muted); line-height:1.55; font-size:13px; }

.game-page { width:min(1500px,calc(100% - 34px)); margin:18px auto 0; display:grid; grid-template-columns:minmax(0,1fr) 270px; gap:15px; align-items:start; }
.game-panel { position:relative; border-radius:22px; border:1px solid rgba(78,207,255,.28); background:rgba(2,8,24,.86); box-shadow:var(--shadow); padding:12px; overflow:hidden; }
.canvas-wrap { position:relative; aspect-ratio:16/10; width:100%; overflow:hidden; border-radius:15px; background:#020513; }
.game-canvas { display:block; width:100%; height:100%; touch-action:none; cursor:none; }
.game-overlay { position:absolute; inset:0; display:grid; place-items:center; background:rgba(3,7,22,.52); backdrop-filter:blur(5px); z-index:3; }
.overlay-card { width:min(440px,calc(100% - 30px)); padding:25px; text-align:center; border-radius:20px; border:1px solid rgba(76,211,255,.38); background:linear-gradient(145deg,rgba(10,23,61,.96),rgba(21,13,58,.94)); box-shadow:0 24px 70px rgba(0,0,0,.48); }
.overlay-card h2 { margin:0 0 10px; font-size:30px; }
.overlay-card p { color:var(--muted); line-height:1.7; }
.overlay-actions { display:flex; justify-content:center; flex-wrap:wrap; gap:10px; margin-top:16px; }

.sidebar { display:grid; gap:13px; position:sticky; top:12px; }
.hud-card { border:1px solid rgba(68,209,255,.23); border-radius:17px; background:rgba(7,19,51,.78); box-shadow:0 12px 34px rgba(0,0,0,.22); overflow:hidden; }
.hud-head { padding:13px 15px; color:#a8eaff; font-size:12px; font-weight:900; letter-spacing:.13em; border-bottom:1px solid rgba(72,207,255,.16); }
.hud-body { padding:15px; }
.score-value { font-size:35px; font-weight:950; letter-spacing:.06em; color:#fff; text-shadow:0 0 18px rgba(47,207,255,.32); }
.hud-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin-top:12px; }
.metric { padding:11px; border-radius:12px; background:rgba(0,0,0,.18); }
.metric span { display:block; color:var(--muted); font-size:11px; }
.metric strong { display:block; margin-top:4px; font-size:18px; }
.lives { color:#ff7189; letter-spacing:.12em; }
.skill-list { display:grid; gap:8px; }
.skill { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:10px 11px; border-radius:11px; background:rgba(0,0,0,.18); color:#dceaff; }
.skill small { color:var(--muted); }
.control-list { display:grid; gap:8px; color:var(--muted); font-size:13px; line-height:1.55; }
.game-tools { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.icon-btn { min-height:43px; border-radius:11px; background:rgba(9,29,72,.82); border:1px solid rgba(76,206,255,.25); font-weight:800; }
.icon-btn:hover { border-color:var(--cyan); background:rgba(12,42,94,.86); }
.icon-btn.danger { border-color:rgba(255,72,105,.26); color:#ffacbb; }

.modal-backdrop { position:fixed; inset:0; z-index:100; display:grid; place-items:center; padding:20px; background:rgba(1,4,15,.76); backdrop-filter:blur(13px); animation:fadeIn .16s ease; }
.modal { width:min(760px,100%); max-height:min(88vh,850px); overflow:auto; border-radius:24px; border:1px solid rgba(83,211,255,.32); background:linear-gradient(145deg,rgba(9,24,60,.98),rgba(23,13,54,.98)); box-shadow:0 30px 100px rgba(0,0,0,.58); }
.modal-header { position:sticky; top:0; z-index:2; display:flex; align-items:center; justify-content:space-between; gap:16px; padding:18px 20px; background:rgba(6,15,41,.95); border-bottom:1px solid rgba(79,207,255,.17); backdrop-filter:blur(12px); }
.modal-header h2 { margin:0; font-size:23px; }
.close-btn { width:40px; height:40px; border-radius:50%; border:1px solid rgba(82,213,255,.28); background:rgba(255,255,255,.04); color:#fff; cursor:pointer; font-size:23px; }
.modal-body { padding:22px; }
.sponsor-intro { text-align:center; color:var(--muted); line-height:1.7; margin-top:0; }
.qr-grid { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-top:19px; }
.qr-card { padding:17px; border-radius:17px; background:rgba(255,255,255,.045); border:1px solid rgba(255,255,255,.1); text-align:center; }
.qr-card img { width:min(100%,260px); height:310px; object-fit:contain; box-sizing:border-box; padding:8px; background:#fff; border-radius:13px; display:block; margin:0 auto 12px; }
.qr-card strong { display:block; font-size:18px; }
.qr-card span { color:var(--muted); font-size:12px; }
.info-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:12px; }
.info-item { padding:15px; border-radius:14px; border:1px solid rgba(73,205,255,.18); background:rgba(0,0,0,.16); }
.info-item h3 { margin:0 0 7px; }
.info-item p { margin:0; color:var(--muted); line-height:1.65; font-size:13px; }
.leaderboard { width:100%; border-collapse:collapse; }
.leaderboard th,.leaderboard td { padding:12px 9px; border-bottom:1px solid rgba(255,255,255,.08); text-align:left; }
.leaderboard th { color:#8fdfff; font-size:12px; letter-spacing:.08em; }
.upgrade-options { display:grid; grid-template-columns:repeat(3,1fr); gap:13px; }
.upgrade-card { padding:18px; min-height:180px; border:1px solid rgba(90,209,255,.25); border-radius:17px; background:rgba(5,17,46,.65); cursor:pointer; text-align:left; transition:.2s ease; }
.upgrade-card:hover { transform:translateY(-5px); border-color:var(--cyan); box-shadow:0 16px 35px rgba(49,217,255,.12); }
.upgrade-card .emoji { font-size:38px; }
.upgrade-card h3 { margin:11px 0 7px; }
.upgrade-card p { margin:0; color:var(--muted); line-height:1.6; font-size:13px; }

.footer { width:min(1500px,calc(100% - 34px)); margin:16px auto 12px; padding:16px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; color:#8fa4c1; border-top:1px solid rgba(76,207,255,.14); font-size:12px; }
.footer strong { color:#dceaff; }
.footer a { color:#63d8ff; }

.toast { position:fixed; left:50%; bottom:26px; z-index:120; transform:translateX(-50%); padding:12px 18px; border-radius:13px; background:rgba(6,20,51,.96); border:1px solid rgba(78,209,255,.35); box-shadow:0 16px 45px rgba(0,0,0,.42); animation:toast .28s ease; }

@keyframes spin { to { transform:rotate(360deg); } }
@keyframes float { 50% { transform:translateY(-13px) scale(1.02); } }
@keyframes drift { to { transform:translateY(-18px) rotate(calc(var(--r) + 7deg)); } }
@keyframes fadeIn { from { opacity:0; } }
@keyframes toast { from { opacity:0; transform:translate(-50%,15px); } }

@media (max-width: 1050px) {
  .home { grid-template-columns:1fr; text-align:center; min-height:auto; }
  .home-copy { padding-top:15px; }
  .intro { margin-left:auto; margin-right:auto; }
  .hero-actions { justify-content:center; }
  .home-stats { margin-left:auto; margin-right:auto; }
  .hero-visual { min-height:480px; }
  .orbit { width:min(76vw,560px); }
  .game-page { grid-template-columns:1fr; }
  .sidebar { position:static; grid-template-columns:repeat(2,1fr); }
}
@media (max-width: 760px) {
  .topbar { align-items:flex-start; }
  .brand-logo { width:155px; height:42px; }
  .top-actions { gap:6px; }
  .nav-btn { min-height:38px; padding:0 10px; font-size:12px; }
  .home { padding:22px 14px; border-radius:20px; }
  .game-title { font-size:44px; }
  .tagline { font-size:18px; }
  .hero-visual { min-height:390px; }
  .feature-row { grid-template-columns:1fr; }
  .home-stats { grid-template-columns:1fr; }
  .game-page { width:calc(100% - 16px); }
  .game-panel { padding:6px; border-radius:15px; }
  .sidebar { grid-template-columns:1fr; }
  .qr-grid, .info-grid, .upgrade-options { grid-template-columns:1fr; }
  .footer { flex-direction:column; text-align:center; }
}
@media (max-width: 520px) {
  .topbar { width:calc(100% - 14px); padding:8px; }
  .brand-version { display:none; }
  .brand-logo { width:118px; }
  .nav-btn span.optional { display:none; }
  .home, .feature-row { width:calc(100% - 14px); }
  .game-title { font-size:36px; }
  .primary-btn { width:100%; }
  .secondary-btn { width:100%; }
  .hero-visual { min-height:320px; }
  .floating-brick { width:68px; height:32px; }
}
