/* ============================================
   THEME PARK TYCOON - Game Screen Styles
   ============================================ */

/* ==================== GAME HUD ==================== */
.game-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border-gold);
    min-height: 48px;
    z-index: 10;
    gap: var(--space-sm);
}

.hud-round {
    font-size: var(--font-size-sm);
    color: var(--gold);
    font-weight: bold;
    white-space: nowrap;
    min-width: 80px;
}

.hud-player {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex: 1;
    justify-content: center;
    min-width: 0;
}

.hud-player-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.hud-player-name {
    font-size: var(--font-size-md);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hud-actions {
    display: flex;
    gap: var(--space-xs);
}

/* ==================== GAME MAP ==================== */
.game-map-container {
    flex: 1;
    overflow: auto;
    position: relative;
    background: linear-gradient(180deg, #0d1b0e 0%, #162618 50%, #0d1b0e 100%);
    -webkit-overflow-scrolling: touch;
    min-height: 0;
}

.game-map {
    display: grid;
    gap: 2px;
    padding: var(--space-sm);
    min-width: fit-content;
    margin: 0 auto;
}

/* Map tiles */
.map-tile {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 2px;
    font-size: 18px;
    transition: all 0.15s;
}

.map-tile-empty {
    /* Invisible tile */
}

.map-tile-path {
    background: #2a3a2e;
    border: 2px solid #3a5a3e;
}

.map-tile-city {
    background: linear-gradient(135deg, #1a2a4e, #2a3a6e);
    border: 2px solid var(--blue-bright);
    cursor: pointer;
    font-size: 20px;
}

.map-tile-city:hover {
    border-color: var(--gold);
}

.map-tile-start {
    background: linear-gradient(135deg, #2a1a3e, #4a2a6e);
    border: 2px solid var(--rainbow-purple);
    font-size: 16px;
}

/* Highlight reachable tiles */
.map-tile-reachable {
    border-color: var(--gold) !important;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
    cursor: pointer;
    animation: glowPulse 1.5s ease-in-out infinite;
}

.map-tile-reachable:active {
    transform: scale(0.95);
}

/* Player tokens on map */
.player-token {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.5);
    position: absolute;
    z-index: 5;
    box-shadow: 0 0 4px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.player-token.active-token {
    animation: playerPulse 1.5s ease-in-out infinite;
    z-index: 6;
    width: 22px;
    height: 22px;
    border-color: white;
}

/* Multiple players on same tile - position offsets */
.player-token[data-offset="0"] { top: 2px; left: 2px; }
.player-token[data-offset="1"] { top: 2px; right: 2px; }
.player-token[data-offset="2"] { bottom: 2px; left: 2px; }
.player-token[data-offset="3"] { bottom: 2px; right: 2px; }
.player-token[data-offset="4"] { top: 50%; left: 2px; transform: translateY(-50%); }
.player-token[data-offset="5"] { top: 50%; right: 2px; transform: translateY(-50%); }

/* City name labels */
.city-label {
    position: absolute;
    bottom: -14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 8px;
    color: var(--text-muted);
    white-space: nowrap;
    pointer-events: none;
    z-index: 3;
}

/* ==================== TURN PANEL ==================== */
.turn-panel {
    background: var(--bg-secondary);
    border-top: 2px solid var(--border-gold);
    padding: var(--space-md);
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.turn-phase {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    text-align: center;
}

.turn-prompt {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    font-weight: bold;
}

.turn-hint {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Dice */
.dice-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.pixel-dice {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(180deg, #FFFFFF 0%, #E0E0E0 100%);
    color: var(--blue);
    border: 4px solid var(--gold);
    box-shadow: var(--pixel-shadow);
}

.pixel-dice.rolling {
    animation: diceRoll 0.5s ease-in-out;
    background: linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%);
    color: var(--blue);
}

/* Action buttons */
.action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    width: 100%;
}

.action-buttons .btn {
    font-size: var(--font-size-sm);
    padding: var(--space-sm);
    min-height: 44px;
}

/* ==================== RESOURCE BAR ==================== */
.resource-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    min-height: 36px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px 4px;
    min-width: fit-content;
}

.res-icon {
    font-size: 14px;
}

.res-count {
    font-size: var(--font-size-sm);
    font-weight: bold;
    color: var(--text-primary);
    min-width: 14px;
    text-align: center;
}

.res-separator {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    padding: 0;
    margin: 0 2px;
}

/* ==================== POPULARITY BAR ==================== */
.popularity-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-xs);
    background: linear-gradient(90deg, rgba(255,215,0,0.1) 0%, rgba(255,215,0,0.05) 100%);
    border-top: 1px solid var(--border-gold);
    min-height: 28px;
}

.pop-icon { font-size: 14px; }
.pop-label { font-size: var(--font-size-sm); color: var(--text-muted); }
.pop-value { font-size: var(--font-size-md); color: var(--gold); font-weight: bold; }

/* ==================== BUILD RIDE PANEL ==================== */
.tier-tabs {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
    margin-bottom: var(--space-md);
}

.tier-tab {
    font-family: var(--font-game);
    font-size: var(--font-size-sm);
    padding: var(--space-xs) var(--space-sm);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    min-width: fit-content;
}

.tier-tab.active {
    background: var(--gold);
    color: var(--blue);
    border-color: var(--gold-dark);
    font-weight: bold;
}

.tier-tab.locked {
    opacity: 0.4;
    cursor: not-allowed;
}

.tier-tab .lock-icon {
    margin-left: 2px;
}

/* Ride cards */
.ride-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-md);
    margin-bottom: var(--space-sm);
    box-shadow: var(--pixel-shadow);
    transition: border-color 0.15s;
}

.ride-card.can-build {
    border-color: var(--success);
    cursor: pointer;
}

.ride-card.can-build:active {
    transform: scale(0.98);
}

.ride-card.already-built {
    border-color: var(--gold);
    opacity: 0.6;
}

.ride-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.ride-name {
    font-size: var(--font-size-md);
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.ride-pop {
    font-size: var(--font-size-sm);
    color: var(--gold);
    font-weight: bold;
}

.ride-cost {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
}

.ride-cost-item {
    display: flex;
    align-items: center;
    gap: 2px;
    font-size: var(--font-size-sm);
    padding: 1px 4px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
}

.ride-cost-item.has-enough {
    border-color: var(--success);
    color: var(--success);
}

.ride-cost-item.not-enough {
    border-color: var(--danger);
    color: var(--danger);
}

.ride-card-footer {
    margin-top: var(--space-sm);
    display: flex;
    justify-content: flex-end;
}

.build-status {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    font-style: italic;
}

.build-status.buildable {
    color: var(--success);
}

/* ==================== UPGRADE PANEL ==================== */
.upgrade-ride-card {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
}

.upgrade-ride-name {
    font-size: var(--font-size-md);
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.upgrade-options {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.upgrade-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm);
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: border-color 0.15s;
}

.upgrade-option.can-afford {
    border-color: var(--success);
}

.upgrade-option.can-afford:active {
    transform: scale(0.98);
}

.upgrade-option.already-applied {
    opacity: 0.5;
    cursor: not-allowed;
}

.upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upgrade-name {
    font-size: var(--font-size-sm);
    font-weight: bold;
}

.upgrade-cost-row {
    display: flex;
    gap: var(--space-xs);
    font-size: var(--font-size-sm);
}

.upgrade-bonus {
    color: var(--gold);
    font-weight: bold;
    font-size: var(--font-size-sm);
    white-space: nowrap;
}

/* ==================== MY PARK ==================== */
.park-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
}

.park-stat {
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-sm);
    text-align: center;
}

.park-stat-value {
    font-size: var(--font-size-xl);
    color: var(--gold);
    font-weight: bold;
}

.park-stat-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.park-rides-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.park-ride-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    padding: var(--space-sm) var(--space-md);
}

.park-ride-icon {
    font-size: 24px;
    width: 36px;
    text-align: center;
}

.park-ride-info {
    flex: 1;
}

.park-ride-name {
    font-weight: bold;
    font-size: var(--font-size-md);
}

.park-ride-tier {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.park-ride-pop {
    color: var(--gold);
    font-weight: bold;
}

.park-ride-upgrades {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.park-ride-upgrade-badge {
    font-size: 10px;
    padding: 1px 4px;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid var(--gold-dark);
    color: var(--gold);
}

.park-empty {
    text-align: center;
    padding: var(--space-xl);
    color: var(--text-muted);
}

.park-empty-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

/* ==================== CITY REWARD ==================== */
.city-reward {
    width: 100%;
    text-align: center;
}

.city-reward-title {
    font-size: var(--font-size-lg);
    color: var(--blue-bright);
    font-weight: bold;
    margin-bottom: var(--space-sm);
}

.city-reward-icon {
    font-size: 40px;
    margin-bottom: var(--space-sm);
}

.city-reward-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.reward-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: var(--space-xs) var(--space-sm);
    background: rgba(78, 203, 113, 0.15);
    border: 2px solid var(--success);
    font-size: var(--font-size-md);
    font-weight: bold;
    color: var(--success);
    animation: popIn 0.3s ease-out;
}

/* ==================== RESPONSIVE ==================== */
@media (min-width: 480px) {
    .game-map-container {
        display: flex;
        align-items: center;
    }

    .turn-panel {
        min-height: 160px;
    }
}

@media (min-width: 768px) {
    .modal-content {
        max-width: 500px;
        margin: 0 auto;
        border-radius: 16px;
    }

    .modal {
        align-items: center;
    }
}
