#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 28px;
  position: relative;
  background: transparent;
  isolation: isolate;
}

#app::before,
#app::after {
  content: "";
  position: fixed;
  z-index: -1;
  border: 3px solid var(--ink-navy);
  opacity: 0.08;
  transform: rotate(12deg);
}

#app::before {
  width: 120px;
  height: 120px;
  border-radius: 32px;
  left: -42px;
  top: 34%;
  background: var(--patch-yellow);
}

#app::after {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  right: -55px;
  bottom: 20%;
  background: var(--patch-teal);
}

/* Progress trail — puzzle pieces */
.progress-trail {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 16px 0;
  border-bottom: 2px solid var(--cloud-grey);
  margin-bottom: 16px;
}

.puzzle-piece {
  font-size: 20px;
  color: var(--cloud-grey);
  transition: all 0.3s ease;
}

.puzzle-piece.current {
  color: var(--patch-yellow);
  animation: piece-peel 2.5s ease-in-out infinite;
}

.puzzle-piece.completed {
  color: var(--ink-navy);
  opacity: 0.7;
}

@keyframes piece-peel {
  0%, 100% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(-3deg) scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .puzzle-piece.current {
    animation: none;
  }
}

.game-label {
  margin-left: auto;
  font-family: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-navy);
  opacity: 0.6;
  font-weight: 700;
}

/* Content area */
.content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 28px;
  padding: 24px 0;
  animation: sticker-place 300ms cubic-bezier(.2,.8,.2,1) both;
}

.content-area h1 {
  font-size: 28px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-navy);
  opacity: 0.6;
}

.content-area .prompt {
  font-size: 48px;
  line-height: 1.4;
  max-width: 800px;
  color: var(--ink-navy);
  padding: 24px 32px;
  border: 3px solid var(--ink-navy);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--sticker-shadow);
}

.content-area .subtitle {
  font-size: 22px;
  color: var(--ink-navy);
  opacity: 0.6;
}

.content-area .answer-reveal {
  font-size: 44px;
  color: var(--patch-purple);
  font-weight: 700;
  padding: 12px 28px;
  border: 3px solid var(--ink-navy);
  border-radius: 999px;
  background: color-mix(in srgb, var(--patch-purple) 12%, white);
  box-shadow: var(--sticker-shadow-sm);
  animation: answer-pop 360ms cubic-bezier(.2,1.5,.4,1) both;
}

@keyframes answer-pop {
  from { opacity: 0; transform: translateY(14px) rotate(-2deg) scale(.88); }
  to { opacity: 1; transform: translateY(0) rotate(0) scale(1); }
}

.content-area .explanation {
  font-size: 22px;
  color: var(--ink-navy);
  opacity: 0.7;
  max-width: 700px;
  animation: fadeInUp 250ms ease-out;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px) rotate(-1deg); }
  to { opacity: 1; transform: translateY(0) rotate(0deg); }
}

/* Scoreboard strip */
.scoreboard-strip {
  display: flex;
  gap: 16px;
  padding: 14px 0 8px 0;
  border-top: 2px solid var(--cloud-grey);
  flex-wrap: wrap;
  justify-content: center;
}

.team-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
  padding: 6px 14px;
  background: var(--paper-white);
  border: 2px solid var(--ink-navy);
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.12);
  animation: sticker-place 240ms ease-out both;
}

.team-score .icon {
  font-size: 18px;
}

.team-score .name {
  font-weight: 700;
}

/* Lobby */
.lobby {
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.lobby .logo {
  max-width: 300px;
  margin-bottom: 8px;
}

.logo-img,
.lb-logo {
  filter: drop-shadow(0 10px 12px rgba(10, 14, 39, 0.16));
  animation: logo-float 4s ease-in-out infinite;
}

.lobby .tagline {
  font-family: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 20px;
  letter-spacing: 0.15em;
  color: var(--ink-navy);
  opacity: 0.7;
  margin-bottom: 20px;
}

/* Game Menu */
.game-menu {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 16px 0;
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
}

.game-card {
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  box-shadow: 4px 4px 0 rgba(10, 14, 39, 0.12);
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  overflow: hidden;
  animation: sticker-place 300ms cubic-bezier(.2,.8,.2,1) both;
}

.game-card:nth-child(2) { animation-delay: 45ms; }
.game-card:nth-child(3) { animation-delay: 90ms; }
.game-card:nth-child(4) { animation-delay: 135ms; }
.game-card:nth-child(5) { animation-delay: 180ms; }
.game-card:nth-child(6) { animation-delay: 225ms; }
.game-card:nth-child(7) { animation-delay: 270ms; }

.game-card:nth-child(4n + 1) { background: color-mix(in srgb, var(--patch-yellow) 30%, white); }
.game-card:nth-child(4n + 2) { background: color-mix(in srgb, var(--patch-pink) 18%, white); }
.game-card:nth-child(4n + 3) { background: color-mix(in srgb, var(--patch-teal) 20%, white); }
.game-card:nth-child(4n) { background: color-mix(in srgb, var(--patch-purple) 15%, white); }

.game-card::after {
  content: "";
  position: absolute;
  width: 54px;
  height: 54px;
  right: -30px;
  top: 50%;
  border: 3px solid var(--ink-navy);
  border-radius: 50%;
  background: var(--page-wash);
  transform: translateY(-50%);
}

.game-card:hover {
  transform: translate(-3px, -4px) rotate(-0.5deg);
  box-shadow: 8px 9px 0 rgba(10, 14, 39, 0.15);
}

.game-card .icon { transition: transform 180ms ease; }
.game-card:hover .icon { transform: rotate(8deg) scale(1.12); }

.game-card .icon {
  font-size: 36px;
  margin-bottom: 8px;
}

.game-card h3 {
  font-family: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 20px;
  color: var(--ink-navy);
  margin-bottom: 4px;
}

.game-card p {
  font-size: 13px;
  color: var(--ink-navy);
  opacity: 0.6;
}

/* Who Am I */
.clues-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.clue-item {
  font-size: 32px;
  padding: 14px 28px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
  max-width: 700px;
  animation: fadeInUp 250ms ease-out;
}

.clue-item:nth-child(even) { transform: rotate(.35deg); }
.clue-item:nth-child(odd) { transform: rotate(-.35deg); }

.clue-item .points {
  font-size: 16px;
  color: var(--patch-pink);
  margin-right: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Faith Feud */
.feud-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.feud-item {
  width: 100%;
  padding: 14px 22px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 16px;
  font-size: 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
}

.feud-item.hidden {
  color: var(--ink-navy);
  opacity: 0.4;
  justify-content: center;
}

.feud-item.revealed {
  border-color: var(--patch-yellow);
}

.feud-item .rank {
  font-size: 18px;
  opacity: 0.5;
  margin-right: 16px;
}

.feud-item .pts {
  font-size: 20px;
  color: var(--patch-purple);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.strikes {
  display: flex;
  gap: 8px;
  font-size: 32px;
}

.strike {
  color: var(--cloud-grey);
}

.strike.active {
  color: var(--patch-pink);
}

/* Story Sequencing */
.story-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 700px;
}

.story-event {
  width: 100%;
  padding: 14px 22px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 16px;
  font-size: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
  transition: all 0.3s ease;
}

.story-event .order-num {
  font-size: 20px;
  color: var(--patch-teal);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 32px;
}

/* Relay Trivia */
.relay-board {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  width: 100%;
  max-width: 900px;
}

.relay-header {
  text-align: center;
  font-size: 13px;
  color: var(--ink-navy);
  opacity: 0.6;
  padding: 8px 4px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}

.relay-cell {
  padding: 18px 8px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 14px;
  text-align: center;
  font-size: 22px;
  color: var(--ink-navy);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
  transition: all 0.15s;
}

.relay-cell.used {
  opacity: 0.2;
  pointer-events: none;
}

.relay-q {
  font-size: 36px;
  max-width: 800px;
}

/* Picture Rebus */
.rebus-display {
  font-size: 64px;
  letter-spacing: 16px;
  line-height: 1.5;
  word-break: break-all;
}

.rebus-length {
  font-size: 28px;
  color: var(--ink-navy);
  opacity: 0.5;
  letter-spacing: 8px;
  font-family: 'Courier New', monospace;
}

/* Leaderboard */
.leaderboard {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  width: 100%;
  max-width: 600px;
}

.lb-row {
  width: 100%;
  padding: 14px 22px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 28px;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
  animation: sticker-place 320ms cubic-bezier(.2,.8,.2,1) both;
}

.lb-row:nth-child(2) { animation-delay: 80ms; }
.lb-row:nth-child(3) { animation-delay: 160ms; }
.lb-row:first-child {
  background: color-mix(in srgb, var(--patch-yellow) 28%, white);
  transform: scale(1.035);
}

.lb-row .rank-num {
  font-size: 20px;
  opacity: 0.5;
  font-weight: 700;
  min-width: 32px;
}

.lb-row .lb-score {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--patch-purple);
}

.lb-logo {
  max-width: 200px;
  margin-bottom: 8px;
}

/* Celebration */
.celebration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.particle {
  position: absolute;
  font-size: 20px;
  animation: float-up linear forwards;
  opacity: 0;
}

@keyframes float-up {
  0% { opacity: 0; transform: translateY(100vh) rotate(0deg) scale(0.5); }
  20% { opacity: 0.9; transform: translateY(80vh) rotate(180deg) scale(1); }
  80% { opacity: 0.5; }
  100% { opacity: 0; transform: translateY(-20vh) rotate(720deg) scale(0.5); }
}

@media (prefers-reduced-motion: reduce) {
  .celebration { display: none; }
}

/* True or Twist banner */
.result-banner {
  font-size: 52px;
  font-weight: 800;
  padding: 16px 48px;
  border-radius: 20px;
  border: 3px solid var(--ink-navy);
  box-shadow: 4px 4px 0 rgba(10, 14, 39, 0.12);
  animation: answer-pop 360ms cubic-bezier(.2,1.5,.4,1) both;
}

.result-banner.true {
  color: var(--patch-teal);
}

.result-banner.twist {
  color: var(--patch-pink);
}

/* choices chips */
.choices-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.choice-chip {
  font-size: 28px;
  padding: 12px 28px;
  background: var(--paper-white);
  border: 3px solid var(--ink-navy);
  border-radius: 40px;
  box-shadow: 3px 3px 0 rgba(10, 14, 39, 0.1);
}

/* Logo */
.logo-img {
  max-width: 320px;
  display: block;
}
