@font-face {
  font-family: "Archivo Black";
  src: url(fonts/ArchivoBlack-Regular.ttf);
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url(fonts/BarlowCondensed-Regular.ttf);
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Barlow Condensed";
  src: url(fonts/BarlowCondensed-SemiBold.ttf);
  font-weight: 600;
  font-display: swap;
}

:root {
  --raps-red: #CE1141;
  --raps-black: #0B0B0F;
  --raps-white: #F5F5F7;
  --raps-silver: #A1A1A4;
  --raps-gold: #B4975A;
  --morph: 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--raps-red);
  color: var(--raps-white);
  font-family: "Barlow Condensed", system-ui, sans-serif;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
}

main {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px clamp(16px, 4vw, 48px);
  max-width: 1100px;
  margin: 0 auto;
}

.top { text-align: center; width: 100%; }

.kicker {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 13px;
  opacity: 0.85;
}

.prompt {
  display: block;
  margin-top: 18px;
  font-size: clamp(18px, 2.6vw, 24px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#name-input {
  margin-top: 8px;
  width: min(420px, 88vw);
  background: transparent;
  border: none;
  border-bottom: 3px solid var(--raps-white);
  color: var(--raps-white);
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(24px, 4.5vw, 36px);
  text-align: center;
  text-transform: uppercase;
  outline: none;
}
#name-input::placeholder { color: var(--raps-white); opacity: 0.35; }
#name-input:focus { border-bottom-color: var(--raps-black); }

#suggestions {
  min-height: 44px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 10px;
}
#suggestions button {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--raps-red);
  background: var(--raps-white);
  border: none;
  border-radius: 999px;
  padding: 8px 16px;
  cursor: pointer;
}

.stage {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

#head-line {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: clamp(14px, 2vw, 18px);
  min-height: 1.4em;
}

#plot {
  position: relative;
  width: 100%;
  height: min(44vh, 400px);
  margin-top: 10px;
}

#word {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

#word .letter {
  font-family: "Archivo Black", sans-serif;
  color: var(--raps-white);
  line-height: 0.82;
  transform-origin: bottom;
  display: inline-block;
  transition: transform var(--morph);
  cursor: pointer;
  user-select: none;
}
#word .letter.mark { display: inline-block; cursor: default; }

#overlay { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; }
#overlay .series { fill: none; stroke: var(--raps-black); stroke-width: 2; stroke-linejoin: round; opacity: 0.85; }
#overlay .grid { stroke: var(--raps-black); stroke-width: 1; opacity: 0.35; }
#overlay .grid-label { fill: var(--raps-black); font-family: "Barlow Condensed", sans-serif; font-weight: 600; font-size: 12px; opacity: 0.7; }
#overlay .high { fill: var(--raps-gold); stroke: var(--raps-black); stroke-width: 1; }

#sub-line {
  margin-top: 14px;
  font-size: clamp(16px, 2.2vw, 20px);
  min-height: 1.4em;
}

#detail {
  margin: 10px auto 0;
  font-size: clamp(15px, 2vw, 18px);
  background: var(--raps-black);
  color: var(--raps-white);
  border-radius: 10px;
  padding: 10px 18px;
  max-width: 90%;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  align-items: center;
  padding: 18px 0 8px;
}

.controls button {
  font-family: "Barlow Condensed", sans-serif;
  font-weight: 600;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: transparent;
  color: var(--raps-white);
  border: 2px solid var(--raps-white);
  border-radius: 999px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 150ms, color 150ms;
}
.controls button[aria-pressed="true"],
.controls button.active {
  background: var(--raps-white);
  color: var(--raps-red);
}

footer {
  padding: 18px 0 6px;
  text-align: center;
  font-size: 13px;
  color: var(--raps-white);
  opacity: 0.75;
  line-height: 1.5;
}
footer a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  #word .letter { transition: none; }
  .controls button { transition: none; }
}
