/* ARENA 8-bit UI. Needs the Press Start 2P font:
   <link href="https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap" rel="stylesheet"> */

:root,
[data-palette="green"] { --gb-d: #0f380f; --gb-m: #306230; --gb-l: #8bac0f; --gb-w: #9bbc0f; }
[data-palette="gray"]  { --gb-d: #1b1b19; --gb-m: #55554a; --gb-l: #a3a390; --gb-w: #d0d1bd; }
[data-palette="gold"]  { --gb-d: #2b1a0e; --gb-m: #7a4a1b; --gb-l: #d9a441; --gb-w: #f4e3a1; }

:root { --gb-font: 'Press Start 2P', 'Courier New', monospace; }

.gb-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--gb-font);
  color: var(--gb-d);
  background-color: var(--gb-w);
  background-image:
    linear-gradient(color-mix(in srgb, var(--gb-m) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--gb-m) 14%, transparent) 1px, transparent 1px);
  background-size: 8px 8px;
  -webkit-font-smoothing: none;
}
.gb-page * { box-sizing: border-box; }
.gb-pixel { display: block; image-rendering: pixelated; }
.gb-wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; display: flex; flex-direction: column; gap: 64px; }

/* Header */
.gb-header { height: 104px; display: flex; align-items: center; justify-content: space-between; border-bottom: 6px solid var(--gb-d); }
.gb-brand { display: flex; align-items: center; gap: 16px; font-size: 28px; letter-spacing: 2px; }

/* Buttons */
.gb-btn {
  min-height: 48px; padding: 0 20px; border: 0; cursor: pointer;
  font: 12px/1 var(--gb-font); color: var(--gb-w); background: var(--gb-d);
  box-shadow: 4px 4px 0 var(--gb-l);
}
.gb-btn:active { transform: translate(4px, 4px); box-shadow: none; }
.gb-btn:focus-visible { outline: 4px dashed var(--gb-m); outline-offset: 4px; }

/* Panels */
.gb-panel { background: var(--gb-w); border: 6px solid var(--gb-d); box-shadow: 8px 8px 0 var(--gb-m); padding: 32px; }
.gb-label { font-size: 12px; line-height: 1.4; }
.gb-big { font-size: 36px; line-height: 1; }
.gb-shadow { text-shadow: 6px 6px 0 var(--gb-l); }

/* Hero */
.gb-hero { display: flex; gap: 56px; align-items: stretch; }
.gb-hero-title { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 28px; }
.gb-wordmark { display: flex; align-items: center; gap: 32px; font-size: 96px; line-height: 1; letter-spacing: 4px; text-shadow: 8px 8px 0 var(--gb-l); }
.gb-pool { width: 520px; flex-shrink: 0; display: flex; flex-direction: column; gap: 28px; }
.gb-pool-value { font-size: 56px; line-height: 1; text-shadow: 6px 6px 0 var(--gb-l); }
.gb-row { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; line-height: 1.4; }

/* Charge bar (prize pool progress) */
.gb-charge { display: grid; grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 4px; }
.gb-charge span { height: 28px; background: var(--gb-w); border: 3px solid var(--gb-d); }
.gb-charge span.on { background: var(--gb-d); }
.gb-charge.full span.on { animation: gb-blink .5s steps(1, end) infinite; }

/* Stats */
.gb-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.gb-stats .gb-panel { display: flex; flex-direction: column; gap: 22px; padding: 26px 28px; }

/* Section heading */
.gb-heading { display: flex; align-items: center; gap: 20px; font-size: 40px; line-height: 1; margin: 0; }
.gb-heading::after { content: ''; flex: 1; height: 6px; background: var(--gb-d); }

/* Arena cam */
.gb-cam { background: var(--gb-d); border-radius: 16px 16px 72px 16px; padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.gb-cam-label { display: flex; align-items: center; gap: 12px; padding-left: 12px; font-size: 12px; color: var(--gb-l); }
.gb-cam-label::before { content: ''; width: 12px; height: 12px; background: var(--gb-l); animation: gb-blink 1s steps(1, end) infinite; }
.gb-stage { position: relative; height: 560px; overflow: hidden; background: var(--gb-w); border: 6px solid var(--gb-m); }
.gb-backdrop { position: absolute; left: 50%; top: 40px; transform: translateX(-50%); opacity: .4; }
.gb-sand { position: absolute; inset: auto 0 0 0; height: 150px; background: var(--gb-l); border-top: 6px solid var(--gb-d); }
.gb-fighters { position: absolute; inset: auto 0 70px 0; display: flex; justify-content: center; align-items: flex-end; gap: 48px; flex-wrap: nowrap; }
.gb-fighter { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.gb-tag { padding: 6px 8px; font-size: 12px; line-height: 1; background: var(--gb-d); color: var(--gb-w); white-space: nowrap; }
.gb-empty-stage { position: absolute; inset: 0 0 150px 0; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.gb-spark { position: absolute; }

/* Draw moment: the stage shakes */
.gb-shake { animation: gb-shake .4s steps(2, end) 3; }

/* Dialog box */
.gb-dialog { border: 8px double var(--gb-d); background: var(--gb-w); box-shadow: 8px 8px 0 var(--gb-m); padding: 28px 32px; display: flex; flex-direction: column; gap: 8px; font-size: 18px; line-height: 1.9; }
.gb-dialog .gb-caret { align-self: flex-end; line-height: 1; }

/* Bottom panels */
.gb-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
.gb-two .gb-panel { display: flex; flex-direction: column; gap: 28px; }
.gb-panel h3 { margin: 0; font-size: 24px; line-height: 1; font-weight: normal; }
.gb-winner { display: flex; align-items: center; gap: 24px; padding: 20px; background: var(--gb-l); border: 4px solid var(--gb-d); }
.gb-winner + .gb-winner { margin-top: -12px; }
.gb-winner-text { display: flex; flex-direction: column; gap: 14px; font-size: 14px; line-height: 1.4; }
.gb-stat-row { display: flex; align-items: baseline; gap: 12px; font-size: 16px; line-height: 1.4; }
.gb-stat-row i { flex: 1; border-bottom: 4px dotted var(--gb-m); }
.gb-stat-list { display: flex; flex-direction: column; gap: 22px; }

/* Footer */
.gb-footer { margin-top: 64px; min-height: 96px; background: var(--gb-d); border-top: 6px solid var(--gb-m); color: var(--gb-w); font-size: 14px; }
.gb-footer .gb-wrap { flex-direction: row; justify-content: space-between; align-items: center; min-height: 96px; gap: 24px; }

/* Victory overlay */
.gb-victory { position: fixed; inset: 0; z-index: 1000; background: var(--gb-d); color: var(--gb-w); overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; padding: 32px 24px 180px; text-align: center; }
.gb-victory[hidden] { display: none; }
.gb-victory-title { font-size: 44px; line-height: 1.1; text-shadow: 6px 6px 0 var(--gb-m); }
.gb-spotlight { width: 320px; height: 320px; border-radius: 50%; background: var(--gb-m); border: 8px solid var(--gb-l); display: flex; align-items: center; justify-content: center; animation: gb-pop .35s steps(4, end); }
.gb-victory-addr { font-size: 24px; color: var(--gb-l); }
.gb-victory-amount { font-size: 64px; line-height: 1; text-shadow: 6px 6px 0 var(--gb-m); }
.gb-victory .gb-dialog { position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%); width: min(1120px, calc(100% - 48px));
  flex-direction: row; align-items: center; justify-content: space-between; gap: 32px; font-size: 14px; color: var(--gb-d); border-color: var(--gb-l); box-shadow: none; }
.gb-victory .gb-btn { box-shadow: 4px 4px 0 var(--gb-m); }

/* Animations */
.gb-fa { animation: gb-fa .9s steps(1, end) infinite; }
.gb-fb { animation: gb-fb .9s steps(1, end) infinite; }
.gb-blink { animation: gb-blink 1s steps(1, end) infinite; }
@keyframes gb-fa { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes gb-fb { 0% { opacity: 0; } 50% { opacity: 1; } }
@keyframes gb-blink { 0% { opacity: 1; } 50% { opacity: 0; } }
@keyframes gb-shake { 0% { transform: translate(-6px, 0); } 50% { transform: translate(6px, -4px); } }
@keyframes gb-pop { 0% { transform: scale(.25); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: reduce) {
  .gb-fa, .gb-fb, .gb-blink, .gb-cam-label::before, .gb-charge.full span.on, .gb-shake, .gb-spotlight { animation: none; }
  .gb-fb { opacity: 0; }
}

/* Mobile */
@media (max-width: 900px) {
  .gb-hero, .gb-two { flex-direction: column; display: flex; }
  .gb-pool { width: 100%; }
  .gb-wordmark { font-size: 48px; gap: 20px; }
  .gb-wordmark .gb-pixel { width: 96px; height: 96px; }
  .gb-pool-value { font-size: 36px; }
  .gb-stats { grid-template-columns: 1fr; }
  .gb-heading { font-size: 24px; }
  .gb-stage { height: 380px; }
  .gb-fighters { gap: 12px; }
  .gb-fighters .gb-pixel { width: 64px; height: 64px; }
  .gb-fighters .gb-fighter.boss .gb-pixel { width: 96px; height: 96px; }
  .gb-dialog { font-size: 12px; }
  .gb-victory-title { font-size: 24px; }
  .gb-victory-amount { font-size: 32px; }
  .gb-spotlight { width: 220px; height: 220px; }
  .gb-spotlight .gb-pixel { width: 160px; height: 160px; }
  .gb-victory .gb-dialog { flex-direction: column; }
  .gb-footer .gb-wrap { flex-direction: column; justify-content: center; padding: 24px; font-size: 10px; text-align: center; }
}
