/* ============================================================
   Fiesta Arena  -  fiesta-glass UI (matches main site brand)
   ============================================================ */
:root {
  --ink: #fff;
  --muted: #e9dcff;
  --glass: rgba(60, 22, 130, 0.42);
  --glass-line: rgba(255, 255, 255, 0.28);
  --pink: #ff3d9a; --purple: #9b3dff; --cyan: #2fd3c4; --sky: #63e3ff;
  --gold: #ffc93c; --green: #5df07a; --red: #ff4d6a;
  --f-display: "Lilita One", "Arial Black", system-ui, sans-serif;
  --f-body: "Outfit", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #3a2bd8; color: var(--ink); font-family: var(--f-body); -webkit-font-smoothing: antialiased; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: none; }
button, a { font: inherit; color: inherit; text-decoration: none; }
button { border: 0; background: none; cursor: pointer; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 3px; }
.hidden { display: none !important; }
.glass {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 18px;
  backdrop-filter: blur(14px) saturate(1.4); -webkit-backdrop-filter: blur(14px) saturate(1.4);
  box-shadow: 0 12px 40px rgba(30, 0, 70, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.hud-tl { position: absolute; left: 16px; top: 16px; display: flex; gap: 12px; align-items: center; padding: 10px 16px 10px 10px; min-width: 300px; }
.hud-portrait { width: 62px; height: 62px; border-radius: 14px; background: rgba(255, 255, 255, .14); display: grid; place-items: center; overflow: hidden; flex: none; }
.hud-portrait svg { width: 76px; height: auto; margin-top: 26px; }
.hud-who { flex: 1; }
.hud-name { font-family: var(--f-display); font-size: 22px; line-height: 1; margin-bottom: 6px; text-shadow: 0 2px 0 rgba(40, 0, 80, .5); }
.hp { position: relative; height: 18px; border-radius: 9px; background: rgba(20, 0, 50, .55); overflow: hidden; border: 1px solid rgba(255, 255, 255, .25); }
.hp-fill { position: absolute; inset: 0; width: 100%; background: linear-gradient(90deg, #5df07a, #c8ff6a); transition: width .15s, background .3s; }
.hp-fill.mid { background: linear-gradient(90deg, #ffc93c, #ffe27a); }
.hp-fill.low { background: linear-gradient(90deg, #ff4d6a, #ff8a5c); }
.hp span { position: relative; display: block; text-align: center; font-size: 12px; font-weight: 700; line-height: 16px; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }
.hud-tags { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.mode-tag { font-size: 11px; font-weight: 700; letter-spacing: .12em; padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .16); }
.mode-tag.leveraged { background: rgba(255, 201, 60, .35); }
.mode-tag.degen { background: rgba(255, 61, 154, .5); }
.buffs { display: flex; gap: 4px; font-size: 12px; font-weight: 700; }
.buffs span { padding: 1px 6px; border-radius: 6px; background: rgba(99, 227, 255, .3); }
.hud-tc { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); padding: 8px 26px 10px; text-align: center; min-width: 250px; }
.zone-status { font-size: 12px; font-weight: 700; letter-spacing: .18em; color: #c8ffd0; }
.zone-status.shrink { color: var(--gold); animation: blink 1s infinite; }
.zone-status.out { color: #ffb0c0; }
.timer { font-family: var(--f-display); font-size: 40px; line-height: 1; text-shadow: 0 3px 0 rgba(40, 0, 80, .5); }
.timer.hot { color: #ffe27a; }
.hud-tr { position: absolute; right: 16px; top: 16px; display: flex; gap: 4px; padding: 8px 10px; }
.hud-tr div { min-width: 82px; text-align: center; padding: 2px 10px; }
.hud-tr div + div { border-left: 1px solid rgba(255, 255, 255, .2); }
.hud-tr small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .14em; color: var(--muted); }
.hud-tr b { font-family: var(--f-display); font-weight: 400; font-size: 28px; line-height: 1.05; }
.banner { position: absolute; left: 50%; top: 24%; transform: translate(-50%, 0) scale(.9); opacity: 0; font-family: var(--f-display); font-size: clamp(30px, 5vw, 64px); text-align: center; white-space: nowrap; color: #fff; transition: opacity .3s, transform .3s; text-shadow: 0 4px 0 #6b1a8a, 0 0 30px rgba(255, 61, 154, .7); }
.banner.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
.banner small { display: block; font-family: var(--f-body); font-weight: 700; font-size: 16px; letter-spacing: .2em; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.warning { position: absolute; left: 50%; top: 118px; transform: translateX(-50%); text-align: center; opacity: 0; transition: opacity .2s; }
.warning.show { opacity: 1; }
.warning b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 44px; color: #ff4d6a; text-shadow: 0 3px 0 #3a0020, 0 0 24px rgba(255, 50, 90, .9); animation: blink .7s infinite; }
.warning span { display: inline-block; margin-top: 4px; font-weight: 700; font-size: 15px; letter-spacing: .2em; padding: 5px 14px; border-radius: 999px; background: rgba(80, 0, 40, .6); }
.pause-btn { position: absolute; right: 16px; bottom: 16px; width: 46px; height: 46px; font-weight: 800; pointer-events: auto; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; overflow-y: auto; background: radial-gradient(ellipse at center, rgba(40, 10, 110, .15), rgba(30, 6, 80, .55)); }
.menu-card { position: relative; width: min(1040px, 100%); padding: 26px 30px 22px; margin: auto; }
.back { position: absolute; left: 22px; top: 18px; font-size: 14px; font-weight: 600; opacity: .9; padding: 4px 8px; border-radius: 8px; }
.back:hover { background: rgba(255, 255, 255, .12); }
.menu-head { text-align: center; margin-bottom: 14px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: .26em; text-transform: uppercase; color: var(--sky); }
h1 { font-family: var(--f-display); font-weight: 400; font-size: clamp(48px, 7vw, 84px); line-height: .95; filter: drop-shadow(0 5px 0 #5a1a7a) drop-shadow(0 0 22px rgba(255, 61, 154, .5)); }
h1 .y { background: linear-gradient(180deg, #fff7c4, #ffd23f 45%, #ff8a1f); -webkit-background-clip: text; background-clip: text; color: transparent; }
h1 .g { background: linear-gradient(180deg, #e6ffb0, #7df24a 45%, #26b03a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.sub { font-weight: 600; letter-spacing: .14em; text-transform: uppercase; font-size: 14px; margin-top: 6px; color: var(--muted); }
.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 560px; margin: 0 auto 8px; }
.tab { padding: 10px 14px; border-radius: 14px; font-family: var(--f-display); font-size: 20px; line-height: 1.1; text-align: center; border: 2px solid transparent; background: rgba(255, 255, 255, .08); }
.tab small { display: block; font-family: var(--f-body); font-size: 11px; font-weight: 700; letter-spacing: .14em; opacity: .85; }
.tab.active { border-color: var(--green); background: rgba(93, 240, 122, .18); box-shadow: 0 0 20px rgba(93, 240, 122, .3); }
.tab.locked { opacity: .7; border-style: dashed; border-color: rgba(255, 201, 60, .6); }
.tab.locked:hover { opacity: 1; }
.step { font-family: var(--f-display); font-weight: 400; font-size: 20px; margin: 16px 0 10px; letter-spacing: .02em; }
.chars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.char { position: relative; padding: 10px 8px 12px; border-radius: 16px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .14); text-align: center; transition: transform .15s, border-color .15s, background .15s; }
.char:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .14); }
.char[aria-checked="true"] { border-color: var(--c); background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 3px rgba(255, 255, 255, .15), 0 0 26px var(--c); }
.char .art { height: 104px; display: grid; place-items: center; }
.char .art svg { height: 100%; width: auto; }
.char[aria-checked="true"] .art svg { animation: hop .9s ease-in-out infinite; }
@keyframes hop { 50% { transform: translateY(-6px); } }
.char b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 19px; margin-top: 4px; }
.char small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; opacity: .85; }
.bars { display: grid; gap: 3px; margin-top: 8px; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-align: left; }
.bar { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 6px; }
.bar i { display: block; height: 6px; border-radius: 3px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.bar i::after { content: ""; display: block; height: 100%; width: var(--v); background: var(--c); }
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mode { padding: 12px; border-radius: 14px; background: rgba(255, 255, 255, .08); border: 2px solid rgba(255, 255, 255, .14); text-align: center; transition: background .15s, border-color .15s; }
.mode b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 22px; letter-spacing: .04em; }
.mode span { font-size: 13px; opacity: .9; }
.mode:hover { background: rgba(255, 255, 255, .14); }
.mode[aria-checked="true"][data-mode="chill"] { border-color: var(--green); background: rgba(93, 240, 122, .2); }
.mode[aria-checked="true"][data-mode="leveraged"] { border-color: var(--gold); background: rgba(255, 201, 60, .2); }
.mode[aria-checked="true"][data-mode="degen"] { border-color: var(--pink); background: rgba(255, 61, 154, .25); }
.enter { display: block; width: 100%; max-width: 520px; margin: 20px auto 0; height: 64px; border-radius: 18px; font-family: var(--f-display); font-size: 28px; letter-spacing: .03em; background: linear-gradient(100deg, #ff3d9a, #c13dff 55%, #7b2ff7); box-shadow: 0 0 0 2px rgba(255, 255, 255, .3) inset, 0 10px 34px rgba(255, 61, 154, .55); transition: transform .15s, box-shadow .15s; }
.enter:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 0 0 2px rgba(255, 255, 255, .45) inset, 0 14px 44px rgba(255, 61, 154, .8); }
.enter:disabled { opacity: .6; cursor: wait; }
.controls { text-align: center; margin-top: 14px; font-size: 14px; color: var(--muted); }
kbd { font-family: var(--f-body); font-weight: 700; font-size: 12px; padding: 2px 7px; border-radius: 6px; background: rgba(255, 255, 255, .16); border-bottom: 2px solid rgba(0, 0, 0, .25); }
.touch-note { display: none; text-align: center; margin-top: 10px; font-size: 13px; color: #ffe7a8; }
.fine { text-align: center; margin-top: 8px; font-size: 12px; opacity: .7; }
.small-card { width: min(460px, 100%); padding: 28px; text-align: center; }
.small-card h2 { font-family: var(--f-display); font-weight: 400; font-size: 44px; line-height: 1; }
.ghost { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 20px; margin-top: 12px; border-radius: 14px; font-weight: 700; background: rgba(255, 255, 255, .1); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .3) inset; }
.ghost:hover { background: rgba(255, 255, 255, .18); }
#pause .ghost { width: 100%; max-width: 520px; }
.end-card { width: min(560px, 100%); }
.end-portrait { height: 150px; display: grid; place-items: center; margin-bottom: 4px; }
.end-portrait svg { height: 100%; width: auto; }
#endTitle.win { color: #fff; background: linear-gradient(180deg, #fff7c4, #ffd23f 45%, #ff8a1f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 #5a1a7a); }
#endTitle.lose { color: #ff6a84; filter: drop-shadow(0 4px 0 #3a0020); }
.end-sub { margin-top: 6px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 14px; color: var(--muted); }
.end-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 20px 0 6px; }
.end-stats div { padding: 10px 4px; border-radius: 12px; background: rgba(255, 255, 255, .1); }
.end-stats small { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; color: var(--muted); }
.end-stats b { font-family: var(--f-display); font-weight: 400; font-size: 30px; }
.end-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 860px) {
  .chars { grid-template-columns: repeat(3, 1fr); }
  .modes { grid-template-columns: 1fr; }
  .hud-tl { min-width: 0; transform: scale(.85); transform-origin: top left; }
  .hud-tr { transform: scale(.8); transform-origin: top right; }
  .hud-tc { top: 96px; transform: translateX(-50%) scale(.85); }
  .back { position: static; display: inline-block; margin-bottom: 6px; }
}
@media (hover: none) and (pointer: coarse) { .touch-note { display: block; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
