/* ===== Heat Check — base layout & shared components ===== */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0b070b; color: #f5eef5; }
body {
  font-family: var(--font-body, "Inter", system-ui, sans-serif);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
  overscroll-behavior: none;
}
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; touch-action: manipulation; }
input, select { font: inherit; }
[hidden] { display: none !important; }

#app {
  --bg: #120a12; --fg: #f8eef6; --muted: #b9a5b5; --accent: #ff5a3c; --accent2: #ffb03b;
  --card: #1e121d; --line: #ffffff1a; --radius: 22px;
  --font-display: "Fraunces", Georgia, serif; --font-body: "Inter", system-ui, sans-serif;
  min-height: 100dvh; background: var(--bg); color: var(--fg);
  font-family: var(--font-body);
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  max-width: 560px; margin: 0 auto; position: relative; overflow-x: hidden;
  transition: background .4s ease;
}

.screen { flex: 1; display: flex; flex-direction: column; padding: 16px 18px 120px; animation: screenIn .35s ease both; }
@keyframes screenIn { from { opacity: 0; transform: translateY(12px); } }

h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.05; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { height: 16px; }

/* Buttons: big, thumb-friendly */
.btn {
  min-height: 58px; padding: 0 22px; border-radius: 999px;
  background: var(--accent); color: var(--btn-fg, #140a10);
  font-weight: 800; font-size: 17px; letter-spacing: .02em;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s ease, filter .2s ease, opacity .2s;
  box-shadow: 0 8px 24px -10px var(--accent);
}
.btn:active { transform: scale(.96); }
.btn.ghost { background: transparent; color: var(--fg); border: 2px solid var(--line); box-shadow: none; }
.btn.alt { background: var(--accent2); box-shadow: 0 8px 24px -10px var(--accent2); }
.btn.block { width: 100%; }
.btn.sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn[disabled] { opacity: .35; pointer-events: none; }

/* Top HUD: back, heat meter, scoreboard */
.hud { position: sticky; top: 0; z-index: 20; padding: 10px 14px 8px; background: linear-gradient(var(--bg) 70%, transparent); }
.hud-top { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font-size: 20px; flex: none; }
.hud-title { font-family: var(--font-display); font-size: 20px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.heat { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.heat-bar { flex: 1; height: 10px; border-radius: 99px; background: #ffffff14; overflow: hidden; position: relative; }
.heat-fill { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: linear-gradient(90deg, #ffd166, #ff7a3c, #ff2e63); transition: width .6s cubic-bezier(.2,.9,.3,1.3); }
.heat-label { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; min-width: 86px; text-align: right; }
.heat-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.h1b { background: #ffd16633; color: #ffd166; }
.h2b { background: #ff7a3c33; color: #ff9b6b; }
.h3b { background: #ff2e6333; color: #ff6b8f; }

.scores { display: flex; gap: 6px; overflow-x: auto; margin-top: 8px; scrollbar-width: none; }
.scores::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 6px 12px; border-radius: 99px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 600; display: flex; gap: 6px; align-items: center; transition: transform .3s; }
.chip b { color: var(--accent); }
.chip.turn { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.chip.bump { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

/* Bottom control bar: Pause + Pass always visible in games */
.controls { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 30;
  display: flex; gap: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 35%); }
.controls .btn { flex: 1; }
.controls .pause { flex: 0 0 64px; padding: 0; background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: none; font-size: 22px; }
.controls .pass { background: var(--card); color: var(--fg); border: 1px solid var(--line); box-shadow: none; flex: 0 0 auto; padding: 0 18px; }
.pass small { font-weight: 600; opacity: .7; font-size: 12px; }

/* Generic card */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.prompt { font-family: var(--font-display); font-size: clamp(24px, 7vw, 34px); line-height: 1.15; }

/* Modal (penalties, prompts) */
.modal-wrap { position: fixed; inset: 0; z-index: 60; display: grid; place-items: end center; background: #000a; backdrop-filter: blur(6px); animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; background: var(--card); color: var(--fg); border-radius: 28px 28px 0 0; padding: 24px 20px calc(22px + env(safe-area-inset-bottom)); border-top: 2px solid var(--accent); animation: sheetUp .35s cubic-bezier(.2,.9,.3,1.1) both; }
@keyframes sheetUp { from { transform: translateY(100%); } }
.modal h2 { font-size: 28px; margin-bottom: 6px; }
.penalty-big { font-family: var(--font-display); font-size: 30px; margin: 12px 0 6px; }
.dare-box { background: #ffffff0d; border: 1px dashed var(--line); border-radius: 16px; padding: 14px; margin: 10px 0 16px; font-size: 17px; line-height: 1.4; }
.dare-box .lbl { display: block; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--accent2); margin-bottom: 6px; }

/* Hold to reveal */
.hold { position: relative; border-radius: var(--radius); min-height: 220px; display: grid; place-items: center; text-align: center; padding: 22px; overflow: hidden; touch-action: none; }
.hold .cover { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 20px; transition: opacity .2s; z-index: 2; }
.hold.on .cover { opacity: 0; pointer-events: none; }
.hold .secret { opacity: 0; transition: opacity .15s; }
.hold.on .secret { opacity: 1; }

/* Pass-the-phone curtain */
.handoff { text-align: center; padding: 30px 10px; }
.handoff .who { font-family: var(--font-display); font-size: 40px; margin: 10px 0; }

/* Timer ring */
.timer { --p: 1; width: 150px; height: 150px; border-radius: 50%; margin: 10px auto; display: grid; place-items: center;
  background: conic-gradient(var(--accent) calc(var(--p) * 360deg), #ffffff14 0); position: relative; }
.timer::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--bg); }
.timer span { position: relative; font-family: var(--font-display); font-size: 48px; }
.timer.warn { animation: pulse .5s infinite alternate; }
@keyframes pulse { to { transform: scale(1.05); } }

/* Countdown overlay */
.countdown { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: #000c; pointer-events: none; }
.countdown span { font-family: var(--font-display); font-size: 40vw; line-height: 1; color: var(--accent); animation: cd .9s ease both; text-shadow: 0 0 40px var(--accent); }
@keyframes cd { from { transform: scale(2.2); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { transform: scale(.8); opacity: 0; } }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.input { min-height: 54px; border-radius: 16px; border: 1px solid var(--line); background: #ffffff0a; color: var(--fg); padding: 0 16px; font-size: 17px; width: 100%; -webkit-user-select: text; user-select: text; }
.input:focus { outline: 2px solid var(--accent); }
.seg { display: flex; background: #ffffff0d; border-radius: 16px; padding: 4px; gap: 4px; }
.seg button { flex: 1; min-height: 48px; border-radius: 12px; font-weight: 700; font-size: 15px; color: var(--muted); }
.seg button.on { background: var(--accent); color: #140a10; }
.couple { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 8px; align-items: center; }
.couple .amp { font-family: var(--font-display); color: var(--accent); font-size: 22px; }
.note { font-size: 13px; color: var(--muted); line-height: 1.45; }
.toggle { display: flex; align-items: center; justify-content: space-between; min-height: 54px; gap: 12px; }
.switch { width: 58px; height: 34px; border-radius: 99px; background: #ffffff22; position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { transform: translateX(24px); }

/* Gate screens */
.gate { min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; padding: 28px; gap: 18px; text-align: center;
  background: radial-gradient(120% 70% at 50% 0%, #ff5a3c33, transparent 60%), #120a12; }
.gate .logo { font-family: "Fraunces", serif; font-weight: 900; font-size: 64px; letter-spacing: -.03em; line-height: .9;
  background: linear-gradient(180deg, #ffd166, #ff5a3c 55%, #ff2e63); -webkit-background-clip: text; background-clip: text; color: transparent; }
.gate .flame { font-size: 54px; animation: flick 1.6s ease-in-out infinite alternate; }
@keyframes flick { to { transform: scale(1.08) rotate(-4deg); filter: hue-rotate(-12deg); } }
.gate p { font-size: 17px; line-height: 1.5; color: #e8d7e4; }
.consent-quote { font-family: "Fraunces", serif; font-size: 26px; line-height: 1.25; color: #fff; }

/* Pause screen */
#pause { position: fixed; inset: 0; z-index: 999; background: #f6f5f1; color: #222; font-family: -apple-system, "Segoe UI", Roboto, sans-serif; display: flex; flex-direction: column; }
.pz-bar { display: flex; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 18px 14px; font-weight: 600; color: #c99a1a; border-bottom: 1px solid #e3e1da; }
.pz-body { padding: 18px 22px; flex: 1; overflow: auto; }
.pz-body h1 { font-family: inherit; font-size: 24px; margin: 8px 0 10px; }
.pz-body li { padding: 8px 0; border-bottom: 1px solid #ecebe6; list-style: none; }
.pz-body ul { padding: 0; margin: 0 0 18px; }
.pz-resume { margin: 12px auto calc(18px + env(safe-area-inset-bottom)); color: #bbb; font-size: 13px; padding: 12px 20px; }

/* Toast */
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); transform: translateX(-50%); z-index: 80; background: var(--fg); color: var(--bg); padding: 12px 18px; border-radius: 99px; font-weight: 700; font-size: 15px; animation: toast 2.2s ease both; white-space: nowrap; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -20px); } 12%, 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
