:root {
  --bg: #080b16;
  --bg-soft: #0e1324;
  --panel: rgba(18, 24, 46, 0.8);
  --panel-strong: rgba(14, 20, 37, 0.96);
  --line: rgba(106, 141, 255, 0.18);
  --text: #f3f7ff;
  --muted: rgba(232, 239, 255, 0.72);
  --soft: rgba(232, 239, 255, 0.48);
  --brand: #3dc5de;
  --brand-2: #7a7dff;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
}

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

[hidden] {
  display: none !important;
}

html {
  -ms-touch-action: auto;
  touch-action: auto;
  min-height: 100%;
  scroll-behavior: smooth;
}

body, canvas, div {
  outline: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(61, 197, 222, 0.12), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(122, 125, 255, 0.12), transparent 22%),
    linear-gradient(180deg, #0a0f1d 0%, #090c16 45%, #070a12 100%);
  font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 36px);
  backdrop-filter: blur(20px);
  background: rgba(7, 10, 18, 0.68);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.brand-inline,
.site-nav,
.hero-badges,
.hero-actions,
.game-panel-head {
  display: flex;
  align-items: center;
}

.brand-inline {
  gap: 10px;
  font-weight: 700;
}

.brand-inline-title {
  margin: 0;
  font: inherit;
  font-size: 1.1rem;
  line-height: 1;
}

.brand-inline-mark,
.panel-pill,
.preview-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
}

.brand-inline-mark {
  width: 28px;
  height: 28px;
  color: #07131a;
  background: linear-gradient(135deg, var(--brand), #9af6ff);
}

.site-nav {
  gap: 18px;
  color: var(--muted);
}

.nav-cta,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-cta,
.primary-button {
  color: #07131a;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #9af6ff);
  box-shadow: 0 12px 32px rgba(61, 197, 222, 0.28);
  cursor: pointer;
}

.nav-cta {
  min-height: 34px;
  padding: 8px 14px;
  font-size: 0.92rem;
  box-shadow: 0 8px 24px rgba(61, 197, 222, 0.24);
}

.nav-cta--donate {
  color: #fff8ee;
  background: linear-gradient(135deg, #ff9a62, #ff5f7b);
  box-shadow: 0 10px 28px rgba(255, 95, 123, 0.28);
}

.secondary-button {
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

.nav-cta:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

main {
  display: block;
}

.hero-section,
.play-section {
  position: relative;
  overflow: hidden;
}

.hero-section {
  padding: clamp(44px, 7vw, 96px) clamp(18px, 4vw, 40px) 40px;
}

.ambient-grid,
.loader-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(61, 197, 222, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 197, 222, 0.06) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.2));
}

.ambient-orb,
.loader-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.orb-left {
  width: 360px;
  height: 360px;
  top: 0;
  left: -80px;
  background: radial-gradient(circle, rgba(61, 197, 222, 0.18), transparent 72%);
}

.orb-right {
  width: 300px;
  height: 300px;
  right: -80px;
  top: 80px;
  background: radial-gradient(circle, rgba(122, 125, 255, 0.16), transparent 72%);
}

.hero-shell,
.info-section,
.play-section,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 24px;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
}

.hero-copy,
.hero-preview-card,
.info-card,
.guide-card,
.game-panel {
  border: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(88, 230, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(19, 26, 46, 0.94), rgba(10, 15, 29, 0.96));
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy,
.hero-preview-card,
.info-card,
.guide-card,
.game-panel {
  border-radius: 28px;
}

.hero-copy {
  padding: clamp(24px, 5vw, 40px);
}

.hero-preview-card,
.guide-card,
.game-panel {
  padding: 24px;
}

.eyebrow,
.splash-tagline,
.loading-text {
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 700;
}

.splash-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.hero-brand {
  margin-bottom: 20px;
}

.logo-icon {
  width: 78px;
  height: 78px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(61, 197, 222, 0.09);
  border: 1px solid rgba(61, 197, 222, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 0 28px rgba(61, 197, 222, 0.14);
}

.small-logo {
  width: 62px;
  height: 62px;
}

.arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--brand);
  animation: arrowPulse 2s ease-in-out infinite;
}

.a1 { animation-delay: 0s; }
.a2 { animation-delay: 0.3s; }
.a3 { animation-delay: 0.6s; }
.a4 { animation-delay: 0.9s; }

@keyframes arrowPulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.18); text-shadow: 0 0 16px rgba(61, 197, 222, 0.9); }
}

.logo-title {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: clamp(3rem, 9vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.loader-title {
  font-size: clamp(2rem, 7vw, 3rem);
}

.logo-title span {
  color: var(--brand);
  text-shadow: 0 0 26px rgba(61, 197, 222, 0.55);
}

.hero-lead,
.hero-preview-card p,
.info-card p,
.guide-card p,
.game-note,
.section-heading p,
.site-footer p {
  color: var(--muted);
  line-height: 1.75;
}

.hero-actions {
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.hero-badges {
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.hero-badges span,
.panel-pill,
.preview-chip {
  padding: 8px 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
}

.hero-preview-card h2,
.section-heading h2,
.info-card h2,
.guide-card h3 {
  margin: 0 0 12px;
}

.hero-preview-card ul,
.guide-card ol {
  margin: 16px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.info-section {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 12px 0 24px;
}

.info-card {
  padding: 24px;
}

.play-section {
  padding: 38px 0 70px;
}

.section-heading {
  max-width: 700px;
  margin-bottom: 24px;
}

.play-layout {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  align-items: start;
}

.game-sidebar {
  display: grid;
  gap: 18px;
}

.compact-card {
  background: var(--panel-strong);
}

.game-panel-head {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-head-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-weight: 600;
}

.panel-pill {
  color: #b7fbff;
  background: rgba(61, 197, 222, 0.14);
  border-color: rgba(61, 197, 222, 0.2);
}

.panel-link {
  color: var(--brand);
  font-weight: 600;
}

.game-shell {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  padding: 8px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(18, 24, 46, 0.96), rgba(8, 12, 23, 0.98));
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.game-shell::before,
.game-shell::after {
  content: '';
  position: absolute;
  pointer-events: none;
}

.game-shell::before {
  inset: 0;
  border-radius: 32px;
  border: 1px solid rgba(122, 180, 255, 0.16);
}

.game-shell::after {
  inset: 12px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0));
  opacity: 0.55;
}

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 1334;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(122, 180, 255, 0.24);
  background:
    radial-gradient(circle at 18% 10%, rgba(61, 197, 222, 0.14), transparent 28%),
    radial-gradient(circle at 82% 12%, rgba(122, 125, 255, 0.14), transparent 24%),
    linear-gradient(180deg, #edf5ff 0%, #ddeafb 46%, #c7dbf7 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), inset 0 -18px 32px rgba(56, 82, 132, 0.08);
  isolation: isolate;
}

.game-stage::before,
.game-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.game-stage::before {
  z-index: 1;
  background: none;
}

.game-stage::after {
  z-index: 1;
  opacity: 0;
  background: none;
}

#GameCanvas {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  display: block;
  z-index: 2;
  image-rendering: auto;
  backface-visibility: hidden;
}

#GameCanvas {
  visibility: hidden;
  background: transparent;
}

#splash {
  position: absolute;
  inset: 0;
  z-index: 10;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, rgba(16, 22, 42, 0.98), rgba(7, 10, 18, 0.98));
}

.loader-orb-1 {
  width: 260px;
  height: 260px;
  top: -60px;
  left: -60px;
  background: radial-gradient(circle, rgba(61, 197, 222, 0.16), transparent 72%);
}

.loader-orb-2 {
  width: 220px;
  height: 220px;
  right: -50px;
  bottom: -50px;
  background: radial-gradient(circle, rgba(122, 125, 255, 0.16), transparent 72%);
}

.loader-shell {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
}

.splash-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.splash-inner .splash-logo {
  align-items: center;
}

.splash-tagline {
  margin: 0;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.52);
}

.progress-wrap {
  width: min(250px, 72vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.progress-bar {
  width: 100%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.09);
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--brand), #9af6ff, var(--brand));
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(61, 197, 222, 0.75);
  transition: width 0.4s ease;
}

.stripes span {
  animation: shimmer 1.8s linear infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-text {
  margin: 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.42);
}

.game-note,
.site-footer {
  text-align: center;
}

.card-head,
.status-row,
.sidebar-actions,
.mode-toggle,
.modal-actions {
  display: flex;
  align-items: center;
}

.card-head,
.status-row,
.sidebar-actions,
.modal-actions {
  justify-content: space-between;
}

.card-head {
  gap: 12px;
  margin-bottom: 16px;
}

.mini-badge,
.modal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(61, 197, 222, 0.18);
  background: rgba(61, 197, 222, 0.12);
  color: #b7fbff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.status-stack {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.status-row {
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.status-label {
  color: var(--soft);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.mode-toggle {
  gap: 10px;
  margin-bottom: 16px;
}

.chip-button,
.sidebar-button,
.level-button,
.modal-button {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.chip-button,
.level-button {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.chip-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  cursor: pointer;
  text-decoration: none;
}

.chip-button.is-active,
.level-button.is-active {
  border-color: rgba(61, 197, 222, 0.6);
  background: rgba(61, 197, 222, 0.18);
  box-shadow: 0 0 0 1px rgba(61, 197, 222, 0.15) inset;
}

.sidebar-actions {
  gap: 10px;
  margin-bottom: 14px;
}

.sidebar-button {
  flex: 1;
  min-height: 46px;
  padding-inline: 16px;
}

.game-status-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.level-card {
  max-height: 420px;
  overflow: auto;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.level-button {
  min-height: 50px;
  border-radius: 16px;
  font-weight: 700;
  cursor: pointer;
}

.challenge-preview-section {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.challenge-preview-head {
  display: grid;
  gap: 8px;
}

.challenge-preview-head h2,
.challenge-preview-head h3,
.challenge-preview-head p {
  margin: 0;
}

.challenge-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.challenge-preview-card {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.challenge-preview-card:hover {
  transform: translateY(-1px);
  border-color: rgba(61, 197, 222, 0.34);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);
}

.challenge-preview-card.is-active {
  border-color: rgba(61, 197, 222, 0.6);
  background: rgba(61, 197, 222, 0.14);
  box-shadow: 0 0 0 1px rgba(61, 197, 222, 0.15) inset;
}

.challenge-preview-thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.96), rgba(8, 11, 20, 0.98));
}

.challenge-preview-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.challenge-preview-meta {
  display: grid;
  gap: 4px;
  min-height: 3.15em;
}

.challenge-preview-label,
.challenge-preview-caption {
  display: block;
}

.challenge-preview-label {
  font-weight: 700;
  font-size: 0.93rem;
  line-height: 1.12;
}

.challenge-preview-caption {
  font-size: 0.78rem;
  line-height: 1.15;
  color: var(--muted);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
  background: rgba(5, 8, 15, 0.68);
  backdrop-filter: blur(10px);
}

.game-stage.is-error-flash {
  animation: stageErrorFlash 0.5s ease;
}

.game-stage.is-success-flash {
  animation: stageSuccessFlash 0.8s ease;
}

.game-stage.is-fail-flash {
  animation: stageFailFlash 0.7s ease;
}

@keyframes stageErrorFlash {
  0% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
  35% { box-shadow: inset 0 0 0 2px rgba(255, 102, 132, 0.72), 0 0 40px rgba(255, 102, 132, 0.28), 0 26px 70px rgba(0,0,0,0.45); }
  100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
}

@keyframes stageSuccessFlash {
  0% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
  40% { box-shadow: inset 0 0 0 2px rgba(90, 255, 190, 0.68), 0 0 44px rgba(90, 255, 190, 0.24), 0 26px 70px rgba(0,0,0,0.45); }
  100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
}

@keyframes stageFailFlash {
  0% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
  40% { box-shadow: inset 0 0 0 2px rgba(255, 136, 180, 0.72), 0 0 44px rgba(255, 136, 180, 0.24), 0 26px 70px rgba(0,0,0,0.45); }
  100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 26px 70px rgba(0,0,0,0.45); }
}

.result-modal-card {
  width: min(100%, 360px);
  padding: 24px;
  border-radius: 24px;
  background: rgba(13, 18, 34, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  text-align: center;
}

.result-modal-title,
.result-modal-card h3 {
  margin: 14px 0 10px;
  font-size: 1.7rem;
}

.result-modal-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.modal-button {
  flex: 1;
  min-height: 46px;
}

.modal-button:disabled,
.modal-button.is-locked {
  opacity: 0.52;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
  transform: none;
}

.modal-button--support {
  flex-basis: 100%;
}

.site-footer {
  padding: 0 0 42px;
}

.noscript-banner {
  margin: 0 auto 24px;
  width: min(1180px, calc(100% - 32px));
  padding: 14px 18px;
  border-radius: 16px;
  background: rgba(255, 92, 92, 0.12);
  border: 1px solid rgba(255, 92, 92, 0.26);
}

@media (max-width: 980px) {
  .hero-shell,
  .play-layout,
  .info-section {
    grid-template-columns: 1fr;
  }

  .site-nav {
    display: none;
  }

  .hero-preview-card,
  .game-panel,
  .guide-card {
    padding: 20px;
  }

  .level-card {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
  }

  .brand-inline,
  .nav-cta {
    width: 100%;
    justify-content: center;
  }

  .game-page-header {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
  }

  .game-page-header .brand-inline {
    width: auto;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-width: 0;
  }

  .game-page-header .game-page-actions {
    width: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .game-page-header .nav-cta {
    width: auto;
    min-height: 30px;
    padding: 5px 10px;
    font-size: 0.82rem;
    white-space: nowrap;
  }

  .game-page-header .brand-inline-title {
    font-size: 1rem;
  }

  .hero-copy,
  .hero-preview-card,
  .info-card,
  .guide-card,
  .game-panel {
    border-radius: 22px;
  }

  .game-stage {
    border-radius: 24px;
  }

  .game-shell {
    padding: 10px;
    border-radius: 30px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar-actions {
    flex-direction: column;
  }

  .result-modal-card {
    width: min(100%, 368px);
    padding: 20px 16px;
  }

  .result-modal-title,
  .result-modal-card h3 {
    margin: 12px 0 8px;
    font-size: 1.45rem;
  }

  .result-modal-card p {
    font-size: 0.95rem;
    line-height: 1.55;
  }

  .result-modal-card .modal-actions {
    flex-direction: row;
    gap: 8px;
    margin-top: 16px;
  }

  .result-modal-card .modal-button {
    min-height: 42px;
    padding: 10px 14px;
    font-size: 0.92rem;
  }

  .level-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .primary-button,
  .secondary-button {
    text-align: center;
  }
}

.brand-inline-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(61, 197, 222, 0.2);
}

.brand-splash-mark {
  width: 76px;
  height: 76px;
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(61, 197, 222, 0.2);
}

.game-page {
  min-height: 100vh;
}

.game-page-header,
.game-page-shell,
.game-footer {
  width: min(980px, calc(100% - 24px));
  margin: 0 auto;
}

.game-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0 6px;
}

.game-page-actions,
.game-page-meta,
.site-footer-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-page-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.game-page-refresh-button { cursor: pointer; }

.game-page-shell {
  display: grid;
  gap: 14px;
  padding-bottom: 26px;
}

.game-page-meta {
  gap: 14px;
  flex-wrap: wrap;
}

.game-page-meta .status-row {
  min-width: 180px;
}

.game-mode-panel {
  min-width: 220px;
}

.game-mode-panel .status-label {
  display: block;
  margin-bottom: 10px;
}

.game-panel--standalone {
  display: grid;
  gap: 12px;
  padding: 18px 18px 16px;
}

.game-panel-head--minimal {
  justify-content: center;
  margin-bottom: 4px;
}

.game-panel-controls {
  display: grid;
  align-items: stretch;
  gap: 10px;
}

.game-panel-controls--minimal {
  width: 100%;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.game-page.is-random-mode .game-panel-controls--minimal,
.game-page.is-challenge-mode .game-panel-controls--minimal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.game-page.has-hint-button.is-default-mode .game-panel-controls--minimal {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.game-page.has-hint-button.is-random-mode .game-panel-controls--minimal,
.game-page.has-hint-button.is-challenge-mode .game-panel-controls--minimal {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.game-mode-wrap,
.game-settings-wrap {
  position: relative;
}

.game-mode-button,
.game-settings-button,
.game-control-button,
.game-stat-chip {
  min-width: 0;
}

.game-mode-panel {
  display: grid;
  gap: 8px;
  width: min(240px, calc(100vw - 40px));
}

.game-mode-option {
  width: 100%;
  min-height: 42px;
  font-weight: 700;
}

.game-mode-option[aria-current="page"] {
  border-color: rgba(61, 197, 222, 0.82);
  background: linear-gradient(180deg, rgba(61, 197, 222, 0.34), rgba(61, 197, 222, 0.2));
  color: #f2fdff;
  box-shadow: 0 0 0 1px rgba(61, 197, 222, 0.22) inset, 0 10px 22px rgba(18, 95, 116, 0.22);
  pointer-events: none;
}

.game-mode-option[aria-current="page"]::before {
  content: "●";
  margin-right: 0.42rem;
  color: #b8f8ff;
  font-size: 0.72em;
}

.game-settings-button,
.game-control-button {
  min-width: 0;
}

.game-settings-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 25;
  width: min(340px, calc(100vw - 40px));
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(8, 12, 24, 0.94);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

#settings-panel {
  padding: 12px;
}

#settings-panel .mode-toggle {
  gap: 6px;
  margin-bottom: 0;
}

#settings-panel .chip-button {
  min-height: 36px;
  padding: 0 12px;
}

#settings-panel .settings-title {
  margin-bottom: 8px;
}

#settings-panel .settings-help {
  margin-top: 6px;
  font-size: 0.78rem;
  line-height: 1.45;
}

.settings-section + .settings-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

#settings-panel .settings-section + .settings-section {
  margin-top: 10px;
  padding-top: 10px;
}

.settings-title {
  margin: 0 0 10px;
  color: var(--soft);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.settings-help {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.thickness-toggle .chip-button {
  flex: 1;
}

.sound-toggle .chip-button {
  flex: 1;
}

.hint-toggle .chip-button {
  flex: 1;
}

.precision-assist-toggle .chip-button {
  flex: 1;
}

#precision-assist-ui {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

#precision-assist-anchor {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  transform: translate(0, 0);
}

#precision-assist-anchor::before,
#precision-assist-anchor::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  transform: translate(-50%, -50%);
}

#precision-assist-anchor::before {
  width: 26px;
  height: 26px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 1px rgba(12, 16, 26, 0.18), 0 6px 18px rgba(10, 14, 24, 0.18);
}

#precision-assist-anchor::after {
  width: 7px;
  height: 7px;
  background: rgba(14, 18, 28, 0.72);
}

#precision-assist-anchor.is-hovering::before {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 10px 24px rgba(10, 14, 24, 0.24);
}

#precision-assist-anchor.is-hovering::after {
  background: rgba(10, 12, 18, 0.9);
}

#precision-assist-anchor.is-attention::before {
  animation: precisionAssistRevealRing 0.25s ease-in-out 4;
}

#precision-assist-anchor.is-attention::after {
  animation: precisionAssistRevealDot 0.25s ease-in-out 4;
}

@keyframes precisionAssistRevealRing {
  0%, 100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.2;
    transform: translate(-50%, -50%) scale(0.78);
  }
}

@keyframes precisionAssistRevealDot {
  0%, 100% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    opacity: 0.18;
    transform: translate(-50%, -50%) scale(0.72);
  }
}

#precision-assist-cursor {
  display: none;
}

.game-stat-chip {
  min-width: 0;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.game-stat-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.game-stat-chip strong {
  font-size: 1rem;
  font-weight: 700;
}

.game-page .mode-toggle,
.game-page .thickness-toggle {
  margin-bottom: 0;
  align-items: stretch;
}

.game-page .chip-button {
  min-height: 42px;
  padding: 0 14px;
}

.game-status-inline {
  margin: 2px 0 0;
  text-align: center;
  font-size: 0.95rem;
  color: var(--muted);
}

.game-info-module {
  display: grid;
  gap: 16px;
  padding: 20px 20px 18px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(88, 230, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(17, 24, 41, 0.94), rgba(8, 12, 22, 0.97));
  box-shadow: var(--shadow);
}

.game-info-intro,
.game-info-card,
.game-faq-item {
  display: grid;
  gap: 10px;
}

.game-status-banner {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(61, 197, 222, 0.18);
  background: linear-gradient(180deg, rgba(61, 197, 222, 0.1), rgba(255, 255, 255, 0.03));
}

.game-status-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(61, 197, 222, 0.14);
  color: #b8f2ff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.game-info-intro p,
.game-info-card p,
.game-faq-item p {
  margin: 0;
}

.game-info-intro h1,
.game-info-intro h2,
.game-info-card h3,
.game-faq h2,
.game-faq h3,
.game-faq-item h3,
.game-faq-item h4 {
  margin: 0;
}

.game-info-grid,
.game-faq-list {
  display: grid;
  gap: 12px;
}

.game-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.game-info-card,
.game-faq-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.game-status-module {
  color: #e5fbff;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.6;
}

.game-faq {
  display: grid;
  gap: 12px;
}

.game-faq-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mode-landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.mode-landing-actions .primary-button,
.mode-landing-actions .secondary-button {
  text-align: center;
}

.game-panel--standalone:fullscreen,
.game-panel--standalone:-webkit-full-screen,
.game-panel--standalone.is-fullscreen-active {
  width: 100vw;
  max-width: none;
  min-height: 100dvh;
  margin: 0;
  padding: clamp(12px, 2vw, 22px);
  border-radius: 0;
  display: grid;
  align-content: start;
  align-items: start;
  justify-items: center;
  background:
    radial-gradient(circle at top, rgba(61, 197, 222, 0.12), transparent 34%),
    linear-gradient(180deg, #08101d 0%, #050914 100%);
}

.game-panel--standalone:fullscreen::before,
.game-panel--standalone:fullscreen::after,
.game-panel--standalone:-webkit-full-screen::before,
.game-panel--standalone:-webkit-full-screen::after,
.game-panel--standalone.is-fullscreen-active::before,
.game-panel--standalone.is-fullscreen-active::after {
  display: none;
}

.game-panel--standalone:fullscreen .game-shell,
.game-panel--standalone:-webkit-full-screen .game-shell,
.game-panel--standalone.is-fullscreen-active .game-shell {
  width: min(100%, 1100px, calc(100dvh - 96px));
  max-width: 100%;
}

body.has-fallback-fullscreen {
  overflow: hidden;
}

.game-panel--standalone.is-fallback-fullscreen-active {
  position: fixed;
  inset: 0;
  z-index: 1200;
  box-sizing: border-box;
  min-height: 100dvh;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding:
    max(12px, env(safe-area-inset-top))
    max(12px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
}

.game-sequence-note {
  color: var(--soft);
  font-size: 0.9rem;
}

.utility-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.game-footer {
  padding-top: 4px;
}

.game-page .game-shell {
  width: min(100%, 620px);
}

.game-page .game-stage {
  aspect-ratio: auto;
  min-height: 320px;
}

.site-footer-links {
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.site-footer-links a {
  color: var(--soft);
}

.guide-page {
  min-height: 0;
  margin: 0;
  background: transparent;
  overflow: hidden;
}

.guide-page-shell {
  width: 100%;
  margin: 0 auto;
  padding: 0;
}

.guide-game-shell {
  width: 100%;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.guide-game-shell::before,
.guide-game-shell::after {
  display: none;
}

.guide-page .game-stage {
  min-height: 0;
  aspect-ratio: auto;
  border-radius: 0;
  border: 0;
}

@media (max-width: 760px) {
  .game-page-actions,
  .game-page-meta {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .game-page-header {
    align-items: center;
  }

  .game-page-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }

  .game-mode-panel {
    min-width: 0;
  }

  .game-panel-controls--minimal {
    display: grid;
    gap: 8px;
    position: relative;
  }

  .game-page.is-default-mode .game-panel-controls--minimal {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .game-page.has-hint-button.is-default-mode .game-panel-controls--minimal {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .game-page.is-random-mode .game-panel-controls--minimal,
  .game-page.is-challenge-mode .game-panel-controls--minimal {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .game-page.has-hint-button.is-random-mode .game-panel-controls--minimal,
  .game-page.has-hint-button.is-challenge-mode .game-panel-controls--minimal {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .game-mode-wrap {
    position: static;
  }

  .game-mode-button,
  .game-settings-wrap {
    width: 100%;
    min-width: 0;
  }

  .game-mode-button,
  .game-control-button,
  .game-settings-button {
    width: 100%;
  }

  .game-settings-panel {
    left: auto;
    right: 0;
    width: min(340px, calc(100vw - 24px));
    top: calc(100% + 8px);
  }

  #settings-panel {
    padding: 10px;
  }

  #settings-panel .mode-toggle {
    gap: 5px;
  }

  #settings-panel .chip-button {
    min-height: 32px;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 0.8rem;
  }

  #settings-panel .settings-title {
    margin-bottom: 6px;
    font-size: 0.72rem;
  }

  #settings-panel .settings-help {
    margin-top: 5px;
    font-size: 0.74rem;
    line-height: 1.38;
  }

  #settings-panel .settings-section + .settings-section {
    margin-top: 8px;
    padding-top: 8px;
  }

  .game-mode-panel {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: min(240px, calc(100vw - 24px));
  }

  .mode-toggle {
    width: 100%;
  }

  .mode-toggle {
    grid-column: 1 / -1;
    justify-content: center;
    gap: 8px;
  }

  .game-stat-chip {
    min-width: 0;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 14px;
  }

  .game-stat-chip strong {
    font-size: 0.84rem;
  }

  .game-page .chip-button {
    min-height: 36px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 0.84rem;
  }

  .game-page #fullscreen-toggle,
  .game-page #hud-level,
  .game-page #hud-timer,
  .game-page #hint-button,
  .game-page #random-board-button,
  .game-page #settings-toggle {
    font-size: 0;
    letter-spacing: 0;
  }

  .game-page #hud-level::before,
  .game-page #hud-timer::before,
  .game-page #hint-button::before,
  .game-page #random-board-button::before,
  .game-page #fullscreen-toggle::before,
  .game-page #settings-toggle::before {
    content: attr(data-mobile-icon);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.08rem;
    line-height: 1;
  }

  .game-page #hud-level::before,
  .game-page #hud-timer::before,
  .game-page #hint-button::before,
  .game-page #random-board-button::before {
    content: attr(data-mobile-label);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
  }

  .game-page-header,
  .game-page-shell,
  .game-footer {
    width: calc(100% - 8px);
  }

  .game-info-module {
    padding: 16px 14px;
  }

  .game-info-grid,
  .game-faq-list {
    grid-template-columns: 1fr;
  }

  .mode-landing-actions {
    flex-direction: column;
  }

  .challenge-preview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-panel--standalone {
    padding: 10px 6px 8px;
  }

  .game-shell {
    padding: 3px;
    border-radius: 26px;
  }

  .game-stage {
    border-radius: 20px;
  }

  .game-page-header {
    gap: 6px;
  }

  .game-page-actions {
    gap: 4px;
  }

  .game-page-header .brand-inline-title {
    font-size: 0.95rem;
  }

  .game-page-header .nav-cta {
    min-height: 28px;
    padding: 4px 8px;
    font-size: 0.76rem;
  }

}

@media (max-width: 480px) {
  .game-panel-controls--minimal {
    gap: 6px;
  }

  .game-mode-panel {
    width: min(240px, calc(100vw - 16px));
  }

  .game-stat-chip {
    min-height: 34px;
    padding: 0 6px;
  }

  .game-stat-chip strong,
  .game-page .chip-button {
    font-size: 0.8rem;
  }

  .game-page .chip-button {
    min-height: 34px;
    padding: 0 6px;
  }

  .result-modal-card {
    width: min(100%, 336px);
    padding: 18px 12px;
    border-radius: 20px;
  }

  .result-modal-title,
  .result-modal-card h3 {
    font-size: 1.28rem;
  }

  .result-modal-card p {
    font-size: 0.88rem;
    line-height: 1.48;
  }

  .result-modal-card .modal-actions {
    gap: 6px;
    margin-top: 14px;
  }

  .result-modal-card .modal-button {
    min-height: 38px;
    padding: 8px 10px;
    font-size: 0.78rem;
  }

  #settings-panel {
    padding: 9px;
  }

  #settings-panel .chip-button {
    min-height: 30px;
    padding: 0 7px;
    font-size: 0.76rem;
  }

  #settings-panel .settings-help {
    font-size: 0.72rem;
  }

  #precision-assist-anchor::before {
    width: 24px;
    height: 24px;
  }

  #precision-assist-anchor::after {
    width: 6px;
    height: 6px;
  }

  .game-page #fullscreen-toggle::before,
  .game-page #settings-toggle::before {
    font-size: 1rem;
  }

  .game-page #hud-level::before,
  .game-page #hud-timer::before,
  .game-page #hint-button::before,
  .game-page #random-board-button::before {
    font-size: 0.8rem;
  }

  .game-page-header,
  .game-page-shell,
  .game-footer {
    width: calc(100% - 2px);
  }

  .game-panel--standalone {
    padding: 8px 2px 6px;
    gap: 8px;
  }

  .game-info-module {
    padding: 14px 10px;
    border-radius: 20px;
  }

  .challenge-preview-section {
    padding: 14px;
  }

  .challenge-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .challenge-preview-label {
    font-size: 0.84rem;
  }

  .challenge-preview-caption {
    font-size: 0.72rem;
  }

  .game-shell {
    padding: 2px;
    border-radius: 18px;
  }

  .game-stage {
    border-radius: 16px;
  }

  .game-settings-panel {
    padding: 12px;
  }
}
