/* =====================================================
   CỜ TỶ PHÚ ONLINE - CSS
   Theme: Dark mode with gold accents
   ===================================================== */

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

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:    #0a0912;
  --bg-mid:     #12101f;
  --bg-card:    #1a1833;
  --gold:       #ffd700;
  --gold-light: #ffe566;
  --gold-dark:  #c8a000;
  --accent:     #a855f7;
  --accent2:    #3b82f6;
  --danger:     #ef4444;
  --success:    #22c55e;
  --text:       #e8e0ff;
  --text-dim:   #8878aa;
  --border:     rgba(255,215,0,0.2);
  --shadow:     rgba(0,0,0,0.6);
  --tile-w:     13.6vh;
  --tile-h:     13.6vh;
  --corner-w:   15.6vh;
  --corner-h:   15.6vh;
}

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  user-select: none;
}

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }

/* === SCREENS === */
.screen {
  position: fixed; inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: flex; }

/* === FULLSCREEN BUTTON === */
#btn-fullscreen {
  position: fixed; top: 12px; right: 14px; z-index: 9999;
  background: rgba(255,215,0,0.12); color: var(--gold);
  border: 1px solid var(--border); border-radius: 8px;
  width: 36px; height: 36px; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
#btn-fullscreen:hover { background: rgba(255,215,0,0.25); }

/* =====================================================
   MENU SCREEN
   ===================================================== */
#screen-menu {
  background: linear-gradient(135deg, #0f0c1b 0%, #1a1a2e 50%, #2e112d 100%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}
#screen-menu::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 50% 30%, rgba(168,85,247,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.menu-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  max-width: 900px;
  width: 90%;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* Left: logo + title */
.menu-left {
  display: flex; flex-direction: column;
  align-items: center; gap: 12px;
}
.menu-logo { width: 90px; height: 90px; object-fit: contain; filter: drop-shadow(0 0 20px #ffd700); }
.menu-title {
  font-size: 52px; font-weight: 900;
  color: var(--gold); letter-spacing: 2px;
  text-shadow: 0 0 30px rgba(255,215,0,0.5), 2px 2px 0 #7c5800;
}
.menu-subtitle { font-size: 18px; color: #ccc; font-weight: 600; }
.menu-version { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.menu-player-info {
  background: rgba(255,255,255,0.05); border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 18px;
  display: flex; align-items: center; gap: 10px;
  width: 100%; cursor: pointer;
}
.menu-player-info:hover { background: rgba(255,215,0,0.08); }
#menu-avatar-img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--gold); }
#menu-player-name { font-weight: 600; font-size: 15px; }

/* Right: buttons */
.menu-right {
  display: flex; flex-direction: column; gap: 14px;
}

.btn { 
  border: none; border-radius: 28px;
  padding: 14px 28px; font-size: 17px; font-weight: 700;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}
.btn:active { transform: scale(0.97); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0912; box-shadow: 0 4px 20px rgba(255,215,0,0.3);
}
.btn-gold:hover { box-shadow: 0 6px 30px rgba(255,215,0,0.5); transform: translateY(-2px); }
.btn-outline {
  background: transparent; color: var(--gold);
  border: 2px solid rgba(255,215,0,0.4);
}
.btn-outline:hover { border-color: var(--gold); background: rgba(255,215,0,0.08); }
.btn-purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  color: #fff; box-shadow: 0 4px 20px rgba(168,85,247,0.3);
}
.btn-purple:hover { box-shadow: 0 6px 30px rgba(168,85,247,0.5); transform: translateY(-2px); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 18px; font-size: 13px; border-radius: 20px; }

/* =====================================================
   LOBBY SCREEN
   ===================================================== */
#screen-lobby {
  background: linear-gradient(135deg, #0f0c1b, #1a1a2e);
  flex-direction: column; align-items: center; justify-content: center;
  gap: 24px;
}
.lobby-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px 40px;
  min-width: 400px; text-align: center;
}
.lobby-room-code-label { color: var(--text-dim); font-size: 13px; }
#lobby-room-code {
  font-size: 48px; font-weight: 900; color: var(--gold);
  letter-spacing: 8px; font-family: monospace;
  text-shadow: 0 0 20px rgba(255,215,0,0.4);
}
#lobby-countdown { color: var(--text-dim); font-size: 14px; }
#lobby-players { min-height: 80px; margin: 16px 0; }
.lobby-player {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,0.05); margin: 6px 0;
}
.lobby-host-badge { background: var(--gold); color: #000; font-size: 10px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
#lobby-status { color: var(--text-dim); font-size: 14px; margin: 8px 0; }
.lobby-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }

/* =====================================================
   GAME SCREEN
   ===================================================== */
#screen-game {
  background: linear-gradient(135deg, #0a0912, #12101f);
  flex-direction: row;
  overflow: hidden;
}

/* Side panel */
.game-sidebar {
  display: none !important;
}

/* Main game area */
.game-main {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  overflow: hidden; padding: 8px;
  gap: 8px;
}

/* Game board */
.board-grid {
  display: grid;
  grid-template-columns: var(--corner-w) repeat(9, var(--tile-w)) var(--corner-w);
  grid-template-rows: var(--corner-h) repeat(5, var(--tile-h)) var(--corner-h);
  border: 3px solid rgba(255,215,0,0.4);
  border-radius: 4px;
  background: #1a3a2a;
  position: relative;
  box-shadow: 0 0 40px rgba(255,215,0,0.1), inset 0 0 60px rgba(0,100,0,0.3);
}

/* Tile cells */
.board-cell {
  border: 1px solid rgba(255,215,0,0.12);
  position: relative; overflow: hidden;
}

.tile { cursor: default; transition: background 0.2s; }
.tile:hover { background: rgba(255,255,255,0.05); }
.tile-flash { background: rgba(255,255,255,0.3) !important; transition: none; }
.tile-flash-group { outline: 3px solid var(--gold); animation: flashGroup 0.4s ease 3; }
@keyframes flashGroup { 0%,100% { outline-color: var(--gold); } 50% { outline-color: #fff; } }

/* Owned tile styling */
.tile.owned {
  background: var(--owner-color) !important;
}
.tile.owned .tile-name,
.tile.owned .tile-price,
.tile.owned .tile-icon {
  color: #ffffff !important;
}
.tile.owned .color-stripe {
  display: none !important;
}

.tile-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 3px; gap: 2px; position: relative;
}

/* Corner tiles */
.tile-corner { padding: 0 !important; }
.corner-img { width: 100%; height: 100%; object-fit: fill; border-radius: 4px; }

/* Side tile content */
.tile-top, .tile-bottom {
  flex-direction: column-reverse;
}
.tile-left, .tile-right {
  width: 100%; height: 100%;
}

.tile-name {
  font-size: 2.2vh; font-weight: 800; text-align: center;
  color: #e0e0e0; line-height: 1.1;
  word-break: keep-all; overflow-wrap: break-word; max-width: 14vh;
  white-space: normal;
}
.tile-price { font-size: 1.05vh; color: var(--gold); font-weight: 600; }
.tile-icon { font-size: 2.4vh; }

.chance-question {
  font-size: 5.5vh !important;
  color: var(--gold) !important;
  font-weight: 900 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  width: 100%;
}

/* Color stripe */
.color-stripe {
  position: absolute;
  opacity: 0.85;
}
.stripe-top    { top: 0;    left: 0; right: 0; height: 1.6vh; }
.stripe-bottom { bottom: 0; left: 0; right: 0; height: 1.6vh; }
.stripe-left   { left: 0;   top: 0; bottom: 0; width: 1.6vh; }
.stripe-right  { right: 0;  top: 0; bottom: 0; width: 1.6vh; }

/* Upgrade images */
.tile-upgrades {
  position: absolute; inset: 0.1vh;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none; z-index: 2; opacity: 0.75;
}
.upgrade-img {
  width: 140%;
  height: 140%;
  max-width: 140%;
  max-height: 140%;
  object-fit: contain;
}

/* Player tokens */
.tile-tokens {
  position: absolute;
  inset: 0.6vh;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.2vh;
  pointer-events: none;
  z-index: 10;
}
.player-token-img {
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.tile-tokens[data-count="1"] .player-token-img {
  width: 85%;
  height: 85%;
}
.tile-tokens[data-count="2"] .player-token-img {
  width: 46%;
  height: 46%;
}
.tile-tokens[data-count="3"] .player-token-img {
  width: 44%;
  height: 44%;
}
.tile-tokens[data-count="4"] .player-token-img {
  width: 44%;
  height: 44%;
}

/* Center area */
.center-cell { 
  grid-column: 2 / 11; 
  grid-row: 2 / 7; 
  background: #092012;
  border: none;
}
.center-area {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  gap: 1vh; padding: 1.5vh;
  overflow: hidden;
}
.center-logo {
  display: flex; flex-direction: column; align-items: center; gap: 0.2vh;
}
.center-logo-img { width: 5.5vh; height: 5.5vh; object-fit: contain; }
.center-title {
  font-size: 2.2vh; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 15px rgba(255,215,0,0.5);
}
.center-subtitle { font-size: 1.2vh; color: var(--text-dim); }

.center-info-panel {
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 1.5vh;
  width: 100%; flex: 1; overflow: hidden;
}

.center-left-column {
  display: flex;
  flex-direction: column;
  gap: 1vh;
  height: 100%;
}

.dice-control-panel {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1vh;
  flex: 1;
}

/* Notification Feed */
.notification-feed {
  background: rgba(0,0,0,0.4); border-radius: 8px;
  padding: 0.8vh; overflow-y: hidden;
  display: flex; flex-direction: column; gap: 0.5vh;
  border: 1px solid rgba(255,215,0,0.1);
  height: 11vh;
}
.feed-item {
  font-size: 1.1vh; color: #ccc; padding: 0.3vh 0.6vh;
  border-radius: 4px; background: rgba(255,255,255,0.04);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Players Panel */
.players-panel {
  display: flex; flex-direction: column; gap: 0.6vh;
  overflow-y: auto;
}
.player-card {
  background: rgba(255,255,255,0.05); border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden; transition: all 0.2s;
  font-size: 1.1vh;
}
.player-card.current-turn {
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255,215,0,0.3);
}
.player-card.bankrupt { opacity: 0.4; }
.pcard-header {
  display: flex; align-items: center; gap: 0.8vh;
  padding: 0.6vh 1vh;
}
.pcard-avatar { width: 2.8vh; height: 2.8vh; border-radius: 50%; object-fit: cover; }
.pcard-name { flex: 1; font-weight: 700; font-size: 1.2vh; }
.pcard-turn-badge { color: var(--gold); font-size: 1.4vh; }
.pcard-body { padding: 0.6vh 1vh; }
.pcard-money { font-size: 1.6vh; font-weight: 700; color: var(--gold); }
.pcard-stats { font-size: 1vh; color: var(--text-dim); }
.pcard-bankrupt { color: var(--danger); font-weight: 700; font-size: 1.1vh; }

#game-turn-info { 
  font-size: 1.3vh; 
  display: flex; 
  align-items: center; 
  justify-content: center;
  gap: 0.8vh; 
  width: 100%;
}
#dice-display {
  display: flex;
  justify-content: center;
  gap: 2.5vh;
  width: 100%;
  margin: 1vh 0;
  transition: transform 0.1s;
}
.dice-cube {
  width: 13vh;
  height: 13vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}
.dice-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
#dice-display.dice-result .dice-cube {
  transform: scale(1.2);
}
#btn-roll {
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: #0a0912; border: none; border-radius: 24px;
  padding: 1.2vh 3vh; font-size: 1.9vh; font-weight: 900;
  text-transform: uppercase;
  box-shadow: 0 4px 16px rgba(255,215,0,0.4);
  transition: all 0.2s;
  width: 100%;
}
#btn-roll:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(255,215,0,0.6); }
#btn-roll:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* Airport badge */
.airport-badge, .private-airport-badge {
  position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.7); color: #fff; font-size: 0.9vh;
  border-radius: 6px; padding: 2px 6px; white-space: nowrap;
  z-index: 5;
}

/* =====================================================
   MONEY FLY ANIMATION
   ===================================================== */
#money-fly-container {
  position: fixed; inset: 0; pointer-events: none; z-index: 1000;
  overflow: hidden;
}
.money-fly {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 18px; font-weight: 800; padding: 8px 16px;
  border-radius: 50px; white-space: nowrap;
  animation: flyUp 1.2s ease-out forwards;
}
.money-in { background: rgba(34,197,94,0.9); color: #fff; }
.money-out { background: rgba(239,68,68,0.9); color: #fff; }
@keyframes flyUp {
  0% { opacity: 0; transform: translate(-50%, -40%); }
  20% { opacity: 1; }
  80% { opacity: 1; transform: translate(-50%, -80%); }
  100% { opacity: 0; transform: translate(-50%, -110%); }
}

/* =====================================================
   SMUG FACE OVERLAY
   ===================================================== */
#smug-overlay {
  position: fixed; inset: 0; pointer-events: none; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0); transition: background 0.3s;
  opacity: 0; transition: opacity 0.3s;
}
#smug-overlay.visible {
  opacity: 1; background: rgba(0,0,0,0.3);
}
.smug-img {
  width: 200px; height: 200px; object-fit: contain;
  border-radius: 50%; border: 4px solid var(--gold);
  box-shadow: 0 0 40px rgba(255,215,0,0.5);
  animation: smugBounce 0.5s ease;
}
@keyframes smugBounce {
  0%,100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* =====================================================
   TOAST NOTIFICATIONS
   ===================================================== */
#toast-container {
  position: fixed; top: 60px; right: 16px; z-index: 5000;
  display: flex; flex-direction: column; gap: 8px;
  max-width: 380px;
}
.toast {
  background: var(--bg-card); border-radius: 12px;
  padding: 12px 16px; font-size: 13px;
  border-left: 4px solid var(--gold);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0; transform: translateX(100%);
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 380px; word-break: break-word;
}
.toast.show { opacity: 1; transform: translateX(0); }
.toast-error { border-left-color: var(--danger); }
.toast-success { border-left-color: var(--success); }

/* =====================================================
   MODALS
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0,0,0,0.75); backdrop-filter: blur(4px);
  align-items: center; justify-content: center;
  display: none;
}
.modal-overlay.active { display: flex; }

.modal-box {
  background: linear-gradient(135deg, var(--bg-card), #1e1640);
  border: 1px solid var(--border); border-radius: 20px;
  padding: 28px 32px; max-width: 480px; width: 90%;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(255,215,0,0.1);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalIn {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-title {
  font-size: 22px; font-weight: 800; color: var(--gold);
  margin-bottom: 16px; text-align: center;
}
.modal-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }

/* Name Dialog */
#name-input {
  width: 100%; padding: 12px 16px; background: rgba(255,255,255,0.07);
  border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 16px; font-family: inherit;
  margin-bottom: 16px; outline: none;
}
#name-input:focus { border-color: var(--gold); }

.avatar-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
  max-height: 220px; overflow-y: auto; margin-bottom: 16px;
}
.avatar-option {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 8px 4px; border-radius: 12px; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s;
}
.avatar-option:hover { border-color: rgba(255,215,0,0.4); background: rgba(255,255,255,0.05); }
.avatar-option.selected { border-color: var(--gold); background: rgba(255,215,0,0.1); }
.avatar-option img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.avatar-option span { font-size: 9px; color: var(--text-dim); text-align: center; }

/* Buy/Upgrade Modals */
.modal-prop-name { font-size: 20px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.modal-color-badge {
  display: inline-block; padding: 3px 12px; border-radius: 12px;
  font-size: 11px; font-weight: 700; margin: 0 auto 12px;
}
.modal-price { font-size: 24px; font-weight: 900; color: var(--gold); text-align: center; }
.modal-label { font-size: 11px; color: var(--text-dim); text-align: center; margin-bottom: 4px; }
.rent-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; margin: 12px 0; }
.rent-info-grid div { padding: 3px 6px; background: rgba(255,255,255,0.05); border-radius: 6px; }

/* Chance Card */
.chance-card-title { font-size: 22px; font-weight: 800; text-align: center; color: var(--gold); margin-bottom: 8px; }
.chance-card-desc { font-size: 15px; text-align: center; color: var(--text); margin-bottom: 12px; line-height: 1.5; }
.chance-action-badge {
  text-align: center; margin-bottom: 16px;
  padding: 4px 14px; background: rgba(255,255,255,0.08);
  border-radius: 20px; display: inline-block; font-size: 13px;
}

/* Liquidate */
.liq-info { text-align: center; margin-bottom: 12px; }
.liq-debt { font-size: 18px; font-weight: 800; color: var(--danger); }
.liq-prop-item {
  background: rgba(255,255,255,0.05); border-radius: 10px;
  padding: 10px; margin: 8px 0;
}
.liq-prop-name { font-weight: 700; margin-bottom: 6px; }
.liq-prop-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Game Over (Victory Modal) */
.gameover-winner { font-size: 28px; font-weight: 900; color: var(--gold); text-align: center; margin: 12px 0; }
.rank-row {
  display: flex; justify-content: space-between;
  padding: 8px 12px; background: rgba(255,255,255,0.05);
  border-radius: 8px; margin: 4px 0; font-size: 14px;
}

.victory-modal-box {
  width: 525px;
  height: 350px;
  position: relative;
  background: url('../images/bg_victory.jpg') center/cover no-repeat;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 215, 0, 0.3);
  animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  user-select: none;
}

.victory-close-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #D93025;
  color: white;
  border: 1.5px solid white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  z-index: 10;
  box-shadow: 0 2px 6px rgba(0,0,0,0.5);
  transition: transform 0.15s ease;
}
.victory-close-btn:hover {
  transform: scale(1.1);
}

.victory-content-grid {
  display: grid;
  grid-template-columns: 245px 1fr;
  grid-template-rows: 52px 22px 60px 160px 56px;
  padding: 0;
  margin-top: 40px;
  height: calc(100% - 40px);
}

.victory-winner-box {
  grid-row: 3;
  grid-column: 2;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 25px 0 0;
}

.victory-winner-name {
  font-size: 18px;
  font-weight: bold;
  color: #FFD700;
  text-shadow: 1.5px 1.5px 3px rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  gap: 6px;
}

.victory-rankings-box {
  grid-row: 4;
  grid-column: 2;
  margin: 10px 65px 2px 5px;
}

.victory-scroll-list {
  max-height: 145px;
  overflow-y: auto;
  padding-right: 2px;
}
.victory-scroll-list::-webkit-scrollbar {
  width: 4px;
}
.victory-scroll-list::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.4);
  border-radius: 4px;
}

.victory-buttons-box {
  grid-row: 5;
  grid-column: 2;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 5px 25px 8px 5px;
  align-items: center;
}

.victory-btn {
  border-radius: 8px;
  height: 38px;
  border: 1px solid transparent;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, filter 0.15s ease;
  outline: none;
}
.victory-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
}

.victory-btn-blue {
  background: #0B5ED7;
  border-color: #40A9FF;
}

.victory-btn-green {
  background: #28A745;
  border-color: #52C41A;
}

@media (max-width: 560px) {
  .victory-modal-box {
    transform: scale(0.85);
  }
}
@media (max-width: 460px) {
  .victory-modal-box {
    transform: scale(0.7);
  }
}

/* Tutorial */
.tutorial-img { width: 100%; border-radius: 10px; }

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* =====================================================
   RESPONSIVE (landscape required)
   ===================================================== */
@media (orientation: portrait) {
  .screen { display: flex; flex-direction: column; align-items: center; justify-content: center; }
  #screen-game .game-sidebar, #screen-game .game-controls { display: none; }
  .rotate-hint {
    color: var(--gold); font-size: 18px; text-align: center;
    padding: 20px;
  }
}

/* =====================================================
   MISC ANIMATIONS
   ===================================================== */
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideIn { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.animate-pulse { animation: pulse 1.5s infinite; }
.animate-slide { animation: slideIn 0.3s ease; }

/* Glow effects */
.glow-gold { box-shadow: 0 0 20px rgba(255,215,0,0.4); }
.glow-purple { box-shadow: 0 0 20px rgba(168,85,247,0.4); }

/* Airplane Flight Animation Overlay */
.airplane-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  pointer-events: none;
  z-index: 9999;
  display: flex;
  align-items: center;
  overflow: hidden;
}
.airplane-sprite {
  width: 25vh;
  height: auto;
  position: absolute;
  right: -30vh;
  animation: flyRightToLeft 2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes flyRightToLeft {
  0% {
    right: -30vh;
    transform: translateY(50px) rotate(-10deg) scale(0.8);
  }
  50% {
    transform: translateY(-20px) rotate(0deg) scale(1.1);
  }
  100% {
    right: 110vw;
    transform: translateY(-50px) rotate(-5deg) scale(0.9);
  }
}

/* =====================================================
   ROTATE DEVICE OVERLAY (Enforce Landscape)
   ===================================================== */
#rotate-device-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: var(--bg-dark);
  color: var(--text);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
}

#rotate-device-overlay .rotate-icon {
  width: 120px;
  height: auto;
  animation: rotatePhone 2s infinite ease-in-out;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 10px rgba(255, 215, 0, 0.3));
}

@keyframes rotatePhone {
  0% { transform: rotate(0deg); }
  50% { transform: rotate(-90deg); }
  100% { transform: rotate(-90deg); }
}

@media screen and (orientation: portrait) and (max-width: 1024px) {
  #rotate-device-overlay {
    display: flex !important;
  }
}
