﻿:root {
  --bg: #0f172a;
  --panel: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --mask: rgba(56, 189, 248, 0.25);
  --mask-border: rgba(56, 189, 248, 0.85);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  background-image: url("assets/BackGround-1600.jpg");
  background-position: center top;
  background-size: cover;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu {
  width: min(760px, 92vw);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.7));
  padding: 40px 32px;
  border-radius: 28px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 30px 60px rgba(15, 23, 42, 0.6);
  text-align: center;
  position: relative;
  min-height: 70vh;
}

.menu-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

.menu-header h1 {
  font-size: 40px;
  margin: 0;
  letter-spacing: 1px;
}

.menu-sub {
  margin: 0;
  color: var(--muted);
}

.menu-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  position: absolute;
  left: 50%;
  bottom: 20vh;
  transform: translateX(-50%);
}

.menu-button {
  text-decoration: none;
  color: #0f172a;
  background: var(--accent);
  padding: 12px 26px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(56, 189, 248, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.menu-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(56, 189, 248, 0.45);
}

.menu-button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
}

.menu-button.ghost:hover {
  box-shadow: 0 12px 26px rgba(148, 163, 184, 0.2);
}

.app {
  width: min(980px, 95vw);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6));
  padding: 28px;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.app.doubleplay {
  transform: scale(1.2);
  transform-origin: top center;
}

.header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.header h1 {
  font-size: 26px;
  margin: 0;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.control-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  padding: 12px 16px;
  border-radius: 12px;
  width: min(360px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--text);
}

.control-card label {
  font-size: 14px;
  color: var(--muted);
}

.option-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.radio {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text);
}

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.app.doubleplay .video-wrap {
  border: 4px solid #ffffff;
}

.app.doubleplay .video-wrap::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 6px;
  transform: translateX(-50%);
  background: #020617;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 3;
}

.start-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.start-button {
  border: none;
  border-radius: 999px;
  padding: 12px 30px;
  font-size: 16px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.25);
  color: rgba(226, 232, 240, 0.7);
  cursor: not-allowed;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.start-button.is-ready {
  background: var(--accent);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 14px 28px rgba(56, 189, 248, 0.35);
}

.start-button.is-ready:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 36px rgba(56, 189, 248, 0.45);
}

.video,
.overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.overlay {
  pointer-events: none;
}

.countdown {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.4);
  font-weight: 700;
  letter-spacing: 2px;
  color: #f8fafc;
  z-index: 4;
}

.mask-counter {
  position: absolute;
  top: 12px;
  left: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.4);
  z-index: 4;
  font-weight: 700;
  color: #f8fafc;
}

.mask-counter img {
  width: 22px;
  height: 22px;
}

.scoreboard.right {
  position: absolute;
  top: 12px;
  right: 12px;
  left: auto;
  transform: none;
}

.three-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
  z-index: 2;
}

.scoreboard {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.4);
  z-index: 4;
  font-weight: 700;
  letter-spacing: 1px;
}

.score-card {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text);
}

.score-label {
  font-size: 12px;
  color: var(--muted);
}

.score-value {
  font-size: 20px;
  color: #f8fafc;
  min-width: 20px;
  text-align: center;
}

.score-divider {
  font-size: 12px;
  color: var(--muted);
}

.win-overlay {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.win-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.win-card {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 20px 26px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.6);
}

.win-text {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 12px;
}

.restart-button {
  border: none;
  border-radius: 999px;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 700;
  background: var(--accent);
  color: #0f172a;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(56, 189, 248, 0.35);
}

.restart-button:hover {
  transform: translateY(-1px);
}

.restart-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.restart-button.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow: none;
}

.cooldown {
  position: absolute;
  bottom: 14px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 12px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 140px;
}

.cooldown.left {
  left: 14px;
}

.cooldown.right {
  right: 14px;
}

.cooldown-label {
  font-size: 12px;
  color: var(--muted);
}

.cooldown-bar {
  height: 6px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  overflow: hidden;
}

.cooldown-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(56, 189, 248, 0.8), rgba(125, 211, 252, 0.9));
  transition: width 0.1s linear;
}

.status {
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--text);
  font-weight: 600;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 14px;
}

.legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.7);
}

@media (max-width: 640px) {
  .menu {
    padding: 30px 20px;
  }

  .menu-header h1 {
    font-size: 30px;
  }

  .app {
    padding: 18px;
  }

  .app.doubleplay {
    transform: scale(1);
  }

  .header h1 {
    font-size: 22px;
  }
}
