/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
  --bg-primary: #0a0a0a;
  --bg-secondary: #111111;
  --bg-tertiary: #1a1a1a;
  --text-primary: #e5e5e5;
  --text-secondary: #888888;
  --text-muted: #555555;
  --border-color: #e5e5e5;
  --border-dim: #333333;

  --suit-red: #dc3545;
  --suit-black: #1a1a1a;
  --card-bg: #f8f8f8;

  --accent-gold: #d4af37;
  --accent-green: #28a745;
  --accent-red: #dc3545;

  --token-color: #d4af37;
}

/* ========================================
   BASE STYLES
   ======================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  cursor: crosshair;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background: var(--text-primary);
  color: var(--bg-primary);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

input {
  font-family: inherit;
}

/* ========================================
   SCREEN MANAGEMENT
   ======================================== */
.screen {
  display: none;
  min-height: 100vh;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ========================================
   ANIMATIONS
   ======================================== */
.fade-in {
  animation: fadeIn 1.2s ease-out forwards;
  opacity: 0;
  transform: translateY(10px);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* Card animations */
@keyframes cardDeal {
  from {
    opacity: 0;
    transform: translateY(-50px) rotate(-10deg) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0) scale(1);
  }
}

@keyframes cardPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes cardGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
  50% { box-shadow: 0 0 20px 5px rgba(212, 175, 55, 0.4); }
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px) rotate(-2deg); }
  75% { transform: translateX(5px) rotate(2deg); }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes bounceIn {
  0% { transform: scale(0); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

.card-deal {
  animation: cardDeal 0.4s ease-out forwards;
}

.card-pop {
  animation: cardPop 0.3s ease-out;
}

.card-glow {
  animation: cardGlow 1.5s ease-in-out infinite;
}

.card-shake {
  animation: cardShake 0.4s ease-out;
}

.slide-up {
  animation: slideUp 0.3s ease-out forwards;
}

.bounce-in {
  animation: bounceIn 0.4s ease-out forwards;
}

/* Flying Card Animation */
.flying-card {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  transition: left 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              top 0.5s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.2s ease-out,
              box-shadow 0.3s ease;
  transform-origin: center center;
  width: 60px;
  height: 84px;
}

.flying-card.fast {
  transition: left 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              top 0.3s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.2s ease-out,
              box-shadow 0.3s ease;
}

.flying-card.slow {
  transition: left 0.7s cubic-bezier(0.23, 1, 0.32, 1),
              top 0.7s cubic-bezier(0.23, 1, 0.32, 1),
              transform 0.2s ease-out,
              box-shadow 0.3s ease;
}

.flying-card.flying {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.flying-card.arriving {
  animation: cardArrive 0.2s ease-out;
}

@keyframes cardArrive {
  0% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Deck draw animation */
@keyframes deckDraw {
  0% { transform: translateY(0) rotateY(180deg); }
  50% { transform: translateY(-20px) rotateY(90deg); }
  100% { transform: translateY(0) rotateY(0deg); }
}

.deck-drawing {
  animation: deckDraw 0.4s ease-out;
}

/* Card rejection effect */
@keyframes cardReject {
  0% { transform: scale(1); }
  25% { transform: scale(0.95) rotate(-5deg); background: rgba(220, 53, 69, 0.2); }
  50% { transform: scale(1.05) rotate(3deg); }
  75% { transform: scale(0.98) rotate(-2deg); }
  100% { transform: scale(1) rotate(0deg); }
}

.card-rejected {
  animation: cardReject 0.5s ease-out;
}

/* Market refill pulse */
@keyframes marketRefill {
  0% { opacity: 0; transform: translateY(-10px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.market-refill {
  animation: marketRefill 0.4s ease-out;
}

/* ========================================
   LANDING PAGE
   ======================================== */
#landing {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.landing-container {
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.landing-header h1 {
  font-size: 4rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.landing-header .tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  font-style: italic;
}

.landing-content {
  margin-top: 3rem;
}

.intro-text {
  font-size: 1.5rem;
  margin-bottom: 2rem;
}

.game-hooks {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2rem;
  letter-spacing: 0.02em;
}

.game-description {
  max-width: 450px;
  margin: 0 auto 2.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.landing-ctas {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
}

.landing-footer {
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-link {
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--text-primary);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 2rem;
  font-size: 1rem;
  transition: all 0.2s ease;
  text-transform: lowercase;
}

.btn:hover:not(:disabled) {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.btn-primary:hover:not(:disabled) {
  background: transparent;
  color: var(--text-primary);
}

.btn-secondary {
  background: transparent;
}

.btn-large {
  padding: 1rem 3rem;
  font-size: 1.1rem;
}

.btn-text {
  border: none;
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
}

.btn-text:hover {
  background: transparent;
  color: var(--text-primary);
}

.btn-action {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn-leave {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}

.btn-leave:hover {
  border-color: var(--accent-red);
  color: var(--accent-red);
}

.copy-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-secondary);
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  transition: all 0.2s ease;
}

.copy-btn:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* ========================================
   LOBBY SCREEN
   ======================================== */
#lobby, #joinLink {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.header .tagline {
  color: var(--text-secondary);
  font-style: italic;
}

.lobby-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 300px;
}

.input-group {
  width: 100%;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.input-group input {
  width: 100%;
  background: transparent;
  border: 2px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.input-group input::placeholder {
  color: var(--text-muted);
}

.lobby-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--text-muted);
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-dim);
}

.join-group {
  display: flex;
  gap: 0.5rem;
}

.join-group input {
  flex: 1;
  background: transparent;
  border: 2px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.2em;
}

.join-group input:focus {
  outline: none;
  border-color: var(--text-primary);
}

.footer {
  position: fixed;
  bottom: 1.5rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========================================
   WAITING ROOM
   ======================================== */
#waiting {
  justify-content: flex-start;
  align-items: center;
  padding: 2rem;
}

.room-code-display {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.5rem;
}

.waiting-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  width: 100%;
  max-width: 400px;
  margin-top: 2rem;
}

.players-list {
  width: 100%;
  text-align: center;
}

.players-list h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  font-weight: 400;
}

.players-list ul {
  list-style: none;
}

.players-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border-dim);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.players-list li:last-child {
  border-bottom: none;
}

.host-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  padding: 0.1rem 0.4rem;
}

.waiting-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.9rem;
}

/* ========================================
   GAME SCREEN
   ======================================== */
#game {
  padding: 1rem;
  gap: 1rem;
  min-height: 100vh;
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-dim);
}

.game-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#turnIndicator {
  font-size: 1.1rem;
}

#turnIndicator.your-turn {
  color: var(--accent-green);
}

.game-header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.token-display {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--token-color);
}

.token-icon {
  font-size: 1rem;
}

#tokenCount {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========================================
   OPPONENTS AREA
   ======================================== */
.opponents-area {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0;
}

.opponent {
  background: var(--bg-secondary);
  border: 2px solid var(--border-dim);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 120px;
  transition: all 0.2s ease;
  cursor: default;
  border-radius: 4px;
}

.opponent.current-turn {
  border-color: var(--accent-green);
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.3);
}

.opponent.fewest {
  border-color: var(--accent-gold);
}

.opponent.self {
  background: var(--bg-tertiary);
  border-style: dashed;
}

.opponent.self .opponent-name {
  color: var(--text-secondary);
}

.opponent.selectable {
  cursor: pointer;
  border-style: dashed;
}

.opponent.selectable:hover {
  border-color: var(--accent-gold);
  background: var(--bg-tertiary);
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.opponent.selectable.fewest:hover {
  box-shadow: 0 8px 20px rgba(212, 175, 55, 0.3);
}

.opponent.waiting {
  animation: pulse 1s ease-in-out infinite;
  border-color: var(--accent-gold);
}

.opponent-name {
  font-size: 1rem;
}

.opponent-cards {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.opponent-tokens {
  font-size: 0.75rem;
  color: var(--token-color);
}

.opponent-offline {
  font-size: 0.7rem;
  color: var(--accent-red);
  text-transform: uppercase;
}

/* ========================================
   TABLE AREA (MARKET + DECK)
   ======================================== */
.table-area {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 3rem;
  padding: 1.5rem 0;
}

.market-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.area-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 400;
}

.market-cards {
  display: flex;
  gap: 0.5rem;
}

.deck-pile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.deck-pile p {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.deck-count {
  font-size: 1.5rem;
  font-weight: 600;
}

/* ========================================
   CARDS
   ======================================== */
.card {
  width: 60px;
  height: 84px;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: 'EB Garamond', Georgia, serif;
  font-weight: 600;
  position: relative;
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  background: var(--card-bg);
  color: var(--suit-black);
  border: 2px solid #ddd;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card.hearts, .card.diamonds {
  color: var(--suit-red);
}

.card.clubs, .card.spades {
  color: var(--suit-black);
}

.card-rank {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 700;
}

.card-suit {
  font-size: 1.3rem;
}

.card.selectable {
  cursor: pointer;
}

.card.selectable:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.card.selected {
  transform: translateY(-15px) scale(1.08);
  box-shadow: 0 0 0 3px var(--accent-gold), 0 15px 30px rgba(212, 175, 55, 0.4);
  z-index: 20;
}

.card.card-back {
  background: linear-gradient(135deg, var(--bg-tertiary) 0%, #252525 100%);
  border: 2px solid var(--border-dim);
  color: var(--text-secondary);
  cursor: pointer;
}

.card.card-back:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card.card-back.selected {
  box-shadow: 0 0 0 3px var(--accent-gold), 0 10px 25px rgba(212, 175, 55, 0.3);
}

.card.card-back .deck-count {
  color: var(--text-secondary);
  font-size: 1.2rem;
}

/* Card in hand gets slight rotation for natural look */
.player-hand .card {
  margin: 0 -8px;
}

.player-hand .card:nth-child(odd) {
  transform: rotate(-1deg);
}

.player-hand .card:nth-child(even) {
  transform: rotate(1deg);
}

.player-hand .card.selectable:hover {
  transform: translateY(-15px) rotate(0deg) scale(1.08);
}

.player-hand .card.selected {
  transform: translateY(-20px) rotate(0deg) scale(1.1);
}

/* ========================================
   ACTIONS AREA
   ======================================== */
.actions-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-dim);
  border-bottom: 1px solid var(--border-dim);
}

.action-hint {
  font-size: 1rem;
  color: var(--accent-gold);
  min-height: 1.5rem;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

.action-hint.hidden {
  visibility: hidden;
}

.action-buttons {
  display: flex;
  justify-content: center;
  gap: 2rem;
}

.action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.action-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-right: 0.5rem;
}

.token-cost {
  color: var(--token-color);
}

/* Mode indicator when card is selected */
.selection-mode {
  position: fixed;
  bottom: 150px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gold);
  color: var(--bg-primary);
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 100;
  animation: bounceIn 0.3s ease-out;
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.4);
}

.selection-mode .cancel-hint {
  font-size: 0.75rem;
  opacity: 0.8;
  margin-left: 0.5rem;
}

/* ========================================
   PLAYER HAND
   ======================================== */
.player-hand-area {
  margin-top: auto;
  padding: 1rem 0;
}

.hand-info {
  text-align: center;
  margin-bottom: 0.5rem;
}

#handCount {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.player-hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ========================================
   TURN TIMER
   ======================================== */
.turn-timer {
  position: fixed;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--accent-green);
  transition: width 0.1s linear, background-color 0.3s ease;
}

.turn-timer.warning {
  background: var(--accent-gold);
}

.turn-timer.critical {
  background: var(--accent-red);
}

.turn-timer.paused {
  background: var(--text-secondary);
  animation: timerPulse 1.5s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* ========================================
   GAME LOG
   ======================================== */
.game-log {
  position: fixed;
  top: 4rem;
  left: 1rem;
  width: 200px;
  max-height: 200px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  font-size: 0.75rem;
}

.game-log-header {
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
}

.game-log-entries {
  padding: 0.5rem;
  max-height: 160px;
  overflow-y: auto;
}

.game-log-entry {
  padding: 0.25rem 0;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-dim);
}

.game-log-entry:last-child {
  border-bottom: none;
}

/* ========================================
   CHAT
   ======================================== */
.chat-container {
  position: fixed;
  top: 4rem;
  right: 1rem;
  width: 250px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  font-size: 0.85rem;
}

.chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-size: 0.75rem;
}

.chat-toggle {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  padding: 0 0.25rem;
}

.chat-messages {
  height: 150px;
  overflow-y: auto;
  padding: 0.5rem;
}

.chat-message {
  margin-bottom: 0.5rem;
}

.chat-message .sender {
  color: var(--text-primary);
}

.chat-message .text {
  color: var(--text-secondary);
}

.chat-input-area {
  display: flex;
  border-top: 1px solid var(--border-dim);
}

.chat-input-area input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 0.5rem;
  font-size: 0.85rem;
}

.chat-input-area input:focus {
  outline: none;
}

.chat-input-area button {
  background: transparent;
  border: none;
  border-left: 1px solid var(--border-dim);
  color: var(--text-secondary);
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.chat-input-area button:hover {
  color: var(--text-primary);
}

.chat-container.collapsed .chat-messages,
.chat-container.collapsed .chat-input-area {
  display: none;
}

/* ========================================
   MODALS
   ======================================== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  padding: 2rem;
  max-width: 400px;
  width: 90%;
  text-align: center;
}

.modal-content h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 1rem;
}

.modal-content p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.target-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.target-btn {
  background: transparent;
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.target-btn:hover {
  border-color: var(--text-primary);
  background: var(--text-primary);
  color: var(--bg-primary);
}

.reaction-options,
.confirm-options {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.reaction-card-display {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

.reaction-timer {
  height: 4px;
  background: var(--border-dim);
  margin-bottom: 1rem;
}

.reaction-timer-bar {
  height: 100%;
  background: var(--accent-gold);
  transition: width 0.1s linear;
}

.card-select-hand {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.bottom-market-cards {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
}

/* ========================================
   ROUND END SCREEN
   ======================================== */
#roundEnd {
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.round-end-content {
  text-align: center;
  max-width: 500px;
  width: 100%;
}

.round-end-content h1 {
  font-size: 2.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.winner-name {
  font-size: 1.5rem;
  color: var(--accent-gold);
  margin-bottom: 2rem;
}

.scores-container {
  margin-bottom: 2rem;
}

.player-score {
  border: 1px solid var(--border-dim);
  margin-bottom: 1rem;
  padding: 1rem;
}

.player-score.winner {
  border-color: var(--accent-gold);
}

.player-score-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-dim);
}

.player-score-name {
  font-size: 1.1rem;
}

.player-score-total {
  font-size: 1.25rem;
  color: var(--accent-gold);
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
}

.score-row {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.score-row .label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.75rem;
}

.score-row .value {
  color: var(--text-primary);
}

.play-again-section {
  margin-bottom: 1rem;
}

.vote-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ========================================
   TOAST & NOTIFICATION
   ======================================== */
.toast {
  position: fixed;
  top: 1rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-secondary);
  border: 2px solid var(--accent-red);
  color: var(--text-primary);
  padding: 0.75rem 1.5rem;
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 2000;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.notification {
  position: fixed;
  top: 4rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  background: var(--bg-secondary);
  border: 1px solid var(--border-dim);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  z-index: 1500;
}

.notification.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ========================================
   RECONNECT OVERLAY
   ======================================== */
.reconnect-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 10, 0.95);
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.reconnect-overlay.active {
  display: flex;
}

.reconnect-content {
  text-align: center;
}

.reconnect-spinner {
  width: 40px;
  height: 40px;
  border: 2px solid var(--border-dim);
  border-top-color: var(--text-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.reconnect-content h2 {
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.reconnect-content p {
  color: var(--text-secondary);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .landing-header h1 {
    font-size: 2.5rem;
  }

  .table-area {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  .actions-area {
    flex-direction: column;
    gap: 1rem;
  }

  .action-group {
    flex-wrap: wrap;
    justify-content: center;
  }

  .game-log {
    position: static;
    width: 100%;
    max-height: 100px;
    margin-bottom: 1rem;
  }

  .chat-container {
    position: static;
    width: 100%;
    margin-top: 1rem;
  }

  .opponents-area {
    gap: 0.5rem;
  }

  .opponent {
    min-width: 100px;
    padding: 0.5rem 0.75rem;
  }

  .card {
    width: 50px;
    height: 70px;
  }

  .card-rank {
    font-size: 1.1rem;
  }

  .card-suit {
    font-size: 0.9rem;
  }
}
