/* Takkar 3 - 90s arcade cabinet: violet-black, arcade yellow, fight red, block blue */
:root { --night: #160F1F; --moon: #FFF5E6; --itch: #FFD23F; --sheet: #FF3B3B; --coil: #4FC3F7; --bite: #FF3B3B; }

/* Screens: arcade speed lines instead of Bzzz Off's coil */
.screen { background:
  repeating-linear-gradient(115deg, rgba(255,210,63,.05) 0 2px, transparent 2px 60px),
  radial-gradient(circle at 50% 36%, #3a1f4a 0%, var(--night) 72%); }
.screen.dim { background: radial-gradient(circle at 50% 40%, rgba(58,31,74,.93) 0%, rgba(22,15,31,.97) 70%); }
.mascot svg { animation: clash .5s ease-in-out infinite alternate; }
@keyframes clash { from { transform: scale(1) rotate(-3deg); } to { transform: scale(1.08) rotate(3deg); } }
.menu-grid a.ghost { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; font-size: 18px; text-decoration: none; }
canvas { cursor: default; }

/* ---------- Character select ---------- */
.roster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; width: 100%; }
.fighter { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 6px 10px; cursor: pointer; font-family: var(--body); color: var(--moon);
  background: linear-gradient(180deg, #2c1b3c, #1b1226); border: 3px solid rgba(255,245,230,.2); border-radius: 14px; }
.fighter canvas { width: 100px; height: 116px; }
.fighter b { font-size: 15px; line-height: 1.15; }
.fighter small { font-size: 11.5px; font-weight: 700; opacity: .75; }
.fighter i { position: absolute; top: 4px; right: 6px; font-style: normal; }
.fighter.on { border-color: var(--itch); box-shadow: 0 0 0 3px var(--night), 0 0 20px rgba(255,210,63,.55); background: linear-gradient(180deg, #4a2c1e, #2a1626); }
.fighter.locked { cursor: default; }
.fighter.locked canvas { filter: brightness(0); opacity: .6; }
.detail { width: 100%; max-width: 560px; text-align: left; background: rgba(255,245,230,.06); border: 3px solid rgba(255,245,230,.18); border-radius: 16px; padding: 12px 16px; }
.detail h3 { margin: 0 0 4px; color: var(--itch); }
.detail h3 small { font-family: var(--body); font-size: 14px; color: var(--moon); opacity: .8; text-shadow: none; }
.detail p { font-size: 15px; }
.stats { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; margin: 8px 0; font-weight: 800; font-size: 14px; }
.stat { display: block; height: 10px; border-radius: 6px; background: rgba(255,245,230,.15); overflow: hidden; }
.stat i { display: block; height: 100%; background: linear-gradient(90deg, var(--itch), var(--sheet)); }
.moves { font-size: 14px !important; }

/* ---------- Versus ---------- */
.versus { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.vsside { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 280px; }
.vsside canvas { width: 160px; height: 184px; filter: drop-shadow(0 0 18px rgba(255,59,59,.45)); }
.vsside b { font-family: var(--display); font-weight: 400; font-size: clamp(22px, 4vw, 34px); color: var(--itch); text-shadow: var(--outline); }
.vsside .quote { font-size: 14px; padding: 8px 12px; }
.vsmark { font-family: var(--comic); font-size: clamp(56px, 12vw, 110px); color: var(--sheet); text-shadow: var(--outline), 6px 6px 0 var(--itch); transform: rotate(-8deg); animation: clash .35s ease-in-out infinite alternate; }

/* ---------- Fight HUD ---------- */
#hud .bars { display: flex; align-items: flex-start; gap: 10px; }
.side { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.side.p2 { align-items: flex-end; }
.name { display: flex; gap: 8px; align-items: center; font-weight: 900; font-size: 15px; text-shadow: 0 2px 0 var(--night); }
.p2 .name { flex-direction: row-reverse; }
.name span { font-size: 12px; letter-spacing: 1px; }
.hp { position: relative; width: 100%; height: 20px; border: 3px solid var(--night); background: #3a1020; border-radius: 6px; overflow: hidden; box-shadow: 0 0 0 2px var(--itch); }
.hp i { position: absolute; top: 0; bottom: 0; left: 0; display: block; }
.p2 .hp i { left: auto; right: 0; }
.hp .lag { background: #ff9a3c; }
.hp .cur { background: linear-gradient(180deg, #ffe066, #f2b705); }
.meter { width: 70%; height: 9px; border: 2px solid var(--night); border-radius: 5px; background: rgba(0,0,0,.4); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--coil); transition: width .15s; }
.p2 .meter i { margin-left: auto; }
.meter.half i { background: var(--itch); }
.meter.full i { background: linear-gradient(90deg, #FF3B3B, #FFD23F, #3DDC84, #4FC3F7); animation: charged .4s linear infinite alternate; }
@keyframes charged { from { filter: brightness(1); } to { filter: brightness(1.6); } }
.mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
#timer { font-family: var(--comic); font-size: 40px; line-height: 1; color: var(--itch); text-shadow: var(--outline); min-width: 52px; text-align: center; }
#hint { position: fixed; left: 50%; top: 26%; transform: translateX(-50%); width: max-content; max-width: 88vw; background: rgba(22,15,31,.92);
  border: 3px dashed var(--moon); border-radius: 16px; padding: 10px 18px; font-weight: 800; font-size: 15px; text-align: center; pointer-events: none; }

/* ---------- Touch controls ---------- */
#touch { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: flex-end; padding: 0 14px max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
#touch button { pointer-events: auto; touch-action: none; user-select: none; font-size: 26px; width: 62px; height: 62px; border-radius: 50%; border: 3px solid var(--night);
  background: rgba(255,245,230,.85); box-shadow: 0 4px 0 var(--night); color: var(--night); }
#touch button.held { transform: translateY(3px); box-shadow: 0 1px 0 var(--night); background: var(--itch); }
#touch button:active { background: var(--itch); }
.pad { display: grid; grid-template-columns: repeat(3, 58px); grid-template-rows: repeat(2, 58px); gap: 4px; }
.pad .up { grid-column: 2; grid-row: 1; }
.pad .left { grid-column: 1; grid-row: 2; }
.pad .down { grid-column: 2; grid-row: 2; }
.pad .right { grid-column: 3; grid-row: 2; }
.pad button { width: 58px !important; height: 58px !important; border-radius: 14px !important; }
.btns { display: grid; grid-template-columns: repeat(2, 66px); gap: 8px; }
.btns .sp { background: var(--sheet) !important; color: #fff !important; }

@media (max-width: 560px) {
  .roster { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .fighter canvas { width: 80px; height: 93px; }
  .vsside canvas { width: 110px; height: 126px; }
  .vsside .quote { font-size: 12px; }
  .name { font-size: 12px; }
  .hp { height: 16px; }
  #timer { font-size: 30px; min-width: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot svg, .vsmark, .meter.full i { animation: none; }
}
