/* ==========================================================================
   EzyGamers — Arena: the inline (no-iframe) game player page
   ========================================================================== */

.arena {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 20px;
  align-items: start;
}

/* ==========================================================================
   Game stage
   ========================================================================== */
.gs {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: #05070c;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .55);
}

.gs__screen {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #061014;
  overflow: hidden;
}
.gs__screen canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: manipulation;
}

/* In-game HUD ------------------------------------------------------------- */
.hud {
  position: absolute;
  inset: 14px 14px auto 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  pointer-events: none;
  z-index: 3;
}

.hud__btn {
  pointer-events: auto;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px;
  background: rgba(8, 12, 20, .62);
  backdrop-filter: blur(6px);
  color: #fff;
  transition: background .16s var(--ease), transform .16s var(--ease);
}
.hud__btn:hover { background: rgba(108, 76, 255, .8); }
.hud__btn:active { transform: scale(.93); }
.hud__btn svg { width: 18px; height: 18px; }

.hud__stats { margin-left: auto; display: flex; gap: 8px; }
.hud__stat {
  min-width: 84px;
  padding: 6px 13px;
  border-radius: 12px;
  background: rgba(8, 12, 20, .62);
  border: 1px solid rgba(255, 255, 255, .13);
  backdrop-filter: blur(6px);
  text-align: right;
}
.hud__k {
  display: block;
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted);
}
.hud__v {
  display: block;
  font-size: 16px; font-weight: 900;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.hud__stat--score .hud__v { color: var(--gold); }
.hud__stat--orbs .hud__v { color: var(--cyan); }
.hud__stat--time .hud__v { color: #fff; }

/* Touch controls ---------------------------------------------------------- */
.touchpad {
  position: absolute;
  right: 16px; bottom: 16px;
  z-index: 4;
  display: none;
}
.touchpad.is-on { display: block; }
.touchpad button {
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 2px solid rgba(34, 211, 238, .5);
  background: rgba(34, 211, 238, .16);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px; font-weight: 900; letter-spacing: .1em;
}
.touchpad button:active { background: rgba(34, 211, 238, .4); transform: scale(.94); }

/* ==========================================================================
   Start / pause / game-over overlays
   ========================================================================== */
.veil {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
  background:
    radial-gradient(700px 380px at 50% 42%, rgba(8, 10, 20, .5), rgba(4, 6, 12, .88)),
    rgba(4, 6, 12, .5);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s var(--ease), visibility .28s;
}
.veil.is-on { opacity: 1; visibility: visible; }

.veil__inner { position: relative; z-index: 2; max-width: 460px; }

/* Poster behind the start veil — the frozen "snapshot" for iframe games */
.veil__poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .3;
  filter: saturate(.8) blur(1px);
  z-index: 1;
}

.veil__kicker {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cyan);
  background: rgba(34, 211, 238, .12);
  border: 1px solid rgba(34, 211, 238, .32);
  padding: 5px 13px; border-radius: 999px;
  margin-bottom: 14px;
}
.veil__title {
  font-size: clamp(26px, 4.4vw, 42px);
  font-weight: 900;
  letter-spacing: -.035em;
  margin-bottom: 6px;
}
.veil__sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }

/* The big round PLAY button */
.play-btn {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 116px; height: 116px;
  border: 0;
  border-radius: 50%;
  background: var(--grad);
  color: #080a12;
  box-shadow: 0 18px 46px rgba(108, 76, 255, .55);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.play-btn::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px solid rgba(139, 92, 246, .55);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0% { transform: scale(.92); opacity: .9; }
  70% { transform: scale(1.16); opacity: 0; }
  100% { transform: scale(1.16); opacity: 0; }
}
.play-btn:hover { transform: scale(1.06); box-shadow: 0 22px 60px rgba(108, 76, 255, .75); }
.play-btn:active { transform: scale(.97); }
.play-btn svg { width: 44px; height: 44px; margin-left: 6px; }

.play-label {
  margin-top: 16px;
  font-size: 12px; font-weight: 800; letter-spacing: .26em; text-transform: uppercase;
  color: #fff;
}
.play-hint { margin-top: 6px; font-size: 12px; color: var(--muted-dim); }

.veil__scores {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  gap: 10px; margin: 18px 0 22px;
}
.veil__scores div {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px 8px;
}
.veil__scores b { display: block; font-size: 21px; font-weight: 900; }
.veil__scores span { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }

.veil__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Bottom game bar
   ========================================================================== */
.gbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background: #101220;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}

.gbar__id { display: flex; align-items: center; gap: 12px; margin-right: auto; min-width: 0; }
.gbar__icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  flex: 0 0 auto;
}
.gbar__title { font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gbar__meta { font-size: 11.5px; color: var(--muted); }

.gbar__group {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line);
}

.gb {
  display: inline-flex; align-items: center; gap: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px; font-weight: 700;
  transition: background .15s var(--ease), color .15s var(--ease), transform .15s var(--ease);
}
.gb:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.gb:active { transform: scale(.95); }
.gb svg { width: 18px; height: 18px; }
.gb.is-on { color: var(--cyan); background: rgba(34, 211, 238, .14); }
.gb.is-on--like { color: #4ade80; background: rgba(34, 197, 94, .15); }
.gb.is-on--down { color: #f87171; background: rgba(248, 113, 113, .15); }
.gb.is-on--fav { color: var(--gold); background: rgba(251, 191, 36, .15); }

/* Controls popover -------------------------------------------------------- */
.pop {
  position: absolute;
  right: 14px; bottom: 74px;
  width: 250px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #1a1c2b;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  z-index: 8;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .2s var(--ease), visibility .2s, transform .2s var(--ease);
}
.pop.is-on { opacity: 1; visibility: visible; transform: none; }
.pop h4 { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; margin: 0; font-size: 13px; }
.pop dt {
  justify-self: start;
  padding: 2px 9px;
  border-radius: 6px;
  background: #262a3d;
  border: 1px solid var(--line-strong);
  font-size: 11.5px; font-weight: 800;
}
.pop dd { margin: 0; color: var(--muted); }

/* ==========================================================================
   Right sidebar
   ========================================================================== */
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: calc(var(--header-h) + 18px); }

.promo {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  padding: 22px 20px 24px;
  background: linear-gradient(140deg, #6c4cff 0%, #8b5cf6 45%, #22d3ee 130%);
  color: #fff;
  min-height: 176px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.promo:hover { transform: translateY(-3px); box-shadow: 0 18px 44px rgba(108, 76, 255, .45); }
.promo::after {
  content: "";
  position: absolute;
  right: -34px; bottom: -34px;
  width: 150px; height: 150px;
  border-radius: 42px;
  background: rgba(255, 255, 255, .14);
  transform: rotate(24deg);
}
.promo__t {
  position: relative; z-index: 2;
  font-size: 22px; font-weight: 900; line-height: 1.16; letter-spacing: -.03em;
  max-width: 210px;
}
.promo__t em { font-style: normal; color: #0b0c14; }
.promo__go {
  position: relative; z-index: 2;
  margin-top: 16px;
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(11, 12, 20, .82);
  font-size: 20px;
}

.side__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -.02em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
/* Inline-block plus padding so the "All" link is a real target, not an
   18px-tall sliver of text. */
.side__title a {
  font-size: 12px; color: var(--cyan); font-weight: 700;
  display: inline-block; padding: 5px 4px;
}
.side__title a:hover { color: #fff; }

.next-list { display: flex; flex-direction: column; gap: 14px; }

.next {
  position: relative;
  display: block;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.next:hover { transform: translateY(-3px); border-color: rgba(139, 92, 246, .6); box-shadow: var(--shadow-hover); }
.next__thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.next__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease); }
.next:hover .next__thumb img { transform: scale(1.07); }
.next__label {
  position: absolute; top: 8px; left: 8px;
  padding: 3.5px 9px;
  border-radius: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #241a00;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
}
.next__label--hot { background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; }
.next__label--new { background: linear-gradient(135deg, #22d3ee, #0ea5e9); color: #04222b; }
.next__label--updated { background: linear-gradient(135deg, #8b5cf6, #6c4cff); color: #fff; }
.next__body { padding: 10px 12px 12px; display: flex; align-items: center; gap: 10px; }
.next__t { font-size: 14px; font-weight: 700; }
.next__c { font-size: 11.5px; color: var(--muted); }
.next__r { margin-left: auto; font-size: 12px; font-weight: 800; color: var(--gold); flex: 0 0 auto; }

/* ==========================================================================
   Info panels below the stage
   ========================================================================== */
.about { margin-top: 18px; }
.about h2 { font-size: 20px; margin-bottom: 6px; }

.side-mobile { display: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1180px) {
  .arena { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .side-mobile { display: block; }
}

@media (max-width: 760px) {
  .gs__screen { aspect-ratio: 4 / 3; }
  .hud { inset: 10px 10px auto 10px; }
  .hud__stat { min-width: 66px; padding: 5px 10px; }
  .hud__v { font-size: 14px; }
  .play-btn { width: 94px; height: 94px; }
  .play-btn svg { width: 36px; height: 36px; }
  .gbar { padding: 9px 10px; gap: 6px; }
  .gbar__id { width: 100%; margin-right: 0; }
  .gb span { display: none; }
  .gb { padding: 0 10px; }
  .gb[data-keep] span { display: inline; }
  .pop { right: 10px; left: 10px; width: auto; bottom: 120px; }
  .touchpad button { width: 66px; height: 66px; }
}

@media (max-width: 900px) and (orientation: landscape) {
  .gs__screen { aspect-ratio: 16 / 9; }
}

/* Fullscreen: the stage fills the display and the canvas takes the height */
.gs:fullscreen, .gs:-webkit-full-screen {
  border-radius: 0;
  border: 0;
  display: flex;
  flex-direction: column;
  background: #05070c;
}
.gs:fullscreen .gs__screen, .gs:-webkit-full-screen .gs__screen {
  aspect-ratio: auto;
  flex: 1 1 auto;
}
.gs:fullscreen .gs__screen canvas, .gs:-webkit-full-screen .gs__screen canvas {
  object-fit: contain;
}

/* ==========================================================================
   Neon Dash — stage banner, coach, and the new HUD / start-screen pieces.
   Same neon vocabulary as the rest of the arena: cyan for the player's own
   numbers, gold for score, teal panels, thin glowing rules.
   ========================================================================== */

.hud__stat--stage .hud__v { color: var(--purple-bright, #8b5cf6); }
.hud__stat--best  .hud__v { color: var(--green, #22c55e); }

/* the score ticks up rather than snapping */
.hud__v { transition: transform .16s var(--ease); }
.hud__v.is-bump { animation: nd-bump .32s var(--ease); }
@keyframes nd-bump { 40% { transform: scale(1.22); color: #fff; } }

/* -------------------------------------------------------- stage banner -- */
.stageban {
  position: absolute; left: 50%; top: 22%;
  transform: translate(-50%, -6px);
  z-index: 4;
  padding: 12px 26px;
  border-radius: 16px;
  text-align: center;
  pointer-events: none;
  background: linear-gradient(160deg, rgba(12, 47, 49, .92), rgba(8, 13, 26, .92));
  border: 1px solid rgba(34, 211, 238, .5);
  box-shadow: 0 0 34px rgba(34, 211, 238, .28), 0 18px 40px rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .28s var(--ease), transform .28s var(--ease);
}
.stageban[hidden] { display: none; }
.stageban.is-on { opacity: 1; transform: translate(-50%, 0); }
.stageban__n {
  display: block;
  font-size: 19px; font-weight: 900; letter-spacing: .02em;
  background: linear-gradient(135deg, #22d3ee, #8b5cf6);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stageban__t {
  display: block; margin-top: 3px;
  font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
}

/* --------------------------------------------------------------- coach -- */
/* Top-centre, clear of the player (who runs at x=240 on a 960 canvas) and
   clear of the ground line, so it never hides what it is talking about. */
.coach {
  position: absolute; left: 50%; top: 58px;
  transform: translateX(-50%);
  z-index: 4;
  width: min(330px, calc(100% - 32px));
  padding: 9px 14px;
  border-radius: 14px;
  text-align: center;
  pointer-events: none;
  background: radial-gradient(240px 90px at 20% 0%, rgba(108, 76, 255, .32), transparent 70%),
              rgba(8, 13, 26, .95);
  border: 1px solid rgba(34, 211, 238, .45);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .55);
  animation: nd-coach-in .3s var(--ease);
}
.coach[hidden] { display: none; }
.coach__step {
  display: block; font-size: 9.5px; font-weight: 800;
  letter-spacing: .18em; text-transform: uppercase; color: var(--cyan);
}
.coach b { display: block; margin-top: 3px; font-size: 14px; }
.coach span:last-child { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.coach.is-cheer { border-color: rgba(34, 197, 94, .55); }
.coach.is-cheer b { color: var(--green, #22c55e); }
@keyframes nd-coach-in { from { opacity: 0; transform: translate(-50%, -8px); } }

/* ------------------------------------------------ start-screen extras --
   Deliberately one quiet line. The start screen is a title, a sentence and a
   Play button; the record and the controls sit underneath in small type
   rather than in boxes of their own. */
.veil__meta {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}
.veil__meta b { color: var(--cyan); font-variant-numeric: tabular-nums; }

.veil__note { margin: -8px 0 14px; font-size: 11.5px; color: var(--gold); }
.veil__note[hidden] { display: none; }

/* ---------------------------------------------------------- responsive -- */
@media (max-width: 720px) {
  .hud__stat--orbs, .hud__stat--time { display: none; }
  .stageban { padding: 9px 18px; top: 18%; }
  .stageban__n { font-size: 16px; }
  .coach { top: 48px; padding: 7px 12px; }
  .coach b { font-size: 12.5px; }
}
@media (max-width: 420px) {
  .hud__stat--best { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .stageban, .hud__v { transition: none; }
  .coach, .hud__v.is-bump { animation: none; }
}
