@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;800&family=Cinzel+Decorative:wght@400;700&display=swap');

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

body {
  background: #0a0608;
  font-family: 'Cinzel', serif;
  overflow-x: hidden;
}

#game-root {
  min-height: 100vh;
  position: relative;
}

/* ── ROOM BACKGROUNDS ── */
.room-bg {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  display: block;
  image-rendering: pixelated;
}

/* ── CARDS ── */
.castle-panel {
  background: linear-gradient(160deg, #1a1018 0%, #100c18 100%);
  border: 2px solid #8b6914;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(180,130,20,0.15), inset 0 1px 0 rgba(255,220,80,0.1);
}

.gold-border { border-color: #c9a227; }
.red-border  { border-color: #8b1a1a; }

/* ── BUTTONS ── */
.btn-gold {
  background: linear-gradient(135deg, #8b6914, #c9a227, #8b6914);
  color: #0a0608;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: none;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  letter-spacing: 0.05em;
  transition: filter 0.2s, transform 0.1s;
  font-size: 0.9rem;
}
.btn-gold:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { filter: grayscale(1) brightness(0.5); cursor: not-allowed; }

.btn-red {
  background: linear-gradient(135deg, #5a0f0f, #8b1a1a, #5a0f0f);
  color: #f0c060;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  border: 1px solid #8b1a1a;
  padding: 10px 24px;
  border-radius: 6px;
  cursor: pointer;
  transition: filter 0.2s, transform 0.1s;
  font-size: 0.9rem;
}
.btn-red:hover { filter: brightness(1.2); transform: translateY(-1px); }
.btn-red:disabled { filter: grayscale(1) brightness(0.5); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: #c9a227;
  font-family: 'Cinzel', serif;
  border: 1px solid #8b6914;
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.85rem;
}
.btn-ghost:hover { background: rgba(200,160,40,0.1); }

/* ── PLAYER TOKENS ── */
.player-token {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #8b6914;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  background: #1a1018;
  flex-shrink: 0;
}
.player-token:hover { transform: scale(1.1); border-color: #c9a227; }
.player-token.selected { border-color: #ff4444; box-shadow: 0 0 16px rgba(255,60,60,0.6); transform: scale(1.1); }
.player-token.eliminated { filter: grayscale(1) brightness(0.4); pointer-events: none; }
.player-token.traitor { border-color: #cc2222; }
.player-token img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.player-token .player-label {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  white-space: nowrap;
  color: #c9a227;
  text-align: center;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── VOTE BADGE ── */
.vote-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ff2222;
  color: white;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: 2px solid #0a0608;
}

/* ── PHASE TITLE ── */
.phase-title {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 1.6rem;
  background: linear-gradient(135deg, #8b6914, #f0d060, #8b6914);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-align: center;
}
.phase-subtitle {
  font-family: 'Cinzel', serif;
  color: #8b6914;
  text-align: center;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* ── SCROLL BOX ── */
.scroll-box {
  background: rgba(0,0,0,0.4);
  border: 1px solid #4a3810;
  border-radius: 8px;
  padding: 12px;
  max-height: 180px;
  overflow-y: auto;
}
.scroll-box::-webkit-scrollbar { width: 6px; }
.scroll-box::-webkit-scrollbar-track { background: #1a1018; }
.scroll-box::-webkit-scrollbar-thumb { background: #8b6914; border-radius: 3px; }

/* ── LOG ENTRY ── */
.log-entry {
  font-size: 0.8rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(138,105,20,0.2);
  color: #c9a060;
  font-family: 'Cinzel', serif;
}
.log-entry.danger { color: #ff8080; }
.log-entry.success { color: #80ff80; }
.log-entry.traitor { color: #ff4444; }
.log-entry.council { color: #cc80ff; }

/* ── CLOCK ── */
#clock-display {
  font-family: 'Cinzel Decorative', cursive;
  font-size: 2.5rem;
  color: #c9a227;
  text-shadow: 0 0 20px rgba(200,160,40,0.5);
}

/* ── ANIMATIONS ── */
@keyframes flicker {
  0%,100% { opacity:1; } 50% { opacity:0.85; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 10px rgba(255,0,0,0.4); }
  50%      { box-shadow: 0 0 30px rgba(255,0,0,0.9); }
}
.flicker { animation: flicker 3s ease-in-out infinite; }
.fade-in { animation: fadeIn 0.5s ease both; }
.pulse-red { animation: pulse-red 1.5s ease infinite; }

/* ── MINI GAME ── */
.mini-game-area {
  background: #0a0608;
  border: 2px solid #8b6914;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}

/* ── MODAL OVERLAY ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-box {
  background: linear-gradient(160deg, #1a1018 0%, #100c18 100%);
  border: 2px solid #8b6914;
  border-radius: 16px;
  padding: 32px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 0 60px rgba(180,130,20,0.3);
  animation: fadeIn 0.3s ease;
}

/* ── TRAITOR COUNCIL MODAL ── */
.council-overlay {
  background: rgba(20,0,20,0.95);
}
.council-box {
  border-color: #8b1a1a;
  box-shadow: 0 0 60px rgba(180,20,20,0.5);
  background: linear-gradient(160deg, #1a0808 0%, #100010 100%);
}

/* ── TEXT INPUTS ── */
.castle-input {
  background: rgba(0,0,0,0.5);
  border: 1px solid #4a3810;
  border-radius: 6px;
  color: #f0d080;
  font-family: 'Cinzel', serif;
  padding: 8px 12px;
  width: 100%;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}
.castle-input:focus { border-color: #c9a227; }

/* ── TAG BADGE ── */
.badge-faithful {
  background: #1a3a1a; border: 1px solid #2d6e2d; color: #6fcf6f;
  padding: 2px 8px; border-radius: 20px; font-size: 0.7rem;
}
.badge-traitor {
  background: #3a1a1a; border: 1px solid #8b1a1a; color: #ff6060;
  padding: 2px 8px; border-radius: 20px; font-size: 0.7rem;
}
.badge-gm {
  background: #1a1a3a; border: 1px solid #3030aa; color: #8080ff;
  padding: 2px 8px; border-radius: 20px; font-size: 0.7rem;
}

/* Progress bar */
.progress-bar {
  height: 12px;
  border-radius: 6px;
  background: #1a1018;
  border: 1px solid #4a3810;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b6914, #c9a227);
  transition: width 0.5s;
}

/* Candlelight ambient */
.ambient-glow {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  border-radius: 12px;
  background: radial-gradient(ellipse at 50% 0%, rgba(180,130,20,0.06) 0%, transparent 70%);
}

/* ── TAB BUTTONS ── */
.tab-btn {
  background: rgba(0,0,0,0.3);
  color: #8b6914;
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  border: 1px solid #4a3810;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.tab-btn:hover { background: rgba(139,105,20,0.15); color: #c9a227; }
.tab-btn.active { background: rgba(139,105,20,0.25); color: #f0d060; border-color: #c9a227; }

/* ── PULSE DOT ── */
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.5; transform: scale(1.4); }
}
.pulse-dot { animation: pulse-dot 1.2s ease infinite; }

/* ── READY TOKEN ── */
.player-token.ready-token { border-color: #2d6e2d; box-shadow: 0 0 8px rgba(80,200,80,0.4); }

/* ── CHAT WIDGET ── */
#chat-widget {
  font-family: 'Cinzel', serif;
}
#chat-panel::-webkit-scrollbar { width: 4px; }
#chat-panel::-webkit-scrollbar-track { background: #1a1018; }
#chat-panel::-webkit-scrollbar-thumb { background: #8b6914; border-radius: 2px; }
#chat-messages::-webkit-scrollbar { width: 4px; }
#chat-messages::-webkit-scrollbar-track { background: transparent; }
#chat-messages::-webkit-scrollbar-thumb { background: #4a3810; border-radius: 2px; }
#chat-input::placeholder { color: #4a3810; font-family: 'Cinzel', serif; }

/* Responsive */
@media (max-width: 640px) {
  .phase-title { font-size: 1.1rem; }
  .player-token { width: 48px; height: 48px; }
  #clock-display { font-size: 1.8rem; }
  .tab-btn { font-size: 0.7rem; padding: 5px 10px; }
  #chat-widget { bottom: 10px; left: 10px; }
}
