/* --------------------------------------------------------------------------
   deepinthe.space , Launch Window game
   -------------------------------------------------------------------------- */

.game-page {
  --gk-line: rgba(205, 216, 248, 0.1);
}

.game-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

/* ---- top line: levels + target readout ---- */

.game-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.level-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.level-chip {
  min-width: 38px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.level-chip:hover:not(:disabled) {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  color: var(--text);
}

.level-chip.is-current {
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.level-chip.is-locked {
  opacity: 0.42;
  cursor: not-allowed;
}

.level-chip .chip-stars {
  display: block;
  font-size: 9px;
  letter-spacing: 0.07em;
  color: var(--accent-warm);
  line-height: 1;
  margin-top: 2px;
}

.game-readout {
  margin-left: auto;
  text-align: right;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  column-gap: 8px;
}

.game-readout .gr-label {
  grid-column: 1 / -1;
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game-readout strong {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.game-readout .gr-sub {
  color: var(--text-soft);
  font-size: 12px;
}

/* ---- stage / canvas ---- */

.game-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(68vh, 640px);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 50% 50%, #101526 0%, #080b14 58%, #05070d 100%);
}

#game-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 24px;
  text-align: center;
  background: rgba(6, 8, 14, 0.72);
  backdrop-filter: blur(4px);
}

.go-eyebrow {
  margin: 0;
  color: var(--text-dim);
  font-size: 10px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.go-title {
  margin: 2px 0 4px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.go-detail {
  margin: 0 0 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.6;
  max-width: 380px;
}

.go-stars {
  display: flex;
  gap: 8px;
  font-size: 34px;
  line-height: 1;
  color: #6b7288;
}

.go-stars .star {
  color: #6b7288;
}

.go-stars .star.is-on {
  color: var(--accent-warm);
  text-shadow: 0 0 18px color-mix(in srgb, var(--accent-warm) 55%, transparent);
}

/* ---- controls ---- */

.game-controls {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.timing-meter {
  font-size: 11px;
}

.meter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}

.meter-label {
  color: var(--text-dim);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 10px;
}

.meter-value {
  color: var(--text-soft);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background:
    linear-gradient(
      to right,
      #2f7a4a 0%,
      #2f7a4a 17%,
      #c49a3a 17%,
      #c49a3a 40%,
      #b6533b 40%,
      #b6533b 62%,
      rgba(255, 255, 255, 0.08) 62%,
      rgba(255, 255, 255, 0.08) 100%
    );
  overflow: hidden;
}

[data-theme="light"] .meter-track {
  background:
    linear-gradient(
      to right,
      #2f7a4a 0%,
      #2f7a4a 17%,
      #c49a3a 17%,
      #c49a3a 40%,
      #b6533b 40%,
      #b6533b 62%,
      rgba(0, 0, 0, 0.08) 62%,
      rgba(0, 0, 0, 0.08) 100%
    );
}

.meter-needle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 3px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transform: translateX(-50%);
  transition: left 0.08s linear;
}

.meter-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  color: var(--text-dim);
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.launch-btn {
  min-width: 150px;
  padding: 14px 24px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--accent-strong), var(--accent));
  color: #07111f;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.launch-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.launch-btn:active:not(:disabled) {
  transform: translateY(0);
}

.launch-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.speed-control {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.speed-control button {
  min-width: 46px;
  padding: 9px 10px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  cursor: pointer;
}

.speed-control button:last-child {
  border-right: 0;
}

.speed-control button[aria-pressed="true"] {
  background: var(--surface-strong);
  color: var(--text);
}

.game-hint {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 11.5px;
  line-height: 1.6;
}

@media (prefers-reduced-motion: reduce) {
  .meter-needle {
    transition: none;
  }
}

@media (max-width: 520px) {
  .game-readout {
    margin-left: 0;
    text-align: left;
  }

  .game-readout .gr-label {
    grid-column: 1 / -1;
  }
}
