:root {
  color-scheme: dark;
  font-family: Arial, Helvetica, sans-serif;
  background: #100426;
  color: #fff;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100svh;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 96, 0, 0.34), transparent 30%),
    radial-gradient(circle at 82% 8%, rgba(255, 184, 28, 0.2), transparent 28%),
    linear-gradient(160deg, #2a0a55 0%, #12042f 48%, #090019 100%);
}

button {
  font: inherit;
}

button:focus-visible,
canvas:focus-visible {
  outline: 4px solid #ffb81c;
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.game-app {
  width: 100%;
  display: grid;
  place-items: center;
}

.game-frame {
  position: relative;
  width: min(100vw, 1536px);
  max-height: 100svh;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  border: clamp(2px, 0.35vw, 5px) solid rgba(255, 255, 255, 0.9);
  border-radius: clamp(18px, 2vw, 30px);
  background-color: #0d0620;
  background-image:
    linear-gradient(180deg, rgba(70, 21, 110, 0.08), rgba(12, 4, 30, 0.28)),
    url("../images/risingGameBoard.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 184, 28, 0.14);
  isolation: isolate;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
}

.hud {
  position: absolute;
  z-index: 4;
  top: clamp(8px, 1.4vw, 20px);
  left: clamp(8px, 1.4vw, 20px);
  right: clamp(8px, 1.4vw, 20px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: clamp(6px, 1vw, 14px);
  pointer-events: none;
}

.hud-card {
  width: fit-content;
  min-width: clamp(84px, 10vw, 150px);
  padding: clamp(6px, 0.8vw, 11px) clamp(9px, 1.2vw, 16px);
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(63, 24, 105, 0.92), rgba(26, 8, 52, 0.92));
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 184, 28, 0.08);
  backdrop-filter: blur(7px);
}

.hud-card--lives {
  grid-column: 1;
  justify-self: start;
  text-align: left;
}

.hud-card--score {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(9px, 1vw, 14px);
  min-width: 0;
  text-align: center;
  border-color: rgba(255, 138, 36, 0.65);
  background: linear-gradient(135deg, rgba(91, 31, 134, 0.96), rgba(40, 10, 73, 0.96));
  box-shadow:
    0 10px 30px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(255, 96, 0, 0.1);
}

.hud-score-copy {
  min-width: clamp(46px, 5vw, 68px);
}

.hud-difficulty {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding-left: clamp(9px, 1vw, 14px);
  border-left: 1px solid rgba(255, 255, 255, 0.28);
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.58rem, 0.72vw, 0.76rem);
  font-weight: 800;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud-label {
  display: block;
  font-size: clamp(0.55rem, 0.75vw, 0.78rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #ff8a24;
}

.hud-value {
  display: block;
  margin-top: 2px;
  font-size: clamp(0.85rem, 1.2vw, 1.3rem);
  line-height: 1.1;
}

.feedback {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: min(82%, 520px);
  padding: clamp(14px, 2vw, 26px);
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  background: rgba(20, 11, 31, 0.92);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.48);
  text-align: center;
  font-size: clamp(1.15rem, 2.4vw, 2.5rem);
  font-weight: 900;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.feedback[data-tone="score"] {
  border-color: #ffb81c;
  color: #ffb81c;
}

.feedback[data-tone="danger"] {
  border-color: #ff4b55;
  color: #fff;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  padding: clamp(16px, 3vw, 48px);
  overflow: auto;
  background:
    linear-gradient(rgba(7, 4, 12, 0.72), rgba(7, 4, 12, 0.88)),
    radial-gradient(circle at center, rgba(229, 95, 32, 0.24), transparent 58%);
  backdrop-filter: blur(5px);
}

.panel {
  width: min(100%, 760px);
  padding: clamp(22px, 3.3vw, 50px);
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: clamp(18px, 2vw, 28px);
  background: rgba(25, 14, 38, 0.93);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.58);
  text-align: center;
}

.panel--menu {
  width: min(100%, 1040px);
}

.panel--compact {
  width: min(100%, 520px);
}

.eyebrow {
  margin: 0 0 8px;
  color: #ffb81c;
  font-size: clamp(0.7rem, 1vw, 0.9rem);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  margin-bottom: 12px;
  line-height: 0.98;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.intro {
  max-width: 650px;
  margin-right: auto;
  margin-bottom: clamp(18px, 2.3vw, 30px);
  margin-left: auto;
  color: rgba(255, 255, 255, 0.84);
  font-size: clamp(0.92rem, 1.35vw, 1.15rem);
  line-height: 1.5;
}

.difficulty-picker {
  margin: 0;
  padding: 0;
  border: 0;
}

.difficulty-picker legend {
  width: 100%;
  margin-bottom: 12px;
  font-size: clamp(0.8rem, 1vw, 1rem);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.difficulty-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 14px);
}

.difficulty-button {
  min-height: 54px;
  padding: 10px 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: clamp(0.95rem, 1.3vw, 1.15rem);
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.difficulty-button:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 184, 28, 0.65);
}

.difficulty-button.is-selected {
  border-color: #ffb81c;
  background: rgba(229, 95, 32, 0.22);
  box-shadow: inset 0 0 0 1px rgba(255, 184, 28, 0.4);
}

.how-to-play {
  margin: clamp(16px, 2vw, 24px) 0;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.045);
}

.section-heading {
  margin-bottom: 12px;
}

.section-kicker {
  margin-bottom: 2px;
  color: #ffb81c;
  font-size: clamp(0.65rem, 0.85vw, 0.78rem);
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.control-guide {
  width: min(100%, 760px);
  margin: 0 auto;
}

.control-guide-card {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 1.5vw, 20px);
  min-height: 116px;
  padding: clamp(12px, 1.5vw, 18px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(10, 5, 17, 0.42);
  text-align: left;
}

.control-guide-card--desktop {
  display: grid;
}

.control-guide-card--mobile {
  display: none;
}

.control-guide-copy strong,
.control-guide-copy span {
  display: block;
}

.control-guide-copy strong {
  margin-bottom: 5px;
  color: #ffb81c;
  font-size: clamp(0.95rem, 1.15vw, 1.1rem);
}

.control-guide-copy span {
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.72rem, 0.9vw, 0.86rem);
  line-height: 1.35;
}

.desktop-key-groups {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-group {
  display: grid;
  grid-template-columns: repeat(3, 30px);
  grid-template-rows: repeat(2, 30px);
  gap: 4px;
}

.key {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-bottom-width: 3px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.07));
  color: #fff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.24);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.key--up {
  grid-column: 2;
  grid-row: 1;
}

.key--left {
  grid-column: 1;
  grid-row: 2;
}

.key--down {
  grid-column: 2;
  grid-row: 2;
}

.key--right {
  grid-column: 3;
  grid-row: 2;
}

.control-or {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.control-preview-joystick {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 108px;
}

.joystick-preview-base {
  position: relative;
  display: block;
  width: 78px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.12) 0 3px, transparent 4px),
    rgba(20, 11, 31, 0.78);
  box-shadow:
    inset 0 0 0 8px rgba(255, 255, 255, 0.035),
    0 7px 16px rgba(0, 0, 0, 0.28);
}

.joystick-preview-base::before,
.joystick-preview-base::after {
  position: absolute;
  inset: 50% auto auto 50%;
  content: "";
  background: rgba(255, 255, 255, 0.18);
  transform: translate(-50%, -50%);
}

.joystick-preview-base::before {
  width: 48px;
  height: 1px;
}

.joystick-preview-base::after {
  width: 1px;
  height: 48px;
}

.joystick-preview-stick {
  position: absolute;
  z-index: 1;
  left: 63%;
  top: 36%;
  display: block;
  width: 34px;
  aspect-ratio: 1;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  background: #e56020;
  box-shadow: 0 5px 11px rgba(0, 0, 0, 0.34);
  transform: translate(-50%, -50%);
}

.joystick-preview-label {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.primary-button,
.secondary-button {
  min-width: 150px;
  min-height: 48px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition:
    transform 140ms ease,
    filter 140ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, #ffb81c, #e56020);
  color: #160b21;
}

.secondary-button {
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.final-score {
  margin-bottom: 8px;
  font-size: clamp(1.15rem, 2vw, 1.6rem);
}

.game-over-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 24px;
}

.mobile-controls {
  position: absolute;
  z-index: 6;
  left: max(14px, env(safe-area-inset-left));
  bottom: max(14px, env(safe-area-inset-bottom));
  width: clamp(138px, 23vw, 184px);
  aspect-ratio: 1;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-controls[hidden] {
  display: none !important;
}

.mobile-controls-label {
  position: absolute;
  z-index: 1001;
  left: 50%;
  bottom: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: clamp(0.62rem, 1.3vw, 0.76rem);
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
  transform: translateX(-50%);
}

.mobile-controls .joystick .back {
  border: 2px solid rgba(255, 255, 255, 0.58);
  box-shadow:
    inset 0 0 0 9px rgba(255, 255, 255, 0.035),
    0 9px 22px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(5px);
}

.mobile-controls .joystick .front {
  border: 2px solid rgba(255, 255, 255, 0.86);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  opacity: 0.92 !important;
}

@media (hover: none) and (pointer: coarse) {
  .mobile-controls:not([hidden]) {
    display: block;
  }
}

@media (hover: hover) and (pointer: fine) {
  .mobile-controls {
    display: none !important;
  }
}

@media (hover: none) and (pointer: coarse) {
  .control-guide-card--desktop {
    display: none;
  }

  .control-guide-card--mobile {
    display: grid;
  }
}

@media (max-width: 700px), (max-height: 620px) {
  .overlay {
    align-items: start;
    padding: 10px;
  }

  .panel {
    margin: auto;
    padding: 18px;
  }

  .difficulty-button {
    min-height: auto;
  }

  .control-guide-card {
    min-height: auto;
  }

  .hud-card {
    padding: 6px 10px;
  }

  .hud-card--score {
    gap: 8px;
  }

  .hud-difficulty {
    padding-left: 8px;
  }
}

@media (max-width: 460px) {
  .difficulty-options {
    grid-template-columns: 1fr;
  }

  .main-menu-actions {
    grid-template-columns: 1fr;
  }

  .high-scores-header {
    grid-template-columns: 1fr auto;
    text-align: left;
  }

  .high-scores-header .back-button {
    position: static;
    grid-column: 1 / -1;
    justify-self: start;
  }

  .control-guide-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .control-guide-copy {
    text-align: center;
  }

  .desktop-key-groups {
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

.main-menu-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(10px, 1.4vw, 16px);
  width: min(100%, 520px);
  margin: 0 auto;
}

.main-menu-actions .primary-button,
.main-menu-actions .secondary-button {
  width: 100%;
  min-width: 0;
}

.panel--high-scores {
  width: min(100%, 680px);
}

.high-scores-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  text-align: center;
}

.high-scores-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.high-scores-header-top .back-button {
  position: static;
  left: auto;
  flex: 0 0 auto;
}

.high-scores-header-top .leaderboard-limit {
  flex: 0 0 auto;
  margin-left: auto;
}

.high-scores-title {
  width: 100%;
  text-align: center;
}

.high-scores-title .eyebrow {
  margin: 0 0 5px;
}

.high-scores-title h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.leaderboard-panel--high-scores {
  width: 100%;
  margin: 0;
}

.leaderboard-panel {
  width: min(100%, 660px);
  margin-right: auto;
  margin-left: auto;
  padding: clamp(14px, 1.8vw, 20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: rgba(10, 5, 17, 0.48);
  text-align: left;
}

.leaderboard-panel--game-over {
  margin-top: 20px;
}

.leaderboard-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.leaderboard-heading h2,
.leaderboard-heading h3 {
  margin: 0;
  font-size: clamp(1.15rem, 1.8vw, 1.55rem);
  line-height: 1.1;
}

.leaderboard-limit {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 184, 28, 0.45);
  border-radius: 999px;
  color: #ffb81c;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: score-rank;
}

.score-list-item {
  counter-increment: score-rank;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.055);
}

.score-list-item::before {
  content: counter(score-rank) ".";
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.score-list-points {
  font-size: 0.92rem;
  font-weight: 900;
}

.score-list-difficulty {
  color: #ffb81c;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-list-empty,
.storage-note {
  color: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.score-list-empty {
  margin: 8px 0 0;
  font-size: 0.82rem;
}

.storage-note {
  margin: 10px 0 0;
  font-size: 0.68rem;
  line-height: 1.35;
}

.high-score-message {
  width: fit-content;
  margin: 14px auto 0;
  padding: 7px 12px;
  border: 1px solid rgba(255, 184, 28, 0.55);
  border-radius: 999px;
  background: rgba(255, 184, 28, 0.12);
  color: #ffb81c;
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

@media (max-width: 460px) {
  .score-list-item {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 7px;
    padding-right: 8px;
    padding-left: 8px;
  }
}


.menu-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(14px, 1.8vw, 22px);
  margin: clamp(16px, 2vw, 24px) 0;
}

.menu-info-grid .next-game-panel,
.menu-info-grid .how-to-play {
  width: 100%;
  height: 100%;
  margin: 0;
}

.menu-info-grid .next-game-panel {
  display: flex;
  flex-direction: column;
}

.menu-info-grid .next-game-actions {
  margin-top: auto;
  padding-top: 16px;
}

.menu-info-grid .control-guide {
  width: 100%;
}

.menu-info-grid .control-guide-card {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 0;
  text-align: center;
}

.menu-info-grid .control-guide-copy {
  text-align: center;
}

@media (max-width: 820px) {
  .menu-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Home schedule */
.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.next-game-panel {
  width: min(100%, 760px);
  margin: clamp(16px, 2vw, 24px) auto;
  padding: clamp(14px, 1.8vw, 22px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  background: rgba(10, 5, 17, 0.52);
  text-align: left;
}

.next-game-heading,
.schedule-header,
.schedule-pagination {
  display: flex;
  align-items: center;
}

.next-game-heading {
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.next-game-heading h2 {
  margin: 0;
  font-size: clamp(1.25rem, 2vw, 1.8rem);
  line-height: 1.1;
}

.schedule-data-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border: 1px solid rgba(255, 184, 28, 0.5);
  border-radius: 999px;
  color: #ffb81c;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.next-game-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 24px);
}

.next-game-matchup {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 176px;
}

.next-game-matchup span {
  color: rgba(255, 255, 255, 0.56);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.next-game-logo {
  width: clamp(40px, 4.4vw, 56px);
  height: clamp(40px, 4.4vw, 56px);
  object-fit: contain;
}

.next-game-details h3 {
  margin: 0 0 5px;
  font-size: clamp(1.05rem, 1.6vw, 1.4rem);
  line-height: 1.15;
}

.next-game-details p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(0.78rem, 1vw, 0.9rem);
}

.next-game-promotion {
  margin-top: 7px;
  color: #ffb81c !important;
  font-weight: 900;
}

.next-game-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.next-game-actions .primary-button,
.next-game-actions .secondary-button {
  min-width: 138px;
  min-height: 44px;
  padding: 10px 18px;
}

.schedule-message {
  margin: 12px 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.86rem;
  line-height: 1.45;
  text-align: center;
}

.panel--schedule {
  width: min(100%, 940px);
  text-align: left;
}

.schedule-header {
  position: relative;
  justify-content: center;
  min-height: 58px;
  padding: 0 104px;
  text-align: center;
}

.schedule-header h2 {
  margin-bottom: 0;
  font-size: clamp(2rem, 4vw, 3.7rem);
}

.back-button {
  position: absolute;
  left: 0;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
}

.back-button:hover {
  border-color: #ffb81c;
  background: rgba(255, 184, 28, 0.1);
}

.schedule-time-note,
.schedule-demo-note {
  text-align: center;
}

.schedule-time-note {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.78rem;
}

.schedule-demo-note {
  width: fit-content;
  margin: 0 auto 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255, 184, 28, 0.35);
  border-radius: 10px;
  background: rgba(255, 184, 28, 0.08);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.72rem;
  line-height: 1.4;
}

.schedule-demo-note code {
  color: #ffb81c;
}

.schedule-list {
  display: grid;
  gap: 9px;
}

.schedule-game-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
}

.schedule-game-logo {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.schedule-game-details h3 {
  margin: 0 0 4px;
  font-size: clamp(0.95rem, 1.35vw, 1.15rem);
  line-height: 1.15;
}

.schedule-game-date,
.schedule-game-promotion {
  margin-bottom: 0;
  font-size: clamp(0.72rem, 0.9vw, 0.82rem);
}

.schedule-game-date {
  color: rgba(255, 255, 255, 0.7);
}

.schedule-game-promotion {
  margin-top: 3px;
  color: #ffb81c;
  font-weight: 900;
}

.schedule-ticket-button {
  min-width: 126px;
  min-height: 42px;
  padding: 9px 15px;
  font-size: 0.78rem;
}

.schedule-pagination {
  justify-content: center;
  gap: 16px;
  margin-top: 18px;
  text-align: center;
}

.schedule-pagination span {
  min-width: 96px;
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.76rem;
  font-weight: 900;
}

.schedule-page-button {
  min-width: 110px;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 0.76rem;
}

.schedule-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  transform: none;
  filter: none;
}

@media (max-width: 700px) {
  .next-game-content {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .next-game-actions {
    justify-content: center;
  }

  .schedule-header {
    justify-content: flex-start;
    padding: 0;
    text-align: left;
  }

  .schedule-header .back-button {
    position: static;
    margin-right: 14px;
  }

  .schedule-game-card {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .schedule-game-logo {
    width: 44px;
    height: 44px;
  }


  .schedule-ticket-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

@media (max-width: 460px) {
  .next-game-heading {
    align-items: flex-start;
  }

  .next-game-matchup {
    min-width: 0;
  }

  .schedule-header {
    align-items: flex-start;
  }

  .schedule-header h2 {
    font-size: 1.8rem;
  }

  .back-button {
    flex: 0 0 auto;
    padding-right: 12px;
    padding-left: 12px;
  }

  .schedule-pagination {
    gap: 8px;
  }

  .schedule-page-button {
    min-width: 86px;
  }
}

/* In-game menu and current-run confirmation */
.experience-exit-button {
  position: absolute;
  z-index: 12;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  min-width: 86px;
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 999px;
  background: rgba(20, 11, 31, 0.84);
  color: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  font-size: clamp(0.72rem, 1vw, 0.86rem);
  font-weight: 900;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.experience-exit-button:hover {
  border-color: #ffb81c;
  background: rgba(50, 27, 70, 0.94);
}

.overlay--exit-confirm {
  z-index: 16;
}

.exit-confirm-copy {
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.45;
}

.exit-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  .experience-exit-button {
    top: auto;
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 92px;
    min-height: 46px;
  }
}


@media (max-width: 760px) and (orientation: portrait) {
  body {
    overflow-y: auto;
    place-items: start center;
  }

  .game-app {
    min-height: 100svh;
    display: block;
  }

  .game-frame {
    width: 100%;
    min-height: 100svh;
    height: auto;
    max-height: none;
    aspect-ratio: auto;
    overflow: visible;
    border-radius: 0;
  }

  .game-frame > canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0.2;
    pointer-events: none;
  }

  .overlay {
    position: relative;
    inset: auto;
    min-height: 100svh;
    height: auto;
    overflow: visible;
    padding: 16px 12px 28px;
    align-items: flex-start;
    justify-content: flex-start;
    background:
      linear-gradient(rgba(24, 4, 49, 0.94), rgba(8, 0, 22, 0.99)),
      radial-gradient(circle at 20% 8%, rgba(255, 96, 0, 0.18), transparent 30%);
  }

  .panel--menu {
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 24px 18px 28px;
    overflow: visible;
    border-radius: 22px;
  }

  .panel--menu h1 {
    font-size: clamp(2.2rem, 13vw, 3.6rem);
  }

  .panel--menu .intro {
    max-width: none;
    font-size: 0.98rem;
    line-height: 1.55;
  }

  .difficulty-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .difficulty-button {
    min-height: 46px;
    padding: 10px 8px;
  }

  .menu-info-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
  }

  .next-game-panel,
  .how-to-play {
    width: 100%;
  }

  .next-game-content {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 12px;
  }

  .next-game-matchup {
    justify-content: center;
  }

  .next-game-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .next-game-actions .primary-button,
  .next-game-actions .secondary-button {
    width: 100%;
  }

  .control-guide {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .control-guide-card--desktop {
    display: none;
  }

  .control-guide-card--mobile {
    display: block;
  }

  .main-menu-actions {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 22px;
  }

  .main-menu-actions .primary-button,
  .main-menu-actions .secondary-button {
    width: 100%;
    min-height: 50px;
  }
}