@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800;900&family=Rubik:wght@400;500;600;700;800;900&family=Inter:wght@400;500;600;700;800;900&display=swap&subset=cyrillic,cyrillic-ext');

:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.05);
  --border-glass: rgba(255, 255, 255, 0.1);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --glow-cyan: 0 0 25px rgba(6, 182, 212, 0.35);
  --glow-emerald: 0 0 25px rgba(16, 185, 129, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Rubik', 'Montserrat', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background: radial-gradient(circle at 50% 20%, #172554 0%, #0a0e17 80%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.header {
  height: 64px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, #38bdf8 0%, #818cf8 50%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.logo-badge {
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 20px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  -webkit-text-fill-color: #38bdf8;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-icon {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.05);
}

.lobby-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.lobby-card {
  background: var(--bg-card);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: 24px;
  padding: 40px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--glow-cyan);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.lobby-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.lobby-title {
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lobby-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 32px;
}

.avatar-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 28px;
}

.avatar-opt {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--bg-glass);
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-opt:hover {
  transform: translateY(-3px) scale(1.08);
  border-color: var(--accent-cyan);
}

.avatar-opt.active {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.2);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.4);
  transform: translateY(-3px) scale(1.1);
}

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

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

.input-field {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 500;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25);
}

.btn-primary {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%);
  color: #fff;
  border: none;
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.55);
}

.btn-secondary {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  color: var(--text-main);
  border: 1px solid var(--border-glass);
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.waiting-room-card {
  max-width: 600px;
}

.room-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px dashed rgba(56, 189, 248, 0.4);
  border-radius: var(--radius-md);
  padding: 14px 20px;
  margin-bottom: 28px;
}

.room-code-text {
  font-family: 'Rubik', monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #38bdf8;
}

.btn-copy {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #38bdf8;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-copy:hover {
  background: rgba(56, 189, 248, 0.3);
}

.players-list-lobby {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 28px;
}

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

.player-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-avatar-lobby {
  font-size: 1.6rem;
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.host-tag {
  font-size: 0.75rem;
  background: rgba(245, 158, 11, 0.2);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 700;
}

.game-layout {
  display: grid;
  grid-template-columns: 280px 1fr 320px;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  width: 100%;
  flex: 1;
}

@media (max-width: 1300px) {
  .game-layout {
    grid-template-columns: 260px 1fr;
  }
  .right-sidebar {
    grid-column: span 2;
  }
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }
}

.sidebar-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.panel-title {
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-glass);
  padding-bottom: 12px;
  color: #e2e8f0;
}

.player-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.player-card.active-turn {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.player-card.active-turn::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #38bdf8;
}

.player-card.bankrupt {
  opacity: 0.45;
  filter: grayscale(1);
}

.player-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.player-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.player-avatar-small {
  font-size: 1.3rem;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-name-text {
  font-weight: 700;
  font-size: 0.95rem;
}

.player-cash-badge {
  font-family: 'Rubik', sans-serif;
  font-size: 1.15rem;
  font-weight: 800;
  color: #10b981;
}

.player-properties-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.prop-pill {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.board-container {
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1000px;
}

.board-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(9, 1fr) 1.4fr;
  grid-template-rows: 1.4fr repeat(9, 1fr) 1.4fr;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 820px;
  background: #0f172a;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 8px;
  gap: 4px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(15, 23, 42, 0.8);
  position: relative;
}

.tile {
  background: #1e293b;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px;
  font-size: 0.68rem;
  position: relative;
  cursor: pointer;
  transition: all 0.15s ease;
  overflow: hidden;
  user-select: none;
}

.tile:hover {
  transform: scale(1.04);
  z-index: 20;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  border-color: #38bdf8;
}

.tile-color-bar {
  height: 8px;
  border-radius: 4px 4px 0 0;
  width: 100%;
}

.tile-name {
  font-weight: 700;
  color: #f1f5f9;
  text-align: center;
  line-height: 1.1;
  font-size: 0.65rem;
  margin: 2px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-price {
  font-family: 'Rubik', sans-serif;
  font-weight: 800;
  color: #38bdf8;
  text-align: center;
  font-size: 0.65rem;
}

.tile-icon {
  font-size: 1.2rem;
  text-align: center;
  margin: auto 0;
}

.tile-owner-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #fff;
}

.tile-houses-bar {
  display: flex;
  gap: 2px;
  justify-content: center;
  margin-top: 2px;
}

.house-icon {
  font-size: 0.65rem;
}

.corner-tile {
  background: #1e1b4b;
  border-color: rgba(99, 102, 241, 0.3);
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.corner-tile .tile-name {
  font-size: 0.72rem;
  font-weight: 800;
}

.corner-tile .tile-icon {
  font-size: 1.6rem;
}

.tile-pawns-container {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 2px;
  pointer-events: none;
  z-index: 10;
}

.pawn-token {
  font-size: 1.1rem;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
  animation: pawnBounce 0.4s ease;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pawnBounce {
  0% { transform: translateY(-10px) scale(1.3); }
  100% { transform: translateY(0) scale(1); }
}

.board-center-hud {
  grid-column: 2 / 11;
  grid-row: 2 / 11;
  background: radial-gradient(circle at 50% 50%, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.98) 100%);
  border-radius: 16px;
  border: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.turn-banner {
  text-align: center;
}

.turn-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 6px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.95rem;
  color: #38bdf8;
}

.dice-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: auto 0;
}

.dice-pair {
  display: flex;
  gap: 18px;
}

.die {
  width: 60px;
  height: 60px;
  background: #f8fafc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Rubik', sans-serif;
  font-size: 2rem;
  font-weight: 900;
  color: #0f172a;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), inset 0 -4px 0 rgba(0, 0, 0, 0.15);
  transition: transform 0.1s ease;
}

.die.rolling {
  animation: diceRollAnim 0.5s ease;
}

@keyframes diceRollAnim {
  0% { transform: rotate(0deg) scale(0.9); }
  25% { transform: rotate(90deg) scale(1.15); }
  50% { transform: rotate(180deg) scale(0.95); }
  75% { transform: rotate(270deg) scale(1.1); }
  100% { transform: rotate(360deg) scale(1); }
}

.action-buttons-group {
  display: flex;
  gap: 12px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

.btn-action {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-md);
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-roll {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-roll:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.6);
}

.btn-buy {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #fff;
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.btn-end {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-glass);
  color: #f3f4f6;
}

.btn-action:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.logs-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;
  padding-right: 4px;
  font-size: 0.85rem;
}

.log-item {
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #38bdf8;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}

.log-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-right: 6px;
}

.chat-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  overflow-y: auto;
}

.chat-bubble {
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-weight: 700;
  font-size: 0.8rem;
  color: #94a3b8;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}

.modal-content {
  background: #111827;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 28px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
  text-align: center;
}

.modal-title {
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.property-card-preview {
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: #1e293b;
  overflow: hidden;
  margin: 16px 0;
  text-align: left;
}

.prop-card-header {
  padding: 12px;
  color: #fff;
  font-family: 'Montserrat', 'Rubik', sans-serif;
  font-weight: 800;
  text-align: center;
  font-size: 1.1rem;
}

.prop-card-body {
  padding: 16px;
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.hidden {
  display: none !important;
}
