:root {
  --bg: #120915;
  --bg-soft: #1a1020;
  --panel: rgba(33, 18, 40, 0.82);
  --panel-strong: rgba(26, 14, 31, 0.96);
  --line: rgba(255, 182, 129, 0.18);
  --text: #fff7f1;
  --muted: rgba(255, 239, 230, 0.76);
  --soft: rgba(255, 229, 214, 0.5);
  --brand: #ff9b54;
  --brand-2: #ff5f87;
  --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(255, 155, 84, 0.16), transparent 28%),
    radial-gradient(circle at 80% 12%, rgba(255, 95, 135, 0.14), transparent 22%),
    linear-gradient(180deg, #170c18 0%, #120913 45%, #0d0710 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(18, 9, 21, 0.72);
  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: #2b130f;
  background: linear-gradient(135deg, var(--brand), #ffc46b);
}

.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: #2b130f;
  font-weight: 700;
  background: linear-gradient(135deg, var(--brand), #ffc46b);
  box-shadow: 0 12px 32px rgba(255, 155, 84, 0.3);
  cursor: pointer;
}

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

.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(255, 155, 84, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(39, 21, 42, 0.96), rgba(19, 11, 24, 0.98));
  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(255, 155, 84, 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(255, 155, 84, 0.5);
}

.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;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.badge-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.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, #efe8ff 0%, #f4dff1 100%);
  box-shadow: 0 16px 34px rgba(63, 33, 66, 0.12);
}

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

.game-shell::before {
  inset: 0;
  border-radius: 32px;
  border: 1px solid rgba(141, 113, 163, 0.22);
}

.game-shell::after {
  inset: 12px;
  border-radius: 24px;
  border: none;
}

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 1334;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(171, 146, 196, 0.22);
  background: linear-gradient(180deg, #ece5ff 0%, #f8e4ef 100%);
  box-shadow: none;
  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), #ffc46b, var(--brand));
  background-size: 200% 100%;
  box-shadow: 0 0 12px rgba(255, 155, 84, 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(255, 155, 84, 0.24);
  background: linear-gradient(135deg, rgba(255, 155, 84, 0.16), rgba(255, 95, 135, 0.12));
  color: #ffe5d2;
  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;
}

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

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(18, 9, 21, 0.72);
  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:
    radial-gradient(circle at top right, rgba(255, 155, 84, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(35, 17, 41, 0.98), rgba(18, 10, 22, 0.98));
  border: 1px solid rgba(255, 185, 145, 0.18);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  text-align: center;
}

.result-modal-card h3 {
  margin: 14px 0 10px;
  font-size: 1.7rem;
  color: #fff4ec;
}

.result-modal-card p {
  margin: 0;
  color: rgba(255, 228, 211, 0.78);
  line-height: 1.7;
}

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

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

.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;
  }

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

  .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,
  .modal-actions {
    flex-direction: column;
  }

  .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 4px;
}

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

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

.game-page-shell {
  display: grid;
  gap: 10px;
  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(255, 155, 84, 0.68);
  background: linear-gradient(135deg, rgba(255, 155, 84, 0.34), rgba(255, 95, 135, 0.22));
  color: #fff6ef;
  box-shadow: 0 0 0 1px rgba(255, 155, 84, 0.18) inset, 0 10px 24px rgba(255, 95, 135, 0.16);
  pointer-events: none;
}

.game-mode-option[aria-current="page"]::before {
  content: "●";
  margin-right: 0.42rem;
  color: #ffe5d3;
  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, 185, 145, 0.18);
  background:
    radial-gradient(circle at top right, rgba(255, 155, 84, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(34, 18, 30, 0.97), rgba(18, 10, 22, 0.98));
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  backdrop-filter: blur(12px);
}

#settings-panel {
  padding: 13px;
}

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

#settings-panel .chip-button {
  min-height: 36px;
  padding: 0 12px;
  border-color: rgba(255, 226, 206, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #fff4ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#settings-panel .chip-button.is-active {
  border-color: rgba(255, 155, 84, 0.58);
  background: linear-gradient(135deg, rgba(255, 155, 84, 0.3), rgba(255, 95, 135, 0.24));
  color: #fffaf6;
  box-shadow: 0 0 0 1px rgba(255, 155, 84, 0.16) inset, 0 10px 22px rgba(255, 95, 135, 0.14);
}

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

#settings-panel .settings-help {
  margin-top: 6px;
  color: rgba(255, 228, 211, 0.74);
  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;
  border-top: 1px solid rgba(255, 155, 84, 0.16);
}

.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;
}

.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(255, 155, 84, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(37, 21, 42, 0.96), rgba(18, 10, 22, 0.98));
  box-shadow: var(--shadow);
}

.game-status-module-card {
  display: grid;
  padding: 14px 16px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top right, rgba(255, 155, 84, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(37, 21, 42, 0.96), rgba(18, 10, 22, 0.98));
  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(255, 155, 84, 0.2);
  background: linear-gradient(180deg, rgba(255, 155, 84, 0.12), rgba(255, 95, 135, 0.06));
}

.game-status-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 155, 84, 0.16);
  color: #ffe0c9;
  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 h2,
.game-info-card h3,
.game-faq 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: #fff1e6;
  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));
}

.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 left, rgba(255, 155, 84, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 95, 135, 0.14), transparent 26%),
    linear-gradient(180deg, #170c18 0%, #120913 45%, #0d0710 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));
  background:
    radial-gradient(circle at top left, rgba(255, 155, 84, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(255, 95, 135, 0.14), transparent 26%),
    linear-gradient(180deg, #170c18 0%, #120913 45%, #0d0710 100%);
}

.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 {
    width: 100%;
    margin: 0;
    align-items: center;
    justify-content: space-between;
    padding-inline: 0;
  }

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

  .game-page-actions {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: auto;
    justify-content: flex-end;
    flex: 0 0 auto;
  }

  .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);
    min-width: 1.75rem;
    justify-content: center;
    text-align: center;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    font-variant-numeric: tabular-nums;
  }

  .game-page #hud-timer::before {
    min-width: 3.25rem;
  }

  .game-page #random-board-button::before {
    font-size: 0.96rem;
  }

  .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;
  }

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

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

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

  .game-page-header .nav-cta {
    min-height: 32px;
    padding: 6px 12px;
    font-size: 0.88rem;
  }

}

@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;
  }

  #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;
  }

  .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;
  }

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

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

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