* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: none;
}

html, body {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}

#game {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 52px);
  left: 0;
  width: 100%;
  height: calc(100% - env(safe-area-inset-top, 0px) - 52px - env(safe-area-inset-bottom, 0px) - 18px);
  touch-action: none;
  display: block;
  border-top: 1px solid rgba(140, 0, 0, 0.35);
  border-bottom: 1px solid rgba(140, 0, 0, 0.35);
}

.hidden { display: none !important; }

/* Apparition video overlay — full-bleed, fades in/out, never blocks touches. */
#apparition {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 6;
  opacity: 0;
  pointer-events: none;
  background: #000;
  transition: opacity 1.2s ease;
  display: none;
}
#apparition.show { opacity: 0.55; }

/* ---------- HUD ---------- */
#hud {
  position: fixed;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  pointer-events: none;
  z-index: 10;
}

#hud .hud-left,
#hud .hud-right {
  color: rgba(200, 180, 180, 0.5);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-shadow: 0 0 8px rgba(0, 0, 0, 0.9);
  transition: color 0.25s ease;
}

#hud .hud-right.danger { color: rgba(255, 40, 40, 0.95); }

.hud-btn {
  pointer-events: all;
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: rgba(200, 180, 180, 0.55);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Round banner ---------- */
#roundBanner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c81414;
  font-size: 40px;
  font-weight: 800;
  letter-spacing: 5px;
  z-index: 15;
  pointer-events: none;
  text-shadow: 0 0 26px rgba(200, 20, 20, 0.7);
  opacity: 0;
  transition: opacity 0.4s ease;
}
#roundBanner.show { opacity: 1; }

/* ---------- Screens ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 20;
  gap: 18px;
}

.menu-title {
  font-size: 66px;
  font-weight: 900;
  letter-spacing: 4px;
  display: flex;
  align-items: baseline;
  animation: flicker 4s linear infinite;
}
.menu-title .ten { color: #d8d2d2; }
.menu-title .threeone {
  color: #c81414;
  text-shadow: 0 0 28px rgba(200, 20, 20, 0.75);
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  41% { opacity: 1; }
  42% { opacity: 0.5; }
  43% { opacity: 1; }
  45% { opacity: 0.35; }
  46% { opacity: 1; }
  92% { opacity: 1; }
  93% { opacity: 0.55; }
  94% { opacity: 1; }
}

.menu-start {
  margin-top: 6px;
  background: none;
  border: 1.5px solid rgba(200, 20, 20, 0.55);
  color: #e8dede;
  padding: 14px 44px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 4px;
  border-radius: 30px;
  box-shadow: 0 0 22px rgba(200, 20, 20, 0.25);
  animation: breathe 2.6s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { box-shadow: 0 0 18px rgba(200, 20, 20, 0.2); }
  50% { box-shadow: 0 0 34px rgba(200, 20, 20, 0.5); }
}

.menu-sub {
  color: rgba(200, 180, 180, 0.3);
  letter-spacing: 5px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.menu-best {
  color: rgba(200, 20, 20, 0.4);
  letter-spacing: 2px;
  font-size: 11px;
  font-weight: 600;
  min-height: 14px;
}

.menu-tip {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  left: 50%;
  transform: translateX(-50%);
  background: none;
  border: none;
  color: rgba(200, 180, 180, 0.28);
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 500;
  white-space: nowrap;
  padding: 8px 12px;
}

/* ---------- Tip card ---------- */
.tip-card {
  max-width: 300px;
  margin: 0 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.tip-heading {
  color: rgba(230, 220, 220, 0.9);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 3px;
}
.tip-body {
  color: rgba(200, 180, 180, 0.6);
  font-size: 14px;
  line-height: 1.5;
}
.tip-body strong { color: rgba(255, 230, 230, 0.9); }
.tip-path {
  color: rgba(230, 220, 220, 0.85);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.7;
  letter-spacing: 0.5px;
  background: rgba(200, 20, 20, 0.08);
  border: 1px solid rgba(200, 20, 20, 0.25);
  border-radius: 12px;
  padding: 14px 18px;
  margin: 4px 0;
}
.tip-path strong { color: #ff4d4d; }

/* ---------- Pause / Game over ---------- */
.pause-title {
  color: rgba(230, 220, 220, 0.85);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  margin-bottom: 8px;
}

.text-btn {
  background: none;
  border: 1.5px solid rgba(200, 20, 20, 0.4);
  color: rgba(230, 220, 220, 0.85);
  padding: 12px 32px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 30px;
  min-width: 200px;
}

.over-kicker {
  color: rgba(200, 20, 20, 0.7);
  font-size: 13px;
  letter-spacing: 4px;
  font-weight: 700;
}

.over-saying {
  color: #e8dede;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  max-width: 320px;
  line-height: 1.2;
  text-shadow: 0 0 24px rgba(200, 20, 20, 0.6);
  padding: 0 24px;
}

.over-sub {
  color: rgba(200, 180, 180, 0.55);
  font-size: 14px;
  letter-spacing: 1px;
  margin-top: 6px;
}

.over-best {
  color: rgba(200, 20, 20, 0.4);
  font-size: 12px;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
