
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* =========================================
   SQPLAYERS — REACTION TIME
   RED NEON × ELECTRIC BLUE CYBERPUNK
========================================= */

:root {
  color-scheme: dark;

  --bg: #080910;
  --surface: #10121d;
  --surface-hover: #171a29;
  --text: #f5f7ff;
  --muted: #9298ad;
  --border: rgba(157, 169, 207, 0.14);

  --red: #ff304f;
  --red-bright: #ff4765;
  --red-glow: rgba(255, 48, 79, 0.28);

  --blue: #368bff;
  --blue-bright: #62b3ff;
  --blue-glow: rgba(54, 139, 255, 0.27);

  --green: #35e89b;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

button {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 4px;
}

/* BACKGROUND */

.background-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;

  background-image:
    linear-gradient(rgba(110, 133, 185, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(110, 133, 185, 0.055) 1px, transparent 1px),
    radial-gradient(ellipse at 20% 0%, rgba(255, 48, 79, 0.13), transparent 48%),
    radial-gradient(ellipse at 90% 30%, rgba(54, 139, 255, 0.12), transparent 48%);

  background-size: 46px 46px, 46px 46px, 100% 100%, 100% 100%;

  mask-image: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 1),
    rgba(0, 0, 0, 0.7) 65%,
    transparent 100%
  );
}

/* NAVIGATION */

.topbar {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  width: min(1120px, calc(100% - 40px));
  min-height: 82px;
  margin: 0 auto;
  padding: 18px 0;

  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;

  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.8px;

  transition: transform 220ms ease;
}

.brand:hover {
  transform: translateY(-2px);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 10px;

  filter:
    drop-shadow(0 0 9px var(--red-glow))
    drop-shadow(0 0 12px var(--blue-glow));
}

.brand-dot {
  color: var(--red);
  text-shadow: 0 0 14px var(--red-glow);
}

.back-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 10px 15px;

  border: 1px solid var(--border);
  border-radius: 12px;

  background: rgba(255, 255, 255, 0.025);
  color: #c4cce0;

  font-size: 13px;
  font-weight: 650;

  transition:
    color 220ms ease,
    border-color 220ms ease,
    background 220ms ease,
    transform 220ms ease,
    box-shadow 220ms ease;
}

.back-button:hover {
  transform: translateY(-2px);
  border-color: rgba(54, 139, 255, 0.5);
  background: rgba(54, 139, 255, 0.08);
  color: white;
  box-shadow: 0 0 20px rgba(54, 139, 255, 0.08);
}

/* MAIN INTRO */

.game {
  width: min(720px, calc(100% - 32px));
  margin: 43px auto 65px;
  flex: 1;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  padding: 8px 13px;
  margin-bottom: 2px;

  border: 1px solid rgba(54, 139, 255, 0.25);
  border-radius: 999px;

  background: linear-gradient(
    100deg,
    rgba(255, 48, 79, 0.075),
    rgba(54, 139, 255, 0.075)
  );

  color: #c5d5f5;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2px;
}

.status-dot {
  position: relative;
  display: inline-block;
  flex: 0 0 7px;

  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(53, 232, 155, 0.65);
}

.status-dot::after {
  position: absolute;
  inset: -4px;
  content: "";

  border: 1px solid rgba(53, 232, 155, 0.4);
  border-radius: 50%;

  animation: status-pulse 2s ease-out infinite;
}

h1 {
  margin: 22px 0 12px;

  font-size: clamp(38px, 7vw, 62px);
  font-weight: 950;
  line-height: 1.05;
  letter-spacing: -3px;
}

h1 span {
  background: linear-gradient(
    100deg,
    #ff536b 0%,
    #ff304f 35%,
    #a94bff 63%,
    #55aaff 100%
  );

  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;

  filter: drop-shadow(0 0 22px rgba(255, 48, 79, 0.12));
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

/* MAIN PANEL */

.game-panel {
  position: relative;
  margin-top: 35px;
  padding: 22px;

  border: 1px solid var(--border);
  border-radius: 24px;

  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 48, 79, 0.055), transparent 45%),
    radial-gradient(ellipse at 100% 0%, rgba(54, 139, 255, 0.055), transparent 45%),
    linear-gradient(145deg, rgba(18, 20, 32, 0.98), rgba(11, 12, 20, 0.99));

  box-shadow:
    0 25px 80px rgba(0, 0, 0, 0.3),
    0 0 35px rgba(54, 139, 255, 0.025);

  text-align: left;
}

.panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;

  margin-bottom: 17px;

  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 1.5px;
}

#roundLabel {
  color: var(--blue-bright);
}

/* REACTION AREA */

.reaction-zone {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  width: 100%;
  min-height: 260px;
  padding: 32px 18px;

  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;

  border: 1px solid rgba(100, 130, 190, 0.24);
  border-radius: 18px;

  background:
    radial-gradient(ellipse at 20% 0%, rgba(255, 48, 79, 0.09), transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(54, 139, 255, 0.09), transparent 60%),
    #121421;

  color: white;
  text-align: center;
  cursor: pointer;

  transition:
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 150ms ease;
}

.reaction-zone::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  pointer-events: none;

  background: linear-gradient(
    120deg,
    transparent 20%,
    rgba(255, 255, 255, 0.035),
    transparent 80%
  );
}

.reaction-zone:hover {
  border-color: rgba(54, 139, 255, 0.4);
}

.reaction-zone:active {
  transform: scale(0.995);
}

.zone-icon {
  font-size: 42px;
  line-height: 1.2;

  filter:
    drop-shadow(0 0 12px var(--red-glow))
    drop-shadow(0 0 15px var(--blue-glow));
}

.zone-title {
  font-size: clamp(21px, 4vw, 30px);
  font-weight: 900;
  letter-spacing: -0.8px;
}

.zone-description {
  color: #a7aec5;
  font-size: 13px;
  line-height: 1.6;
}

/* WAITING STATE — RED */

.reaction-zone.waiting {
  border-color: rgba(255, 48, 79, 0.55);

  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 48, 79, 0.2), transparent 65%),
    radial-gradient(ellipse at 100% 100%, rgba(54, 139, 255, 0.07), transparent 65%),
    #1b101a;

  box-shadow:
    inset 0 0 35px rgba(255, 48, 79, 0.04),
    0 0 20px rgba(255, 48, 79, 0.045);

  cursor: not-allowed;
}

.reaction-zone.waiting .zone-icon {
  animation: waiting-pulse 1s ease-in-out infinite alternate;
}

/* GO STATE — GREEN SIGNAL FOR GAMEPLAY */

.reaction-zone.go {
  border-color: rgba(53, 232, 155, 0.9);

  background:
    radial-gradient(ellipse at 0% 0%, rgba(53, 232, 155, 0.16), transparent 65%),
    radial-gradient(ellipse at 100% 100%, rgba(54, 139, 255, 0.08), transparent 65%),
    #073529;

  box-shadow:
    inset 0 0 45px rgba(53, 232, 155, 0.07),
    0 0 32px rgba(53, 232, 155, 0.15);

  animation: green-pulse 0.7s ease-in-out infinite alternate;
  cursor: crosshair;
}

.reaction-zone.go .zone-icon {
  filter: drop-shadow(0 0 16px rgba(53, 232, 155, 0.6));
}

.reaction-zone.go .zone-title {
  color: #69ffc0;
}

.reaction-zone.go .zone-description {
  color: #a3f8d4;
}

/* FALSE START — RED ALERT */

.reaction-zone.false-start {
  border-color: rgba(255, 48, 79, 0.85);

  background:
    radial-gradient(ellipse at 0% 0%, rgba(255, 48, 79, 0.24), transparent 65%),
    radial-gradient(ellipse at 100% 100%, rgba(54, 139, 255, 0.07), transparent 65%),
    #280e19;

  box-shadow: inset 0 0 35px rgba(255, 48, 79, 0.05);
}

.reaction-zone.false-start .zone-title {
  color: #ff8297;
}

/* RESULT */

.result {
  padding: 25px 8px 19px;
  text-align: center;
}

.result-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 2px;
}

.result-time {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 7px;
  margin-top: 9px;
}

.result-time span {
  font-size: clamp(42px, 8vw, 58px);
  font-weight: 950;
  letter-spacing: -2px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.result-time small {
  color: var(--blue-bright);
  font-size: 14px;
  font-weight: 800;
}

#resultMessage {
  min-height: 20px;
  margin: 9px 0 0;
  color: #b2b9ce;
  font-size: 12px;
  line-height: 1.6;
}

/* BUTTONS */

.actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 4px 0 25px;
}

.start-button,
.reset-button {
  min-height: 47px;
  padding: 0 23px;

  border: 1px solid transparent;
  border-radius: 12px;

  font-size: 13px;
  font-weight: 850;
  cursor: pointer;

  transition:
    transform 220ms ease,
    background 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.start-button {
  color: white;

  background: linear-gradient(110deg, #ff304f 0%, #e51d48 48%, #236ee8 100%);

  box-shadow:
    0 7px 24px rgba(255, 36, 75, 0.18),
    0 0 18px rgba(54, 139, 255, 0.08);
}

.start-button:hover:not(:disabled) {
  transform: translateY(-2px);

  background: linear-gradient(110deg, #ff536b 0%, #f12751 48%, #368bff 100%);

  box-shadow:
    0 10px 30px rgba(255, 36, 75, 0.24),
    0 0 22px rgba(54, 139, 255, 0.15);
}

.start-button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.start-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.reset-button {
  color: #c6cce0;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.035);
}

.reset-button:hover {
  transform: translateY(-2px);
  border-color: rgba(54, 139, 255, 0.45);
  background: rgba(54, 139, 255, 0.08);
  box-shadow: 0 0 18px rgba(54, 139, 255, 0.07);
}

/* STATS */

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.stats > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
}

.stats > div + div {
  border-left: 1px solid var(--border);
}

.stat-label {
  color: var(--muted);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 1px;
}

.stats strong {
  color: #f1f3ff;
  font-size: 17px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.tip {
  margin: 20px 0 0;
  color: #818aa5;
  font-size: 12px;
  line-height: 1.7;
}

/* FOOTER */

footer {
  padding: 22px 16px;
  border-top: 1px solid rgba(157, 169, 207, 0.09);
  color: #737d96;
  font-size: 11px;
  text-align: center;
}

/* ANIMATIONS */

@keyframes green-pulse {
  from {
    box-shadow:
      inset 0 0 25px rgba(53, 232, 155, 0.05),
      0 0 18px rgba(53, 232, 155, 0.08);
  }

  to {
    box-shadow:
      inset 0 0 45px rgba(53, 232, 155, 0.09),
      0 0 38px rgba(53, 232, 155, 0.2);
  }
}

@keyframes waiting-pulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.07);
  }
}

@keyframes status-pulse {
  0% {
    opacity: 0.8;
    transform: scale(0.65);
  }

  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

/* RESPONSIVE */

@media (max-width: 540px) {
  .topbar {
    width: calc(100% - 28px);
    min-height: 70px;
    padding: 16px 0;
  }

  .brand {
    gap: 8px;
    font-size: 18px;
  }

  .brand img {
    width: 30px;
    height: 30px;
  }

  .back-button {
    padding: 9px 11px;
    font-size: 11px;
  }

  .game {
    width: calc(100% - 24px);
    margin-top: 35px;
  }

  h1 {
    letter-spacing: -2px;
  }

  .subtitle {
    font-size: 13px;
  }

  .game-panel {
    margin-top: 26px;
    padding: 14px;
    border-radius: 19px;
  }

  .reaction-zone {
    min-height: 225px;
    padding: 25px 12px;
  }

  .zone-icon {
    font-size: 36px;
  }

  .zone-description {
    max-width: 260px;
    font-size: 12px;
  }

  .actions {
    gap: 9px;
  }

  .start-button,
  .reset-button {
    min-height: 45px;
    padding: 0 17px;
    font-size: 12px;
  }

  .stats {
    gap: 4px;
    padding-top: 18px;
  }

  .stat-label {
    font-size: 8px;
    letter-spacing: 0.5px;
  }

  .stats strong {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
