:root {
  --bg: #f4f4f0; /* Warm gallery plaster off-white */
  --card-bg: #ffffff;
  --text: #111111;
  --muted: #666666;
  --accent: #10a37f;
  --danger: #ae0f2f;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
  -webkit-tap-highlight-color: transparent;
}

body { 
  background: #e5e5e0; /* Outer backdrop for desktop/tablet */
  color: var(--text); 
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Global View Router - Constrained to mobile proportions on big screens */
.game-view {
  width: 100%;
  max-width: 480px; 
  height: 100dvh; 
  display: flex; 
  flex-direction: column; 
  background: var(--bg);
  box-shadow: 0 0 30px rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}

.hidden { display: none !important; }

header { 
  text-align: center; 
  padding: 0.85rem 1rem; 
  border-bottom: 2px solid var(--text); 
  background: var(--card-bg);
  flex-shrink: 0;
}

header h2 {
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

header p {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* The Split Wordmark */
.brand-logo {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

/* Option A: High-Fashion Gallery Serif (Default) */
.logo-art {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-weight: 600;
  text-transform: lowercase; /* Forces "art" even inside an uppercase h2 */
  font-size: 1.15em;         /*Slightly larger to match the cap-height of BULLSH */
  letter-spacing: 0;
  margin-left: 1px;
  color: var(--danger);      /* Optional: Museum-red accent, or keep var(--text) for pure black */
}

/* Persistent Commission Banner */
.commission-banner {
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 0.65rem 1rem;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.35;
  flex-shrink: 0;
}

/* Scrollable Main Containers (Lobby, Briefing, Pitching, Verdict, Game Over) */
.lobby-content,
.briefing-content,
.pitch-content,
#verdict-logs,
#leaderboard {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

.briefing-content,
.pitch-content {
  justify-content: center;
}

/* Lobby Controls */
.auth-box, #lobby-roster {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--card-bg);
  border: 2px solid var(--text);
  padding: 1.5rem;
  box-shadow: 4px 4px 0px var(--text);
  margin: auto 0;
}

/* Updated Lobby Box & Secondary Buttons */
.lobby-box {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background: var(--card-bg);
  border: 2px solid var(--text);
  padding: 1.5rem;
  box-shadow: 4px 4px 0px var(--text);
  margin: auto 0;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
}

/* Avatar Picker */
/* 4x2 Image Avatar Picker with Exclusive Locking */
.avatar-picker {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.avatar-option {
  position: relative;
  padding: 0.25rem;
  background: #fff;
  border: 2px solid #7d7d7d;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.avatar-option img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 1px solid var(--text);
  display: block;
  opacity: 0.8;
}

.avatar-option.selected {
  border-color: var(--text);
  background: var(--bg);
  box-shadow: 3px 3px 0px var(--text);
  transform: translateY(-2px);
}

.avatar-option.selected img {
  opacity: 1;
}

.avatar-option.taken:disabled {
  opacity: 1;
}

/* Greyed-out state when claimed by another player */
.avatar-option.taken {
  cursor: not-allowed;
  pointer-events: none;
  border-style: solid;
  border-color: #bbb;
}

.avatar-option.taken img {
  opacity: 0.35;
  filter: grayscale(100%);
  border-color: #aaa;
}

.avatar-option.taken::after {
  content: "SOLD";
  position: absolute;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 6px;
  letter-spacing: 1px;
  border: 1.5px solid var(--text);
  box-shadow: 2px 2px 0px var(--text);
  transform: rotate(-12deg);
  z-index: 2;
}

.avatar-thumb-sm {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border: 1.5px solid var(--text);
  vertical-align: middle;
  margin-right: 0.5rem;
  background: #fff;
}

.avatar-thumb-lg {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border: 2px solid var(--text);
  box-shadow: 2px 2px 0px var(--text);
  margin-bottom: 0.5rem;
  background: #fff;
}

/* Rules Selector */
.rule-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 600;
}

.rule-row select {
  padding: 0.4rem 0.6rem;
  border: 2px solid var(--text);
  background: #fff;
  font-weight: 700;
}

input[type="text"] {
  width: 100%;
  padding: 0.85rem;
  border: 2px solid var(--text);
  font-size: 1rem;
  background: #fff;
}

button {
  padding: 0.9rem 1.2rem;
  background: var(--text);
  color: #fff;
  border: 2px solid var(--text);
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

button:active:not(:disabled) {
  transform: translateY(2px);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

#roster-list {
  list-style: none;
  margin: 0.5rem 0 1rem 0;
  border-top: 1px solid #ddd;
}

#roster-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
  font-weight: 600;
}

/* The Plaque Aesthetic */
.plaque-card {
  position: relative; /* <-- Makes the outer card the anchor for the stamp */
  background: var(--card-bg); 
  border: 2px solid var(--text); 
  padding: 1.25rem;
  box-shadow: 4px 4px 0px var(--text); 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  user-select: none;
}

.master-plaque {
  padding: 2rem 1.5rem;
}

#plaque-title {
  font-size: 1.5rem;
  font-style: italic;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.plaque-category { 
  font-size: 0.65rem; 
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: 0.15em; 
  color: var(--muted); 
  border-bottom: 1px solid #e0e0e0; 
  padding-bottom: 0.35rem; 
  margin-bottom: 0.5rem; 
}

.plaque-text { 
  font-size: 1.05rem; 
  font-weight: 600; 
  line-height: 1.35;
  color: var(--text); 
}

.mt-4 { margin-top: 1.25rem; }

/* Drafting UI - Fixed for both Touch & Desktop */
.drafting-zone { 
  flex: 1; 
  display: flex; 
  flex-direction: column; 
  justify-content: space-evenly; 
  overflow-y: auto; 
  padding: 0.5rem 0; 
}

.carousel-track { 
  display: flex; 
  overflow-x: auto; 
  scroll-snap-type: x mandatory; 
  gap: 0.85rem; 
  padding: 0.75rem 15%; 
  -webkit-overflow-scrolling: touch;
  min-height: 280px;
}

.track-header {
  margin-left: 0.5rem;
  text-transform: uppercase;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track .plaque-card { 
  flex: 0 0 70%; 
  min-height: 135px;
  scroll-snap-align: center; 
  opacity: 0.45; 
  transform: scale(0.92); 
  transition: transform 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease; 
  cursor: pointer;
}

.carousel-track .plaque-card {
  position: relative; /* <-- Makes the outer card the anchor for the stamp */
  background: var(--card-bg); 
  border: 2px solid var(--text); 
  padding: 1.25rem;
  box-shadow: 4px 4px 0px var(--text); 
  display: flex; 
  flex-direction: column; 
  justify-content: center;
  user-select: none;
  height: 100%;
  box-sizing: border-box;
}

.carousel-track #plaque-title {
  font-size: 1.5rem;
  font-style: italic;
  margin-bottom: 0.5rem;
  line-height: 1.25;
}

.carousel-track .plaque-category { 
  font-size: 0.65rem; 
  font-weight: 700;
  text-transform: uppercase; 
  letter-spacing: 0.15em; 
  color: var(--muted); 
  border-bottom: 1px solid #e0e0e0; 
  padding-bottom: 0.35rem; 
  margin-bottom: 0.5rem; 
  flex-shrink: 0;
  text-align: left;
  width: 100%;
  margin-bottom: 0;
}

.carousel-track .plaque-text { 
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 0;
  font-size: 1.05rem; 
  font-weight: 600; 
  line-height: 1.35;
  color: var(--text); 
}

#view-drafting.curator-mode .track-header,
#view-drafting.curator-mode hr,
#view-drafting.curator-mode .titling-zone {
  display: none;
}

.carousel-track .plaque-card.locked-in { 
  opacity: 1; 
  transform: scale(1); 
  box-shadow: 6px 6px 0px var(--text); 
  border-width: 2px;
}

.titling-zone { 
  display: flex; 
  padding: 0.75rem; 
  gap: 0.5rem; 
  flex-shrink: 0;
}

.titling-zone button {
  width: auto;
  flex-shrink: 0;
}

/* Judgment Grid */
.gallery-grid { 
  flex: 1;
  overflow-y: auto;
  display: grid; 
  grid-template-columns: repeat(2, 1fr); 
  gap: 0.85rem; 
  padding: 1.25rem; 
  align-content: center;
}

.portrait-btn { 
  position: relative; 
  background: var(--card-bg); 
  color: var(--text);
  border: 2px solid var(--text); 
  box-shadow: 3px 3px 0px var(--text);
  padding: 1.25rem 0.75rem; 
  display: flex; 
  flex-direction: column; 
  align-items: center; 
  text-align: center;
  text-transform: none;
  font-weight: 700; 
}

.portrait-btn.selected { 
  transform: scale(0.96); 
  background: #f0f0f0; 
}

.selection-badge { 
  position: absolute; 
  top: -10px; 
  right: -10px; 
  width: 28px; 
  height: 28px; 
  border-radius: 50%; 
  display: none; 
  align-items: center; 
  justify-content: center; 
  font-weight: 800; 
  font-size: 0.9rem;
  border: 2px solid var(--text); 
  color: #fff; 
}

.voting-state-bet .portrait-btn.selected { border-color: var(--accent); box-shadow: 3px 3px 0px var(--accent); }
.voting-state-bet .portrait-btn.selected .bet-badge { display: flex; background: var(--accent); }
.voting-state-suspect .portrait-btn.selected { border-color: var(--danger); box-shadow: 3px 3px 0px var(--danger); }
.voting-state-suspect .portrait-btn.selected .suspect-badge { display: flex; background: var(--danger); }

.pitch-footer, .judgment-footer, .verdict-footer { 
  padding: 1rem; 
  text-align: center; 
  border-top: 2px solid var(--text);
  background: var(--card-bg);
  flex-shrink: 0;
}

.pitch-footer button, .judgment-footer button, .verdict-footer button {
  width: 100%;
}

/* Briefing Specifics */
.role-title { font-size: 1.6rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.75rem; }
.danger-text { color: var(--danger); }
.redacted-box { background: var(--text); color: #f4f4f0; padding: 1.25rem; margin: 1.25rem 0; font-family: monospace; font-size: 1rem; letter-spacing: 1px; }
.commission-display { font-size: 1.3rem; font-style: italic; border-left: 4px solid var(--text); padding: 0.75rem 1rem; margin: 1rem 0; background: var(--card-bg); text-align: left; }

/* ==========================================
   VERDICT SCREEN: THEATRICAL REVEAL
   ========================================== */
.verdict-stage {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.reveal-card {
  opacity: 0;
  transform: translateY(15px);
  animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 2.2s; }
.delay-3 { animation-delay: 4.2s; }

@keyframes slideUpFade {
  to { opacity: 1; transform: translateY(0); }
}

.verdict-spotlight {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}



.verdict-spotlight .avatar-thumb-lg {
  margin-bottom: 0;
  flex-shrink: 0;
}

/* Rubber Stamp Effect */
.verdict-stamp {
  position: absolute;
  top: 20px;
  right: 12px;
  font-size: 0.8rem;
  font-weight: 900;
  padding: 4px 10px;
  letter-spacing: 2px;
  border: 2.5px solid var(--text);
  box-shadow: 2px 2px 0px var(--text);
  color: #fff;
  opacity: 0;
  z-index: 5;
  transform: scale(2.5) rotate(8deg); /* Slight clockwise tilt fits the top-right corner cleanly */
  animation: stampSlam 0.35s cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards;
  animation-delay: 2.8s;
}

@keyframes stampSlam {
  to { opacity: 1; transform: scale(1) rotate(-12deg); }
}

.stamp-exposed { background: var(--danger); }
.stamp-escaped { background: var(--accent); }
.stamp-winner { 
  background: linear-gradient(135deg, #d4af37 0%, #b5891c 100%);
  color: #fff;
  text-shadow: 1px 1px 0px var(--text);
  animation-delay: 0.8s; /* Slams down 0.6s after Beat 1 appears */
}


/* Accusation Finger-Pointing Row */
.vote-breakdown {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed #ccc;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.8rem;
}

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.voter-cluster {
  display: flex;
  align-items: center;
  gap: 4px;
}

.voter-mini-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--text);
}

/* Gallery Ledger (Leaderboard) */
.ledger-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 2px solid var(--text);
  padding: 0.65rem 0.85rem;
  margin-bottom: 0.5rem;
  box-shadow: 3px 3px 0px var(--text);
}

.ledger-player {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ==========================================
   GILDED GRANT WINNER FRAME
   ========================================== */
.gilded-card {
  background: linear-gradient(135deg, #fffdf5 0%, #fef9e7 100%);
  border: 3px solid #d4af37; /* Metallic Gold */
   outline: 1.5px solid var(--text); /* Outer crisp museum line */
  box-shadow: 
    inset 0 0 0 3px #ffffff,
    inset 0 0 0 4px #d4af37,
    5px 5px 0px var(--text);
}

.gilded-card .plaque-category {
  color: #9a7b1c;
  border-bottom-color: #ebd68f;
}

.gilded-card .avatar-thumb-lg {
  border-color: #d4af37;
  box-shadow: 2px 2px 0px #9a7b1c;
}

/* ==========================================
   SPLIT LEDGER TICKETS (PAYOUT PILLS)
   ========================================== */
.payout-pills {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}

.payout-pill {
  display: inline-flex;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid var(--text);
  box-shadow: 2px 2px 0px var(--text);
}

.pill-reason {
  padding: 3px 6px;
  background: #fff;
  color: var(--text);
  border-right: 1px solid var(--text);
}

.pill-amount {
  padding: 3px 6px;
  background: #e6f4ea;
  color: #137333;
}

/* Locks the width of the dollar column so ticking from $0 to $1500 never pushes the left column */
.net-worth-counter {
  font-weight: 900;
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  min-width: 72px;
  text-align: right;
  flex-shrink: 0;
}

/* ==========================================
   MUSEUM WALL LABEL TYPOGRAPHY
   ========================================== */
.museum-label-details {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
}

.museum-artist-name {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.museum-work-line {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 0.45rem;
}

.museum-work-title {
  font-weight: 700;
  font-style: italic;
}

.museum-work-year {
  font-weight: 400;
  font-style: normal;
  font-size: 0.9rem;
  color: var(--muted);
}

.museum-medium,
.museum-subject {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-style: italic;
  font-size: 1.05rem;
  line-height: 1.25;
  color: #333;
}

.museum-subject {
  margin-top: 0.15rem;
  color: #555;
}

/* ==========================================
   PHASE TRANSITION OVERLAY
   ========================================== */
#phase-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(245, 242, 235, 0.95); /* Semi-transparent museum wall color */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: opacity 0.8s ease;
}

#phase-transition.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* ==========================================
   FINAL STANDINGS PODIUM
   ========================================== */
.podium-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.champion-card {
  width: 100%;
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: var(--card-bg);
  border: 2px solid var(--text);
  box-shadow: 6px 6px 0px var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.champion-avatar-wrapper {
  width: 140px;
  height: 140px;
  margin-bottom: 0.5rem;
}

.champion-avatar-wrapper img {
  width: 100%;
  height: 100%;
  border: 3px solid var(--text);
  border-radius: 50%;
  box-shadow: 4px 4px 0px var(--text);
  object-fit: cover;
  background: #fff;
}

.champion-name {
  font-family: 'Playfair Display', serif;
  font-size: 2.2rem;
  font-weight: 900;
  margin-bottom: 1rem;
}

.champion-badge {
  display: inline-block;
  background: linear-gradient(135deg, #d4af37 0%, #b5891c 100%);
  color: #fff;
  font-weight: 900;
  font-size: 1.25rem;
  padding: 0.4rem 1.25rem;
  border: 2px solid var(--text);
  box-shadow: 3px 3px 0px var(--text);
  text-shadow: 1px 1px 0px var(--text);
  margin-top: -0.5rem;
}

/* ==========================================
   HOW TO PLAY / LOADING OVERLAY
   ========================================== */
#btn-how-to-play {
  margin-top: 1rem; 
  width: 100%; 
  background: black; 
  border: 2px solid var(--text);
}

#how-to-play-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(245, 242, 235, 0.95);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.loading-bar-container {
  width: 100%;
  height: 12px;
  background: #e0dcd3;
  border: 2px solid var(--text);
  border-radius: 6px;
  overflow: hidden;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(135deg, #d4af37 0%, #b5891c 100%);
  /* The transition duration handles the 10-second "timer" visually */
  transition: width 10s linear; 
}

.tailhawk-footer {
  text-align: center;
  margin-top: 2rem;
  padding-bottom: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.tailhawk-logo {
  width: 40px;
  height: 40px;
  margin-bottom: 0.5rem;
}

.tailhawk-text {
  font-family: 'Audiowide', system-ui, -apple-system, sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #283038;
  text-transform: uppercase;
}

.tail-text {
  color: #ae0f2f;
}