/* CheerMe fan web app — styled after the Claude Design prototype (web/design/).
   Cream + ink + signal-red, Outfit for UI, Space Grotesk for big numbers.
   Mobile-first; on desktop the app renders as a centered phone-width column. */

/* Fonts embedded from the design bundle (variable weight ranges). */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('assets/fonts/outfit-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('assets/fonts/space-grotesk-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0;
}

:root {
  /* Design tokens from the prototype */
  --bg: #FBF6EE;
  --bg-page: #E9E2D4;
  --bg-open-grad: linear-gradient(180deg, #FBF6EE 0%, #FBEEE4 100%);
  --ink: #211D18;
  --muted: #8A7F70;
  --soft: #A2937D;
  --body-text: #6B6153;
  --red: #E8492F;
  --red-hover: #D03E26;
  --red-deep: #CE3C22;
  --red-bright: #F2603F;
  --border: #E0D5C2;
  --card-border: #E7DCCB;
  --track: #F0E8DA;
  --cream-on-dark: #C9BBA4;
  --pale-on-red: #FCD9CE;
  --cream-text: #FBF6EE;
  --btn-cream: #FFF8F0;
  --font-ui: 'Outfit', system-ui, sans-serif;
  --font-num: 'Space Grotesk', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { min-height: 100%; }

body {
  background: var(--bg-page);
  font-family: var(--font-ui);
  color: var(--ink);
  display: flex;
  justify-content: center;
}

/* Phone-width app column */
.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
}
@media (min-width: 480px) {
  .app { box-shadow: 0 0 40px rgba(33, 29, 24, 0.12); }
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: max(24px, env(safe-area-inset-top)) 28px max(32px, env(safe-area-inset-bottom));
  animation: popin 0.3s ease;
}
.screen--center { justify-content: center; }
.screen--dark { background: var(--ink); color: var(--cream-text); }
.screen--red { background: var(--red); color: var(--btn-cream); }
.screen--open { background: var(--bg-open-grad); }

@keyframes popin { from { transform: scale(0.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes eq { from { transform: scaleY(0.2); } to { transform: scaleY(1); } }
@keyframes cheerpulse {
  0% { box-shadow: 0 0 0 0 rgba(232, 73, 47, 0.38); }
  70% { box-shadow: 0 0 0 30px rgba(232, 73, 47, 0); }
  100% { box-shadow: 0 0 0 0 rgba(232, 73, 47, 0); }
}
@keyframes blink { 50% { opacity: 0.2; } }

/* Typography */
.wordmark { font-size: 15px; font-weight: 800; letter-spacing: -0.3px; color: var(--red); padding: 10px 0 30px; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 2px; text-transform: uppercase; color: var(--red); }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.2; }
.sub { font-size: 15px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.body-copy { font-size: 14px; color: var(--body-text); line-height: 1.5; max-width: 260px; }
.footnote { font-size: 13px; color: var(--soft); }
.spacer { flex: 1; }

/* Avatar (event/athlete photo) */
.avatar {
  width: 108px; height: 108px;
  border-radius: 50%;
  border: 4px solid #FFFFFF;
  box-shadow: 0 4px 18px rgba(33, 29, 24, 0.12);
  background: repeating-linear-gradient(45deg, #F0E8DA 0 8px, #E5D9C6 8px 16px);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

/* Inputs */
.input {
  width: 100%;
  height: 54px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  padding: 0 22px;
  font-family: var(--font-ui);
  font-size: 16px;
  text-align: center;
  color: var(--ink);
  outline: none;
}
.input:focus { border-color: var(--red); }
.input + .input { margin-top: 10px; }

/* Buttons */
.btn {
  width: 100%;
  border: none;
  border-radius: 999px;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.08s ease;
}
.btn:active { transform: scale(0.98); }
.btn--primary {
  height: 58px;
  background: var(--red);
  color: var(--btn-cream);
  font-size: 17px;
  font-weight: 700;
  margin-top: 12px;
}
.btn--primary:hover { background: var(--red-hover); }
.btn--primary:disabled { opacity: 0.6; cursor: default; }
.btn--big { height: 62px; font-size: 18px; font-weight: 800; }
.btn--ghost {
  height: 52px;
  margin-top: 10px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--body-text);
  font-size: 15px;
  font-weight: 600;
}
.btn--demo {
  width: auto;
  height: 44px;
  padding: 0 20px;
  margin-top: 34px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}
.btn--on-red {
  width: auto;
  height: 56px;
  padding: 0 30px;
  margin-top: 40px;
  background: var(--btn-cream);
  color: var(--red);
  font-size: 16px;
  font-weight: 800;
}

.error-text { color: var(--red-hover); font-weight: 600; font-size: 14px; margin-top: 10px; }

/* Countdown (waiting) */
.count-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-family: var(--font-num);
  margin-top: 22px;
}
.count-row .num { font-size: 58px; font-weight: 700; }
.count-row .sep { font-size: 40px; font-weight: 700; color: #D7C9B0; }
/* Four-segment clock (dd:hh:mm:ss) — smaller digits so it fits narrow phones */
.count-row--days { align-items: flex-start; gap: 4px; }
.count-row--days .num { font-size: 44px; line-height: 1; }
.count-row--days .sep { font-size: 30px; line-height: 44px; }
.count-group { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.count-unit {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--soft);
}

/* Pill row: music pill + info button side by side */
.pill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.pill-row .music-pill { margin-top: 0; }

.info-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid #F0DFCB;
  background: #FFFFFF;
  color: #B9502F;
  font-family: Georgia, serif;
  font-size: 17px;
  font-style: italic;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

/* Info overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(33, 29, 24, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}
/* The `hidden` attribute's display:none is a weak UA rule that .overlay's
   display:flex would override — make the hidden state win explicitly. */
.overlay[hidden] { display: none; }
.modal {
  width: 100%;
  max-width: 400px;
  background: var(--bg);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: left;
  animation: popin 0.25s ease;
}
.modal h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}
.modal__p {
  font-size: 15px;
  color: var(--body-text);
  line-height: 1.55;
  margin-top: 12px;
}
.modal .btn { margin-top: 22px; }

/* Music pill + equalizer */
.music-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFFFF;
  border: 1px solid #F0DFCB;
  border-radius: 999px;
  padding: 8px 16px;
  margin-top: 8px;
  cursor: pointer;
  font-family: var(--font-ui);
}
.music-pill__label { font-size: 12px; font-weight: 700; color: #B9502F; }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.eq span {
  width: 3px;
  border-radius: 2px;
  background: var(--red);
  transform-origin: 50% 100%;
  animation: eq 0.8s ease-in-out infinite alternate;
}
.eq span:nth-child(1) { height: 8px;  animation-duration: 0.7s; }
.eq span:nth-child(2) { height: 14px; animation-delay: 0.1s; }
.eq span:nth-child(3) { height: 10px; animation-delay: 0.2s; animation-duration: 0.9s; }
.eq span:nth-child(4) { height: 16px; animation-delay: 0.3s; }
.eq span:nth-child(5) { height: 9px;  animation-delay: 0.15s; animation-duration: 0.75s; }
.music-pill.is-off .eq span { animation-play-state: paused; transform: scaleY(0.2); }

/* CHEER! button */
.cheer-btn {
  width: 210px; height: 210px;
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--red-bright), var(--red) 60%, var(--red-deep));
  color: var(--btn-cream);
  font-family: var(--font-ui);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  animation: cheerpulse 2s infinite;
  transition: transform 0.12s ease;
}
.cheer-btn:hover { transform: scale(1.03); }
.cheer-btn:active { transform: scale(0.97); }

/* Recording screen */
.rec-indicator { display: flex; align-items: center; gap: 8px; margin-top: 18px; }
.rec-indicator .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
.rec-indicator .label { font-size: 13px; font-weight: 700; letter-spacing: 2px; color: var(--cream-on-dark); }
.rec-title { font-size: 24px; font-weight: 800; margin-top: 26px; line-height: 1.25; max-width: 260px; }
.rec-timer { font-family: var(--font-num); font-size: 84px; font-weight: 700; line-height: 1; }
.rec-bars { display: flex; align-items: flex-end; justify-content: center; gap: 4px; height: 52px; margin-top: 30px; }
.rec-bars span {
  width: 4px;
  border-radius: 2px;
  background: var(--cream-text);
  transform-origin: 50% 100%;
  animation: eq 0.8s ease-in-out infinite alternate;
}
.stop-btn {
  width: 88px; height: 88px;
  border-radius: 50%;
  border: 4px solid var(--cream-text);
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.stop-btn .square { width: 32px; height: 32px; border-radius: 8px; background: var(--red); }

/* Review player card */
.player-card {
  width: 100%;
  background: #FFFFFF;
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 18px;
  margin-top: 28px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.play-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--ink);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.player-card__meta { flex: 1; text-align: left; }
.player-card__title { font-size: 15px; font-weight: 700; }
.progress { height: 6px; border-radius: 3px; background: var(--track); margin-top: 10px; overflow: hidden; }
.progress__fill { height: 100%; width: 0%; background: var(--red); border-radius: 3px; }

/* Sent screen check */
.check-circle {
  width: 96px; height: 96px;
  border-radius: 50%;
  border: 4px solid var(--btn-cream);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popin 0.35s ease;
}
.sent-title { font-size: 30px; font-weight: 800; margin-top: 26px; line-height: 1.15; }
.sent-body { font-size: 15px; color: var(--pale-on-red); margin-top: 12px; line-height: 1.5; max-width: 260px; }

/* Loading spinner */
.spinner {
  width: 44px; height: 44px;
  border: 4px solid rgba(232, 73, 47, 0.2);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
