/* 6TCG · arcade at night. Grape carpet, marquee yellow, neon pink and LED cyan. */
:root {
  --carpet: #1c0b33;
  --cab: #2d1452;
  --cab-hi: #3d1d6b;
  --line: #5a2f94;
  --yellow: #ffcf33;
  --pink: #ff4f9a;
  --cyan: #45e3ff;
  --cream: #fff3d9;
  --mut: #b9a6d9;
  --ok: #7dff9b;
  --bad: #ff6b7a;
  --pixel: "Press Start 2P", "Rubik", ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  --body: "Rubik", ui-sans-serif, system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { overflow-x: clip; }
body {
  margin: 0; color: var(--cream); font: 16px/1.6 var(--body);
  background-color: var(--carpet);
  /* 90s arcade carpet: scattered stars and squiggles */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cg fill='none' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M18 30q8-10 16 0t16 0' stroke='%23ff4f9a' opacity='.16'/%3E%3Cpath d='M100 110q8-10 16 0t16 0' stroke='%2345e3ff' opacity='.14'/%3E%3Ccircle cx='120' cy='34' r='6' stroke='%23ffcf33' opacity='.12'/%3E%3Cpath d='M40 120l6 6m0-6l-6 6' stroke='%2345e3ff' opacity='.14'/%3E%3C/g%3E%3Cg fill='%23fff3d9' opacity='.12'%3E%3Crect x='76' y='60' width='3' height='3'/%3E%3Crect x='140' y='140' width='3' height='3'/%3E%3Crect x='10' y='82' width='3' height='3'/%3E%3C/g%3E%3C/svg%3E");
}
a { color: var(--cyan); }
img { max-width: 100%; }
code { font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: .9em; word-break: break-all; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.muted { color: var(--mut); }
.small { font-size: 14px; }
.note { color: var(--mut); font-size: 14px; }
.ok { color: var(--ok); } .warn { color: var(--yellow); } .bad { color: var(--bad); }
.up { color: var(--ok); font-style: normal; } .down { color: var(--bad); font-style: normal; }
[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--pixel); font-weight: 400; line-height: 1.45; margin: 0; }
h1 { font-size: clamp(22px, 3.4vw, 36px); color: var(--yellow); text-shadow: 4px 4px 0 var(--pink); letter-spacing: .02em; }
h2 { font-size: clamp(18px, 2.2vw, 24px); color: var(--yellow); margin-bottom: 18px; }
h3 { font-size: 13px; color: var(--cyan); margin-bottom: 14px; }
:lang(zh) h1, :lang(zh) h2, :lang(zh) h3 { font-family: var(--body); font-weight: 700; letter-spacing: .04em; }

/* ── Buttons: chunky arcade buttons with a hard bottom edge ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font: 12px/1 var(--pixel); color: var(--carpet); background: var(--yellow);
  border: 3px solid var(--carpet); padding: 12px 16px; text-decoration: none; cursor: pointer;
  box-shadow: 0 5px 0 #b38a12, 0 5px 0 3px var(--carpet);
  transform: translateY(0); transition: transform .06s, box-shadow .06s;
}
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #b38a12, 0 1px 0 3px var(--carpet); }
.btn.alt { background: var(--pink); color: var(--cream); box-shadow: 0 5px 0 #a8255f, 0 5px 0 3px var(--carpet); }
.btn.alt:active { box-shadow: 0 1px 0 #a8255f, 0 1px 0 3px var(--carpet); }
.btn.big { font-size: 13px; padding: 16px 20px; }
.btn.sm { font-size: 10px; padding: 9px 11px; }
.btn[disabled] { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn img { width: 18px; height: 18px; }
:lang(zh) .btn { font-family: var(--body); font-weight: 700; font-size: 15px; }
.key {
  font: 500 14px/1 var(--body); color: var(--cream); background: var(--cab); border: 2px solid var(--line);
  padding: 8px 12px; cursor: pointer;
}
.key:hover { border-color: var(--cyan); }
.key[aria-pressed="true"] { background: var(--cyan); color: var(--carpet); border-color: var(--cyan); }
.key.bad { color: var(--bad); }

/* ── Cabinet ── */
.cab { height: 100vh; height: 100dvh; max-width: 1280px; margin: 0 auto; display: grid; grid-template-rows: auto 1fr auto; padding: 10px clamp(6px, 2vw, 22px) 0; }
.marquee {
  position: relative; display: flex; align-items: center; gap: 16px; padding: 12px 20px 18px;
  background: linear-gradient(#3d1d6b, #2d1452); border: 4px solid #12061f; border-bottom: 0;
  border-radius: 18px 18px 0 0;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo img { image-rendering: pixelated; }
.logo span { font: 26px var(--pixel); color: var(--yellow); text-shadow: 3px 3px 0 var(--pink), 0 0 18px rgba(255, 207, 51, .45); }
.bulbs { position: absolute; left: 16px; right: 16px; bottom: 5px; height: 8px;
  background: radial-gradient(circle, #fff3d9 0 2px, var(--yellow) 3px, transparent 4px) 0 0 / 22px 8px repeat-x; opacity: .85; }
.mq-r { margin-left: auto; display: flex; gap: 10px; align-items: center; }
.coin { font: 11px/1 var(--pixel); color: var(--carpet); background: var(--yellow); border: 3px solid #12061f; padding: 11px 14px; cursor: pointer; box-shadow: 0 4px 0 #b38a12; display: inline-flex; gap: 8px; align-items: center; }
.coin img { width: 18px; height: 18px; }
:lang(zh) .coin { font: 700 15px var(--body); }
.acct { position: relative; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 10px); width: 270px; display: grid; gap: 8px; padding: 14px; background: var(--cab); border: 3px solid var(--cyan); z-index: 30; }
.acct-row { display: flex; gap: 8px; align-items: center; }
.acct-row img { width: 22px; height: 22px; }

.screen {
  position: relative; overflow-y: auto; overscroll-behavior: contain;
  border: 14px solid #12061f; border-top-width: 10px; border-radius: 0 0 6px 6px;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .22) 0 1px, transparent 1px 3px) fixed, radial-gradient(ellipse at 50% 40%, #241044, #0d0518 75%);
  box-shadow: inset 0 0 60px rgba(69, 227, 255, .08);
}
.modes { position: sticky; top: 0; z-index: 5; display: flex; justify-content: center; gap: 4px clamp(10px, 2.4vw, 30px); flex-wrap: wrap; padding: 14px 12px 12px; background: rgba(13, 5, 24, .92); border-bottom: 2px dashed #3b2066; }
.modes a { font: 11px/1.6 var(--pixel); color: var(--mut); text-decoration: none; padding: 4px 2px 4px 18px; position: relative; }
.modes a:hover { color: var(--cream); }
.modes a[aria-current="page"] { color: var(--yellow); }
.modes a[aria-current="page"]::before { content: "▶"; position: absolute; left: 0; color: var(--pink); }
:lang(zh) .modes a { font: 700 16px var(--body); }
.mode { padding: 24px clamp(14px, 3vw, 40px) 40px; max-width: 1120px; margin: 0 auto; }

/* PLAY: arcade attract screen */
#m-play { display: grid; justify-items: center; gap: 10px; text-align: center; padding-top: 14px; }
#m-play[hidden] { display: none; }
.hud { width: 100%; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.hud div { display: grid; gap: 6px; }
.hud span { font: 9px var(--pixel); color: var(--pink); }
:lang(zh) .hud span { font: 700 14px var(--body); }
.hud b { font: 15px var(--pixel); color: var(--cream); }
.hud .hud-hi b { color: var(--yellow); text-shadow: 0 0 12px rgba(255, 207, 51, .5); }
.stage { display: grid; place-items: center; }
.stage .smash { width: min(400px, 78vw, 52vh); }
.attract h1 { font-size: clamp(14px, 1.8vw, 20px); text-shadow: 3px 3px 0 var(--pink); }
.attract .smash-cap { margin: 10px auto 0; }
.credit { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 2px dashed #3b2066; background: rgba(13, 5, 24, .6); }
.credit > span { font: 10px var(--pixel); color: var(--pink); }
.credit code { color: var(--yellow); }
.credit code.na { font: 14px/1.5 var(--body); color: var(--mut); max-width: 36em; word-break: normal; }
@media (max-width: 640px) { .hud { grid-template-columns: 1fr 1fr; } .logo span { font-size: 18px; } .marquee { padding: 10px 12px 16px; } }

/* Control deck */
.deck {
  display: flex; align-items: center; justify-content: center; gap: clamp(14px, 4vw, 46px); padding: 14px 18px 16px;
  background: linear-gradient(#3d1d6b, #22103f); border: 4px solid #12061f; border-top: 0;
  clip-path: polygon(0 0, 100% 0, 97% 100%, 3% 100%);
}
.stick { width: 64px; height: 64px; border-radius: 50%; background: #12061f; display: grid; place-items: center; box-shadow: inset 0 3px 0 rgba(255, 255, 255, .08); }
.stick i { width: 30px; height: 30px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff9ac4, var(--pink) 55%, #a8255f); box-shadow: 0 6px 0 #5c1238; transform: translateY(-8px); }
.pad { display: grid; justify-items: center; gap: 6px; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: none; color: var(--cream); }
.pad i { width: 58px; height: 58px; border-radius: 50%; border: 4px solid #12061f; box-shadow: 0 6px 0 #12061f; transition: transform .06s, box-shadow .06s; }
.pad:active i { transform: translateY(5px); box-shadow: 0 1px 0 #12061f; }
.pad span { font: 10px var(--pixel); }
:lang(zh) .pad span { font: 700 14px var(--body); }
.pad.yellow i { background: radial-gradient(circle at 35% 30%, #fff0b3, var(--yellow) 60%, #b38a12); }
.pad.pink i { background: radial-gradient(circle at 35% 30%, #ffc2dc, var(--pink) 60%, #a8255f); }
.pad.cyan i { background: radial-gradient(circle at 35% 30%, #d4faff, var(--cyan) 60%, #1e8fa8); }
@media (max-width: 640px) { .stick { display: none; } .pad i { width: 48px; height: 48px; } .deck { clip-path: none; } }

/* ── Smash stage ── */
.smash {
  position: relative; width: min(380px, 86vw); aspect-ratio: 1 / 1.08; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 62%, rgba(255, 79, 154, .22), transparent 62%);
}
.smash::after { /* floor shadow */
  content: ""; position: absolute; left: 22%; right: 22%; bottom: 10%; height: 18px; background: rgba(0, 0, 0, .45); border-radius: 50%; z-index: 0;
}
.crate { position: relative; z-index: 1; width: 74%; padding: 0; border: 0; background: none; cursor: pointer; }
.crate svg { display: block; width: 100%; image-rendering: pixelated; }
.crate:focus-visible { outline-offset: 8px; }
.ck { fill: none; stroke: #12061f; stroke-width: .9; stroke-linejoin: miter; opacity: 0; }
.smash.h1 .ck1, .smash.h2 .ck1, .smash.h2 .ck2, .smash.h3 .ck { opacity: 1; }
.smash.bump .crate { animation: bump .22s steps(4); }
@keyframes bump {
  0% { transform: translate(0, 0) scale(1, 1); }
  25% { transform: translate(-6px, 4px) scale(1.06, .9); }
  50% { transform: translate(6px, -3px) scale(.96, 1.05); }
  75% { transform: translate(-3px, 1px) rotate(-2deg); }
  100% { transform: none; }
}
.smash.broken .crate { animation: pop .38s steps(3) forwards; }
@keyframes pop { to { transform: scale(1.25); opacity: 0; } }
.debris { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.dust, .shard { position: absolute; left: 50%; top: 50%; }
.dust { width: 6px; height: 6px; animation: fly .55s ease-out forwards; }
.shard { animation: fly 1s cubic-bezier(.2, .7, .4, 1) forwards; }
@keyframes fly {
  from { transform: translate(-50%, -50%) rotate(0); opacity: 1; }
  to { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) rotate(var(--r, 90deg)); opacity: 0; }
}
.reveal { position: relative; z-index: 2; display: grid; justify-items: center; gap: 10px; text-align: center; animation: rise .5s steps(6) both; }
@keyframes rise { from { transform: translateY(40px) scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.slab {
  width: min(190px, 46vw); padding: 8px; background: #e9e4f5; border: 3px solid var(--tc, var(--yellow));
  box-shadow: 0 0 0 4px var(--carpet), 0 0 38px 6px color-mix(in srgb, var(--tc, #ffcf33) 60%, transparent);
}
.slab img { display: block; width: 100%; }
.info { display: grid; gap: 4px; justify-items: center; }
.info .tier { font: 10px var(--pixel); color: var(--carpet); background: var(--tc); padding: 5px 8px; }
.info .nm { font-size: 15px; max-width: 26em; }
.info .vl { color: var(--mut); font-size: 14px; }
.info .vl b { color: var(--yellow); }
.info .pv { font-size: 12px; color: var(--mut); }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.hitbar { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 12px; justify-content: center; align-items: center; font: 10px var(--pixel); color: var(--cream); z-index: 2; }
:lang(zh) .hitbar { font: 500 14px var(--body); }
.pips { display: inline-flex; gap: 5px; }
.pips i { width: 14px; height: 14px; border: 2px solid var(--yellow); }
.pips i.on { background: var(--pink); border-color: var(--pink); }
.smash .reveal:not([hidden]) + .hitbar { display: none; }
.smash.broken::after { display: none; }
@media (prefers-reduced-motion: reduce) {
  .smash.bump .crate, .reveal, .smash.broken .crate { animation: none; }
}

/* ── Mode screens ── */
.mode h2 { text-align: center; }
.h2b { margin-top: 40px; }
.sub { color: var(--mut); max-width: 44em; margin: -6px auto 24px; text-align: center; }
.panel { background: var(--cab); border: 3px solid var(--line); padding: 20px; box-shadow: inset 3px 3px 0 rgba(255, 255, 255, .06), inset -3px -3px 0 rgba(0, 0, 0, .3); }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-h h3 { margin: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

/* How to play: a cabinet instruction card */
.steps { list-style: none; counter-reset: s; padding: 0; margin: 0 0 34px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.steps li { counter-increment: s; background: var(--cab); border: 3px solid var(--line); padding: 18px; position: relative; }
.steps li::before { content: counter(s); position: absolute; top: -14px; left: 14px; font: 14px var(--pixel); background: var(--pink); color: var(--cream); padding: 6px 9px; border: 3px solid var(--carpet); }
.steps b { display: block; margin: 8px 0 6px; color: var(--yellow); font-size: 17px; }
.steps p { margin: 0; color: var(--cream); font-size: 15px; }
@media (max-width: 900px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (max-width: 540px) { .steps { grid-template-columns: 1fr; } }

.ladder { display: grid; grid-template-columns: repeat(4, 1fr); align-items: end; gap: 10px; margin-bottom: 10px; }
.rung { display: grid; gap: 6px; padding: 14px; background: var(--cab); border: 3px solid var(--line); }
.rung:nth-child(1) { min-height: 110px; } .rung:nth-child(2) { min-height: 135px; } .rung:nth-child(3) { min-height: 160px; }
.rung.top { min-height: 185px; border-color: var(--yellow); background: linear-gradient(var(--cab-hi), var(--cab)); }
.rung i { font: 10px var(--pixel); color: var(--mut); font-style: normal; }
.rung b { font: 20px var(--pixel); color: var(--yellow); }
.rung span { color: var(--cream); font-size: 14px; }

/* Rewards */
.kv-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; }
.kv-list dt { color: var(--mut); }
.kv-list dd { margin: 0; }
.big-num { font: 14px var(--pixel); }
.lv-big { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.lv-big i { font: 14px var(--pixel); color: var(--pink); font-style: normal; }
.lv-big b { font: 32px var(--pixel); color: var(--yellow); }
.xp { height: 18px; border: 3px solid var(--cream); background: var(--carpet); padding: 2px; }
.xp div { height: 100%; background: repeating-linear-gradient(90deg, var(--ok) 0 10px, transparent 10px 12px); }
.scores { margin-bottom: 20px; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; color: var(--mut); font-weight: 500; padding: 8px 10px; border-bottom: 3px solid var(--line); }
.tbl td { padding: 10px; border-bottom: 2px dashed #3b2066; vertical-align: middle; }
.tbl .num { font-variant-numeric: tabular-nums; }
#epochTbl tbody tr:nth-child(-n+3) td:first-child:not([colspan]) { color: var(--yellow); }
.tbl.kv td:first-child { color: var(--mut); width: 42%; }
.tag { font-size: 13px; padding: 2px 8px; border: 2px solid currentColor; }
.calc { display: grid; grid-template-columns: 1fr 280px; gap: 20px; align-items: start; }
.calc h3 { grid-column: 1 / -1; margin: 0; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form label { display: grid; gap: 6px; font-size: 14px; color: var(--mut); }
.form input, .form select { font: 16px var(--body); color: var(--cream); background: var(--carpet); border: 2px solid var(--line); padding: 9px 10px; }
.out { display: grid; gap: 8px; padding: 16px; background: #0d0518; border: 3px solid var(--cyan); }
.out span { color: var(--mut); font-size: 14px; }
.out b { font: 20px var(--pixel); color: var(--cyan); }
.out small { color: var(--mut); }
@media (max-width: 760px) { .calc { grid-template-columns: 1fr; } .form { grid-template-columns: 1fr; } }

/* Boxes */
.bx-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.bx { background: var(--cab); border: 3px solid var(--line); padding: 18px; display: grid; gap: 12px; align-content: start; }
.bx:hover { border-color: var(--pink); }
.bx-art { width: 96px; margin: 0 auto; }
.bx-art svg { display: block; width: 100%; image-rendering: pixelated; }
.bx-art .ck { display: none; }
.bx h3 { color: var(--cream); font-size: 11px; text-align: center; margin: 0; }
:lang(zh) .bx h3 { font-size: 16px; }
.bx dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 14px; }
.bx dt { color: var(--mut); } .bx dd { margin: 0; text-align: right; }
.odds { display: flex; flex-wrap: wrap; gap: 6px; }
.odds i { font-style: normal; font-size: 12px; padding: 2px 6px; border: 2px solid var(--tc); color: var(--tc); }
.top3 { display: flex; gap: 8px; justify-content: center; min-height: 60px; }
.top3 img { width: 30%; max-width: 70px; border: 2px solid var(--line); background: #e9e4f5; }
.bx .row { justify-content: stretch; }
.bx .row > * { flex: 1; }

/* Prize counter */
.indices { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.idx { display: grid; gap: 2px; padding: 10px 14px; background: #0d0518; border: 2px solid var(--line); min-width: 150px; }
.idx span { color: var(--mut); font-size: 13px; }
.idx b { font: 13px var(--pixel); color: var(--cream); }
.idx em { font-size: 13px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.prizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.prize { display: grid; gap: 6px; color: var(--cream); text-decoration: none; padding: 10px; background: var(--cab); border: 3px solid var(--line); }
.prize:hover { border-color: var(--yellow); }
.shelf { aspect-ratio: 3 / 4; display: grid; place-items: center; background: #e9e4f5; overflow: hidden; }
.shelf img { width: 100%; height: 100%; object-fit: contain; }
.prize .g { color: var(--mut); font-size: 12px; }
.prize .n { font-size: 14px; line-height: 1.35; }
.prize .tk { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; border-top: 2px dashed #3b2066; }
.prize .tk b { font: 11px var(--pixel); color: var(--yellow); }
.prize .tk em { font-size: 12px; }

/* FAQ */
details { background: var(--cab); border: 3px solid var(--line); margin-bottom: 10px; }
summary { cursor: pointer; padding: 14px 18px; font-weight: 500; font-size: 17px; }
details[open] summary { color: var(--yellow); }
details p { margin: 0; padding: 0 18px 16px; max-width: 48em; }

.foot { text-align: center; padding: 30px 0 0; color: var(--mut); font-size: 14px; }
.foot a { color: var(--mut); margin-left: 10px; }

/* Modals */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(13, 5, 24, .82); display: grid; place-items: center; padding: 16px; }
.modal-c { width: min(440px, 100%); }
.wlist { display: grid; gap: 8px; margin: 8px 0 14px; }
.wbtn { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--carpet); color: var(--cream); border: 2px solid var(--line); font: 500 15px var(--body); cursor: pointer; text-decoration: none; }
.wbtn:hover { border-color: var(--cyan); }
.wbtn img, .wbtn .ini { width: 26px; height: 26px; }
.wbtn .ini { display: grid; place-items: center; background: var(--pink); font: 10px var(--pixel); }
.wbtn small { margin-left: auto; color: var(--mut); }
.smash-modal { position: relative; display: grid; justify-items: center; gap: 8px; padding: 26px 20px 30px; background: var(--cab); border: 4px solid var(--pink); width: min(460px, 100%); }
.smash-modal h3 { color: var(--cream); text-align: center; max-width: 85%; }
.sm-x { position: absolute; top: 10px; right: 10px; }

#toast { position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; background: var(--yellow); color: var(--carpet); padding: 12px 18px; font-weight: 700; border: 3px solid var(--carpet); transition: transform .2s; z-index: 60; }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
