/* Roadster Dash — Halloween Night theme. Loaded after the game stylesheet. */
@font-face {
  font-family: "Creepster";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/creepster-latin.woff2) format("woff2");
}
:root {
  --hw-orange: #ff7a1a;
  --hw-orange-hi: #ffb347;
  --hw-orange-lo: #d4470c;
  --hw-purple: #8f4bff;
  --hw-purple-hi: #c9a6ff;
  --hw-purple-deep: #1a0b2e;
  --hw-ink: #0b0612;
  --hw-green: #8dff5a;
  --hw-bone: #f6eedd;
  --hw-display: "Creepster", "Rajdhani", system-ui, sans-serif;
  --red: #ff6a1a;
  --red-glow: #ff6a1a99;
  --cyan: #c9a6ff;
  --white: #f6eedd;
  --dim: #f6eedd99;
  --line: #c9a6ff66;
  --panel: #1a0b2ecc;
}

/* ── buttons and cards ─────────────────────────────────────────────────── */
.primary {
  background: linear-gradient(180deg, var(--hw-orange-hi), var(--hw-orange) 48%, var(--hw-orange-lo));
  border-color: #ffd29a;
  color: #2a0e02;
  border-radius: 12px;
  box-shadow: 0 6px 22px #ff6a1a55, inset 0 1px 0 #fff6;
}
.primary:hover {
  background: linear-gradient(180deg, #ffc56a, #ff8a2a 48%, #e2550f);
  box-shadow: 0 8px 30px #ff6a1a88, inset 0 1px 0 #fff8;
}
.ghost {
  border-color: #c9a6ff59;
  background: #1a0b2e73;
  border-radius: 12px;
}
.ghost:hover {
  background: #8f4bff38;
  border-color: var(--hw-purple-hi);
}
.primary:focus-visible,
.ghost:focus-visible {
  outline: 2px solid var(--hw-orange-hi);
  outline-offset: 3px;
}
.hint {
  border-radius: 4px;
}
.modal {
  background: radial-gradient(120% 90% at 50% 40%, #2a0f4a99, #050208d9);
}
.modal-card,
.go-card,
.start-card {
  background: linear-gradient(170deg, #22103af2, #0d0618f5 70%);
  border: 1px solid #c9a6ff47;
  border-radius: 18px;
  box-shadow: 0 24px 60px #000a, 0 0 40px #8f4bff26, inset 0 1px 0 #ffffff14;
}
.modal-title {
  font-family: var(--hw-display);
  letter-spacing: 0.08em;
  font-weight: 400;
  font-size: 30px;
  color: var(--hw-orange);
  text-shadow: 0 0 16px #ff6a1a66;
}
.toggle {
  border-bottom-color: #c9a6ff24;
}
.toggle input {
  accent-color: var(--hw-orange);
}
.quality-setting select,
#language-select {
  background: #1a0b2e;
  border-color: #c9a6ff59;
  border-radius: 8px;
}

/* ── loading ───────────────────────────────────────────────────────────── */
#loading {
  background: radial-gradient(90% 70% at 50% 45%, #2a0f4a, #07030c 75%);
}
#loading::before {
  content: "🎃";
  font-size: 64px;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 22px #ff7a1acc);
  animation: hw-bob 1.6s ease-in-out infinite;
}
#loading {
  flex-direction: column;
}
.loading-text {
  font-family: var(--hw-display);
  letter-spacing: 0.14em;
  font-size: 22px;
  color: var(--hw-orange-hi);
}
.loading-bar {
  height: 6px;
  border-radius: 6px;
  background: #ffffff14;
}
.loading-bar i {
  background: linear-gradient(90deg, var(--hw-purple), var(--hw-orange));
  box-shadow: 0 0 14px #ff7a1a99;
}

/* ── main menu ─────────────────────────────────────────────────────────── */
#menu {
  background:
    radial-gradient(70% 90% at 0% 45%, #0b0612e6 0, #0b0612a6 38%, #0000 70%),
    radial-gradient(120% 70% at 50% 120%, #2a0f4acc, #0000 60%),
    linear-gradient(180deg, #0b061266, #0000 30%);
  grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
  isolation: isolate;
}
#menu::before,
#menu::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 46%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(22% 55% at 20% 80%, #b9a3d433, #0000 70%),
    radial-gradient(20% 50% at 55% 90%, #a48fc22e, #0000 70%),
    radial-gradient(25% 60% at 85% 85%, #b9a3d42b, #0000 70%);
  background-size: 180% 100%;
  animation: hw-fog 26s ease-in-out infinite alternate;
}
#menu::after {
  height: 34%;
  opacity: 0.7;
  animation-duration: 38s;
  animation-direction: alternate-reverse;
}
.menu-left {
  max-width: 560px;
  gap: 18px;
}
.hw-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.42em;
  color: var(--hw-orange-hi);
  text-shadow: 0 0 14px #ff7a1a80;
}
.hw-kicker svg {
  width: 30px;
  height: 15px;
  fill: var(--hw-purple-hi);
  filter: drop-shadow(0 0 6px #8f4bff99);
  animation: hw-flap 0.5s ease-in-out infinite alternate;
}
.hw-kicker svg:last-child {
  animation-delay: 0.25s;
}
.brand h1.hw-title {
  font-family: var(--hw-display);
  font-weight: 400;
  letter-spacing: 0.05em;
  line-height: 0.92;
  font-size: clamp(60px, 8.4vw, 124px);
  margin: 4px 0 0;
  background: linear-gradient(180deg, #ffe08a 0%, var(--hw-orange) 55%, #b8360a 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 0 #2a0e02) drop-shadow(0 0 26px #ff6a1a59);
}
.hw-title .hw-o {
  display: inline-block;
  width: 0.74em;
  height: 0.74em;
  vertical-align: -0.04em;
  margin: 0 0.02em;
  filter: drop-shadow(0 0 14px #ff8a1acc);
  animation: hw-glow 2.4s ease-in-out infinite;
}
.hw-tagline {
  margin: 10px 0 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: #e9dcff;
  opacity: 0.85;
}
.hw-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
#play-btn.hw-mode,
.hw-mode {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 16px;
  text-align: left;
  font-size: 16px;
  letter-spacing: 0.04em;
  align-self: stretch;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.hw-mode:hover {
  transform: translateY(-2px);
}
.hw-mode-duo {
  color: #fff;
  border: 1px solid #d9c2ff80;
  background: linear-gradient(180deg, #8a4dff, #5a22b8 52%, #3a1380);
  box-shadow: 0 6px 22px #8f4bff55, inset 0 1px 0 #fff5;
}
.hw-mode-duo:hover {
  background: linear-gradient(180deg, #9d66ff, #6a2ed0 52%, #44178f);
  box-shadow: 0 8px 30px #8f4bff88, inset 0 1px 0 #fff7;
}
.hw-mode-icon {
  width: 46px;
  height: 46px;
  display: block;
}
.hw-mode-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}
.hw-mode-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hw-mode-text b {
  font-size: 24px;
  letter-spacing: 0.16em;
  line-height: 1;
}
.hw-mode-text small {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hw-mode .hint {
  position: absolute;
  top: 8px;
  right: 10px;
  margin: 0;
  font-size: 10px;
}
.best-records.hw-records {
  align-self: flex-start;
  padding: 10px 18px;
  border: 1px solid #c9a6ff3d;
  border-radius: 14px;
  background: #0b0612a6;
  backdrop-filter: blur(6px);
}
.hw-records .best .v {
  color: var(--hw-orange-hi);
  font-size: 26px;
}
.hw-row .ghost {
  padding: 10px 18px;
}
.menu-footer {
  border-top-color: #c9a6ff2e;
}

/* ── HUD ───────────────────────────────────────────────────────────────── */
#score {
  color: var(--hw-bone);
  text-shadow: 0 0 18px #ff7a1a8c, 0 2px 0 #2a0e02;
}
.key-btn {
  border-color: #c9a6ff59;
  border-radius: 8px;
}
.fever {
  border-color: #ffb34799;
  border-radius: 5px;
  overflow: hidden;
}
#fever-fill {
  background: linear-gradient(90deg, var(--hw-purple), var(--hw-orange));
  box-shadow: 0 0 12px #ff7a1a99;
}
.air-bar {
  border-color: #8dff5a80;
  border-radius: 6px;
  overflow: hidden;
  background: #0b061299;
}
#air-fill {
  background: linear-gradient(90deg, #4ccf2a, var(--hw-green) 70%, #d6ffb0);
  box-shadow: 0 0 14px #8dff5a88;
}
.combo.hot,
.combo-total {
  color: var(--hw-orange-hi);
  text-shadow: 0 0 10px #ff7a1ab3;
}
.big.countdown {
  font-family: var(--hw-display);
  font-weight: 400;
  color: var(--hw-orange);
  text-shadow: 0 0 30px #ff6a1aa6, 0 4px 0 #2a0e02;
}
.story-line {
  background: #1a0b2ee0;
  border-color: #c9a6ff3d;
}

/* ── game over ─────────────────────────────────────────────────────────── */
.go-score {
  font-family: var(--hw-display);
  font-weight: 400;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #ffe08a, var(--hw-orange) 60%, #b8360a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 18px #ff6a1a59);
}
.go-record {
  background: var(--hw-orange);
  color: #2a0e02;
  border-radius: 6px;
}

/* ── duel: each half runs this page inside duo.html ────────────────────── */
html.hw-duo #menu,
html.hw-duo #gameover,
html.hw-duo #pause,
html.hw-duo #loading,
html.hw-duo #toast,
html.hw-duo #story-line,
html.hw-duo #start-guide,
html.hw-duo #key-hints,
html.hw-duo .key-btns,
html.hw-duo #meya-logo,
html.hw-duo #start-items,
html.hw-duo #revive-modal {
  display: none !important;
}

@keyframes hw-fog {
  from { background-position: 0% 100%; }
  to { background-position: 100% 100%; }
}
@keyframes hw-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes hw-flap {
  from { transform: scaleY(1); }
  to { transform: scaleY(0.45); }
}
@keyframes hw-glow {
  0%, 100% { filter: drop-shadow(0 0 10px #ff8a1a99); }
  50% { filter: drop-shadow(0 0 22px #ffb347ff); }
}
@media (prefers-reduced-motion: reduce) {
  #menu::before,
  #menu::after,
  .hw-kicker svg,
  .hw-title .hw-o,
  #loading::before {
    animation: none;
  }
}
@media (width <= 760px), (height <= 500px) and (pointer: coarse) {
  #menu {
    background:
      linear-gradient(180deg, #0b0612d9, #0b061259 42%, #0b0612e0),
      radial-gradient(120% 60% at 50% 110%, #2a0f4acc, #0000 60%);
    grid-template-columns: minmax(0, 1fr);
  }
  .hw-kicker {
    font-size: 12px;
    letter-spacing: 0.3em;
    min-height: 0;
  }
  .brand h1.hw-title {
    font-size: clamp(46px, 14vw, 72px);
  }
  .hw-tagline {
    font-size: 14px;
    margin-top: 6px;
  }
  #play-btn.hw-mode,
  .hw-mode {
    min-height: 70px;
    padding: 12px;
    gap: 10px;
  }
  .hw-mode-icon {
    width: 36px;
    height: 36px;
  }
  .hw-mode-text b {
    font-size: 19px;
    letter-spacing: 0.1em;
  }
  .hw-mode-text small {
    font-size: 10px;
    letter-spacing: 0.04em;
    white-space: normal;
  }
}
@media (width <= 360px) {
  .hw-modes {
    grid-template-columns: 1fr;
  }
}
/* Phones: two split screens are too small to play, so the menu offers solo play only.
   Keep this query in sync with PHONE in halloween.js and duo.js. */
@media (pointer: coarse) and (width <= 760px), (pointer: coarse) and (height <= 500px) {
  #duo-btn {
    display: none;
  }
  .hw-modes {
    grid-template-columns: 1fr;
  }
}
