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

:root {
    --imperial-red: #ff1a1a;
    --imperial-dark-red: #8b0000;
    --imperial-crimson: #dc143c;
    --sith-gold: #ffd700;
    --dark-bg: #0a0a12;
    --panel-bg: rgba(15, 15, 30, 0.92);
    --panel-border: rgba(255, 26, 26, 0.3);
    --text-primary: #e8e8f0;
    --text-secondary: #8888aa;
    --hologram-blue: #00ccff;
    --hologram-cyan: #00ffcc;
    --energy-green: #00ff66;
    --warning-orange: #ff8800;
}

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

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    cursor: crosshair;
}

#game-container {
    width: 100vw;
    height: 100vh;
    position: relative;
}

.hidden { display: none !important; }

/* ========== LOADING SCREEN ========== */
#loading-screen {
    position: fixed;
    inset: 0;
    background: radial-gradient(ellipse at center, #1a0005 0%, #0a0000 40%, #000 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 1s ease;
}

.empire-emblem {
    animation: pulse-emblem 2s ease-in-out infinite;
    margin-bottom: 30px;
}

@keyframes pulse-emblem {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.05); filter: brightness(1.3); }
}

.loading-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: var(--imperial-red);
    text-shadow: 0 0 30px rgba(255, 26, 26, 0.6), 0 0 60px rgba(255, 26, 26, 0.3);
    letter-spacing: 15px;
    margin-bottom: 5px;
}

.loading-subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--text-secondary);
    letter-spacing: 10px;
    margin-bottom: 40px;
}

.loading-bar-container {
    width: 400px;
    height: 3px;
    background: rgba(255, 26, 26, 0.15);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 20px;
}

.loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--imperial-red), var(--sith-gold));
    border-radius: 2px;
    animation: load-progress 3s ease-in-out forwards;
    box-shadow: 0 0 15px var(--imperial-red);
}

@keyframes load-progress {
    0% { width: 0%; }
    30% { width: 35%; }
    60% { width: 70%; }
    90% { width: 95%; }
    100% { width: 100%; }
}

.loading-text {
    font-family: 'Rajdhani', sans-serif;
    color: var(--text-secondary);
    font-size: 0.85rem;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* ========== SPACE VIEW ========== */
#space-view {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 30% 20%, #0d0d2b 0%, #060612 50%, #000 100%);
    overflow: hidden;
}

#stars-canvas {
    position: absolute;
    inset: 0;
    z-index: 1;
}

#nebula-canvas {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0.4;
}

/* ========== DEATH STAR SHIP ========== */
#ship-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
}

#death-star {
    position: relative;
    animation: ship-float 8s ease-in-out infinite;
}

@keyframes ship-float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(0.3deg); }
    75% { transform: translateY(8px) rotate(-0.3deg); }
}

.ds-main {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #4a4a5a 0%, #2a2a35 30%, #1a1a22 60%, #0d0d15 100%);
    position: relative;
    box-shadow: 
        inset -20px -20px 40px rgba(0,0,0,0.8),
        inset 5px 5px 15px rgba(100,100,120,0.2),
        0 0 60px rgba(255, 26, 26, 0.15),
        0 0 120px rgba(255, 26, 26, 0.05);
    overflow: hidden;
}

.ds-surface {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
}

.ds-trench {
    position: absolute;
    width: 180px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.6), transparent);
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
}

.ds-trench-2 {
    top: 30%;
    width: 140px;
    left: 30px;
    transform: rotate(-5deg);
}

.ds-trench-3 {
    top: 72%;
    width: 150px;
    left: 25px;
    transform: rotate(3deg);
}

.ds-panel {
    position: absolute;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(100, 100, 120, 0.15);
    border-radius: 2px;
}

.ds-panel { width: 20px; height: 15px; top: 25%; left: 20%; }
.ds-panel-2 { width: 15px; height: 20px; top: 60%; left: 15%; }
.ds-panel-3 { width: 25px; height: 10px; top: 35%; left: 65%; }
.ds-panel-4 { width: 12px; height: 18px; top: 70%; left: 60%; }
.ds-panel-5 { width: 18px; height: 12px; top: 15%; left: 55%; }
.ds-panel-6 { width: 22px; height: 14px; top: 80%; left: 35%; }

.ds-laser-dish {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 22%;
    left: 12%;
    border-radius: 50%;
    background: radial-gradient(circle, #0a0a15 40%, #151520 60%, #1a1a28 100%);
    border: 2px solid rgba(60, 60, 80, 0.4);
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.8), 0 0 5px rgba(255, 26, 26, 0.1);
    animation: laser-pulse 4s ease-in-out infinite;
}

@keyframes laser-pulse {
    0%, 100% { box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 5px rgba(255,26,26,0.1); }
    50% { box-shadow: inset 0 0 15px rgba(0,0,0,0.8), 0 0 20px rgba(255,26,26,0.3); }
}

.ds-laser-inner {
    position: absolute;
    width: 25px;
    height: 25px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 26, 26, 0.3) 0%, transparent 70%);
}

.ds-laser-core {
    position: absolute;
    width: 8px;
    height: 8px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: var(--imperial-red);
    box-shadow: 0 0 10px var(--imperial-red);
    animation: core-glow 2s ease-in-out infinite;
}

@keyframes core-glow {
    0%, 100% { opacity: 0.5; box-shadow: 0 0 5px var(--imperial-red); }
    50% { opacity: 1; box-shadow: 0 0 20px var(--imperial-red), 0 0 40px rgba(255,26,26,0.3); }
}

.ds-glow {
    position: absolute;
    inset: -10px;
    border-radius: 50%;
    background: radial-gradient(circle, transparent 40%, rgba(255, 26, 26, 0.03) 70%, transparent 100%);
    pointer-events: none;
}

.ds-engine-glow {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 20px;
    background: radial-gradient(ellipse, rgba(0, 150, 255, 0.4), transparent);
    border-radius: 50%;
    animation: engine-flicker 0.3s ease-in-out infinite alternate;
}

.ds-engine-trail {
    position: absolute;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 40px;
    background: linear-gradient(to bottom, rgba(0, 150, 255, 0.2), transparent);
    border-radius: 0 0 50% 50%;
    animation: engine-flicker 0.2s ease-in-out infinite alternate;
}

@keyframes engine-flicker {
    0% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ========== PLANETS ========== */
.planet {
    position: absolute;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.3s ease, filter 0.3s ease;
    animation: planet-orbit 0.5s ease-out;
}

.planet:hover {
    transform: scale(1.15);
    filter: brightness(1.3);
}

.planet-label {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: var(--text-secondary);
    white-space: nowrap;
    letter-spacing: 2px;
    text-transform: uppercase;
    opacity: 0;
    transition: opacity 0.3s;
}

.planet:hover .planet-label {
    opacity: 1;
}

.planet-ring {
    position: absolute;
    width: 140%;
    height: 30%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotateX(75deg);
    border: 2px solid rgba(200, 180, 150, 0.4);
    border-radius: 50%;
    pointer-events: none;
}

@keyframes planet-orbit {
    0% { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== HUD ========== */
#hud {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 15px;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: auto;
    gap: 15px;
}

.hud-left-group, .hud-right-group {
    display: flex;
    gap: 10px;
}

.hud-center-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.hud-credits, .hud-resources {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 8px 16px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.hud-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.5rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.hud-value {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--sith-gold);
}

.hud-status-bar {
    display: flex;
    gap: 12px;
}

.status-item {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    letter-spacing: 1px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 4px 10px;
    border-radius: 3px;
}

.hud-morale-bar {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 8px 16px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

.morale-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.morale-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--imperial-red), #00ff66);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.game-log {
    position: absolute;
    bottom: 60px;
    left: 15px;
    width: 320px;
    max-height: 180px;
    overflow-y: auto;
    pointer-events: none;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.log-entry {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    color: #8899aa;
    background: rgba(8, 8, 20, 0.8);
    padding: 4px 10px;
    border-left: 2px solid rgba(255, 26, 26, 0.3);
    border-radius: 0 3px 3px 0;
    backdrop-filter: blur(5px);
    animation: log-in 0.3s ease-out;
}

@keyframes log-in {
    0% { opacity: 0; transform: translateX(-10px); }
    100% { opacity: 1; transform: translateX(0); }
}

.hud-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--imperial-red);
    letter-spacing: 5px;
    text-shadow: 0 0 10px rgba(255, 26, 26, 0.3);
    padding: 10px 25px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 4px;
    backdrop-filter: blur(10px);
}

.hud-bottom {
    display: flex;
    justify-content: center;
    gap: 15px;
    pointer-events: auto;
}

.hud-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 12px 25px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.hud-btn:hover {
    background: rgba(255, 26, 26, 0.15);
    border-color: var(--imperial-red);
    box-shadow: 0 0 20px rgba(255, 26, 26, 0.2);
}

.hud-btn-icon {
    margin-right: 5px;
}

/* ========== PLANET DETAIL VIEW ========== */
#planet-view {
    position: relative;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 60% 40%, #0d0d2b, #060612);
    overflow: hidden;
}

.planet-detail-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

#planet-detail-canvas {
    width: 100%;
    height: 100%;
}

.back-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 50;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.back-btn:hover {
    background: rgba(255, 26, 26, 0.15);
    border-color: var(--imperial-red);
}

.planet-info-panel {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 350px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 30px;
    z-index: 10;
    backdrop-filter: blur(15px);
}

.planet-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--sith-gold);
    letter-spacing: 5px;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.planet-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.planet-stat {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 4px;
    border: 1px solid rgba(255, 26, 26, 0.1);
}

.stat-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.planet-description {
    color: var(--text-secondary);
    line-height: 1.6;
    font-size: 0.9rem;
}

.planet-actions {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 20px;
    z-index: 10;
}

.action-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    padding: 15px 35px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s;
    border: none;
}

.destroy-btn {
    background: linear-gradient(135deg, var(--imperial-dark-red), var(--imperial-red));
    color: white;
    box-shadow: 0 0 20px rgba(255, 26, 26, 0.3);
    animation: destroy-pulse 2s ease-in-out infinite;
}

@keyframes destroy-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 26, 26, 0.3); }
    50% { box-shadow: 0 0 40px rgba(255, 26, 26, 0.6), 0 0 80px rgba(255, 26, 26, 0.2); }
}

.destroy-btn:hover {
    background: linear-gradient(135deg, var(--imperial-red), #ff4444);
    transform: scale(1.05);
    box-shadow: 0 0 40px rgba(255, 26, 26, 0.5);
}

.invade-btn {
    background: linear-gradient(135deg, #1a3a1a, #2a5a2a);
    color: var(--energy-green);
    border: 1px solid rgba(0, 255, 102, 0.3);
}

.invade-btn:hover {
    background: linear-gradient(135deg, #2a5a2a, #3a7a3a);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 255, 102, 0.3);
}

.blockade-btn {
    background: linear-gradient(135deg, #1a1a3a, #2a2a5a);
    color: var(--hologram-blue);
    border: 1px solid rgba(0, 200, 255, 0.3);
}

.blockade-btn:hover {
    background: linear-gradient(135deg, #2a2a5a, #3a3a7a);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.3);
}

.diplo-btn {
    background: linear-gradient(135deg, #1a2a1a, #2a5a2a);
    color: #ffcc00;
    border: 1px solid rgba(255, 200, 0, 0.3);
}

.diplo-btn:hover {
    background: linear-gradient(135deg, #2a4a2a, #3a6a3a);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 200, 0, 0.3);
}

/* ========== DIPLOMACY ========== */
.diplomacy-panel {
    position: absolute;
    left: 30px;
    top: 50%;
    transform: translateY(-50%);
    width: 400px;
    max-height: 70vh;
    overflow-y: auto;
    background: rgba(8, 8, 25, 0.97);
    border: 2px solid rgba(255, 200, 0, 0.4);
    border-radius: 10px;
    padding: 20px;
    z-index: 30;
    backdrop-filter: blur(15px);
    box-shadow: 0 0 40px rgba(255, 200, 0, 0.1);
    animation: panel-appear 0.3s ease-out;
}

.diplo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 200, 0, 0.2);
}

.diplo-header h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: #ffcc00;
    letter-spacing: 4px;
}

.diplo-faction {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    padding: 4px 12px;
    border: 1px solid;
    border-radius: 3px;
    letter-spacing: 1px;
}

.diplo-rel-bar {
    margin-bottom: 12px;
}

.diplo-rel-track {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 5px;
}

.diplo-rel-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease, background 0.5s ease;
}

.diplo-rel-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    letter-spacing: 2px;
}

.diplo-status-icons {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.diplo-icon {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    padding: 3px 10px;
    border-radius: 3px;
    letter-spacing: 1px;
}

.diplo-icon.allied {
    background: rgba(0, 255, 102, 0.1);
    border: 1px solid rgba(0, 255, 102, 0.4);
    color: #00ff66;
}

.diplo-icon.spy {
    background: rgba(0, 200, 255, 0.1);
    border: 1px solid rgba(0, 200, 255, 0.4);
    color: #00ccff;
}

.diplo-icon.betrayed {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff3333;
}

.diplo-actions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.diplo-action {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 200, 0, 0.15);
    border-radius: 6px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: left;
    color: #ddeeff;
}

.diplo-action:hover:not(.locked) {
    border-color: rgba(255, 200, 0, 0.5);
    background: rgba(255, 200, 0, 0.08);
    transform: translateY(-1px);
}

.diplo-action.locked {
    opacity: 0.35;
    cursor: not-allowed;
}

.diplo-action-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    color: #ffcc00;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.diplo-action-desc {
    font-size: 0.7rem;
    color: #8899aa;
    line-height: 1.3;
    margin-bottom: 6px;
}

.diplo-action-cost {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: #667788;
}

.rep-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #886600, #ffcc00);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.hud-rep-bar {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 8px 16px;
    border-radius: 4px;
    backdrop-filter: blur(10px);
    min-width: 120px;
}

/* ========== EMPEROR OVERLAY ========== */
.overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.emperor-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    max-width: 600px;
}

.emperor-hologram {
    width: 250px;
    height: 300px;
    position: relative;
    background: radial-gradient(ellipse at center, rgba(0, 200, 255, 0.05), transparent);
    border: 1px solid rgba(0, 200, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
}

.holo-scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(0, 200, 255, 0.03) 2px,
        rgba(0, 200, 255, 0.03) 4px
    );
    z-index: 3;
    animation: scanline-move 3s linear infinite;
}

@keyframes scanline-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

.holo-flicker {
    position: absolute;
    inset: 0;
    background: rgba(0, 200, 255, 0.02);
    z-index: 4;
    animation: holo-flicker 0.15s ease-in-out infinite alternate;
}

@keyframes holo-flicker {
    0% { opacity: 0.5; }
    50% { opacity: 0.8; }
    100% { opacity: 0.6; }
}

.emperor-figure {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 220px;
    z-index: 2;
}

.emperor-hood {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 90px;
    background: linear-gradient(180deg, #1a1a1a, #0a0a0a);
    border-radius: 50% 50% 30% 30%;
    overflow: hidden;
    border: 1px solid rgba(0, 200, 255, 0.2);
}

.emperor-face {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 55px;
    background: radial-gradient(ellipse at 50% 40%, #d4c4a0, #a09070);
    border-radius: 40% 40% 45% 45%;
}

.emperor-eyes {
    position: absolute;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 14px;
}

.emperor-eye {
    width: 6px;
    height: 4px;
    background: var(--sith-gold);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--sith-gold), 0 0 15px rgba(255, 215, 0, 0.5);
    animation: eye-glow 3s ease-in-out infinite;
}

@keyframes eye-glow {
    0%, 100% { box-shadow: 0 0 8px var(--sith-gold), 0 0 15px rgba(255,215,0,0.5); }
    50% { box-shadow: 0 0 15px var(--sith-gold), 0 0 30px rgba(255,215,0,0.8); }
}

.emperor-mouth {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    background: #3a2a2a;
    border-radius: 0 0 50% 50%;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.emperor-robe {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 140px;
    background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
    clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
    border: 1px solid rgba(0, 200, 255, 0.15);
}

.emperor-text-box {
    background: var(--panel-bg);
    border: 1px solid rgba(0, 200, 255, 0.3);
    padding: 25px 30px;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
    position: relative;
}

.emperor-text-box::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--hologram-blue), transparent);
}

.emperor-text {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--hologram-cyan);
    font-style: italic;
    text-shadow: 0 0 10px rgba(0, 255, 204, 0.3);
}

.emperor-continue-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    background: linear-gradient(135deg, var(--imperial-dark-red), var(--imperial-red));
    color: white;
    padding: 15px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 3px;
    transition: all 0.3s;
}

.emperor-continue-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 30px rgba(255, 26, 26, 0.5);
}

/* ========== TACTICAL MAP ========== */
#map-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: var(--dark-bg);
    display: flex;
    flex-direction: column;
}

.map-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 25px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--panel-border);
    position: relative;
    z-index: 10;
}

.map-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--imperial-red);
    letter-spacing: 3px;
}

.map-troops-info {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--sith-gold);
}

.map-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
}

.map-main-area {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#tactical-map-canvas {
    width: 100%;
    height: 100%;
    background: #06060f;
    display: block;
}

.zone-info-panel {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 8, 25, 0.97);
    border: 2px solid rgba(255, 200, 0, 0.5);
    border-radius: 10px;
    padding: 18px 30px;
    min-width: 420px;
    max-width: 550px;
    backdrop-filter: blur(15px);
    z-index: 10;
    box-shadow: 0 0 30px rgba(255, 200, 0, 0.15), inset 0 0 30px rgba(255, 200, 0, 0.03);
    animation: panel-appear 0.3s ease-out;
}

@keyframes panel-appear {
    0% { opacity: 0; transform: translateX(-50%) translateY(20px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.map-units-panel {
    width: 200px;
    background: var(--panel-bg);
    border-left: 1px solid var(--panel-border);
    padding: 15px;
    overflow-y: auto;
}

.map-units-panel h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--imperial-red);
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-align: center;
}

.unit-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 26, 26, 0.15);
    border-radius: 4px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.unit-card:hover, .unit-card.selected {
    border-color: var(--imperial-red);
    background: rgba(255, 26, 26, 0.1);
    box-shadow: 0 0 15px rgba(255, 26, 26, 0.1);
}

.unit-icon {
    font-size: 1.2rem;
    width: 30px;
    text-align: center;
}

.unit-card span:nth-child(2) {
    flex: 1;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.unit-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--sith-gold);
}

.map-actions {
    display: flex;
    gap: 15px;
    padding: 15px 25px;
    background: var(--panel-bg);
    border-top: 1px solid var(--panel-border);
    justify-content: center;
}

.map-action-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    padding: 12px 30px;
    border-radius: 4px;
    cursor: pointer;
    letter-spacing: 2px;
    border: none;
    transition: all 0.3s;
}

.attack-btn {
    background: linear-gradient(135deg, #8b0000, var(--imperial-red));
    color: white;
}

.attack-btn:hover { box-shadow: 0 0 20px rgba(255, 26, 26, 0.4); transform: scale(1.05); }

.defend-btn {
    background: linear-gradient(135deg, #1a3a1a, #2a5a2a);
    color: var(--energy-green);
}

.defend-btn:hover { box-shadow: 0 0 20px rgba(0, 255, 102, 0.3); transform: scale(1.05); }

.retreat-btn {
    background: linear-gradient(135deg, #2a2a3a, #3a3a4a);
    color: var(--text-secondary);
}

.retreat-btn:hover { box-shadow: 0 0 20px rgba(100, 100, 150, 0.3); transform: scale(1.05); }

/* ========== SHOP ========== */
.shop-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(255, 26, 26, 0.03), transparent 50%),
                radial-gradient(ellipse at 70% 30%, rgba(0, 200, 255, 0.02), transparent 40%),
                var(--dark-bg);
    z-index: 0;
}

#shop-screen, #fleet-screen, #profile-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
}

.shop-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--imperial-red);
    text-align: center;
    letter-spacing: 8px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(255, 26, 26, 0.3);
    position: relative;
    z-index: 1;
}

.shop-credits {
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    color: var(--sith-gold);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.shop-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.shop-category {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 20px;
    backdrop-filter: blur(10px);
}

.category-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--imperial-red);
    letter-spacing: 3px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 26, 26, 0.15);
    text-align: center;
}

.shop-item {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 26, 26, 0.1);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.shop-item:hover {
    border-color: var(--imperial-red);
    background: rgba(255, 26, 26, 0.08);
    transform: translateY(-2px);
}

.shop-item-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--text-primary);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.shop-item-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.4;
}

.shop-item-price {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    color: var(--sith-gold);
    display: flex;
    align-items: center;
    gap: 5px;
}

.shop-item-buy {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    background: linear-gradient(135deg, var(--imperial-dark-red), var(--imperial-red));
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 3px;
    cursor: pointer;
    letter-spacing: 2px;
    margin-top: 8px;
    transition: all 0.3s;
}

.shop-item-buy:hover {
    box-shadow: 0 0 15px rgba(255, 26, 26, 0.4);
}

/* ========== FLEET ========== */
.fleet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    max-width: 1000px;
    margin: 30px auto 0;
    position: relative;
    z-index: 1;
}

.fleet-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.fleet-card:hover {
    border-color: var(--hologram-blue);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.1);
}

.fleet-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.fleet-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--hologram-blue);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.fleet-count {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    color: var(--sith-gold);
    font-weight: 700;
}

/* ========== EMPIRE PROFILE ========== */
.empire-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 30px auto 0;
    position: relative;
    z-index: 1;
}

.empire-stat-card {
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(10px);
}

.empire-stat-icon {
    font-size: 2.5rem;
    color: var(--imperial-red);
}

.empire-stat-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 5px;
}

.empire-stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--sith-gold);
}

.conquered-planets {
    max-width: 800px;
    margin: 30px auto 0;
    position: relative;
    z-index: 1;
}

.conquered-planets h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    color: var(--imperial-red);
    letter-spacing: 3px;
    margin-bottom: 15px;
    text-align: center;
}

.conquered-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.conquered-planet-tag {
    background: rgba(255, 26, 26, 0.1);
    border: 1px solid rgba(255, 26, 26, 0.3);
    padding: 8px 18px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--text-primary);
}

/* ========== NOTIFICATION ========== */
.notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 12px 30px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--sith-gold);
    letter-spacing: 2px;
    z-index: 5000;
    backdrop-filter: blur(10px);
    transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.notification.show {
    transform: translateX(-50%) translateY(0);
}

/* ========== DESTRUCTION ========== */
#destruction-overlay {
    z-index: 2000;
}

#destruction-canvas {
    width: 100%;
    height: 100%;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .shop-grid {
        grid-template-columns: 1fr;
    }
    .planet-info-panel {
        right: 15px;
        width: 280px;
        padding: 20px;
    }
    .empire-stats {
        grid-template-columns: 1fr;
    }
    .planet-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    .ds-main {
        width: 140px;
        height: 140px;
    }
    .loading-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .map-units-panel {
        width: 150px;
    }
    .hud-bottom {
        flex-wrap: wrap;
    }
    .planet-info-panel {
        width: 90%;
        right: 5%;
        top: auto;
        bottom: 180px;
        transform: none;
    }
}

/* ========== DEVICE ADAPTIVE ========== */
#device-indicator {
    position: fixed;
    top: 5px;
    right: 50%;
    transform: translateX(50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    color: var(--text-secondary);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 3px 12px;
    border-radius: 3px;
    z-index: 9999;
    letter-spacing: 1px;
    pointer-events: none;
    opacity: 0.6;
}

.key-hint {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.7rem;
    color: rgba(150, 160, 180, 0.4);
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 5;
}

/* TOUCH CONTROLS */
.touch-controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 9000;
    display: grid;
    grid-template-areas:
        ".    up    ."
        "left .     right"
        "down .     ."
        ".    .     ."
        "attack select back"
        "shop  .     .";
    grid-template-columns: 70px 70px 70px;
    grid-template-rows: 60px 60px 60px 10px 55px 55px;
    gap: 6px;
}

.device-desktop .touch-controls { display: none; }

.touch-btn {
    border: 2px solid rgba(255, 26, 26, 0.3);
    background: rgba(10, 10, 30, 0.85);
    color: var(--text-primary);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    backdrop-filter: blur(10px);
    transition: all 0.15s;
}

.touch-btn:active {
    background: rgba(255, 26, 26, 0.2);
    border-color: var(--imperial-red);
    transform: scale(0.93);
}

.touch-up { grid-area: up; }
.touch-left { grid-area: left; }
.touch-right { grid-area: right; }
.touch-down { grid-area: down; }
.touch-attack { grid-area: attack; background: rgba(139, 0, 0, 0.6); border-color: rgba(255, 50, 50, 0.5); }
.touch-select { grid-area: select; background: rgba(0, 80, 0, 0.4); border-color: rgba(0, 255, 102, 0.3); }
.touch-back { grid-area: back; background: rgba(40, 40, 80, 0.6); border-color: rgba(100, 100, 200, 0.3); }
.touch-shop { grid-area: shop; background: rgba(100, 80, 0, 0.4); border-color: rgba(255, 200, 0, 0.3); }

/* TABLET ADAPTATIONS */
.device-tablet .hud-btn {
    padding: 16px 30px;
    font-size: 0.85rem;
}

.device-tablet .action-btn {
    padding: 18px 40px;
    font-size: 0.95rem;
}

.device-tablet .planet {
    transform: scale(1.2);
}

.device-tablet .planet:hover {
    transform: scale(1.35);
}

.device-tablet .map-action-btn {
    padding: 16px 35px;
    font-size: 0.85rem;
}

.device-tablet .unit-card {
    padding: 16px;
    margin-bottom: 12px;
}

.device-tablet .shop-item-buy {
    padding: 10px 20px;
    font-size: 0.7rem;
}

.device-tablet .diplo-action {
    padding: 14px;
}

.device-tablet .back-btn {
    padding: 14px 25px;
    font-size: 0.85rem;
}

.device-tablet .diplomacy-panel {
    width: 450px;
}

.device-tablet .zone-info-panel {
    min-width: 480px;
    padding: 20px 35px;
}

/* Touch target enlargement */
.touch-target {
    min-height: 44px;
    min-width: 44px;
}

/* MOBILE ADAPTATIONS */
.device-mobile .hud-top {
    flex-wrap: wrap;
    gap: 5px;
}

.device-mobile .hud-title {
    font-size: 0.6rem;
    padding: 6px 12px;
}

.device-mobile .hud-value {
    font-size: 0.85rem;
}

.device-mobile .hud-bottom {
    gap: 8px;
}

.device-mobile .hud-btn {
    padding: 12px 18px;
    font-size: 0.6rem;
}

.device-mobile .action-btn {
    padding: 14px 25px;
    font-size: 0.8rem;
}

.device-mobile .planet-info-panel {
    width: 95%;
    right: 2.5%;
    top: auto;
    bottom: 200px;
    transform: none;
    padding: 15px;
}

.device-mobile .diplomacy-panel {
    width: 95%;
    left: 2.5%;
    top: auto;
    bottom: 10px;
    transform: none;
    max-height: 50vh;
}

.device-mobile .planet-actions {
    bottom: 130px;
    flex-wrap: wrap;
    gap: 8px;
}

.device-mobile .map-units-panel {
    width: 120px;
}

.device-mobile .zone-info-panel {
    min-width: 280px;
    font-size: 0.85rem;
}

.device-mobile .game-log {
    display: none;
}

.device-mobile .shop-grid {
    grid-template-columns: 1fr;
}

.device-mobile .ds-main {
    width: 100px;
    height: 100px;
}

.device-mobile .loading-title {
    font-size: 2rem;
}

/* ============================================================
   DEVICE DETECTION & ADAPTIVE CONTROLS
   ============================================================ */
.device-indicator {
    position: absolute;
    left: 15px;
    bottom: 60px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    color: #556677;
    letter-spacing: 1px;
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    padding: 5px 12px;
    border-radius: 3px;
    pointer-events: none;
    z-index: 25;
}

/* ========== TOUCH CONTROLS ========== */
.touch-controls {
    position: fixed;
    bottom: 15px;
    right: 15px;
    z-index: 9999;
    display: grid;
    grid-template-areas:
        ".    up    ."
        "left .     right"
        "down .     ."
        ".    atk   ."
        "sel  back  shop";
    grid-template-columns: 65px 65px 65px;
    grid-template-rows: 65px 65px 65px 55px 55px;
    gap: 5px;
    pointer-events: auto;
}

.touch-btn {
    border: none;
    border-radius: 12px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
}

.touch-btn:active {
    transform: scale(0.9);
    filter: brightness(1.3);
}

.touch-up { grid-area: up; }
.touch-left { grid-area: left; }
.touch-right { grid-area: right; }
.touch-down { grid-area: down; }

.touch-dpad {
    background: rgba(0, 150, 255, 0.2);
    border: 2px solid rgba(0, 150, 255, 0.4);
    color: #88bbdd;
    font-size: 1.2rem;
}

.touch-attack { grid-area: atk; background: rgba(255, 26, 26, 0.25); border: 2px solid rgba(255, 50, 50, 0.5); color: #ff6644; }
.touch-select { grid-area: sel; background: rgba(0, 255, 102, 0.15); border: 2px solid rgba(0, 255, 102, 0.4); color: #44dd66; }
.touch-back { grid-area: back; background: rgba(150, 150, 180, 0.15); border: 2px solid rgba(150, 150, 180, 0.3); color: #99aabb; }
.touch-shop { grid-area: shop; background: rgba(255, 200, 0, 0.15); border: 2px solid rgba(255, 200, 0, 0.4); color: #ddaa33; }

/* ========== TABLET ADAPTATIONS ========== */
.device-tablet .ds-main {
    width: 160px;
    height: 160px;
}

.device-tablet .planet {
    min-width: 50px;
    min-height: 50px;
}

.device-tablet .hud-btn,
.device-tablet .action-btn,
.device-tablet .map-action-btn,
.device-tablet .back-btn {
    min-height: 52px;
    font-size: 0.8rem;
    padding: 14px 22px;
}

.device-tablet .planet-actions {
    flex-wrap: wrap;
    gap: 12px;
}

.device-tablet .unit-card {
    min-height: 55px;
    padding: 15px;
}

.device-tablet .shop-item {
    padding: 18px;
}

.device-tablet .shop-item-buy {
    min-height: 44px;
    font-size: 0.7rem;
}

.device-tablet .diplo-action {
    padding: 14px;
}

.device-tablet .planet-info-panel {
    width: 320px;
    padding: 22px;
}

.device-tablet .diplomacy-panel {
    width: 360px;
}

.touch-target {
    min-height: 44px !important;
    min-width: 44px !important;
}

.device-tablet .map-units-panel {
    width: 180px;
}

.device-tablet #zone-info-panel {
    min-width: 350px;
    padding: 14px 20px;
}

/* ========== MOBILE ADAPTATIONS ========== */
.device-mobile .hud-top {
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.device-mobile .hud-center-group {
    flex-direction: column;
}

.device-mobile .hud-status-bar {
    flex-wrap: wrap;
    justify-content: center;
}

.device-mobile .hud-btn {
    padding: 10px 14px;
    font-size: 0.6rem;
}

.device-mobile .ds-main {
    width: 120px;
    height: 120px;
}

.device-mobile .planet-info-panel {
    width: 95%;
    right: 2.5%;
    top: auto;
    bottom: 220px;
    transform: none;
    max-height: 35vh;
    overflow-y: auto;
}

.device-mobile .planet-actions {
    flex-direction: column;
    align-items: center;
    bottom: 20px;
}

.device-mobile .action-btn {
    width: 80%;
    max-width: 300px;
}

.device-mobile .shop-grid {
    grid-template-columns: 1fr;
}

.device-mobile .map-units-panel {
    width: 130px;
}

.device-mobile .diplomacy-panel {
    width: 95%;
    left: 2.5%;
    top: auto;
    bottom: 10px;
    transform: none;
    max-height: 60vh;
}

.device-mobile .empire-stats {
    grid-template-columns: 1fr;
}

.device-mobile .map-actions {
    flex-direction: column;
    align-items: center;
}

.device-mobile .map-action-btn {
    width: 80%;
    max-width: 300px;
}

/* ========== DESKTOP ONLY ========== */
.device-desktop .touch-controls {
    display: none !important;
}

.device-desktop .device-indicator {
    display: none;
}
