* { box-sizing: border-box; }
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 45%, #7c3aed 100%);
  background-attachment: fixed;
  color: #1f2937;
}
.font-game { font-family: 'Baloo 2', cursive; }

/* ---------- Auth screens ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.97);
  border-radius: 24px;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.4);
  padding: 32px;
}
.globe-spin {
  display: inline-block;
  animation: spin 8s linear infinite;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid #e5e7eb;
  font-size: 15px;
  margin-bottom: 12px;
  outline: none;
  transition: border-color 0.15s;
}
.input-field:focus { border-color: #6366f1; }

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 0 6px 14px rgba(99,102,241,0.35);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: white;
  color: #6366f1;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: 12px;
  border: 2px solid #6366f1;
  cursor: pointer;
}

.btn-success {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white; font-weight: 700; padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white; font-weight: 700; padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
}
.btn-warn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white; font-weight: 700; padding: 10px 18px; border-radius: 10px; border: none; cursor: pointer;
}

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }

/* ---------- Lobby ---------- */
.puppet-badge {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* ---------- Game screen layout ---------- */
.game-shell {
  display: grid;
  grid-template-columns: 260px 1fr 300px;
  gap: 12px;
  padding: 12px;
  min-height: 100vh;
}
@media (max-width: 1100px) {
  .game-shell { grid-template-columns: 1fr; }
}

.panel {
  background: rgba(255,255,255,0.95);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* ---------- Board ---------- */
.board-wrap {
  background: radial-gradient(circle at 50% 50%, #bae6fd 0%, #7dd3fc 40%, #38bdf8 100%);
  border-radius: 20px;
  padding: 12px;
  box-shadow: inset 0 0 40px rgba(255,255,255,0.5), 0 15px 30px rgba(0,0,0,0.25);
}
.board-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  grid-template-rows: repeat(9, 1fr);
  gap: 3px;
  width: 100%;
  aspect-ratio: 1 / 1;
}
.board-center {
  grid-row: 2 / 9;
  grid-column: 2 / 9;
  background: linear-gradient(135deg,#0284c7,#0ea5e9 40%, #38bdf8);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.board-center::before {
  content: '🌍';
  font-size: 90px;
  position: absolute;
  opacity: 0.25;
  animation: spin 30s linear infinite;
}
.board-tile {
  background: white;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 700;
  text-align: center;
  position: relative;
  padding: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.1s;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.board-tile:hover { transform: scale(1.06); z-index: 5; }
.board-tile .flag { font-size: 16px; }
.board-tile .owner-strip {
  position: absolute; bottom: 0; left: 0; right: 0; height: 5px;
}
.board-tile .level-icons { position: absolute; top: 2px; right: 2px; font-size: 9px; }
.board-tile .color-band { height: 6px; width: 100%; border-radius: 4px 4px 0 0; }

.puppet-token {
  position: absolute;
  font-size: 14px;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5));
  transition: all 0.4s ease;
}

/* ---------- Player cards ---------- */
.player-row {
  display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px;
  background: #f8fafc; margin-bottom: 6px; border: 2px solid transparent;
}
.player-row.active-turn {
  border-color: #f59e0b;
  background: #fef3c7;
  animation: pulse-turn 1.5s infinite;
}
@keyframes pulse-turn { 0%,100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); } 50% { box-shadow: 0 0 0 6px rgba(245,158,11,0); } }
.player-row.bankrupt { opacity: 0.5; filter: grayscale(1); }

/* ---------- Dice ---------- */
.dice-face {
  width: 60px; height: 60px; background: white; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.dice-rolling { animation: dice-shake 0.6s ease; }
@keyframes dice-shake {
  0%,100% { transform: rotate(0deg); }
  25% { transform: rotate(-25deg) scale(1.1); }
  50% { transform: rotate(20deg) scale(1.1); }
  75% { transform: rotate(-10deg); }
}

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 100;
  padding: 16px;
}
.modal-card {
  background: white; border-radius: 20px; padding: 24px; max-width: 420px; width: 100%;
  box-shadow: 0 25px 60px rgba(0,0,0,0.5);
  animation: modal-pop 0.25s ease;
}
@keyframes modal-pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.card-flip {
  width: 160px; height: 220px; margin: 0 auto;
  border-radius: 16px;
  background: linear-gradient(135deg,#f59e0b,#ef4444);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: white; box-shadow: 0 10px 25px rgba(0,0,0,0.35);
  animation: card-reveal 0.5s ease;
}
@keyframes card-reveal { from { transform: rotateY(90deg); opacity: 0;} to { transform: rotateY(0deg); opacity: 1; } }

/* ---------- Notification toast ---------- */
.toast-feed {
  max-height: 220px; overflow-y: auto; font-size: 12px;
}
.toast-item { padding: 6px 8px; border-radius: 8px; background: #f1f5f9; margin-bottom: 4px; }

/* ---------- Country card list ---------- */
.country-card {
  border-radius: 12px; padding: 10px; margin-bottom: 8px; color: white; position: relative; overflow: hidden;
}

/* scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }

.tab-btn {
  padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 700; cursor: pointer; background: #f1f5f9; color: #475569;
}
.tab-btn.active { background: #6366f1; color: white; }

/* ---------- Banker settings / details-summary ---------- */
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: '▶'; display: inline-block; font-size: 9px; margin-right: 6px; transition: transform 0.15s; }
details[open] > summary::before { transform: rotate(90deg); }

/* ---------- Multi-select (Trade tab country pickers) ---------- */
select.input-field[multiple] {
  padding: 6px;
  overflow-y: auto;
}
select.input-field[multiple] option {
  padding: 4px 6px;
  border-radius: 6px;
}
select.input-field[multiple] option:checked {
  background: #6366f1 linear-gradient(0deg, #6366f1, #6366f1);
  color: white;
}

/* ---------- Visa / Credit Card tab ---------- */
.country-card .chip { font-size: 11px; }

/* ---------- Trade cards ---------- */
.country-card p { margin: 2px 0; }

