/* ========= EmpireClick UI Polish Pack ========= */

:root{
  --ui-bg: 12 12 16;
  --ui-card: 22 22 28;
  --ui-accent: 255 184 77;   /* gold */
  --ui-accent-2: 93 156 236; /* royal blue */
  --ui-text: 240 240 248;
  --ui-muted: 170 170 182;

  --glass-bg: rgba(20,20,28,0.6);
  --glass-border: rgba(255,255,255,0.08);
  --glow: 0 8px 24px rgba(0,0,0,0.55);

  --z-base: 10;
  --z-tooltip: 900;
  --z-toast: 1200;
  --z-modal: 1400;
  --z-message: 1500;
}

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

.ec-glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: var(--glow);
  backdrop-filter: blur(10px);
}

.ec-title {
  font-weight: 700;
  letter-spacing: .3px;
  color: rgb(var(--ui-text));
}

/* Plot Info Panel (uses existing #plotInfoPanel) */
.plot-info-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: var(--z-message);
  display: none;
  min-width: 260px;
  padding: 14px 16px;
  color: rgb(var(--ui-text));
  border-left: 3px solid rgb(var(--ui-accent));
}
.plot-info-panel.ec-glass .label { color: rgba(var(--ui-text), .8); font-size: .85rem; }
.plot-info-panel.ec-glass .value { font-weight: 600; }
.plot-info-panel .row { display: grid; grid-template-columns: 90px 1fr; gap: 6px; margin: 4px 0; }
.plot-info-panel .tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 8px; border-radius: 999px;
  background: rgba(var(--ui-accent), .12);
  border: 1px solid rgba(var(--ui-accent), .35);
  color: rgb(var(--ui-text));
  font-size: .8rem;
}

/* Modal polish (uses existing .modal containers) */
.modal {
  position: fixed; inset: 0; display: none; z-index: var(--z-modal);
  align-items: center; justify-content: center;
}
.modal.is-open { display: flex; }
.modal::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0,0,0,.5); backdrop-filter: blur(3px);
}
.modal .modal-content {
  position: relative; z-index: 1; width: min(720px, 92vw);
  padding: 18px;
  animation: ecPop .18s ease-out;
}
.modal .modal-content.ec-glass { border-top: 1px solid rgba(255,255,255,.06); }

@keyframes ecPop {
  from { transform: translateY(8px) scale(.98); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

/* Game Message (uses existing #gameMessage) */
#gameMessage {
  position: fixed; left: 50%; top: 6%;
  transform: translateX(-50%);
  z-index: var(--z-message);
  display: none;
  padding: 16px 22px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(32,32,38,.9), rgba(20,20,26,.9));
  color: rgb(var(--ui-text));
  box-shadow: 0 16px 38px rgba(0,0,0,.45);
}

/* Toasts */
.ec-toast-container {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex; flex-direction: column; gap: 10px; align-items: center;
}
.ec-toast {
  min-width: 260px; max-width: 520px;
  padding: 10px 14px; border-radius: 10px;
  background: rgba(20,20,28,.85);
  border: 1px solid rgba(255,255,255,.08);
  color: rgb(var(--ui-text));
  box-shadow: var(--glow);
  animation: toastIn .2s ease-out;
}
.ec-toast.success { border-left: 3px solid #22c55e; }
.ec-toast.error   { border-left: 3px solid #ef4444; }
.ec-toast.info    { border-left: 3px solid rgb(var(--ui-accent-2)); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Tooltips (optional helper class) */
.ec-tip {
  position: absolute; z-index: var(--z-tooltip);
  padding: 6px 8px; border-radius: 8px;
  background: rgba(0,0,0,.85); color: #fff; font-size: 12px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: 0 8px 18px rgba(0,0,0,.45);
}

/* Motion respect */
@media (prefers-reduced-motion: reduce){
  * { animation: none !important; transition: none !important; }
}

body {
    background: linear-gradient(to bottom, #87CEEB 0%, #98D8E8 50%, #B0E0E6 100%);
    min-height: 100vh;
    overflow: hidden;
    font-family: 'Arial', sans-serif;
    /* Mobile landscape enforcement */
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Overlay styles for all devices */
.overlay-panel {
    position: fixed;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #ffd700;
    border-radius: 10px;
    padding: 10px;
    color: white;
    font-size: 12px;
    max-width: 250px;
    min-width: 180px;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.minimize-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #ffd700;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 5px;
    border-radius: 3px;
}

.minimize-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.minimized {
    width: auto !important;
    height: auto !important;
    overflow: hidden;
}

.minimized .overlay-content {
    display: none;
}

/* Mobile orientation warning */
.mobile-orientation-warning {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    color: white;
    text-align: center;
}

.orientation-content {
    padding: 20px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 15px;
    border: 2px solid #ffd700;
}

.orientation-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.orientation-arrow {
    font-size: 36px;
    margin-top: 15px;
    animation: rotate 2s infinite linear;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile landscape enforcement */
@media screen and (max-width: 768px) {
    body {
        /* Force landscape orientation */
        transform: rotate(90deg);
        transform-origin: center center;
        width: 100vh;
        height: 100vw;
        position: fixed;
        top: 0;
        left: 0;
    }
    
    .game-container {
        width: 100vh;
        height: 100vw;
        transform: rotate(-90deg);
        transform-origin: center center;
    }
    
    .world {
        width: 100vh;
        height: 100vw;
    }
    
    /* Adjust plot sizes for mobile */
    .plot {
        min-width: 20px;
        min-height: 20px;
    }
    
    /* Make panels more mobile-friendly */
    .panel {
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
        font-size: 14px;
    }
    
    /* Ensure overlays are draggable and visible */
    .draggable {
        touch-action: none;
        user-select: none;
    }
    
    /* Mobile-friendly overlay positioning */
    .overlay-panel {
        position: fixed;
        z-index: 1000;
        background: rgba(0, 0, 0, 0.9);
        border: 2px solid #ffd700;
        border-radius: 10px;
        padding: 10px;
        color: white;
        font-size: 12px;
        max-width: 200px;
        min-width: 150px;
    }
    
    /* Minimize button for overlays */
    .minimize-btn {
        position: absolute;
        top: 5px;
        right: 5px;
        background: none;
        border: none;
        color: #ffd700;
        font-size: 14px;
        cursor: pointer;
        padding: 2px 5px;
        border-radius: 3px;
    }
    
    .minimize-btn:hover {
        background: rgba(255, 215, 0, 0.2);
    }
    
    /* Minimized state */
    .minimized {
        width: auto !important;
        height: auto !important;
        overflow: hidden;
    }
    
    .minimized .overlay-content {
        display: none;
    }
}

.game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    perspective: 1000px;
    overflow: hidden;
}

.world {
    position: absolute;
    width: 100vw;
    height: 100vh;
    transform-style: preserve-3d;
    transform: rotateX(45deg) translateZ(-200px) scale(1);
    transition: transform 0.1s ease-out;
    overflow: hidden;
    z-index: 1;
}

.ground {
    position: absolute;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #666 25%, transparent 25%), 
                linear-gradient(-45deg, #666 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #666 75%), 
                linear-gradient(-45deg, transparent 75%, #666 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #777;
}

.plot {
    position: absolute;
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 6px;
    transform-style: preserve-3d;
    transition: transform 0.2s ease;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    cursor: pointer;
}

.plot:hover {
    transform: translateZ(4px) scale(1.02);
    filter: brightness(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.plot.claimed {
    border: 2px solid #FFD700;
    box-shadow: 0 4px 8px rgba(255, 215, 0, 0.3);
}

.plot.Common {
    background: linear-gradient(135deg, #4CAF50, #66BB6A);
}

.plot.Rare {
    background: linear-gradient(135deg, #2196F3, #42A5F5);
}

.plot.Epic {
    background: linear-gradient(135deg, #9C27B0, #BA68C8);
}

.plot.Legendary {
    background: linear-gradient(135deg, #FF9800, #FFB74D);
}

.plot.Elite {
    background: linear-gradient(135deg, #F44336, #E57373);
    animation: eliteGlow 3s ease-in-out infinite alternate;
}

@keyframes eliteGlow {
    0% { 
        box-shadow: 0 4px 8px rgba(244, 67, 54, 0.3);
    }
    100% { 
        box-shadow: 0 6px 12px rgba(244, 67, 54, 0.5);
    }
}

.plot-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5px;
    font-size: 10px;
    color: white;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    text-align: center;
    font-weight: bold;
    z-index: 3;
}

.plot-tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 10px;
    border-radius: 8px;
    font-size: 12px;
    max-width: 200px;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 2px solid #FFD700;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.plot:hover .plot-tooltip {
    opacity: 1;
}

.building {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    transform-style: preserve-3d;
    transform: rotateX(45deg) rotateZ(0deg) translateZ(20px);
}

.building-common {
    background: #D4A574;
    box-shadow: 
        0 4px 8px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Common Cottage - 3D Structure */
.building-common::before {
    content: '';
    position: absolute;
    top: 60%;
    left: 20%;
    width: 60%;
    height: 40%;
    background: #A0522D;
    transform: rotateX(90deg) translateZ(10px);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.building-common::after {
    content: '';
    position: absolute;
    top: 40%;
    left: 30%;
    width: 40%;
    height: 20%;
    background: #8B4513;
    transform: rotateX(90deg) translateZ(20px);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.1);
}

/* Common Cottage - Side Walls */
.building-common .wall-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 20%;
    height: 100%;
    background: #CD853F;
    transform: rotateY(-90deg) translateZ(10px);
    box-shadow: inset 2px 0 4px rgba(0,0,0,0.3);
}

.building-common .wall-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 20%;
    height: 100%;
    background: #CD853F;
    transform: rotateY(90deg) translateZ(10px);
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
}

.building-common {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="20" y="60" width="60" height="40" fill="%23D4A574" stroke="%238B4513" stroke-width="2"/><rect x="30" y="50" width="40" height="20" fill="%23A0522D" stroke="%238B4513" stroke-width="2"/><rect x="35" y="40" width="30" height="20" fill="%238B4513" stroke="%238B4513" stroke-width="2"/><rect x="40" y="35" width="20" height="15" fill="%23CD853F" stroke="%238B4513" stroke-width="1"/><circle cx="45" cy="42" r="2" fill="%23FFD700"/></svg>');
}

.building-rare {
    background: #DAA520;
    box-shadow: 
        0 6px 12px rgba(0,0,0,0.4),
        inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Rare House - 3D Structure */
.building-rare::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 15%;
    width: 70%;
    height: 50%;
    background: #B8860B;
    transform: rotateX(90deg) translateZ(15px);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.building-rare::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 25%;
    width: 50%;
    height: 25%;
    background: #CD853F;
    transform: rotateX(90deg) translateZ(30px);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.1);
}

/* Rare House - Side Walls */
.building-rare .wall-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 15%;
    height: 100%;
    background: #B8860B;
    transform: rotateY(-90deg) translateZ(15px);
    box-shadow: inset 2px 0 4px rgba(0,0,0,0.3);
}

.building-rare .wall-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 15%;
    height: 100%;
    background: #B8860B;
    transform: rotateY(90deg) translateZ(15px);
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
}

.building-epic {
    background: #A0A0A0;
    box-shadow: 
        0 8px 16px rgba(0,0,0,0.5),
        inset 0 2px 4px rgba(255,255,255,0.3);
}

/* Epic Stone Fort - 3D Structure */
.building-epic::before {
    content: '';
    position: absolute;
    top: 40%;
    left: 10%;
    width: 80%;
    height: 60%;
    background: #808080;
    transform: rotateX(90deg) translateZ(20px);
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.2);
}

.building-epic::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 60%;
    height: 30%;
    background: #C0C0C0;
    transform: rotateX(90deg) translateZ(40px);
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.1);
}

/* Epic Stone Fort - Side Walls */
.building-epic .wall-left {
    position: absolute;
    top: 0;
    left: 0;
    width: 10%;
    height: 100%;
    background: #808080;
    transform: rotateY(-90deg) translateZ(20px);
    box-shadow: inset 2px 0 4px rgba(0,0,0,0.3);
}

.building-epic .wall-right {
    position: absolute;
    top: 0;
    right: 0;
    width: 10%;
    height: 100%;
    background: #808080;
    transform: rotateY(90deg) translateZ(20px);
    box-shadow: inset -2px 0 4px rgba(0,0,0,0.3);
}

/* Epic Stone Fort - Towers */
.building-epic .tower-left {
    position: absolute;
    top: 0;
    left: 5%;
    width: 8%;
    height: 100%;
    background: #C0C0C0;
    transform: rotateY(-90deg) translateZ(25px);
    box-shadow: inset 1px 0 2px rgba(0,0,0,0.3);
}

.building-epic .tower-right {
    position: absolute;
    top: 0;
    right: 5%;
    width: 8%;
    height: 100%;
    background: #C0C0C0;
    transform: rotateY(90deg) translateZ(25px);
    box-shadow: inset -1px 0 2px rgba(0,0,0,0.3);
}

.building-legendary {
    background: linear-gradient(135deg, #DAA520 0%, #FFD700 50%, #F4A460 100%);
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.4),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 10px 20px rgba(255,215,0,0.3);
}

.building-legendary::before {
    content: '';
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 55%;
    background: linear-gradient(135deg, #FFD700 0%, #DAA520 100%);
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.3);
}

.building-legendary::after {
    content: '';
    position: absolute;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 40%;
    background: linear-gradient(135deg, #F4A460 0%, #DEB887 100%);
    border-radius: 8px 8px 0 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.2);
}

.building-elite {
    background: linear-gradient(135deg, #FFD700 0%, #F4A460 50%, #DEB887 100%);
    box-shadow: 
        inset 0 2px 4px rgba(255,255,255,0.5),
        inset 0 -2px 4px rgba(0,0,0,0.3),
        0 12px 24px rgba(255,215,0,0.4);
    animation: eliteGlow 3s ease-in-out infinite alternate;
}

.building-elite::before {
    content: '';
    position: absolute;
    top: 0%;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    height: 60%;
    background: linear-gradient(135deg, #F4A460 0%, #FFD700 100%);
    border-radius: 12px 12px 0 0;
    box-shadow: inset 0 2px 4px rgba(255,255,255,0.4);
}

.building-elite::after {
    content: '';
    position: absolute;
    top: -5%;
    left: 50%;
    transform: translateX(-50%);
    width: 75%;
    height: 45%;
    background: linear-gradient(135deg, #DEB887 0%, #CD853F 100%);
    border-radius: 10px 10px 0 0;
    box-shadow: inset 0 1px 2px rgba(255,255,255,0.3);
}

.plot-name {
    font-weight: bold;
    margin-bottom: 2px;
    text-transform: uppercase;
    font-size: 9px;
}

.plot-owner {
    font-size: 8px;
    opacity: 0.9;
    font-style: italic;
}

.plot-rarity {
    font-size: 8px;
    font-weight: bold;
    margin-top: 2px;
}

.player {
    position: absolute;
    width: 20px;
    height: 20px;
    background: linear-gradient(145deg, #FFF, #E0E0E0);
    border: 2px solid #333;
    border-radius: 50%;
    transform: translateZ(10px);
    transition: all 0.2s ease;
    z-index: 100;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

.player::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
}

.player.moving {
    animation: walk 0.3s ease-in-out;
}

@keyframes walk {
    0%, 100% { transform: translateZ(10px) scale(1); }
    50% { transform: translateZ(12px) scale(1.1); }
}

.ui {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-family: monospace;
    z-index: 1000;
    backdrop-filter: blur(10px);
    min-width: 200px;
}

.game-panels {
    position: fixed;
    top: 20px;
    left: 240px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 1000;
    max-height: 80vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #666 #333;
}

.game-panels::-webkit-scrollbar {
    width: 8px;
}

.game-panels::-webkit-scrollbar-track {
    background: #333;
    border-radius: 4px;
}

.game-panels::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.game-panels::-webkit-scrollbar-thumb:hover {
    background: #888;
}

.panel {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    min-width: 250px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    border: 2px solid #444;
}

.kings-draw-section {
    border: 2px solid gold;
}

.tax-section {
    border: 2px solid #f0f;
}

.takeover-section {
    border: 2px solid #f00;
}

.treasury-section {
    border: 2px solid #0ff;
}

.stats-panel {
    border: 2px solid #0f0;
}

.achievements-section {
    border: 2px solid #4CAF50;
}

.leaderboard-section {
    border: 2px solid #2196F3;
}

.empire-progression-section {
    border: 2px solid #FFD700;
}

.rank-progress {
    margin: 10px 0;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin: 5px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 10px;
}

.achievements-modal {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-modal {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.achievements-list {
    max-height: 400px;
    overflow-y: auto;
}

.leaderboard-list {
    max-height: 400px;
    overflow-y: auto;
}

.achievement-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
    border-left: 3px solid #666;
}

.achievement-item.completed {
    border-left-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
}

.achievement-icon {
    font-size: 24px;
    margin-right: 10px;
    width: 40px;
    text-align: center;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin: 5px 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 5px;
}

.leaderboard-item.rank-1 {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    border-left: 3px solid #FFD700;
}

.leaderboard-item.rank-2 {
    background: linear-gradient(90deg, rgba(192, 192, 192, 0.2), rgba(192, 192, 192, 0.1));
    border-left: 3px solid #C0C0C0;
}

.leaderboard-item.rank-3 {
    background: linear-gradient(90deg, rgba(205, 127, 50, 0.2), rgba(205, 127, 50, 0.1));
    border-left: 3px solid #CD7F32;
}

.achievements-header, .leaderboard-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
}

button {
    background: #FFA500;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: bold;
    margin: 0.25rem;
    border-radius: 5px;
    transition: background 0.2s ease;
}

button:hover {
    background: #FFB84D;
}

.winners-board {
    background: rgba(0,0,0,0.9);
    padding: 10px;
    margin-top: 10px;
    border-radius: 5px;
}

.controls {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 15px;
    border-radius: 10px;
    font-size: 12px;
    z-index: 1000;
}



.road {
    position: absolute;
    background: linear-gradient(90deg, #555, #444, #555);
    border-radius: 2px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3), 0 1px 2px rgba(255,255,255,0.1);
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #222;
    padding: 2rem;
    text-align: center;
    border: 2px solid orange;
    border-radius: 8px;
    color: white;
}

.modal-buttons {
    margin-top: 1rem;
}

.modal-buttons button {
    background: orange;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: bold;
    margin: 0 1rem;
}

.exploration-info {
    background: #444;
    padding: 1rem;
    margin: 1rem 0;
    border-radius: 8px;
}

.exploration-count {
    color: #0f0;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .ui, .controls {
        font-size: 10px;
        padding: 10px;
    }
}

.navigation-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 15px;
    border-radius: 10px;
    border: 2px solid #FFD700;
    z-index: 1000;
    min-width: 200px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

.navigation-panel h3 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #FFD700;
}

.nav-quadrants {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* Fix and unify quadrant buttons */
.nav-quadrants button {
    background: linear-gradient(145deg, #FFA500, #FF8C00);
    color: #fff;
    font-weight: bold;
    border: 2px solid #fff;
    border-radius: 8px;
    padding: 8px 14px;
    margin: 4px;
    cursor: pointer;
    box-shadow: 0 3px 6px rgba(0,0,0,0.3);
    transition: all 0.2s ease-in-out;
}

.nav-quadrants button:hover {
    background: linear-gradient(145deg, #FFB84D, #FFA500);
    transform: scale(1.05);
}

.nav-quadrants button:focus, .nav-quadrants button:active {
    outline: none;
    transform: scale(0.95);
    box-shadow: 0 0 0 2px #fff;
}

.nav-region-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-region-toggle button {
    background: #FFA500;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 10px;
    border-radius: 3px;
    transition: background 0.2s ease;
}

.nav-region-toggle button:hover {
    background: #FFB84D;
}

.current-region {
    font-size: 10px;
    opacity: 0.9;
}

/* Admin styles moved to separate admin.html page */

/* Region management styles moved to admin panel */

.region-item:hover {
    background: rgba(52, 73, 94, 0.9);
    transform: translateX(5px);
}

.region-item.active {
    background: rgba(46, 204, 113, 0.3);
    border-left-color: #2ECC71;
    font-weight: bold;
}

/* Region Effects */
.region-default {
    background: linear-gradient(45deg, #8B4513 25%, transparent 25%), 
                linear-gradient(-45deg, #8B4513 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #8B4513 75%), 
                linear-gradient(-45deg, transparent 75%, #8B4513 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #DEB887;
}

.region-forest {
    background: linear-gradient(45deg, #228B22 25%, transparent 25%), 
                linear-gradient(-45deg, #228B22 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #228B22 75%), 
                linear-gradient(-45deg, transparent 75%, #228B22 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #90EE90;
}

.region-mountain {
    background: linear-gradient(45deg, #696969 25%, transparent 25%), 
                linear-gradient(-45deg, #696969 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #696969 75%), 
                linear-gradient(-45deg, transparent 75%, #696969 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #C0C0C0;
}

.region-coastal {
    background: linear-gradient(45deg, #4682B4 25%, transparent 25%), 
                linear-gradient(-45deg, #4682B4 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #4682B4 75%), 
                linear-gradient(-45deg, transparent 75%, #4682B4 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #87CEEB;
}

.region-desert {
    background: linear-gradient(45deg, #F4A460 25%, transparent 25%), 
                linear-gradient(-45deg, #F4A460 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #F4A460 75%), 
                linear-gradient(-45deg, transparent 75%, #F4A460 75%);
    background-size: 40px 40px;
    background-position: 0 0, 0 20px, 20px -20px, -20px 0px;
    background-color: #F5DEB3;
}

/* Earnings Display Panel */
.panel.earnings-section {
    border: 2px solid #0f0;
}

.earnings-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
}

.current-earnings, .earnings-rate, .withdrawal-controls {
    flex: 1;
}

.current-earnings div, .earnings-rate div, .withdrawal-controls div {
    margin-bottom: 5px;
}

.withdrawal-controls button {
    background: #FFA500;
    border: none;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-weight: bold;
    margin: 0.25rem;
    border-radius: 5px;
    transition: background 0.2s ease;
}

.withdrawal-controls button:hover {
    background: #FFB84D;
}

#withdrawalStatus {
    font-size: 11px;
    color: #ccc;
}

#boostStatus {
    display: none;
    font-size: 11px;
    color: #FFD700;
}

#boostMultiplier, #boostTimeLeft {
    font-weight: bold;
}

/* Mobile-friendly earnings display */
@media (max-width: 768px) {
    .earnings-display {
        flex-direction: column;
        gap: 10px;
    }
    
    .current-earnings, .earnings-rate, .withdrawal-controls {
        width: 100%;
        text-align: center;
    }
    
    .withdrawal-controls button {
        width: 100%;
        margin: 5px 0;
        padding: 10px;
        font-size: 14px;
    }
    
    .earnings-section {
        margin-bottom: 15px;
    }
}

/* Daily Login Bonus Panel */
.panel.login-bonus-section {
    border: 2px solid #0f0;
}

.login-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
}

.login-info div {
    margin-bottom: 5px;
}

#loginStatus {
    text-align: center;
}

/* Alert Boxes */
.alert-box {
  padding: 12px 18px;
  margin: 10px 0;
  background-color: rgba(255, 255, 255, 0.15);
  border-left: 6px solid #FFA500;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #fff;
  font-family: monospace;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

/* Success */
.alert-success {
  border-left-color: #4CAF50;
  background-color: rgba(76, 175, 80, 0.2);
}

/* Error */
.alert-error {
  border-left-color: #f44336;
  background-color: rgba(244, 67, 54, 0.2);
}

/* Game Message Modal */
.game-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: linear-gradient(145deg, #222, #333);
  color: #FFD700;
  padding: 2rem;
  border-radius: 12px;
  border: 3px solid #FFD700;
  text-align: center;
  font-size: 1.1rem;
  z-index: 3000;
  display: none;
  box-shadow: 0 10px 20px rgba(0,0,0,0.7);
}

/* Floating Tip */
.floating-tip {
  position: absolute;
  background: #000;
  color: #fff;
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  z-index: 1000;
}

/* Upgraded Panel Look */
.panel {
  background: rgba(15, 15, 15, 0.9);
  border: 2px solid #555;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  padding: 16px;
  color: #eee;
}

/* Buttons Enhanced */
button {
  background: linear-gradient(145deg, #FFA500, #FF8C00);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-weight: bold;
  transition: all 0.2s ease-in-out;
  cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,0.3);
}

button:hover {
  background: linear-gradient(145deg, #FFB84D, #FFA500);
  transform: scale(1.05);
} 

/* Plot Info Panel */
.plot-info-panel {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 12px 16px;
    border: 2px solid gold;
    border-radius: 10px;
    font-size: 14px;
    z-index: 9999;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    width: 200px;
    line-height: 1.6;
}

/* Lucky Draw Panel */
.lucky-draw-section {
    background: linear-gradient(145deg, #FF6B35, #FF4500, #FF6347);
    border: 2px solid #FFA500;
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.lucky-draw-info {
    line-height: 1.4;
    color: #fff;
}

.lucky-draw-info div {
    margin-bottom: 8px;
}

.lucky-draw-info ul {
    margin: 8px 0;
    padding-left: 20px;
}

.lucky-draw-info li {
    margin-bottom: 4px;
    color: #FFD700;
    font-weight: 500;
}

.lucky-draw-section button {
    background: linear-gradient(145deg, #FF6B35, #FF4500);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 3px 6px rgba(255, 107, 53, 0.4);
}

.lucky-draw-section button:hover {
    background: linear-gradient(145deg, #FF8C69, #FF6B35);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.6);
}

/* Wealth Tax Panel */
.wealth-tax-section {
    background: linear-gradient(145deg, #2C3E50, #34495E, #2C3E50);
    border: 2px solid #3498DB;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.wealth-tax-section h3 {
    color: #FFD700;
}

.wealth-tax-section div {
    margin-bottom: 8px;
    color: #fff;
}

.wealth-tax-section ul {
    margin: 8px 0;
    padding-left: 20px;
}

.wealth-tax-section li {
    margin-bottom: 4px;
    color: #BDC3C7;
    font-size: 11px;
}

.wealth-tax-section button {
    background: linear-gradient(145deg, #FF6B35, #FF4500);
    border: none;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 3px 6px rgba(255, 107, 53, 0.4);
}

.wealth-tax-section button:hover {
    background: linear-gradient(145deg, #FF8C69, #FF6B35);
    transform: scale(1.02);
    box-shadow: 0 4px 8px rgba(255, 107, 53, 0.6);
}

/* Plot Takeover Panel */
.takeover-section {
    background: linear-gradient(145deg, #2C2C2C, #3C3C3C, #2C2C2C);
    border: 2px solid #DC3545;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.takeover-plots-list {
    max-height: 300px;
    overflow-y: auto;
    margin: 10px 0;
}

.takeover-plot-entry {
    background: rgba(44, 44, 44, 0.9);
    border: 1px solid #DC3545;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.plot-info {
    flex: 1;
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
}

.plot-info strong {
    color: #FFD700;
}

.takeover-btn {
    background: linear-gradient(145deg, #DC3545, #C82333);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
}

.takeover-btn:hover {
    background: linear-gradient(145deg, #E74C3C, #DC3545);
    transform: scale(1.05);
}

/* Expired Plot Distress Effects */
.plot.expired {
    position: relative;
    opacity: 0.8;
    filter: grayscale(30%);
}

.plot.expired::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(139, 69, 19, 0.3), rgba(160, 82, 45, 0.3));
    border-radius: 4px;
    z-index: 1;
}

.distress-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 2;
}

.smoke-effect {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 15px;
    background: radial-gradient(ellipse, rgba(128, 128, 128, 0.6) 0%, transparent 70%);
    border-radius: 50%;
    animation: smokeRise 3s infinite ease-out;
}

.smoke-effect::before,
.smoke-effect::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 10px;
    background: radial-gradient(ellipse, rgba(128, 128, 128, 0.4) 0%, transparent 70%);
    border-radius: 50%;
    animation: smokeRise 3s infinite ease-out;
}

.smoke-effect::before {
    top: -8px;
    left: -5px;
    animation-delay: 0.5s;
}

.smoke-effect::after {
    top: -6px;
    right: -3px;
    animation-delay: 1s;
}

@keyframes smokeRise {
    0% {
        opacity: 0.8;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    50% {
        opacity: 0.4;
        transform: translateX(-50%) translateY(-10px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px) scale(1.5);
    }
}

.damage-effect {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #8B0000 0%, #DC143C 50%, transparent 100%);
    border-radius: 50%;
    animation: damagePulse 2s infinite ease-in-out;
}

.damage-effect::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid #DC143C;
    border-radius: 50%;
    animation: damagePulse 2s infinite ease-in-out;
    animation-delay: 0.5s;
}

@keyframes damagePulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

.plot.expired .plot-status {
    color: #DC143C;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
} 