/* ===================== v2: arcade extras ===================== */

/* Scanline intensity */
body.scan-off .scan { display: none; }
body.scan-high .scan { background: repeating-linear-gradient(0deg, rgba(0,0,0,.42) 0 2px, transparent 2px 3px); }

/* Shell + optional cabinet frame on large screens */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.marquee { display: none; }
@media (min-width: 1500px) {
  body.cabinet { background: #05030A; padding: 22px 0 40px; }
  body.cabinet .shell { width: 1340px; max-width: calc(100% - 140px); margin: 0 auto; min-height: calc(100vh - 62px); background: var(--bg); border: 14px solid #1B0E2E; outline: 6px solid #3A2A5C; box-shadow: 0 0 0 12px #0A0612, 0 30px 90px rgba(0,0,0,.7), inset 0 0 80px rgba(41,243,255,.06); border-radius: 18px; position: relative; }
  body.cabinet .marquee { display: flex; align-items: center; justify-content: center; gap: 18px; height: 70px; background: #12081F; border-bottom: 6px solid #3A2A5C; font-family: var(--pixel); font-size: 24px; color: var(--pink); text-shadow: 4px 4px 0 var(--cyan); animation: glow 2.4s ease-in-out infinite; border-radius: 6px 6px 0 0; }
  body.cabinet .shell::before, body.cabinet .shell::after { content: ""; position: absolute; top: 120px; width: 26px; height: 260px; background: repeating-linear-gradient(0deg, #3A2A5C 0 4px, transparent 4px 10px); }
  body.cabinet .shell::before { left: -52px; }
  body.cabinet .shell::after { right: -52px; }
}
.marquee-coin { width: 26px; height: 26px; background: var(--yellow); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); animation: coin 1.2s steps(6) infinite; }
@keyframes glow { 0%,100% { box-shadow: inset 0 -6px 18px rgba(255,43,214,.25); } 50% { box-shadow: inset 0 -6px 30px rgba(255,43,214,.5); } }

/* Header icon buttons */
.icon-btn { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 10px; color: var(--muted); border-color: var(--line); }
.icon-btn.on { color: var(--green); border-color: var(--green); }

/* Live ticker */
.ticker { border-top: 3px solid var(--line); border-bottom: 3px solid var(--line); background: var(--panel); overflow: hidden; white-space: nowrap; }
.ticker-track { display: inline-flex; gap: 46px; padding: 10px 20px; width: max-content; font-size: 21px; }
.ticker-track.moving { animation: tick 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tick { from { transform: translateX(0) } to { transform: translateX(-50%) } }
.tk { font-family: var(--pixel); font-size: 9px; padding: 4px 6px; color: var(--bg); margin-right: 10px; }
.tk-buy { background: var(--green); } .tk-sell { background: var(--red); } .tk-new { background: var(--yellow); }
.tk-boss { background: var(--pink); color: var(--text); } .tk-whale { background: #FFB14A; }
.ticker a { color: var(--text); text-decoration: none; } .ticker a:hover { color: var(--yellow); }

/* Boot screen */
.boot { position: fixed; inset: 0; z-index: 80; background: #05030A; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.boot-screen { width: min(860px, calc(100% - 32px)); min-height: min(520px, 80vh); box-sizing: border-box; background: #0A0612; border: 14px solid #1B0E2E; outline: 6px solid #3A2A5C; border-radius: 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 30px 16px; box-shadow: inset 0 0 70px rgba(41,243,255,.12); animation: power 1.3s ease-out both; text-align: center; }
@keyframes power { 0%,35% { transform: scale(1,.004); filter: brightness(4); } 60% { transform: scale(1,1); filter: brightness(1.8); } 100% { transform: none; filter: none; } }
.boot-title { font-family: var(--pixel); font-size: clamp(34px, 8vw, 64px); line-height: 1.15; color: var(--pink); text-shadow: 6px 6px 0 var(--cyan); animation: flick 4s linear infinite; }
.boot-sub { font-size: 28px; color: #D6CCF0; }
.boot-row { display: flex; gap: 34px; flex-wrap: wrap; justify-content: center; font-family: var(--pixel); font-size: 14px; }
.boot-credit { color: var(--cyan); } .boot-prompt { color: var(--yellow); }
.boot-slot { position: relative; width: 118px; height: 86px; background: #12081F; border: 4px solid var(--line); color: var(--yellow); font-family: var(--pixel); font-size: 9px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding-bottom: 10px; cursor: pointer; margin-top: 20px; }
.boot-hole { width: 8px; height: 30px; background: #000; border: 2px solid var(--yellow); }
.boot-coin { position: absolute; top: -34px; width: 28px; height: 28px; background: var(--yellow); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); animation: bob 1.2s steps(3) infinite; }
.boot-slot.dropped .boot-coin { animation: drop .55s ease-in forwards; }
@keyframes drop { 0% { transform: translateY(0) scaleX(1); } 70% { transform: translateY(44px) scaleX(.2); opacity: 1; } 100% { transform: translateY(46px) scaleX(.1); opacity: 0; } }
.boot-hint { font-family: var(--pixel); font-size: 9px; color: #8C80B0; }
.boot-skip { position: absolute; top: 18px; right: 18px; min-height: 44px; padding: 0 14px; background: transparent; border: 3px solid var(--line); color: var(--muted); font-family: var(--pixel); font-size: 10px; cursor: pointer; }
.boot-out { animation: bootout .45s ease-in forwards; }
@keyframes bootout { to { opacity: 0; transform: scale(1.04); } }

/* Mascot */
.mascot { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.mascot-svg { width: 150px; height: 150px; image-rendering: pixelated; animation: bob 1.4s steps(4) infinite; }
.mascot.small .mascot-svg { width: 90px; height: 90px; }
.mascot-shadow { width: 100px; height: 10px; background: rgba(0,0,0,.55); }
.mascot.small .mascot-shadow { width: 60px; }
.mascot-bubble { background: var(--text); color: var(--bg); padding: 10px 14px; font-family: var(--pixel); font-size: 10px; line-height: 1.6; max-width: 260px; text-align: center; box-shadow: 4px 4px 0 var(--pink); position: relative; margin-bottom: 8px; }
.mascot-bubble::after { content: ""; position: absolute; bottom: -12px; left: 50%; margin-left: -8px; border: 8px solid transparent; border-top: 12px solid var(--text); border-bottom: 0; }
.mascot .m-sad, .mascot .m-tear { display: none; }
.mascot[data-mood="sad"] .m-happy { display: none; }
.mascot[data-mood="sad"] .m-sad, .mascot[data-mood="sad"] .m-tear { display: inline; }
.mascot[data-mood="happy"] .mascot-svg { animation: jump .5s steps(4) 3; }
.mascot[data-mood="sad"] .mascot-svg { animation: shake .35s steps(2) 4; }
.m-eyes { animation: blinkeye 4s infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes jump { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-26px); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes blinkeye { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }

/* Konami rainbow mode */
body.rainbow .logo, body.rainbow .hero h1, body.rainbow .coin-head h1, body.rainbow .marquee { animation: hue 3s linear infinite; }
body.rainbow .mascot-svg { animation: hue 3s linear infinite, bob 1.4s steps(4) infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }

/* Home extras */
.hero { display: flex; flex-wrap: wrap; gap: 30px; align-items: center; justify-content: center; text-align: center; }
.hero-main { flex: 1 1 520px; min-width: 0; }
.live-dot { display: inline-flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 10px; color: var(--green); margin-top: 18px; }
.live-dot i { width: 10px; height: 10px; background: var(--green); animation: blink 1s steps(1) infinite; }
.king { border: 4px solid var(--yellow); background: #1C1600; padding: 20px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--pink); text-decoration: none; color: var(--text); }
.king:hover { color: var(--text); }
.king-ava { position: relative; flex: none; }
.king .avatar { width: 92px; height: 92px; font-size: 22px; }
.crown { position: absolute; top: -30px; left: 50%; margin-left: -28px; width: 56px; height: 34px; image-rendering: pixelated; animation: crown 2s ease-in-out infinite; transform-origin: 50% 100%; }
.crown.sm { top: -20px; margin-left: -18px; width: 36px; height: 22px; }
@keyframes crown { 0%,100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-6px) rotate(6deg); } }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters button { font-family: var(--pixel); font-size: 10px; min-height: 44px; padding: 0 10px; border: 3px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.filters button.on { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.filters button.boss.on { background: var(--pink); border-color: var(--pink); color: var(--text); }
.search { display: flex; align-items: center; gap: 8px; border: 3px solid var(--line); padding: 0 10px; min-height: 44px; flex-direction: row; }
.search input { border: 0; min-height: 38px; padding: 0; width: 180px; background: transparent; }
.card { position: relative; }
.card .boss-tag { position: absolute; top: -12px; right: 10px; font-family: var(--pixel); font-size: 9px; padding: 4px 6px; background: var(--pink); color: var(--text); }
.xp { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.xp b { font-family: var(--pixel); font-size: 8px; color: var(--yellow); font-weight: normal; }
.xp i { flex: 1; height: 10px; border: 2px solid var(--line); display: block; position: relative; }
.xp i::after { content: ""; position: absolute; inset: 0; width: var(--xp, 0%); background: var(--yellow); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.bdg { font-family: var(--pixel); font-size: 8px; padding: 4px 5px; border: 2px solid currentColor; }

/* Coin page: boss fight */
.boss { border: 4px solid var(--pink); background: var(--panel); box-shadow: 0 0 0 4px var(--bg), 0 0 0 8px var(--cyan); position: relative; overflow: hidden; margin: 8px 8px 28px; }
.boss-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 18px; border-bottom: 3px solid var(--line); font-family: var(--pixel); font-size: 11px; }
.boss-body { display: flex; flex-wrap: wrap; gap: 18px; padding: 18px; }
.arena { flex: 1 1 420px; min-width: 0; min-height: 250px; background: var(--bg); border: 3px solid var(--line); display: flex; align-items: flex-end; justify-content: space-around; padding: 16px; position: relative; }
.arena::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 46px; background: repeating-linear-gradient(90deg, #1B0E2E 0 40px, #170C28 40px 80px); }
.arena > * { position: relative; z-index: 1; }
.fighter { display: flex; flex-direction: column; align-items: center; gap: 8px; font-family: var(--pixel); font-size: 9px; }
.fighter svg { width: 120px; height: 120px; image-rendering: pixelated; }
.fighter.bot svg { width: 150px; height: 150px; animation: shake .35s steps(2) infinite; }
.vs { font-family: var(--pixel); font-size: 22px; color: var(--yellow); align-self: center; }
.boss-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.hp { height: 26px; border: 4px solid var(--text); padding: 3px; }
.hp i { display: block; height: 100%; background: var(--pink); transition: width .5s steps(5); }
.combat-log { border: 3px solid var(--line); background: var(--bg); padding: 10px 12px; min-height: 160px; max-height: 220px; overflow-y: auto; font-size: 20px; }
.combat-log div { animation: logIn .3s steps(3) both; }
@keyframes logIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.defeated { padding: 30px 18px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; position: relative; }
.defeated::before { content: ""; position: absolute; left: 50%; top: 50%; width: 1000px; height: 1000px; margin: -500px 0 0 -500px; background: repeating-conic-gradient(rgba(255,230,0,.07) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.defeated > * { position: relative; }
.defeated h2 { font-family: var(--pixel); font-size: clamp(26px, 5vw, 48px); line-height: 1.15; color: var(--yellow); text-shadow: 6px 6px 0 var(--pink); margin: 0; }
.defeated h2.boom { animation: boom .7s cubic-bezier(.2,.9,.3,1.3) both; }
@keyframes boom { 0% { transform: scale(.2); opacity: 0; } 40% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; width: 100%; max-width: 760px; }
.stat { border: 3px solid var(--line); background: var(--bg); padding: 14px; text-align: center; }
.stat b { display: block; font-family: var(--pixel); font-size: 22px; font-weight: normal; }
.stat span { color: var(--muted); }
.rain { position: absolute; top: -30px; width: 20px; height: 20px; background: var(--yellow); clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); animation: rain 2.6s linear infinite; pointer-events: none; }
@keyframes rain { to { transform: translateY(560px) rotate(540deg); } }

/* Coin page: levels */
.levels { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.lvl { border: 3px solid var(--line); background: var(--bg); padding: 10px 6px; text-align: center; font-family: var(--pixel); font-size: 9px; color: #8C80B0; }
.lvl b { display: block; font-size: 11px; color: var(--text); margin-top: 8px; font-weight: normal; }
.lvl.done { border-color: var(--green); color: var(--green); }
.lvl.cur { border-color: var(--yellow); background: #2A2200; color: var(--yellow); }
.xpbar { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 4px; height: 30px; border: 4px solid var(--text); padding: 4px; margin-top: 12px; }
.xpbar i { background: #1B0E2E; } .xpbar i.f { background: var(--yellow); } .xpbar i.f2 { background: #FFB14A; }
.levelup-pop { position: fixed; left: 50%; top: 40%; z-index: 70; transform: translate(-50%, -50%); font-family: var(--pixel); font-size: clamp(26px, 6vw, 56px); color: var(--green); text-shadow: 5px 5px 0 var(--bg), 8px 8px 0 var(--pink); pointer-events: none; animation: lvlpop 2.2s ease-out forwards; text-align: center; line-height: 1.3; }
@keyframes lvlpop { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 100% { opacity: 0; transform: translate(-50%, -70%); } }
@media (max-width: 640px) { .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Coin page: achievements + safety */
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ach-item { border: 3px solid var(--line); background: var(--bg); padding: 12px 8px; text-align: center; color: #8C80B0; opacity: .55; }
.ach-item.on { opacity: 1; border-color: currentColor; }
.ach-item svg { width: 40px; height: 40px; image-rendering: pixelated; }
.ach-item b { display: block; font-family: var(--pixel); font-size: 8px; line-height: 1.5; margin-top: 8px; font-weight: normal; }
.ach-item span { display: block; font-size: 17px; color: var(--muted); line-height: 1.1; margin-top: 4px; }
.safe-row { display: flex; gap: 12px; align-items: flex-start; border-bottom: 2px dotted var(--line); padding-bottom: 10px; }
.safe-row svg { width: 22px; height: 22px; flex: none; margin-top: 2px; image-rendering: pixelated; }
.safe-row small { display: block; font-size: 18px; color: var(--muted); }

/* Pixel chart */
.chart-box { position: relative; border: 3px solid var(--line); background: var(--bg); height: 300px; }
.chart-box svg { width: 100%; height: 100%; display: block; shape-rendering: crispEdges; }
.tf { display: flex; gap: 6px; flex-wrap: wrap; }
.tf button { font-family: var(--pixel); font-size: 10px; min-height: 40px; padding: 0 9px; border: 3px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.tf button.on { background: var(--cyan); border-color: var(--cyan); color: var(--bg); }
.chart-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 10px; }

/* Share */
.dialog-wide { max-width: 860px; }
.share-canvas { width: 100%; height: auto; border: 3px solid var(--line); }

/* Player page */
.player-head { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.player-ava { width: 84px; height: 84px; background: var(--pink); display: flex; align-items: center; justify-content: center; flex: none; }
.player-ava svg { width: 56px; height: 56px; image-rendering: pixelated; }
.radio-row { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 14px; }
.radio-row legend { color: var(--muted); margin-bottom: 6px; padding: 0; }
.coin-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

@media (prefers-reduced-motion: reduce) {
  .ticker-track.moving, .mascot-svg, .crown, .defeated::before, .rain, .fighter.bot svg, .marquee-coin, .boot-screen { animation: none !important; }
}
.chart-mark { position: absolute; top: 0; bottom: 0; border-left: 2px dashed var(--pink); pointer-events: none; }
.chart-mark span { position: absolute; top: 6px; left: 6px; white-space: nowrap; font-family: var(--pixel); font-size: 9px; padding: 5px 6px; background: var(--pink); color: var(--text); }
@media (max-width: 1150px) { .net { display: none; } }
.fighter .m-sad, .fighter .m-tear { display: none; }

/* Who gets the taxes: two-way switch */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.seg-3 { grid-template-columns: repeat(3, 1fr); }
.seg-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 420px) { .seg-4 { grid-template-columns: 1fr 1fr; } }
.seg button { font-family: var(--pixel); font-size: 10px; min-height: 44px; padding: 0 8px; border: 3px solid var(--line); background: transparent; color: var(--text); cursor: pointer; }
.seg button.on { background: var(--green); border-color: var(--green); color: var(--bg); box-shadow: 3px 3px 0 var(--pink); }
.seg button:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
