/* ─── Font ───────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'SproutPixel';
  src: url('../fuddle/assets/font/pixelFont-7-8x14-sproutLands.ttf') format('truetype');
  font-display: swap;
}

/* ─── Variables ──────────────────────────────────────────────────────────── */
:root {
  --cream:        #f5edd6;
  --parchment:    #e8d5a3;
  --warm-tan:     #c9a96e;
  --brown:        #7a5230;
  --dark-brown:   #4a2e10;
  --shadow-brown: rgba(74,46,16,0.35);
  --green:        #5a8a3c;
  --green-light:  #7db35a;
  --red:          #b83030;
  --gold:         #d4a017;
  --sky-top:      #c8e6f5;
  --sky-bottom:   #e8f4de;
  --radius:       10px;
  --radius-sm:    6px;
  /* Dingus-specific */
  --dingus-red:    #c0392b;
  --dingus-orange: #e67e22;
  --dingus-purple: #6c3483;
  --dingus-bg:    #1a0a2e;
  /* Answer colors */
  --ans-a: #2471a3;
  --ans-b: #1e8449;
  --ans-c: #d35400;
  --ans-d: #7d3c98;
}

/* ─── Reset ──────────────────────────────────────────────────────────────── */
*,*::before,*::after { box-sizing:border-box; margin:0; padding:0; }

html, body {
  height: 100%;
  overflow: hidden;
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  font-family: 'Nunito', system-ui, sans-serif;
  color: var(--dark-brown);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

/* ─── Screens ────────────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 20px 16px 24px;
  overflow-y: auto;
  gap: 16px;
}

.hidden { display: none !important; }

/* ─── Logo ───────────────────────────────────────────────────────────────── */
.logo-area {
  text-align: center;
  margin-bottom: 8px;
}
.logo-area--small { margin-bottom: 0; }

.logo-emoji { font-size: 56px; display: block; }
.logo-area--small .logo-emoji { font-size: 36px; }

.logo-title {
  font-family: 'SproutPixel', 'Nunito', sans-serif;
  font-size: 42px;
  color: var(--dark-brown);
  letter-spacing: 4px;
  line-height: 1;
  margin-top: 4px;
  text-shadow: 3px 3px 0 var(--warm-tan);
}
.logo-area--small .logo-title { font-size: 28px; letter-spacing: 3px; }

.logo-tagline {
  font-size: 13px;
  color: var(--brown);
  margin-top: 6px;
  font-weight: 700;
}

/* ─── Card ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--cream);
  border: 3px solid var(--brown);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow-brown);
  padding: 20px 18px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--dark-brown);
  text-align: center;
}
.card-sub {
  font-size: 13px;
  color: var(--brown);
  text-align: center;
}

/* ─── Tabs ───────────────────────────────────────────────────────────────── */
.tab-row {
  display: flex;
  gap: 4px;
  background: var(--parchment);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.tab-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brown);
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: 'Nunito', sans-serif;
}
.tab-btn.active {
  background: var(--dark-brown);
  color: var(--cream);
}

/* ─── Inputs ─────────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius-sm);
  background: white;
  font-size: 15px;
  font-family: 'Nunito', sans-serif;
  color: var(--dark-brown);
  font-weight: 700;
  outline: none;
  transition: border-color .2s;
}
.input:focus { border-color: var(--brown); }
.input--code {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-size: 18px;
  font-weight: 900;
  text-align: center;
  flex: 1;
}
.input--big {
  font-size: 20px;
  font-weight: 900;
  text-align: center;
  padding: 14px;
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px;
  background: var(--green);
  color: var(--cream);
  border: 3px solid var(--dark-brown);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--shadow-brown);
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow-brown); }
.btn-primary:disabled { background: var(--warm-tan); color: var(--parchment); cursor: not-allowed; box-shadow: none; }

.btn-big { font-size: 18px; padding: 18px; }

.btn-secondary {
  padding: 14px 20px;
  background: var(--gold);
  color: var(--dark-brown);
  border: 3px solid var(--dark-brown);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--shadow-brown);
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--shadow-brown); }

.btn-ghost {
  background: transparent;
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius);
  padding: 10px 16px;
  color: var(--brown);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost-sm {
  background: transparent;
  border: 1px solid var(--warm-tan);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--brown);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
}

/* ─── Error ──────────────────────────────────────────────────────────────── */
.error-msg {
  background: #fde8e8;
  color: var(--red);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ─── Home Screen ────────────────────────────────────────────────────────── */
.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--parchment);
  border: 2px solid var(--warm-tan);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--brown);
  max-width: 100%;
}
#home-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }

.home-actions {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.divider {
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--warm-tan);
  position: relative;
}
.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--warm-tan);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }

.join-row { display: flex; gap: 8px; }

/* ─── Auth ───────────────────────────────────────────────────────────────── */
#auth-panel-email,
#auth-panel-sent {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-sent-emoji { font-size: 48px; display: block; text-align: center; }

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: white;
  color: #3c3c3c;
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--shadow-brown);
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
}
.btn-google:active { transform: translateY(2px); box-shadow: none; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--warm-tan);
  font-size: 12px;
  font-weight: 700;
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--warm-tan);
}

/* ─── Nickname ───────────────────────────────────────────────────────────── */
.auth-hint { font-size: 12px; color: var(--brown); text-align: center; }

/* ─── Lobby ──────────────────────────────────────────────────────────────── */
.lobby-header {
  text-align: center;
  width: 100%;
}
.room-code-box {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--dark-brown);
  border-radius: var(--radius);
  padding: 10px 16px;
  margin-bottom: 6px;
}
.room-code-label {
  font-size: 10px;
  font-weight: 900;
  color: var(--warm-tan);
  letter-spacing: 2px;
}
.room-code-value {
  font-family: 'SproutPixel', monospace;
  font-size: 28px;
  color: var(--gold);
  letter-spacing: 6px;
}
.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 2px;
  -webkit-tap-highlight-color: transparent;
}
.lobby-status { font-size: 14px; color: var(--brown); font-weight: 700; }

.player-list-wrap {
  width: 100%;
  max-width: 420px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.player-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.player-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 800;
  color: var(--dark-brown);
}
.player-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
  border: 2px solid rgba(0,0,0,.15);
}
.player-chip-name { flex: 1; }
.player-chip-you {
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  background: #e8f5e0;
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 2px 7px;
}
.player-chip-host {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: #fff8e0;
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 2px 7px;
}

.host-controls, .guest-waiting {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guest-waiting {
  text-align: center;
  color: var(--brown);
  font-size: 14px;
  font-weight: 700;
  background: var(--parchment);
  border-radius: var(--radius);
  padding: 16px;
}
.rounds-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--parchment);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.rounds-label { font-size: 14px; font-weight: 800; color: var(--dark-brown); flex: 1; }
.rounds-btns { display: flex; gap: 6px; }
.rounds-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--warm-tan);
  background: white;
  font-size: 16px;
  font-weight: 900;
  color: var(--brown);
  cursor: pointer;
  font-family: 'Nunito', sans-serif;
  transition: background .15s, color .15s, border-color .15s;
}
.rounds-btn.active {
  background: var(--dark-brown);
  color: var(--cream);
  border-color: var(--dark-brown);
}
.start-hint { font-size: 12px; color: var(--brown); text-align: center; font-weight: 700; }

/* ─── Role Reveal ────────────────────────────────────────────────────────── */
#screen-role-reveal {
  background: var(--dingus-bg);
  justify-content: center;
}
.role-reveal-inner {
  text-align: center;
  padding: 40px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}
.role-emoji { font-size: 80px; display: block; animation: pop-in .4s ease; }
.role-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 2px;
  animation: pop-in .4s ease .1s both;
}
.role-title--dingus { color: #e74c3c; }
.role-title--player { color: #2ecc71; }
.role-desc {
  font-size: 14px;
  color: rgba(255,255,255,.7);
  max-width: 280px;
  line-height: 1.5;
  animation: pop-in .4s ease .2s both;
}
.role-countdown {
  height: 6px;
  background: rgba(255,255,255,.15);
  width: 100%;
  position: absolute;
  bottom: 0;
}
.role-countdown-bar {
  height: 100%;
  background: var(--gold);
  transition: width linear;
  width: 100%;
}

/* ─── Question Screen ────────────────────────────────────────────────────── */
#screen-question {
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  padding: 0;
  justify-content: space-between;
  gap: 0;
}
.q-header {
  width: 100%;
  background: var(--dark-brown);
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.q-meta {
  font-size: 12px;
  font-weight: 800;
  color: var(--parchment);
  white-space: nowrap;
}
.q-timer-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.2);
  border-radius: 4px;
  overflow: hidden;
}
.q-timer-bar {
  height: 100%;
  background: var(--gold);
  transition: width linear;
  width: 100%;
}
.q-timer-bar.urgent { background: var(--red); }
.q-timer-label {
  font-size: 14px;
  font-weight: 900;
  color: var(--gold);
  min-width: 22px;
  text-align: right;
}

.q-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 20px;
  min-height: 0;
}
.q-text {
  font-size: 20px;
  font-weight: 800;
  color: var(--dark-brown);
  text-align: center;
  line-height: 1.4;
  max-width: 420px;
}

.q-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 12px;
  width: 100%;
  flex-shrink: 0;
}
.ans-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 12px;
  border: 3px solid rgba(0,0,0,.2);
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  text-align: left;
  line-height: 1.3;
  transition: transform .08s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 0 rgba(0,0,0,.25);
  min-height: 64px;
}
.ans-btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.25); }
.ans-btn[data-choice="a"] { background: var(--ans-a); }
.ans-btn[data-choice="b"] { background: var(--ans-b); }
.ans-btn[data-choice="c"] { background: var(--ans-c); }
.ans-btn[data-choice="d"] { background: var(--ans-d); }

.ans-btn.answered { opacity: .5; cursor: default; transform: none; box-shadow: none; }
.ans-btn.selected { border-color: white; border-width: 3px; box-shadow: 0 0 0 3px rgba(255,255,255,.4), 0 4px 0 rgba(0,0,0,.25); }
.ans-label {
  font-size: 18px;
  font-weight: 900;
  opacity: .85;
  flex-shrink: 0;
}
.ans-text { flex: 1; }

.q-footer {
  padding: 10px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}
.answered-indicator {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}
.player-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warm-tan);
  transition: background .2s;
}
.player-dot.done { background: var(--green); }

.dingus-hint {
  background: rgba(192,57,43,.15);
  border: 2px solid var(--dingus-red);
  color: var(--dingus-red);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

/* ─── Reveal Screen ──────────────────────────────────────────────────────── */
#screen-reveal {
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  padding: 0;
  gap: 0;
}
.reveal-header {
  width: 100%;
  background: var(--dark-brown);
  padding: 10px 16px 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.reveal-title { font-size: 14px; font-weight: 800; color: var(--parchment); }
.reveal-timer-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.2);
  border-radius: 4px;
  overflow: hidden;
}
.reveal-timer-bar {
  height: 100%;
  background: var(--gold);
  transition: width linear;
  width: 100%;
}

.reveal-answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px 12px 0;
  width: 100%;
}
.rev-ans-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 10px;
  border-radius: var(--radius);
  color: white;
  font-size: 14px;
  font-weight: 800;
  opacity: 0.55;
  min-height: 56px;
  border: 3px solid transparent;
}
.rev-ans-btn[data-choice="a"] { background: var(--ans-a); }
.rev-ans-btn[data-choice="b"] { background: var(--ans-b); }
.rev-ans-btn[data-choice="c"] { background: var(--ans-c); }
.rev-ans-btn[data-choice="d"] { background: var(--ans-d); }
.rev-ans-btn.correct {
  opacity: 1;
  border-color: white;
  box-shadow: 0 0 0 3px rgba(255,255,255,.5);
  animation: correct-pulse .4s ease;
}
.rev-ans-label { font-size: 16px; font-weight: 900; opacity: .85; flex-shrink: 0; }
.rev-ans-text { flex: 1; }

.reveal-players {
  flex: 1;
  padding: 10px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}
.rev-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.rev-player-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}
.rev-player-name { flex: 1; font-size: 14px; font-weight: 800; color: var(--dark-brown); }
.rev-player-answer {
  font-size: 13px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 10px;
  color: white;
}
.rev-player-answer.correct { background: var(--green); }
.rev-player-answer.wrong   { background: var(--red); }
.rev-player-answer.none    { background: var(--warm-tan); color: var(--dark-brown); }

.reveal-mypoints {
  text-align: center;
  padding: 8px;
  font-size: 24px;
  font-weight: 900;
  min-height: 44px;
  animation: pop-in .3s ease;
}
.points-positive { color: var(--green); }
.points-negative { color: var(--red); }

/* ─── Accusation Screen ──────────────────────────────────────────────────── */
#screen-accusation {
  background: linear-gradient(160deg, #2c1810 0%, #4a1a1a 100%);
}
.accuse-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.accuse-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--parchment);
  white-space: nowrap;
}
.accuse-timer-wrap {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,.15);
  border-radius: 4px;
  overflow: hidden;
}
.accuse-timer-bar {
  height: 100%;
  background: #e74c3c;
  transition: width linear;
  width: 100%;
}
.accuse-timer-label {
  font-size: 14px;
  font-weight: 900;
  color: #e74c3c;
  min-width: 16px;
  text-align: right;
}

.accuse-cost-note {
  font-size: 13px;
  color: rgba(255,255,255,.6);
  font-weight: 700;
  text-align: center;
}

.accuse-panel, .accuse-panel-default, .accuse-panel-waiting, .accuse-panel-done {
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.accuse-panel-waiting, .accuse-panel-done {
  color: rgba(255,255,255,.6);
  font-size: 16px;
  font-weight: 700;
}

.btn-accuse {
  background: var(--dingus-red);
  color: white;
  border: 4px solid white;
  border-radius: 16px;
  padding: 24px 40px;
  font-size: 28px;
  font-weight: 900;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  box-shadow: 0 8px 0 rgba(0,0,0,.4);
  transition: transform .1s, box-shadow .1s;
  -webkit-tap-highlight-color: transparent;
  letter-spacing: 2px;
  animation: pulse-accuse 1.5s ease-in-out infinite;
}
.btn-accuse:active { transform: translateY(5px); box-shadow: 0 3px 0 rgba(0,0,0,.4); animation: none; }

.accuse-pick-label {
  font-size: 18px;
  font-weight: 900;
  color: var(--cream);
}
.accuse-player-list {
  list-style: none;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 300px;
  overflow-y: auto;
}
.accuse-player-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,.1);
  border: 2px solid rgba(255,255,255,.2);
  border-radius: var(--radius);
  padding: 12px 16px;
  cursor: pointer;
  color: var(--cream);
  font-size: 16px;
  font-weight: 800;
  font-family: 'Nunito', sans-serif;
  transition: background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.accuse-player-item:active { background: rgba(231,76,60,.3); border-color: #e74c3c; }

/* ─── Accusation Result ──────────────────────────────────────────────────── */
#screen-accusation-result {
  justify-content: center;
}
.accuse-result-inner {
  text-align: center;
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.result-emoji { font-size: 80px; display: block; animation: pop-in .4s ease; }
.result-title { font-size: 28px; font-weight: 900; animation: pop-in .4s ease .1s both; }
.result-title--caught  { color: var(--red); }
.result-title--escaped { color: var(--green); }
.result-sub { font-size: 15px; color: var(--brown); max-width: 300px; line-height: 1.5; font-weight: 700; animation: pop-in .4s ease .2s both; }

/* ─── Game Over ──────────────────────────────────────────────────────────── */
#screen-game-over {
  background: linear-gradient(160deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
  gap: 20px;
}
.gameover-reveal {
  text-align: center;
  background: var(--dark-brown);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 420px;
}
.gameover-label {
  font-size: 14px;
  color: var(--warm-tan);
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.gameover-dingus-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--dingus-red);
  border-radius: var(--radius);
  padding: 12px 20px;
  color: white;
  font-size: 22px;
  font-weight: 900;
  animation: pop-in .5s ease;
}
.gameover-leaderboard {
  width: 100%;
  max-width: 420px;
}
.leaderboard-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--dark-brown);
  margin-bottom: 10px;
  text-align: center;
}
.leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lb-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--cream);
  border: 2px solid var(--warm-tan);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.lb-row:first-child { border-color: var(--gold); background: #fff8e0; }
.lb-rank { font-size: 18px; font-weight: 900; color: var(--dark-brown); min-width: 28px; }
.lb-rank-1 { color: var(--gold); }
.lb-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 900;
  color: white;
  flex-shrink: 0;
}
.lb-name { flex: 1; font-size: 15px; font-weight: 800; color: var(--dark-brown); }
.lb-dingus { font-size: 12px; }
.lb-score { font-size: 16px; font-weight: 900; color: var(--green); }
.lb-score.negative { color: var(--red); }

.gameover-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 420px;
}

/* ─── How to Play Modal ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fade-in .2s ease;
}
.modal-card {
  background: var(--cream);
  border: 3px solid var(--brown);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow-brown);
  padding: 24px 20px;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: pop-in .25s ease;
}
.modal-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--dark-brown);
  text-align: center;
}
.htp-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--dark-brown);
  line-height: 1.4;
}
.htp-list li {
  padding-left: 20px;
  position: relative;
}
.htp-list li::before {
  content: '>';
  position: absolute;
  left: 0;
  color: var(--gold);
  font-weight: 900;
}
.htp-list em {
  color: var(--dingus-red);
  font-style: normal;
  font-weight: 900;
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Animations ─────────────────────────────────────────────────────────── */
@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
@keyframes correct-pulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes pulse-accuse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 0 rgba(0,0,0,.4); }
  50%       { transform: scale(1.04); box-shadow: 0 10px 20px rgba(231,76,60,.5); }
}
@keyframes slide-up {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
