:root {
  --slot-item-h: 88px;
  --bg: #070a14;
  --bg-mid: #0f1428;
  --panel: rgba(255, 255, 255, 0.05);
  --panel-edge: rgba(255, 255, 255, 0.12);
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.62);
  --accent: #6ee7ff;
  --accent2: #a78bfa;
  --radius: 20px;
  --shadow-deep: 0 24px 80px rgba(0, 0, 0, 0.55);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(900px 520px at 15% -10%, rgba(110, 231, 255, 0.12), transparent),
    radial-gradient(700px 480px at 95% 0%, rgba(167, 139, 250, 0.1), transparent),
    linear-gradient(165deg, var(--bg) 0%, var(--bg-mid) 45%, #06080f 100%);
  min-height: 100%;
  overflow-x: hidden;
}

.app {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 18px 36px;
}

.screen {
  display: none;
  width: min(1040px, 100%);
}

.screen--active {
  display: block;
}

.menu-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  padding: 28px 26px 26px;
}

.menu-panel::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -10px;
  height: 14px;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 0, 0, 0.35), transparent 70%);
  filter: blur(8px);
  opacity: 0.75;
  pointer-events: none;
}

.screen-header {
  text-align: center;
  margin-bottom: 22px;
}

.screen-header h1 {
  margin: 0 0 8px;
  font-size: clamp(1.75rem, 4vw, 2.35rem);
  letter-spacing: 0.04em;
  font-weight: 800;
  background: linear-gradient(120deg, #fff 0%, rgba(200, 230, 255, 0.85) 55%, var(--accent) 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 12px 40px rgba(110, 231, 255, 0.15);
}

.screen-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.character-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin: 8px 0 26px;
}

.character-card {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  padding: 0;
  cursor: pointer;
  width: min(220px, 42vw);
  text-align: left;
  color: inherit;
  transform: translateY(0);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
  outline: none;
  position: relative;
}

.character-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.35);
}

.character-card:not(.character-card--locked):hover {
  transform: translateY(-4px);
  border-color: rgba(110, 231, 255, 0.45);
  background: rgba(110, 231, 255, 0.07);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(110, 231, 255, 0.12) inset;
}

.character-card[aria-pressed="true"] {
  border-color: rgba(110, 231, 255, 0.75);
  background: rgba(110, 231, 255, 0.11);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.12) inset, 0 20px 60px rgba(110, 231, 255, 0.08);
}

.character-card--locked {
  cursor: default;
  pointer-events: none;
  opacity: 0.48;
  filter: grayscale(0.35);
}

.character-card--locked:hover {
  transform: translateY(0);
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.card-inner {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card-preview {
  height: 128px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(0, 0, 0, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  box-shadow: inset 0 -12px 24px rgba(0, 0, 0, 0.35);
}

.card-preview svg {
  display: block;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}

.character-name {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.character-tag {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(110, 231, 255, 0.85);
}

.character-desc {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--muted);
}

.lock-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  background: rgba(0, 0, 0, 0.35);
  border-radius: 18px;
  pointer-events: none;
}

.screen-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.selection-hint {
  font-size: 0.9rem;
  color: var(--muted);
}

.selection-hint strong {
  color: var(--accent);
  font-weight: 700;
}

.btn {
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.32);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  min-width: 200px;
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.28), rgba(167, 139, 250, 0.2));
  border-color: rgba(110, 231, 255, 0.45);
  box-shadow: 0 14px 40px rgba(110, 231, 255, 0.12);
}

.btn--primary:hover:not(:disabled) {
  box-shadow: 0 18px 50px rgba(110, 231, 255, 0.2);
}

.btn--ghost {
  background: transparent;
  font-weight: 700;
}

.next-screen {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--panel-edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-deep);
  padding: 36px 28px;
  text-align: center;
}

.next-screen h2 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.next-screen p {
  margin: 0 0 22px;
  color: var(--muted);
  line-height: 1.5;
}

.next-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.weapon-panel {
  max-width: 920px;
  margin: 0 auto;
}

.weapon-title {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  letter-spacing: 0.03em;
}

.screen-sub-muted {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.slot-machine {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px 16px;
  margin: 18px 0 16px;
}

.slot-reel-wrap {
  flex: 0 0 auto;
  width: min(200px, 30vw);
  transition: transform 160ms ease, filter 160ms ease;
}

.slot-reel-wrap--selectable {
  cursor: pointer;
}

.slot-reel-wrap--selectable:hover .slot-chrome {
  border-color: rgba(110, 231, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.12), 0 18px 40px rgba(0, 0, 0, 0.35);
}

.slot-reel-wrap--selected .slot-chrome {
  border-color: rgba(250, 204, 21, 0.85);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.2), 0 0 28px rgba(250, 204, 21, 0.15);
}

.slot-chrome {
  border-radius: 16px;
  padding: 10px 10px 12px;
  background: linear-gradient(165deg, rgba(30, 22, 48, 0.9), rgba(12, 18, 36, 0.95));
  border: 2px solid rgba(212, 175, 55, 0.45);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 36px rgba(0, 0, 0, 0.45);
}

.slot-label {
  display: block;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: rgba(250, 204, 21, 0.75);
  margin-bottom: 8px;
}

.slot-window {
  position: relative;
  height: var(--slot-item-h, 88px);
  overflow: hidden;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 0%, rgba(255, 255, 255, 0.08), transparent 55%),
    linear-gradient(180deg, #050810, #0c1224);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.65);
}

.slot-window::before,
.slot-window::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 2;
  pointer-events: none;
}

.slot-window::before {
  top: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent);
}

.slot-window::after {
  bottom: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent);
}

.slot-window--shine::after {
  box-shadow: inset 0 -2px 0 rgba(250, 204, 21, 0.35);
}

.slot-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.slot-item {
  flex: 0 0 var(--slot-item-h, 88px);
  height: var(--slot-item-h, 88px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.slot-item svg {
  display: block;
}

.weapon-hint {
  text-align: center;
  margin: 0 0 8px;
  min-height: 2.75em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.weapon-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
}

.summary-line {
  margin: 0 0 12px;
  font-size: 1.15rem;
  color: var(--text);
}

.summary-dot {
  margin: 0 0.35em;
  color: var(--muted);
}

.summary-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.summary-screen {
  max-width: 900px;
  margin: 0 auto;
  /* 3D rotate on .next-screen can break hit-testing for buttons in WebKit */
  transform: none;
  transform-style: flat;
}

.summary-actions {
  margin-top: 8px;
  position: relative;
  z-index: 3;
}

.arena-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 8px;
  text-align: left;
}

@media (max-width: 640px) {
  .arena-picker {
    grid-template-columns: 1fr;
  }
}

.arena-card {
  appearance: none;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px 14px;
  cursor: pointer;
  color: inherit;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  outline: none;
}

.arena-card:hover {
  border-color: rgba(110, 231, 255, 0.35);
  transform: translateY(-2px);
}

.arena-card:focus-visible {
  box-shadow: 0 0 0 3px rgba(110, 231, 255, 0.35);
}

.arena-card[aria-pressed="true"] {
  border-color: rgba(110, 231, 255, 0.65);
  background: rgba(110, 231, 255, 0.09);
  box-shadow: 0 0 0 2px rgba(110, 231, 255, 0.12) inset;
}

.arena-card__visual {
  display: block;
  height: 56px;
  border-radius: 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.arena-card--rooftop .arena-card__visual {
  background: linear-gradient(180deg, #1a1f3a, #0f172a 60%, #1e293b);
  box-shadow: inset 0 -8px 16px rgba(110, 231, 255, 0.12);
}

.arena-card--desert .arena-card__visual {
  background: linear-gradient(180deg, #ea580c, #fbbf24 55%, #b45309);
  box-shadow: inset 0 -10px 18px rgba(120, 53, 15, 0.35);
}

.arena-card--colosseum .arena-card__visual {
  background: linear-gradient(180deg, #334155, #1e293b 50%, #422006);
  box-shadow: inset 0 -8px 14px rgba(251, 191, 36, 0.15);
}

.arena-card--frozen .arena-card__visual {
  background: linear-gradient(180deg, #0e7490, #164e63 45%, #e2e8f0);
  box-shadow: inset 0 -8px 16px rgba(125, 211, 252, 0.2);
}

.arena-card__name {
  display: block;
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.arena-card__blurb {
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--muted);
}

.battle-panel {
  max-width: 960px;
  margin: 0 auto;
}

.battle-header {
  text-align: center;
  margin-bottom: 8px;
}

.battle-title {
  margin: 0 0 6px;
  font-size: clamp(1.25rem, 2.8vw, 1.65rem);
  font-weight: 800;
}

.battle-status {
  margin: 0 0 12px;
  min-height: 2.75em;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--muted);
}

#battleCanvas {
  width: 100%;
  max-width: 920px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #070b18;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
}

.battle-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.hub-panel .hub-tagline {
  margin: 0 0 8px;
}

.hub-blurb {
  margin: 0 0 22px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--muted);
}

.hub-blurb strong {
  color: rgba(250, 204, 21, 0.95);
  font-weight: 700;
}

.hub-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.token-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
  color: rgba(254, 240, 138, 0.95);
}

.token-pill--inline {
  margin: 10px auto 0;
}

.weapon-screen-header .token-pill--inline {
  margin-top: 12px;
}

.shop-panel .shop-list {
  margin-top: 8px;
}

.shop-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  margin: 0 auto 20px;
  text-align: left;
}

.shop-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  padding: 16px 18px;
}

.shop-card__title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
}

.shop-card__meta {
  margin: 0 0 8px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(250, 204, 21, 0.85);
}

.shop-card__desc {
  margin: 0 0 14px;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
}

.shop-card__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.skin-row {
  max-width: 720px;
  margin: 0 auto 12px;
  text-align: center;
}

.skin-row-label {
  margin: 0 0 10px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(110, 231, 255, 0.75);
}

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

.skin-chip {
  appearance: none;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  transition: border-color 160ms ease, background 160ms ease;
}

.skin-chip:hover:not(:disabled) {
  border-color: rgba(110, 231, 255, 0.45);
  background: rgba(110, 231, 255, 0.08);
}

.skin-chip[aria-pressed="true"] {
  border-color: rgba(110, 231, 255, 0.75);
  background: rgba(110, 231, 255, 0.12);
}

.skin-chip:disabled {
  opacity: 0.5;
  cursor: default;
}

.skin-chip-note {
  font-size: 0.82rem;
  color: var(--muted);
  align-self: center;
}
