/* ============================================================
   Dev Happens — Styles
   ============================================================ */

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

:root {
  --bg: #0f172a;
  --bg-card: #1e1e2e;
  --bg-card-hover: #262640;
  --bg-input: #151525;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --accent2: #ec4899;
  --green: #10b981;
  --amber: #fbbf24;
  --orange: #f97316;
  --red: #ef4444;
  --text: #e2e8f0;
  --text-dim: #64748b;
  --text-bright: #ffffff;
  --border: #2d2d4a;
  --radius: 12px;
  --radius-sm: 8px;
}

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  background-image:
    linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app { min-height: 100vh; display: flex; flex-direction: column; }

/* --- Header --- */
header {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header-inner { max-width: 1000px; margin: 0 auto; padding: 0.65rem 1.5rem; display: flex; align-items: center; }
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.1rem; letter-spacing: 1px; }
.logo-icon { font-family: 'Courier New', monospace; color: var(--accent); font-size: 1.2rem; }
.accent { color: var(--accent); }
.text-dim { color: var(--text-dim); }
.text-win { color: var(--green); }

/* --- Buttons --- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.6rem 1.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; text-decoration: none; }
.btn:hover { background: var(--bg-card-hover); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background: #5558e6; box-shadow: 0 0 20px var(--accent-glow); }
.btn-lg { padding: 0.8rem 2rem; font-size: 1rem; border-radius: var(--radius); }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* --- Cards & Forms --- */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.4rem; font-size: 0.8rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input { width: 100%; padding: 0.7rem 1rem; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 1rem; transition: border-color 0.2s; outline: none; }
.form-group input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

main { flex: 1; max-width: 1000px; width: 100%; margin: 0 auto; padding: 1.5rem; }
.page-center { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 100px); }
.auth-card { width: 100%; max-width: 400px; }

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-page { max-width: 700px; margin: 0 auto; }
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero-terminal { font-family: 'Courier New', monospace; font-size: 0.85rem; color: var(--accent); margin-bottom: 0.75rem; letter-spacing: 2px; }
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.75rem; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1rem; color: var(--text-dim); max-width: 480px; margin: 0 auto; line-height: 1.5; }
.home-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.5rem; }
.home-card h2 { font-size: 1.15rem; margin-bottom: 0.3rem; }
.home-card p { font-size: 0.85rem; margin-bottom: 1rem; }
.how-to-play { margin-top: 1.5rem; }
.how-to-play h2 { font-size: 1.15rem; margin-bottom: 1rem; }
.rules-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.rule-item { display: flex; gap: 0.75rem; align-items: flex-start; }
.rule-num { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: white; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.8rem; flex-shrink: 0; }
.rule-item div:last-child { font-size: 0.85rem; line-height: 1.4; }

/* ============================================================
   LOBBY
   ============================================================ */
.lobby-page { max-width: 500px; margin: 0 auto; }
.lobby-card { text-align: center; }
.lobby-header h1 { font-size: 1.5rem; margin-bottom: 1rem; }
.room-code-big { font-size: 3rem; font-weight: 800; letter-spacing: 8px; color: var(--accent); font-family: 'Courier New', monospace; }
.qr-container { margin: 1rem auto; }
.player-list { display: flex; flex-direction: column; gap: 0.5rem; }
.player-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 1rem; background: var(--bg-input); border-radius: var(--radius-sm); }
.player-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: white; flex-shrink: 0; }
.player-name { font-weight: 600; flex: 1; text-align: left; }
.badge-you, .badge-host { font-size: 0.65rem; padding: 0.15rem 0.5rem; border-radius: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.badge-you { background: rgba(99, 102, 241, 0.15); color: var(--accent); border: 1px solid rgba(99, 102, 241, 0.3); }
.badge-host { background: rgba(251, 191, 36, 0.15); color: var(--amber); border: 1px solid rgba(251, 191, 36, 0.3); }
/* --- Settings Panel --- */
.settings-panel {
  margin-top: 1.5rem; text-align: left;
  background: var(--bg-input); border-radius: var(--radius);
  padding: 1rem 1.25rem; border: 1px solid var(--border);
}
.settings-panel h3 { font-size: 0.9rem; }
.settings-grid { display: flex; flex-direction: column; gap: 0.6rem; }
.setting-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(45, 45, 74, 0.3);
}
.setting-item:last-child { border-bottom: none; padding-bottom: 0; }
.setting-icon { font-size: 1.3rem; flex-shrink: 0; width: 32px; text-align: center; }
.setting-info { flex: 1; }
.setting-label { font-weight: 600; font-size: 0.85rem; }
.setting-desc { font-size: 0.7rem; color: var(--text-dim); margin-top: 0.1rem; }
.setting-control {
  display: flex; align-items: center; gap: 0.4rem; flex-shrink: 0;
}
.setting-btn {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 1rem; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.setting-btn:hover { border-color: var(--accent); background: var(--bg-card-hover); }
.setting-btn:active { transform: scale(0.92); }
.setting-value {
  font-weight: 800; font-size: 1rem; min-width: 36px; text-align: center;
  color: var(--accent);
}
.setting-value-ro {
  font-weight: 700; font-size: 0.95rem; color: var(--accent);
  flex-shrink: 0; min-width: 36px; text-align: center;
}

.lobby-actions { margin-top: 1.5rem; display: flex; flex-direction: column; align-items: center; }

/* ============================================================
   GAME PAGE
   ============================================================ */
.game-page { display: flex; flex-direction: column; min-height: calc(100vh - 100px); padding: 0; }

/* --- STATUS BANNER — the big "what's happening" indicator --- */
.status-banner {
  display: flex; align-items: center; gap: 1rem;
  padding: 0.75rem 1.25rem; border-radius: var(--radius);
  margin-bottom: 0.5rem;
}
.banner-your-turn {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.15), rgba(249, 115, 22, 0.1));
  border: 2px solid rgba(251, 191, 36, 0.4);
  animation: bannerPulse 2s ease-in-out infinite;
}
.banner-watching {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
@keyframes bannerPulse {
  0%, 100% { border-color: rgba(251, 191, 36, 0.4); }
  50% { border-color: rgba(251, 191, 36, 0.7); }
}
.banner-icon { font-size: 1.5rem; flex-shrink: 0; }
.banner-text { flex: 1; }
.banner-title { font-weight: 700; font-size: 1rem; color: var(--text-bright); }
.banner-your-turn .banner-title { color: var(--amber); }
.banner-sub { font-size: 0.8rem; color: var(--text-dim); margin-top: 0.15rem; }
.banner-timer { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; flex-shrink: 0; }
.timer-circle {
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(251, 191, 36, 0.1); border: 3px solid var(--amber);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.95rem; color: var(--amber);
  transition: all 0.3s;
}
.timer-warn {
  border-color: var(--orange) !important;
  color: var(--orange) !important;
  background: rgba(249, 115, 22, 0.12) !important;
  animation: timerWarnPulse 1s ease-in-out infinite;
}
.timer-critical {
  border-color: var(--red) !important;
  color: var(--red) !important;
  background: rgba(239, 68, 68, 0.15) !important;
  animation: timerCritPulse 0.5s ease-in-out infinite;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.3);
}
@keyframes timerWarnPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}
@keyframes timerCritPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 8px rgba(239, 68, 68, 0.2); }
  50% { transform: scale(1.1); box-shadow: 0 0 20px rgba(239, 68, 68, 0.4); }
}

/* --- Top bar --- */
.game-topbar { display: flex; justify-content: space-between; align-items: center; padding: 0.25rem 0; gap: 0.75rem; font-size: 0.8rem; }

/* --- Player Seats --- */
.player-seats { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; padding: 0.5rem 0; }
.seat {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.4rem 0.6rem; border-radius: var(--radius-sm);
  border: 2px solid transparent; min-width: 65px;
  position: relative; transition: all 0.3s;
}
.seat-avatar { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.9rem; color: white; transition: box-shadow 0.3s; }
.seat-name { font-size: 0.65rem; font-weight: 600; max-width: 75px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-cards { font-size: 0.75rem; font-weight: 700; }

.seat-active { border-color: rgba(99, 102, 241, 0.3); background: rgba(99, 102, 241, 0.05); }
.seat-active .seat-avatar { box-shadow: 0 0 10px rgba(99, 102, 241, 0.3); }

.seat-placing {
  border-color: rgba(251, 191, 36, 0.5);
  background: rgba(251, 191, 36, 0.08);
  animation: seatPulse 1.5s ease-in-out infinite;
}
.seat-placing .seat-avatar { box-shadow: 0 0 14px rgba(251, 191, 36, 0.5); }
@keyframes seatPulse { 0%, 100% { border-color: rgba(251, 191, 36, 0.5); } 50% { border-color: rgba(251, 191, 36, 0.2); } }

.seat-me { background: rgba(99, 102, 241, 0.04); }
.seat-disconnected { opacity: 0.3; }

.seat-badge {
  position: absolute; top: -6px;
  font-size: 0.5rem; padding: 0.1rem 0.35rem;
  border-radius: 6px; font-weight: 700; letter-spacing: 0.5px;
}
.seat-badge-placing { background: var(--amber); color: #1a1a2e; animation: labelPulse 1s ease-in-out infinite; }
.seat-badge-drew { background: var(--accent); color: white; }
.seat-badge-dc { background: var(--red); color: white; }
@keyframes labelPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }

/* --- Center Card --- */
.table-center { display: flex; justify-content: center; align-items: center; padding: 1rem 0; min-height: 180px; }

.drawn-card {
  background: #1e1e24; border: 1px solid #3a3a50;
  border-radius: 14px; padding: 1.25rem;
  width: 300px; max-width: 92vw;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.drawn-card.floating { animation: cardFloat 3s ease-in-out infinite; }
.drawn-card.card-highlight {
  border-color: var(--amber);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.2), 0 8px 32px rgba(0, 0, 0, 0.4);
}

@keyframes cardFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.card-decoration { font-family: 'Courier New', monospace; font-size: 0.55rem; color: rgba(255, 255, 255, 0.07); position: absolute; bottom: 8px; right: 12px; }
.card-prompt { font-family: 'Courier New', monospace; font-size: 0.7rem; color: var(--accent); margin-bottom: 0.4rem; opacity: 0.5; }
.card-text { font-size: 0.95rem; line-height: 1.5; color: var(--text); margin-bottom: 0.75rem; }

.card-severity-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.75rem; border-radius: 20px; font-weight: 700; font-size: 0.9rem; }
.severity-hidden { background: rgba(100, 116, 139, 0.15); color: var(--text-dim); font-size: 1.1rem; }
.sev-label { font-size: 0.7rem; font-weight: 600; opacity: 0.7; }

.card-sev-bar { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 14px 14px; transition: width 0.5s; }

.card-flipping { animation: cardFlip 0.6s ease; }
@keyframes cardFlip { 0% { transform: rotateY(0deg) scale(1); } 50% { transform: rotateY(90deg) scale(0.95); } 100% { transform: rotateY(0deg) scale(1); } }
.card-revealed { animation: cardRevealPop 0.4s ease; }
@keyframes cardRevealPop { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }

.deck-stack { display: flex; flex-direction: column; align-items: center; position: relative; }
.deck-card { width: 60px; height: 85px; background: linear-gradient(135deg, #2a2a40, #1e1e30); border: 1px solid #3a3a50; border-radius: 8px; position: absolute; }
.deck-card:nth-child(1) { top: -4px; left: -2px; }
.deck-card:nth-child(2) { top: -2px; left: -1px; }
.deck-card:nth-child(3) { top: 0; left: 0; position: relative; }

/* --- Timer --- */
.timer-bar { height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; width: 48px; }
.timer-bar-fill { height: 100%; background: var(--amber); border-radius: 2px; transition: width 1s linear; }
.timer-bar-fill.warning { background: var(--orange); }
.timer-bar-fill.urgent { background: var(--red); }

/* --- Activity Log --- */
.game-log-section { padding: 0.25rem 0; }
.game-log { display: flex; flex-direction: column; gap: 0.2rem; }
.log-entry {
  font-size: 0.75rem; padding: 0.3rem 0.6rem;
  border-radius: 6px; background: rgba(30, 30, 46, 0.5);
  color: var(--text-dim); border-left: 3px solid var(--border);
}
.log-turn { border-left-color: var(--accent); color: var(--text); }
.log-correct { border-left-color: var(--green); color: var(--green); }
.log-wrong { border-left-color: var(--red); color: var(--red); }
.log-pass { border-left-color: var(--orange); color: var(--orange); }
.log-info { border-left-color: var(--text-dim); }

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline-section {
  margin-top: auto; padding: 0.75rem 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
  position: relative;
}
.timeline-section.interactive {
  border-color: rgba(251, 191, 36, 0.4);
  background: linear-gradient(to top, rgba(251, 191, 36, 0.06), rgba(15, 23, 42, 0.7));
}
.timeline-title { font-size: 0.8rem; font-weight: 700; padding: 0 1rem; margin-bottom: 0.5rem; }
.timeline-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 0 0.5rem 0.5rem; }
.timeline-row { display: flex; align-items: stretch; gap: 0; min-width: min-content; padding-bottom: 0.25rem; }

/* Timeline cards */
.tl-card { flex-shrink: 0; width: 120px; }
.tl-card-inner {
  background: #1e1e24; border: 1px solid #3a3a50; border-radius: 10px;
  padding: 0.5rem; height: 100%; min-height: 72px;
  display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.tl-severity {
  font-size: 0.8rem; font-weight: 800;
  padding: 0.15rem 0.45rem; border-radius: 8px;
  display: inline-block; margin-bottom: 0.25rem; align-self: flex-start;
}
.tl-text {
  font-size: 0.55rem; line-height: 1.25; color: var(--text-dim);
  flex: 1; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.tl-bar { position: absolute; bottom: 0; left: 0; height: 3px; border-radius: 0 0 10px 10px; }

/* Placement slots */
.tl-slot {
  flex-shrink: 0; width: 56px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0 3px;
  -webkit-tap-highlight-color: transparent;
}
.tl-slot-inner {
  width: 100%; height: 100%; min-height: 72px;
  border: 2px dashed rgba(251, 191, 36, 0.35); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.2rem;
  transition: all 0.2s; animation: slotPulse 2.5s ease-in-out infinite;
}
@keyframes slotPulse {
  0%, 100% { border-color: rgba(251, 191, 36, 0.25); background: transparent; }
  50% { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.03); }
}
.tl-slot-icon { font-size: 1rem; font-weight: 700; color: var(--amber); opacity: 0.6; }
.tl-slot-hint {
  font-size: 0.5rem; font-weight: 600; color: var(--text-dim);
  white-space: nowrap; opacity: 0.7;
}

/* Hover / active */
.tl-slot:hover .tl-slot-inner, .tl-slot:active .tl-slot-inner {
  border-color: var(--amber); background: rgba(251, 191, 36, 0.1);
  transform: scale(1.04);
}
.tl-slot:hover .tl-slot-hint, .tl-slot:active .tl-slot-hint { color: var(--amber); opacity: 1; }

/* Selected slot (tap-to-confirm) */
.tl-slot-selected .tl-slot-inner {
  border-color: var(--amber) !important;
  border-style: solid !important;
  background: rgba(251, 191, 36, 0.15) !important;
  transform: scale(1.06);
  animation: none;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.2);
}
.tl-slot-selected .tl-slot-icon { opacity: 1; font-size: 1.2rem; }
.tl-slot-selected .tl-slot-hint { color: var(--amber); opacity: 1; }

.tl-slot-disabled { pointer-events: none; opacity: 0.2; }

/* Confirm button */
.slot-confirm {
  position: absolute; bottom: 100%; left: 50%;
  transform: translateX(-50%) translateY(20px);
  opacity: 0; pointer-events: none;
  transition: all 0.2s ease;
  z-index: 10; padding-bottom: 0.5rem;
}
.slot-confirm.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1; pointer-events: auto;
}
.slot-confirm .btn {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
  animation: confirmPop 0.3s ease;
}
@keyframes confirmPop { 0% { transform: scale(0.9); } 100% { transform: scale(1); } }

/* ============================================================
   GAME OVER
   ============================================================ */
.gameover-page { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 100px); }
.gameover-card { max-width: 500px; width: 100%; text-align: center; position: relative; overflow: hidden; }
.gameover-icon { font-size: 4rem; margin-bottom: 0.5rem; }
.gameover-card h1 { font-size: 2rem; font-weight: 800; }

.rankings-table { width: 100%; border-collapse: collapse; margin-top: 0.5rem; }
.rankings-table th { text-align: left; padding: 0.5rem 0.6rem; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); border-bottom: 1px solid var(--border); }
.rankings-table td { padding: 0.5rem 0.6rem; border-bottom: 1px solid rgba(45, 45, 74, 0.4); font-size: 0.85rem; }
.rank-me td { background: rgba(99, 102, 241, 0.08); }
.rank-dc td { opacity: 0.4; }
.lb-user { display: flex; align-items: center; gap: 0.5rem; }
.lb-avatar { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.6rem; color: white; flex-shrink: 0; }

.confetti { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -10px; width: 8px; height: 8px; border-radius: 2px; animation: confettiFall linear forwards; }
@keyframes confettiFall { 0% { transform: translateY(-10px) rotate(0deg); opacity: 1; } 100% { transform: translateY(400px) rotate(720deg); opacity: 0; } }

/* --- Flash & Toast --- */
.reveal-flash { position: fixed; inset: 0; pointer-events: none; z-index: 1000; animation: flashFade 0.6s ease forwards; }
.flash-correct { background: rgba(16, 185, 129, 0.12); }
.flash-wrong { background: rgba(239, 68, 68, 0.12); }
@keyframes flashFade { 0% { opacity: 1; } 100% { opacity: 0; } }

.toast {
  position: fixed; bottom: 1.5rem; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 0.7rem 1.25rem;
  font-size: 0.85rem; font-weight: 600; z-index: 1000;
  transition: transform 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast-success { border-color: var(--green); color: var(--green); }
.toast-error { border-color: var(--red); color: var(--red); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 640px) {
  .header-inner { padding: 0.5rem 0.75rem; }
  .logo { font-size: 0.95rem; }
  main { padding: 0.5rem; }

  .hero { padding: 1.5rem 0 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .home-grid { grid-template-columns: 1fr; }
  .rules-grid { grid-template-columns: 1fr; }
  .room-code-big { font-size: 2.2rem; letter-spacing: 6px; }

  .game-page { min-height: calc(100vh - 80px); }

  .status-banner { padding: 0.5rem 0.75rem; gap: 0.6rem; border-radius: 8px; margin-bottom: 0.25rem; }
  .banner-icon { font-size: 1.1rem; }
  .banner-title { font-size: 0.85rem; }
  .banner-sub { font-size: 0.7rem; }
  .timer-circle { width: 42px; height: 42px; font-size: 0.85rem; }

  .game-topbar { padding: 0.15rem 0; font-size: 0.75rem; }

  .player-seats { gap: 0.3rem; padding: 0.4rem 0; }
  .seat { min-width: 50px; padding: 0.3rem 0.35rem; }
  .seat-avatar { width: 28px; height: 28px; font-size: 0.75rem; }
  .seat-name { font-size: 0.5rem; max-width: 52px; }
  .seat-cards { font-size: 0.65rem; }
  .seat-badge { font-size: 0.45rem; }

  .table-center { padding: 0.75rem 0; min-height: 140px; }
  .drawn-card { width: 100%; max-width: 300px; padding: 0.85rem; }
  .card-prompt { font-size: 0.65rem; margin-bottom: 0.3rem; }
  .card-text { font-size: 0.8rem; line-height: 1.4; margin-bottom: 0.5rem; }
  .card-severity-badge { font-size: 0.8rem; padding: 0.2rem 0.6rem; }

  .game-log-section { padding: 0.15rem 0; }
  .log-entry { font-size: 0.65rem; padding: 0.2rem 0.5rem; }

  .timeline-section { padding: 0.5rem 0; }
  .timeline-title { font-size: 0.75rem; padding: 0 0.75rem; margin-bottom: 0.4rem; }
  .tl-card { width: 100px; }
  .tl-card-inner { padding: 0.4rem; min-height: 62px; }
  .tl-severity { font-size: 0.7rem; padding: 0.1rem 0.35rem; margin-bottom: 0.15rem; }
  .tl-text { font-size: 0.5rem; -webkit-line-clamp: 2; }

  .tl-slot { width: 50px; }
  .tl-slot-inner { min-height: 62px; }
  .tl-slot-icon { font-size: 0.9rem; }
  .tl-slot-hint { font-size: 0.45rem; }

  .gameover-card h1 { font-size: 1.5rem; }
  .gameover-icon { font-size: 3rem; }

  .settings-panel { padding: 0.75rem 1rem; }
  .setting-icon { font-size: 1.1rem; width: 28px; }
  .setting-label { font-size: 0.8rem; }
}

@media (max-width: 380px) {
  .status-banner { padding: 0.4rem 0.6rem; gap: 0.5rem; }
  .banner-title { font-size: 0.8rem; }
  .timer-circle { width: 38px; height: 38px; font-size: 0.8rem; }

  .seat { min-width: 44px; padding: 0.25rem 0.3rem; }
  .seat-avatar { width: 24px; height: 24px; font-size: 0.65rem; }
  .seat-name { font-size: 0.45rem; max-width: 44px; }

  .drawn-card { padding: 0.75rem; }
  .card-text { font-size: 0.75rem; }

  .tl-card { width: 88px; }
  .tl-card-inner { min-height: 56px; }
  .tl-slot { width: 44px; }
  .tl-slot-inner { min-height: 56px; }
}
