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

:root {
  --bg-dark: #090a16;
  --bg-card: rgba(22, 27, 46, 0.75);
  --bg-card-hover: rgba(33, 40, 68, 0.85);
  --border-glass: rgba(255, 255, 255, 0.12);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary-glow: #6366f1;
  --accent-gold: #f59e0b;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.12) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Common App Layout */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
  position: relative;
}

/* Typography & Headers */
h1, h2, h3 {
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand-header {
  text-align: center;
  margin: 24px 0 16px;
}

.brand-header h1 {
  font-size: 2.2rem;
  background: linear-gradient(135deg, #a855f7, #6366f1, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.brand-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-top: 4px;
}

/* Glassmorphic Panel Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  margin-bottom: 16px;
}

/* Form Controls */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 1rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary-glow);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

/* Buttons */
.btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid var(--border-glass);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Avatar Selector */
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.avatar-option {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-option.selected {
  border-color: var(--primary-glow);
  background: rgba(99, 102, 241, 0.2);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.5);
}

/* Room Code Badge */
.room-code-box {
  background: rgba(99, 102, 241, 0.15);
  border: 1px dashed var(--primary-glow);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  margin-bottom: 20px;
}

.room-code-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.room-code-value {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  color: #fff;
  margin: 4px 0;
}

/* Player Lobby List */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.player-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px 16px;
}

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

.player-avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  border: 1px solid var(--border-glass);
}

.player-name {
  font-weight: 600;
  font-size: 1.05rem;
}

.player-status-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 700;
}

.host-badge {
  background: rgba(245, 158, 11, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ===================================================
   MONOPOLY BOARD & GAME PAGE STYLES (MOBILE-FIRST)
   =================================================== */

.game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  margin-bottom: 8px;
}

.turn-bar {
  background: rgba(15, 20, 36, 0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.turn-player {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 0.85rem;
}

.turn-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-success);
  box-shadow: 0 0 8px var(--accent-success);
  animation: pulse 1.5s infinite;
}

.turn-bar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.room-code-pill {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: 0.5px;
}

.btn-exit-pill {
  border: none;
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-exit-pill:hover {
  background: rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* Players Scroll Container & Compact Rich Chips */
.players-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 4px 2px;
  margin-bottom: 6px;
  scrollbar-width: thin;
}

.player-chip {
  flex: 0 0 auto;
  min-width: 105px;
  background: rgba(20, 26, 46, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--chip-color, #6366f1);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.player-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(28, 36, 64, 0.9);
}

.player-chip.active-turn {
  border-color: var(--accent-gold);
  border-left-width: 3px;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4), inset 0 0 8px rgba(245, 158, 11, 0.1);
  animation: turnPulseGlow 2s infinite alternate;
}

@keyframes turnPulseGlow {
  0% { box-shadow: 0 0 8px rgba(245, 158, 11, 0.3); }
  100% { box-shadow: 0 0 16px rgba(245, 158, 11, 0.6); }
}

.chip-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.chip-avatar-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  flex-shrink: 0;
}

.chip-user-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chip-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 2px;
}

.self-star {
  font-size: 0.65rem;
}

.chip-props-count {
  font-size: 0.58rem;
  color: var(--text-muted);
  font-weight: 600;
}

.chip-money {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--accent-gold);
  letter-spacing: -0.01em;
}

.chip-status-tag {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
  width: fit-content;
}

.chip-status-tag.bankrupt {
  background: rgba(239, 68, 68, 0.2);
  color: var(--accent-danger);
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.chip-status-tag.jail {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.chip-status-tag.free-card {
  background: rgba(245, 158, 11, 0.15);
  color: #fde047;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Mobile Scrollable Board Grid */
.board-wrapper {
  width: 100%;
  max-width: min(100%, calc(100dvh - 220px));
  aspect-ratio: 1;
  margin: 0 auto 6px auto;
  background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
  border: 3px solid #94a3b8;
  border-radius: 20px;
  padding: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.75), inset 0 0 12px rgba(255, 255, 255, 0.6);
  box-sizing: border-box;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  grid-template-rows: repeat(11, minmax(0, 1fr));
  width: 100%;
  height: 100%;
  gap: 1px;
  box-sizing: border-box;
}

/* Board Tile Base */
.board-tile {
  background: #141a30;
  border: 1px solid rgba(255, 255, 255, 0.09);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 1px;
  position: relative;
  text-align: center;
  cursor: pointer;
  overflow: visible;
  min-height: 0;
  min-width: 0;
  box-sizing: border-box;
}

.tile-color-bar {
  width: 100%;
  height: 4px;
  border-radius: 2px 2px 0 0;
  margin-bottom: 1px;
  flex-shrink: 0;
}

/* Floating Inner Building Badges (Facing Board Center Outside Tiles) */
.tile-inner-buildings {
  position: absolute;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.inner-house-badge {
  background: #0f172a;
  border: 1.5px solid #34d399;
  border-radius: 5px;
  padding: 1px 3px;
  font-size: clamp(8px, 1.8vw, 11px);
  line-height: 1;
  letter-spacing: -2px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
  display: flex;
  align-items: center;
}

.inner-hotel-badge {
  background: #0f172a;
  border: 1.5px solid #ef4444;
  border-radius: 5px;
  padding: 1px 3px;
  font-size: clamp(9px, 2vw, 12px);
  line-height: 1;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
}

.inner-mortgage-badge {
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid #dc2626;
  border-radius: 4px;
  padding: 1px 3px;
  font-size: clamp(6px, 1.4vw, 8px);
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

/* Positioning towards center board */
.inner-side-top {
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.inner-side-right {
  right: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.inner-side-bottom {
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.inner-side-left {
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
}

.tile-owner-tag {
  position: absolute;
  top: 1px;
  right: 1px;
  min-width: 10px;
  height: 10px;
  border-radius: 2px;
  font-size: 0.42rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  border: 1px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  padding: 0 1px;
  pointer-events: none;
}

.tile-title {
  font-weight: 700;
  line-height: 1.05;
  color: #ffffff;
  font-size: clamp(7px, 1.8vw, 11px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  margin: 1px 0;
  width: 100%;
  max-width: 100%;
  padding: 0 1px;
  box-sizing: border-box;
}

.tile-price {
  font-size: clamp(6.5px, 1.6vw, 10px);
  color: var(--accent-gold);
  font-weight: 800;
  white-space: nowrap;
  line-height: 1;
  margin-top: auto;
  padding-bottom: 1px;
  flex-shrink: 0;
}

.tile-building-badge {
  font-size: 0.45rem;
  line-height: 1;
  margin: 1px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.badge-houses {
  letter-spacing: -2px;
  color: #34d399;
}

.badge-hotel {
  font-size: 0.55rem;
  line-height: 1;
}

.badge-mortgaged {
  font-size: 0.4rem;
  color: var(--accent-danger);
  font-weight: 800;
  background: rgba(239, 68, 68, 0.2);
  padding: 1px 2px;
  border-radius: 3px;
  white-space: nowrap;
}

/* Color Group Palette */
.color-brown { background: #8B4513; }
.color-light_blue { background: #38bdf8; }
.color-pink { background: #ec4899; }
.color-orange { background: #f97316; }
.color-red { background: #ef4444; }
.color-yellow { background: #eab308; }
.color-green { background: #22c55e; }
.color-dark_blue { background: #3b82f6; }

/* Corner Tiles */
.tile-corner {
  background: #252e50;
  justify-content: center;
  font-weight: 800;
  font-size: 0.52rem;
  padding: 2px 1px;
}

/* Special Chance Tile (Kesempatan) */
.tile-chance {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.35), rgba(99, 102, 241, 0.25)) !important;
  border: 1px solid rgba(168, 85, 247, 0.6) !important;
  box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.3);
}

/* Special Community Chest Tile (Dana Umum) */
.tile-community-chest {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.35), rgba(217, 119, 6, 0.25)) !important;
  border: 1px solid rgba(245, 158, 11, 0.6) !important;
  box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.3);
}

/* Special Corner & Action Tiles */
.tile-start {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(5, 150, 105, 0.25)) !important;
  border: 1px solid rgba(16, 185, 129, 0.6) !important;
  box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.3);
}

.tile-jail-cell {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.25), rgba(120, 53, 15, 0.25)) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
  box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.2);
}

.tile-free-parking {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.35), rgba(14, 165, 233, 0.25)) !important;
  border: 1px solid rgba(6, 182, 212, 0.6) !important;
  box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.3);
}

.tile-go-to-jail {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(185, 28, 28, 0.3)) !important;
  border: 1px solid rgba(239, 68, 68, 0.7) !important;
  box-shadow: inset 0 0 12px rgba(239, 68, 68, 0.4);
}

.tile-special-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  gap: 1px;
  padding: 0 1px;
  box-sizing: border-box;
}

.chance-visual .special-icon {
  font-size: clamp(10px, 2.4vw, 15px);
  line-height: 1;
  color: #c084fc;
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.8));
}

.chest-visual .special-icon {
  font-size: clamp(10px, 2.4vw, 15px);
  line-height: 1;
  color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.8));
}

.start-visual .special-icon {
  font-size: clamp(9px, 2.2vw, 14px);
  line-height: 1;
  color: #34d399;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.8));
}

.jail-visual .special-icon {
  font-size: clamp(9px, 2vw, 13px);
  line-height: 1;
  color: #f87171;
  filter: drop-shadow(0 0 6px rgba(248, 113, 113, 0.8));
}

.parking-visual .special-icon {
  font-size: clamp(9px, 2.2vw, 14px);
  line-height: 1;
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.8));
}

.go-jail-visual .special-icon {
  font-size: clamp(9px, 2.2vw, 14px);
  line-height: 1;
  color: #ef4444;
  filter: drop-shadow(0 0 8px rgba(239, 68, 68, 0.9));
  animation: pulseGlow 1.5s infinite ease-in-out;
}

.special-sublabel {
  font-size: clamp(5.5px, 1.4vw, 9px);
  font-weight: 800;
  letter-spacing: 0.1px;
  color: rgba(255, 255, 255, 0.95);
  text-transform: uppercase;
  white-space: nowrap;
  margin-top: 1px;
}

/* Tokens Container inside tile */
.tile-tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  justify-content: center;
  margin-top: auto;
  flex-shrink: 0;
  z-index: 4;
}

.player-token {
  width: clamp(10px, 2.5vw, 14px);
  height: clamp(10px, 2.5vw, 14px);
  border-radius: 50%;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(5.5px, 1.4vw, 8.5px);
  border: 1px solid #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.9);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: translateY(0);
}

.btn-sound-pill {
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-sound-pill:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Center Board Area with Luxury Light Slate Felt Inlay & Card Decks */
.board-center {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  background: radial-gradient(circle at 50% 50%, #f8fafc 0%, #e2e8f0 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  position: relative;
  overflow: hidden;
  border: 2px solid #cbd5e1;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.08);
}

/* Card Deck Slots (Diagonal in Center Area) */
.card-deck-slot {
  position: absolute;
  width: 80px;
  height: 46px;
  border-radius: 8px;
  padding: 2px;
  pointer-events: none;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  opacity: 0.9;
  z-index: 1;
}

.slot-chance {
  top: 12%;
  right: 4%;
  transform: rotate(-35deg);
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.9), rgba(67, 56, 202, 0.9));
  border: 1.5px solid #a855f7;
}

.slot-chest {
  bottom: 12%;
  left: 4%;
  transform: rotate(-35deg);
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.9), rgba(180, 83, 9, 0.9));
  border: 1.5px solid #f59e0b;
}

.card-deck-slot.deck-drawing {
  animation: deckCardPulseUp 0.8s ease-in-out forwards;
  z-index: 100 !important;
}

@keyframes deckCardPulseUp {
  0% { transform: rotate(-35deg) scale(1) translateY(0); opacity: 0.85; }
  45% { transform: rotate(-10deg) scale(1.4) translateY(-30px); opacity: 1; box-shadow: 0 0 30px rgba(245, 158, 11, 0.9), 0 0 50px rgba(168, 85, 247, 0.9); }
  100% { transform: rotate(-35deg) scale(1) translateY(0); opacity: 0.85; }
}

.deck-inner {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.7);
}

.deck-icon {
  font-size: 0.9rem;
  line-height: 1;
}

.deck-label {
  font-size: 0.38rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 1px;
}

/* Center Brand Emblem Box */
.center-brand-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
  margin-bottom: 2px;
}

.logo-ring {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  margin-bottom: 3px;
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

.brand-title {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #1e1b4b, #4338ca, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
}

.brand-subtitle {
  font-size: 0.5rem;
  color: #475569;
  font-weight: 800;
  letter-spacing: 2px;
  margin-top: 2px;
}

/* 3D Dice Display Pedestal */
.dice-pedestal {
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 12px;
  padding: 6px 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 2;
  margin: 3px 0;
}

.dice-container {
  display: flex;
  gap: 12px;
  align-items: center;
}

.dice-cube {
  width: 38px;
  height: 38px;
  background: linear-gradient(145deg, #ffffff, #e2e8f0);
  border-radius: 8px;
  padding: 3px;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.6), inset 0 -2px 4px rgba(0, 0, 0, 0.15);
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-sizing: border-box;
}

.dice-face {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  align-items: center;
  justify-items: center;
}

.dice-pip {
  width: 6px;
  height: 6px;
  background: #0f172a;
  border-radius: 50%;
}

.pip-top-left     { grid-row: 1; grid-column: 1; }
.pip-top-right    { grid-row: 1; grid-column: 3; }
.pip-mid-left     { grid-row: 2; grid-column: 1; }
.pip-center       { grid-row: 2; grid-column: 2; background: #ef4444; }
.pip-mid-right    { grid-row: 2; grid-column: 3; }
.pip-bottom-left  { grid-row: 3; grid-column: 1; }
.pip-bottom-right { grid-row: 3; grid-column: 3; }

.dice-rolling {
  animation: diceSpin 0.5s ease-in-out infinite;
}

@keyframes diceSpin {
  0% { transform: rotate(0deg) scale(1); }
  50% { transform: rotate(180deg) scale(1.25); }
  100% { transform: rotate(360deg) scale(1); }
}

/* Center Turn Status Pill */
.center-turn-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #0f172a;
  color: #f8fafc;
  border: 1px solid #475569;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 2;
  margin-top: 3px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.center-turn-pill.waiting-turn {
  background: #1e293b;
  color: #cbd5e1;
  border-color: #475569;
}

.center-turn-pill.active-my-turn {
  background: #0f172a;
  color: #fbbf24;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
}

.pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-gold);
  animation: pulse 1.5s infinite;
}

.pill-dot.waiting {
  background: var(--text-muted);
  box-shadow: none;
  animation: none;
}

.pill-text {
  font-size: 0.65rem;
  color: var(--accent-gold);
  font-weight: 800;
  letter-spacing: 0.3px;
}

.pill-text.waiting {
  color: var(--text-muted);
  font-weight: 600;
}

/* Action Controls Panel */
.action-controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.btn-roll-3d {
  background: linear-gradient(135deg, #fbbf24, #f59e0b, #d97706);
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  position: relative;
  overflow: hidden;
  transition: all 0.2s ease;
}

.btn-roll-3d:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(245, 158, 11, 0.6);
}

.btn-roll-3d:active:not(:disabled) {
  transform: translateY(1px);
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.4);
}

.action-secondary-group {
  display: flex;
  gap: 8px;
}

.flex-1 {
  flex: 1;
}

/* Log Section & Drawer */
.log-section {
  margin-top: 10px;
  background: rgba(15, 20, 36, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}

.log-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 4px;
}

.log-live-badge {
  font-size: 0.6rem;
  background: rgba(16, 185, 129, 0.18);
  color: var(--accent-success);
  border: 1px solid rgba(16, 185, 129, 0.4);
  padding: 1px 6px;
  border-radius: 10px;
}

.log-drawer {
  max-height: 110px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scrollbar-width: thin;
}

.log-item {
  font-size: 0.75rem;
  color: #cbd5e1;
  padding: 3px 0;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.35;
}

.log-icon {
  font-size: 0.8rem;
  flex-shrink: 0;
}

.log-text {
  flex: 1;
}

/* Landing Modal / Center Popups */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.landing-card {
  width: 100%;
  max-width: 440px;
  background: #161b2e;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
  padding: 24px 20px;
  transform: scale(0.9) translateY(10px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
}

.modal-overlay.active .landing-card {
  transform: scale(1) translateY(0);
}

.card-header-bar {
  height: 8px;
  border-radius: 4px;
  width: 100%;
  margin-bottom: 16px;
}

.card-title-box {
  text-align: center;
  margin-bottom: 16px;
}

.card-title-box h3 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.card-price-tag {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.rent-list {
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-md);
  padding: 12px;
  margin: 12px 0;
  font-size: 0.85rem;
}

.rent-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px rgba(255,255,255,0.05) solid;
}

.rent-row:last-child {
  border-bottom: none;
}

/* Toast Banners */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 420px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: rgba(22, 27, 46, 0.95);
  border: 1px solid var(--primary-glow);
  backdrop-filter: blur(12px);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: slideDown 0.3s ease, fadeOut 0.3s 3.7s forwards;
}

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

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(-10px); }
}

/* Game Log Drawer */
.log-drawer {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 12px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.log-item {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

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

/* Nusakambangan Tile & Token Styles */
.tile-jail-cell {
  background: radial-gradient(circle, #3b111e 0%, #170a16 100%) !important;
  border: 1px solid rgba(239, 68, 68, 0.5) !important;
}

.token-jailed {
  border: 2px solid #ef4444 !important;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.9) !important;
  position: relative;
}

.jail-lock-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  font-size: 0.6rem;
}

/* Distinct Card Themes for Property Types */
.property-card-city {
  border-left: 4px solid var(--card-color, #6366f1);
  background: rgba(22, 27, 46, 0.85);
}

.property-card-utility {
  border-left: 4px solid #38bdf8 !important;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.15) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  border-top: 1px solid rgba(56, 189, 248, 0.35) !important;
}

.property-card-railroad {
  border-left: 4px solid #cbd5e1 !important;
  background: linear-gradient(135deg, rgba(100, 116, 139, 0.18) 0%, rgba(15, 23, 42, 0.9) 100%) !important;
  border-top: 1px solid rgba(203, 213, 225, 0.35) !important;
}

.property-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.badge-city {
  background: rgba(99, 102, 241, 0.2);
  color: #a5b4fc;
}

.badge-utility {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.badge-railroad {
  background: rgba(203, 213, 225, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(203, 213, 225, 0.4);
}

/* Active Rent Tier Highlight in Modal */
.rent-row.active-rent-row {
  background: rgba(16, 185, 129, 0.2) !important;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 6px;
  padding: 4px 8px;
  color: #34d399 !important;
  font-weight: 700;
}

/* Responsive Mobile Layout Adjustments */
@media (max-width: 480px) {
  .app-container {
    padding: 8px 10px;
  }
  .turn-bar {
    padding: 4px 8px;
    margin-bottom: 4px;
  }
  .players-bar {
    margin-bottom: 4px;
  }
  .player-chip {
    min-width: 96px;
    padding: 4px 6px;
  }
  .action-controls {
    gap: 6px;
    margin-top: 4px;
  }
  .btn-roll-3d {
    padding: 12px;
    font-size: 0.95rem;
  }
  .btn {
    padding: 12px;
    font-size: 0.9rem;
  }
  .log-section {
    margin-top: 6px;
    padding: 6px 10px;
  }
  .log-drawer {
    max-height: 85px;
  }
}

/* ===================================================
   LIGHT MODE THEME SYSTEM (HOME & LOBBY PREMIUM)
   =================================================== */

.btn-theme-pill {
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.85);
  color: #1e293b;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s ease;
}

.btn-theme-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

body.light-mode {
  background: #f1f5f9;
  background-image: 
    radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.14) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.12) 0px, transparent 50%),
    linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #0f172a;
}

body.light-mode .glass-panel {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(203, 213, 225, 0.9);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
}

body.light-mode .brand-header h1 {
  background: linear-gradient(135deg, #6366f1, #4f46e5, #d97706);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-mode .brand-header p {
  color: #475569;
  font-weight: 600;
}

body.light-mode .form-group label {
  color: #475569;
  font-weight: 700;
}

body.light-mode .form-input {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
}

body.light-mode .form-input:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3.5px rgba(99, 102, 241, 0.2);
}

body.light-mode .form-input::placeholder {
  color: #94a3b8;
}

body.light-mode .room-code-box {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(79, 70, 229, 0.12));
  border: 1.5px dashed #6366f1;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1);
}

body.light-mode .room-code-label {
  color: #475569;
  font-weight: 700;
}

body.light-mode .room-code-value {
  color: #1e1b4b;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

body.light-mode .player-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

body.light-mode .player-name {
  color: #0f172a;
  font-weight: 700;
}

body.light-mode .player-avatar-badge {
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid #cbd5e1;
}

body.light-mode .avatar-option {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
}

body.light-mode .avatar-option:hover {
  border-color: #a5b4fc;
  transform: translateY(-1px);
}

body.light-mode .avatar-option.selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.14);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transform: translateY(-2px) scale(1.04);
}

body.light-mode .btn-secondary {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

body.light-mode .btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

body.light-mode .btn-sound-pill {
  background: #ffffff;
  color: #334155;
  border: 1px solid #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
