:root {
  --bg: #f5efe4;
  --bg-warm: #ebe2d2;
  --surface: #fffdf9;
  --surface-muted: #f8f3ea;
  --ink: #1c1917;
  --ink-soft: #574f47;
  --ink-faint: #8a8075;
  --card-black: #191715;
  --card-black-text: #faf5ea;
  --red: #cf3626;
  --red-dark: #a62619;
  --red-soft: #fdebe8;
  --gold: #d99326;
  --gold-soft: #fdf3dc;
  --teal: #1a6b58;
  --teal-soft: #e4f3ee;
  --border: 2px solid #1c1917;
  --shadow: 4px 4px 0 #1c1917;
  --shadow-sm: 2px 2px 0 #1c1917;
  --radius: 14px;
  --radius-sm: 10px;
  --font-sans: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --font-display: 'ZCOOL XiaoWei', 'Noto Serif SC', 'Songti SC', serif;
  --font-mono: 'Space Grotesk', ui-monospace, SFMono-Regular, Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100dvh;
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 18% 8%, rgba(217, 147, 38, 0.11), transparent 46%),
    radial-gradient(circle at 86% 88%, rgba(207, 54, 38, 0.08), transparent 44%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.032'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
textarea,
select {
  font-family: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 0;
  background: rgba(245, 239, 228, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px dashed rgba(28, 25, 23, 0.16);
  margin-bottom: 16px;
}

.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  padding: 0;
  text-align: left;
}

.brand-seal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--red);
  color: var(--surface);
  font-weight: 900;
  font-size: 16px;
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  letter-spacing: 0;
}

.brand-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.12s ease;
}

.room-chip:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 var(--ink);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  font-size: 13px;
  font-weight: 600;
  gap: 4px;
  transition: transform 0.12s ease, background-color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-warm);
}

.icon-btn:active {
  transform: translateY(1px);
}

/* Main Content */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Paper Card Primitive */
.card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}

.card-flat {
  background: var(--surface);
  border: 1.5px solid rgba(28, 25, 23, 0.22);
  border-radius: var(--radius);
  padding: 16px;
}

.card-subtle {
  background: var(--surface-muted);
  border: 1.5px solid rgba(28, 25, 23, 0.16);
  border-radius: var(--radius-sm);
  padding: 14px;
}

/* Typography */
.hero-header {
  text-align: center;
  padding: 10px 6px 4px;
}

.hero-header h1 {
  margin: 0;
  font-size: 38px;
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.hero-sub {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
  letter-spacing: 0.02em;
}

.section-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.muted {
  color: var(--ink-soft);
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  border: var(--border);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.15s ease;
}

.btn:active:not(:disabled) {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  box-shadow: 2px 2px 0 rgba(28, 25, 23, 0.4);
}

.btn-primary {
  background: var(--red);
  color: var(--surface);
}

.btn-primary:hover:not(:disabled) {
  background: var(--red-dark);
}

.btn-ink {
  background: var(--ink);
  color: var(--card-black-text);
}

.btn-ink:hover:not(:disabled) {
  background: #2f2a26;
}

.btn-teal {
  background: var(--teal);
  color: var(--surface);
}

.btn-teal:hover:not(:disabled) {
  background: #145646;
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--bg-warm);
}

.btn-ghost {
  background: transparent;
  border: 1.5px solid rgba(28, 25, 23, 0.25);
  box-shadow: none;
  min-height: 38px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(28, 25, 23, 0.06);
}

.btn-sm {
  width: auto;
  min-height: 34px;
  padding: 6px 12px;
  font-size: 13px;
  box-shadow: 2px 2px 0 var(--ink);
}

.btn-row {
  display: flex;
  gap: 10px;
}

.btn-row > * {
  flex: 1;
}

/* Form Elements */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}

.input,
.textarea {
  width: 100%;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--ink);
  background: var(--surface);
  font-size: 15px;
  outline: none;
  transition: background-color 0.15s ease;
}

.input:focus,
.textarea:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(217, 147, 38, 0.28);
}

.input-with-btn {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.input-with-btn .input {
  flex: 1;
  min-width: 0;
}

.random-name-btn {
  flex-shrink: 0;
  min-height: 46px;
  padding: 0 14px;
  white-space: nowrap;
}

.textarea {
  resize: vertical;
  min-height: 88px;
  line-height: 1.55;
}

.code-input {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.34em;
  padding: 12px;
}

/* Segmented Tabs */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  background: var(--bg-warm);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  margin-bottom: 16px;
}

.tab-btn {
  padding: 9px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
  transition: all 0.15s ease;
}

.tab-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 var(--ink), inset 0 0 0 1.5px var(--ink);
}

/* Identity Box on Home */
.identity-box {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.avatar-preview-btn {
  position: relative;
  flex-shrink: 0;
  width: 78px;
  height: 78px;
  padding: 5px 5px 14px;
  border-radius: 14px;
  border: 2px solid var(--ink);
  background: var(--av-bg, var(--surface-muted));
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.avatar-preview-btn:hover {
  transform: translateY(-1px);
}

.avatar-preview-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.avatar-preview-btn .avatar-svg {
  width: 58px;
  height: 58px;
  display: block;
}

.avatar-preview-badge {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--card-black-text);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* Avatar Illustrated Stamp Picker */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.avatar-modal-grid {
  max-height: 48dvh;
  overflow-y: auto;
  padding: 2px 2px 6px;
}

@media (min-width: 460px) {
  .avatar-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.avatar-option {
  padding: 6px 4px 5px;
  border-radius: 12px;
  border: 1.5px solid rgba(28, 25, 23, 0.22);
  background: var(--av-bg, var(--surface-muted));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}

.avatar-option:hover {
  transform: translateY(-1px);
  border-color: var(--ink);
}

.avatar-option.selected {
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  transform: translateY(-2px);
}

.avatar-option .avatar-svg {
  width: 44px;
  height: 44px;
  display: block;
}

.avatar-option-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.1;
}

.player-seal {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 2px;
  border-radius: 11px;
  border: 2px solid var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 var(--ink);
  overflow: hidden;
}

.player-seal .avatar-svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* Resume Banner */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gold-soft);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: 3px 3px 0 var(--ink);
}

.resume-info {
  font-size: 13px;
  line-height: 1.4;
}

.resume-info strong {
  font-size: 14px;
}

/* Lobby Invite Card */
.invite-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: center;
}

.room-code-big {
  font-family: var(--font-mono);
  font-size: 42px;
  font-weight: 800;
  letter-spacing: 0.16em;
  line-height: 1;
  margin: 4px 0 8px;
}

.qr-box {
  width: 126px;
  height: 126px;
  padding: 6px;
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 10px;
  box-shadow: 3px 3px 0 var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.lan-note {
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--surface-muted);
  border-radius: 8px;
  font-size: 12px;
  color: var(--ink-soft);
  word-break: break-all;
}

/* Players List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border: 1.5px solid rgba(28, 25, 23, 0.18);
  border-radius: 11px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.player-row.is-me {
  background: var(--surface);
  border-color: var(--ink);
}

.player-row.is-speaking {
  background: var(--gold-soft);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}

.player-row.is-winner {
  background: var(--teal-soft);
  border: 2px solid var(--teal);
}

.player-row.is-fooled {
  background: var(--red-soft);
  border: 2px solid var(--red);
}

.player-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.player-meta {
  min-width: 0;
}

.player-name {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.player-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

.player-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Badges */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid rgba(28, 25, 23, 0.25);
  background: var(--surface);
  white-space: nowrap;
}

.tag-gold {
  background: var(--gold-soft);
  border-color: var(--gold);
  color: #7c4e08;
}

.tag-teal {
  background: var(--teal-soft);
  border-color: var(--teal);
  color: #0e4a3c;
}

.tag-red {
  background: var(--red-soft);
  border-color: var(--red);
  color: #8f1d12;
}

.tag-ink {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--card-black-text);
}

.dot-offline {
  color: var(--ink-faint);
  font-size: 11px;
}

/* Settings Pills */
.setting-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.setting-block + .setting-block {
  margin-top: 14px;
}

.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1.5px solid rgba(28, 25, 23, 0.28);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.12s ease;
}

.chip.active {
  background: var(--ink);
  color: var(--card-black-text);
  border-color: var(--ink);
}

.chip:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Round Status Strip */
.round-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
}

.timer-pill {
  font-family: var(--font-mono);
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg-warm);
  border: 1.5px solid var(--ink);
  font-size: 13px;
}

.timer-pill.urgent {
  background: var(--red);
  color: #fff;
  animation: pulseUrgent 0.9s ease-in-out infinite;
}

@keyframes pulseUrgent {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Signature Black-Face Trivia Card */
.trivia-card {
  position: relative;
  background: var(--card-black);
  color: var(--card-black-text);
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 5px 0 rgba(28, 25, 23, 0.25);
  padding: 24px 20px;
  text-align: center;
  overflow: hidden;
}

.trivia-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(250, 245, 234, 0.18);
  border-radius: 10px;
  pointer-events: none;
}

.trivia-top-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.trivia-stars {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 0.24em;
}

.trivia-region-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  background: rgba(217, 147, 38, 0.16);
  color: #f9db97;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.trivia-kicker {
  font-size: 12px;
  letter-spacing: 0.12em;
  color: rgba(250, 245, 234, 0.65);
  text-transform: uppercase;
}

.trivia-term {
  margin: 12px 0 6px;
  font-size: 28px;
  line-height: 1.28;
  font-weight: 900;
  letter-spacing: 0.04em;
  word-break: break-word;
}

.trivia-subterm {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #f3d79b;
  word-break: break-word;
}

.answer-subterm {
  font-family: var(--font-mono);
  font-size: 0.72em;
  font-weight: 700;
  color: var(--ink-soft);
}

.trivia-footer {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(250, 245, 234, 0.6);
}

/* Anti-Peek 3D Flip Secret Card */
.secret-scene {
  perspective: 1100px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.secret-card {
  position: relative;
  width: 100%;
  min-height: 230px;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}

.secret-card.is-flipped {
  transform: rotateY(180deg);
}

.secret-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.secret-front {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(28, 25, 23, 0.03),
      rgba(28, 25, 23, 0.03) 8px,
      transparent 8px,
      transparent 16px
    ),
    var(--bg-warm);
  align-items: center;
  text-align: center;
  gap: 10px;
}

.secret-lock-seal {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  box-shadow: 3px 3px 0 var(--ink);
}

/* Unified Ivory Back Face for BOTH Realupper & Bluffer to prevent reflection peeking */
.secret-back {
  transform: rotateY(180deg);
  background: var(--surface);
  justify-content: space-between;
  gap: 12px;
}

.secret-card.is-flipped .secret-back {
  position: relative;
}

.secret-card.is-flipped .secret-front {
  position: absolute;
}

.secret-role-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed rgba(28, 25, 23, 0.2);
}

.secret-role-title {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.secret-body {
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink);
}

.secret-tip {
  font-size: 12px;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 8px;
  border-top: 1px solid rgba(28, 25, 23, 0.1);
}

/* Reveal Outcome Banner */
.outcome-banner {
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-align: center;
}

.outcome-banner.thinker-win {
  background: var(--teal-soft);
}

.outcome-banner.bluffer-win {
  background: var(--red-soft);
}

.outcome-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.outcome-desc {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
}

/* Ivory Answer Reveal Card */
.answer-card {
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.answer-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--teal);
  margin-bottom: 6px;
}

.answer-term {
  font-size: 20px;
  font-weight: 900;
  margin: 0 0 10px;
}

.answer-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.75;
  color: var(--ink);
}

/* Score Delta List */
.delta-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.delta-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-muted);
  border-radius: 10px;
  border: 1.5px solid rgba(28, 25, 23, 0.15);
}

.delta-score {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 16px;
  color: var(--teal);
  padding: 2px 9px;
  background: var(--teal-soft);
  border-radius: 7px;
  border: 1px solid var(--teal);
}

/* Podium / Game Over */
.crown-hero {
  background: var(--card-black);
  color: var(--card-black-text);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 20px;
  text-align: center;
}

.crown-kicker {
  color: var(--gold);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.crown-names {
  margin: 10px 0 6px;
  font-size: 30px;
  font-weight: 900;
}

.awards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.award-card {
  background: var(--surface);
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  box-shadow: 2px 2px 0 var(--ink);
  padding: 12px;
}

.award-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--red);
}

.award-winner {
  font-size: 16px;
  font-weight: 900;
  margin: 4px 0 2px;
}

.award-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

/* History Accordion */
.history-item {
  padding: 12px;
  background: var(--surface-muted);
  border-radius: 10px;
  border: 1px solid rgba(28, 25, 23, 0.15);
}

.history-item + .history-item {
  margin-top: 8px;
}

/* Notice & Toast */
.notice-bar {
  padding: 10px 13px;
  border-radius: 10px;
  background: var(--gold-soft);
  border: 1.5px solid var(--gold);
  font-size: 13px;
  font-weight: 600;
}

.toast-container {
  position: fixed;
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  width: min(460px, calc(100vw - 32px));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--ink);
  color: var(--card-black-text);
  padding: 11px 16px;
  border-radius: 10px;
  border: 1.5px solid rgba(250, 245, 234, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  animation: toastIn 0.2s ease;
}

.toast.is-error {
  background: var(--red);
  color: #fff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(28, 25, 23, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 12px;
}

@media (min-width: 560px) {
  .modal-backdrop {
    align-items: center;
  }
}

.modal-sheet {
  width: min(520px, 100%);
  max-height: 88dvh;
  overflow-y: auto;
  background: var(--surface);
  border: var(--border);
  border-radius: 16px;
  box-shadow: 6px 6px 0 var(--ink);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed rgba(28, 25, 23, 0.18);
}

.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}

.custom-q-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface-muted);
  border-radius: 10px;
  border: 1px solid rgba(28, 25, 23, 0.16);
}

.custom-q-item + .custom-q-item {
  margin-top: 8px;
}

.custom-q-term {
  font-weight: 800;
  font-size: 14px;
}

.custom-q-ans {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 3px;
}

.conn-banner {
  padding: 8px 12px;
  border-radius: 9px;
  background: var(--red-soft);
  border: 1.5px solid var(--red);
  color: var(--red-dark);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.hidden {
  display: none !important;
}

@media (max-width: 400px) {
  .invite-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .awards-grid {
    grid-template-columns: 1fr;
  }
  .trivia-term {
    font-size: 24px;
  }
}
