:root {
  --fc-bg: #08111a;
  --fc-panel: rgba(7, 13, 20, 0.7);
  --fc-panel-strong: rgba(11, 18, 27, 0.88);
  --fc-border: rgba(255, 255, 255, 0.14);
  --fc-text: #f5efe3;
  --fc-muted: rgba(245, 239, 227, 0.72);
  --fc-accent: #f6b36c;
  --fc-accent-2: #89f1ff;
  --fc-danger: #ff8d74;
  --fc-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
  --fc-radius-xl: 32px;
  --fc-radius-lg: 24px;
  --fc-radius-pill: 999px;
  --fc-font-sans: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  --fc-font-display: "Cormorant Garamond", Georgia, serif;
}

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

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  background: var(--fc-bg);
  color: var(--fc-text);
  font-family: var(--fc-font-sans);
}

body {
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
kbd {
  font: inherit;
}

button,
a,
canvas {
  touch-action: manipulation;
}

.fc-bg {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 18%, rgba(246, 179, 108, 0.24), transparent 24%),
    radial-gradient(circle at 84% 12%, rgba(137, 241, 255, 0.16), transparent 20%),
    linear-gradient(180deg, rgba(6, 10, 15, 0.6), rgba(6, 10, 15, 0.92));
}

.fc-bg-video,
.fc-bg-overlay,
.fc-bg-grid {
  position: absolute;
  inset: 0;
}

.fc-bg-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.2;
  filter: saturate(0.8) contrast(1.1);
}

.fc-bg-overlay {
  background:
    linear-gradient(180deg, rgba(6, 10, 16, 0.15) 0%, rgba(6, 10, 16, 0.48) 46%, rgba(6, 10, 16, 0.88) 100%),
    radial-gradient(circle at 40% 20%, rgba(255, 255, 255, 0.08), transparent 18%);
}

.fc-bg-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 72px 72px;
  opacity: 0.22;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.95));
}

.fc-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(36px);
  opacity: 0.45;
}

.fc-orb-a {
  width: 16rem;
  height: 16rem;
  left: -5rem;
  top: 8rem;
  background: rgba(246, 179, 108, 0.22);
}

.fc-orb-b {
  width: 22rem;
  height: 22rem;
  right: -8rem;
  bottom: -4rem;
  background: rgba(137, 241, 255, 0.14);
}

.fc-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 2rem));
  height: 100dvh;
  margin: 0 auto;
  padding: 0.9rem 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 0.7rem;
}

.glass {
  border: 1px solid var(--fc-border);
  border-radius: var(--fc-radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0.015) 100%),
    var(--fc-panel);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  box-shadow: var(--fc-shadow);
}

.fc-stat-label,
.fc-overlay-kicker {
  margin: 0 0 0.45rem;
  color: rgba(246, 179, 108, 0.88);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.fc-overlay-card h2 {
  margin: 0;
  font-family: var(--fc-font-display);
}

.fc-help,
.fc-overlay-card p {
  margin: 0;
  color: var(--fc-muted);
  line-height: 1.6;
}

.fc-chip,
.fc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.85rem 1.2rem;
  border-radius: var(--fc-radius-pill);
  border: 1px solid var(--fc-border);
  background: rgba(9, 15, 22, 0.72);
  color: var(--fc-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.fc-chip:hover,
.fc-chip:focus-visible,
.fc-button:hover,
.fc-button:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(246, 179, 108, 0.58);
  background: rgba(246, 179, 108, 0.15);
}

.fc-button-launch {
  background: rgba(36, 126, 66, 0.9);
  border-color: rgba(122, 234, 160, 0.34);
  color: #f2fff5;
}

.fc-button-launch:hover,
.fc-button-launch:focus-visible {
  background: rgba(45, 151, 79, 0.96);
  border-color: rgba(163, 255, 193, 0.54);
}

.fc-chip-exit {
  justify-self: center;
  min-width: min(20rem, 100%);
  background: rgba(133, 26, 26, 0.82);
  border-color: rgba(255, 124, 124, 0.34);
  color: #fff3f1;
}

.fc-chip-exit:hover,
.fc-chip-exit:focus-visible {
  background: rgba(173, 34, 34, 0.92);
  border-color: rgba(255, 160, 160, 0.56);
}

.fc-stage-wrap {
  min-height: 0;
  padding: 0.35rem;
  display: flex;
}

.fc-scoreboard {
  position: absolute;
  top: 1rem;
  left: 1rem;
  right: 5rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  pointer-events: none;
}

.fc-audio-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(9, 15, 22, 0.72);
  color: var(--fc-text);
  cursor: pointer;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.fc-audio-toggle:hover,
.fc-audio-toggle:focus-visible {
  outline: none;
  transform: translateY(-1px);
  border-color: rgba(246, 179, 108, 0.58);
  background: rgba(246, 179, 108, 0.15);
}

.fc-audio-icon {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fc-audio-toggle[aria-pressed="true"] .fc-audio-icon-on,
.fc-audio-toggle[aria-pressed="false"] .fc-audio-icon-off {
  display: none;
}

.fc-stat {
  min-width: 132px;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: var(--fc-panel-strong);
}

.fc-stat strong {
  font-size: 1.15rem;
}

.fc-help kbd {
  display: inline-flex;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  font-size: 0.82em;
}

.fc-help {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 2;
  margin: 0;
  width: min(100% - 2rem, 26rem);
  padding: 0.6rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(9, 15, 22, 0.58);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  text-align: center;
  font-size: 0.88rem;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.fc-help-hidden {
  opacity: 0;
  transform: translate(-50%, 10px);
}

.fc-stage {
  flex: 1;
  min-height: 0;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  border-radius: var(--fc-radius-xl);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(10, 18, 28, 0.3) 0%, rgba(4, 7, 10, 0.72) 100%),
    radial-gradient(circle at 20% 20%, rgba(137, 241, 255, 0.16), transparent 22%);
}

#gameCanvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: 100%;
  max-height: 100%;
  border-radius: inherit;
}

.fc-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(5, 9, 15, 0.44);
  transition: opacity 200ms ease, visibility 200ms ease;
}

.fc-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.fc-overlay-card {
  width: min(100%, 24rem);
  padding: 1.15rem 1.1rem 1.2rem;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03)),
    rgba(9, 15, 24, 0.9);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.fc-overlay-card h2 {
  margin-bottom: 0.15rem;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 0.92;
}

#gameOverOverlay .fc-overlay-card h2 {
  margin-top: 0.25rem;
  margin-bottom: 0.95rem;
  max-width: 17ch;
}

.fc-overlay-card p {
  margin-bottom: 1rem;
}

.fc-overlay-card .fc-button {
  margin-top: 0.45rem;
}

#startOverlay .fc-overlay-card .fc-button {
  margin-top: 1.35rem;
}

.fc-overlay-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.7rem;
  margin-top: 0.45rem;
}

.fc-overlay-actions .fc-button {
  margin-top: 0;
}

.fc-overlay-link {
  display: inline-flex;
  margin-top: 0.9rem;
  color: rgba(245, 239, 227, 0.82);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(245, 239, 227, 0.22);
  transition: color 180ms ease, border-color 180ms ease;
}

.fc-overlay-link:hover,
.fc-overlay-link:focus-visible {
  color: var(--fc-accent);
  border-color: rgba(246, 179, 108, 0.5);
  outline: none;
}

@media (max-width: 920px) {
  .fc-shell {
    width: min(100%, calc(100% - 1rem));
    padding: 0.6rem 0;
  }

  .fc-stage-wrap {
    border-radius: 26px;
  }

  .fc-audio-toggle {
    top: 0.75rem;
    right: 0.75rem;
  }
}

@media (max-width: 700px) {
  .fc-shell {
    width: calc(100% - 0.75rem);
    gap: 0.65rem;
  }

  .fc-stage-wrap {
    padding: 0.4rem;
  }

  .fc-scoreboard {
    left: 0.75rem;
    right: 4.2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }

  .fc-scoreboard .fc-stat:last-child {
    grid-column: 1 / -1;
  }

  .fc-audio-toggle {
    width: 2.8rem;
    height: 2.8rem;
  }

  .fc-help {
    width: min(calc(100% - 1.5rem), 23rem);
    bottom: 0.75rem;
    font-size: 0.8rem;
  }

  .fc-stat {
    min-width: 0;
    padding: 0.65rem 0.55rem;
    border-radius: 16px;
  }

  .fc-stat strong {
    display: block;
    font-size: 0.96rem;
    line-height: 1.2;
  }

  .fc-stat-label {
    margin-bottom: 0.25rem;
    font-size: 0.58rem;
    letter-spacing: 0.1em;
  }

  .fc-overlay-card {
    padding: 1.2rem;
  }

  .fc-chip-exit {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fc-bg-video {
    display: none;
  }

  .fc-orb {
    opacity: 0.2;
    filter: none;
  }
}
