:root {
  --bg-dark: #0a0b10;
  --bg-card: #131522;
  --bg-glass: rgba(22, 25, 42, 0.75);
  --border-gold: #ffd700;
  --border-neon: #00f0ff;
  --accent-pink: #ff007f;
  --accent-green: #39ff14;
  --accent-purple: #9d4edd;
  --text-main: #f8f9fa;
  --text-dim: #9aa0a6;
  --font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

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

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(255, 0, 127, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.04) 0%, transparent 60%);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 24px;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(255, 215, 0, 0.25);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 1px;
  background: linear-gradient(135deg, #ffd700, #ff007f, #00f0ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.aura-tag {
  background: linear-gradient(90deg, #ff007f, #9d4edd);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.5);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Soundboard Pill Buttons */
.btn-pill {
  background: #1c1f33;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-pill:hover {
  background: #2a2f4d;
  border-color: var(--border-neon);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
  transform: translateY(-1px);
}

.btn-pill:active {
  transform: scale(0.96);
}

.btn-pill.active {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #111;
  border-color: #ffd700;
}

/* App Container */
#app {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Lobby Screen */
.lobby-screen {
  max-width: 600px;
  margin: 40px auto;
  padding: 32px;
  background: var(--bg-card);
  border-radius: 16px;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  text-align: center;
}

.lobby-screen h2 {
  font-size: 28px;
  font-weight: 900;
  color: var(--border-gold);
  margin-bottom: 8px;
}

.lobby-screen p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--border-neon);
}

.input-swag {
  width: 100%;
  padding: 12px 16px;
  background: #1c1f33;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.2s;
}

.input-swag:focus {
  border-color: var(--border-gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.car-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.car-option {
  padding: 10px;
  background: #1c1f33;
  border: 2px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.car-option:hover {
  background: #252a45;
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateY(-2px);
}

.car-option.selected {
  background: #272c47;
  border-color: var(--border-gold);
  box-shadow: 0 0 16px rgba(255, 215, 0, 0.5);
}

.car-vector-preview {
  width: 90px;
  height: 45px;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6));
}

.car-option .name {
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}

.car-option .aura-bonus {
  font-size: 10px;
  font-weight: 700;
  color: var(--border-gold);
  margin-top: 2px;
}

.avatar-vector-preview {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  overflow: hidden;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.btn-primary-swag {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  border: none;
  border-radius: 12px;
  color: #111;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 10px;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

.btn-primary-swag:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
}

.btn-primary-swag:active {
  transform: scale(0.98);
}

.btn-secondary-swag {
  width: 100%;
  padding: 12px;
  background: transparent;
  border: 1px solid var(--border-neon);
  border-radius: 12px;
  color: var(--border-neon);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}

.btn-secondary-swag:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

/* Room Wait Area */
.room-code-badge {
  display: inline-block;
  background: #1c1f33;
  border: 2px dashed var(--border-gold);
  color: var(--border-gold);
  padding: 8px 18px;
  border-radius: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 3px;
  margin: 12px 0;
}

.player-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
  text-align: left;
}

.player-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #1c1f33;
  border-radius: 8px;
  border-left: 4px solid var(--border-gold);
}

/* Game Board Layout */
.game-container {
  display: flex;
  flex: 1;
  gap: 20px;
  padding: 16px 24px;
  max-width: 1600px;
  margin: 0 auto;
  align-items: flex-start;
}

.board-wrapper {
  position: relative;
  background: #090a10;
  padding: 10px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
  border: 2px solid rgba(255, 215, 0, 0.2);
}

#boardCanvas {
  display: block;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
}

/* Dashboard Sidebar */
.dashboard-sidebar {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 360px;
}

.panel-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.panel-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--border-gold);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Turn Action Hub */
.action-hub {
  border: 2px solid var(--border-neon);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
  background: linear-gradient(180deg, #161b2e 0%, #101322 100%);
}

.turn-banner {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 12px;
  text-align: center;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-action {
  padding: 12px;
  border-radius: 10px;
  border: none;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}

.btn-roll {
  grid-column: span 2;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #111;
  font-size: 16px;
  padding: 16px;
}

.btn-roll:not(:disabled):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
}

.btn-buy {
  background: linear-gradient(135deg, #00f0ff, #0077b6);
  color: #111;
}

.btn-upgrade {
  background: linear-gradient(135deg, #ff007f, #7b2cbf);
  color: #fff;
}

.btn-bail {
  background: linear-gradient(135deg, #ff8c00, #d90429);
  color: #fff;
}

.btn-end {
  grid-column: span 2;
  background: #252a42;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Player Status Cards */
.players-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.player-status-card {
  background: #171a2b;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-left: 4px solid #fff;
  transition: all 0.2s ease;
}

.player-status-card.active-turn {
  background: #20243d;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
  transform: translateX(4px);
}

.player-info-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.player-avatar {
  font-size: 26px;
  background: #0d0e17;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.player-details .p-name {
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-details .p-status {
  font-size: 11px;
  color: var(--text-dim);
}

.player-finance {
  text-align: right;
}

.p-cash {
  font-size: 15px;
  font-weight: 900;
  color: var(--accent-green);
}

.p-aura {
  font-size: 11px;
  font-weight: 800;
  color: var(--border-gold);
}

/* Event Log Feed */
.log-feed {
  height: 200px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  padding-right: 4px;
}

.log-feed::-webkit-scrollbar {
  width: 6px;
}
.log-feed::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

.log-entry {
  background: #171a2b;
  padding: 8px 10px;
  border-radius: 6px;
  line-height: 1.4;
  border-left: 2px solid rgba(255, 215, 0, 0.4);
}

/* Modal Popup for Cards */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-card {
  max-width: 440px;
  background: #181b2e;
  border: 3px solid var(--border-gold);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.7); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.modal-title {
  font-size: 20px;
  font-weight: 900;
  color: var(--border-gold);
  margin-bottom: 12px;
}

.modal-text {
  font-size: 15px;
  line-height: 1.5;
  color: #fff;
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 1024px) {
  .game-container {
    flex-direction: column;
    align-items: center;
  }
  .dashboard-sidebar {
    width: 100%;
    min-width: auto;
  }
}
