:root {
    --bg-color: #1a1a1a;
    --panel-bg: #2d2d2d;
    --accent: #ff4757;
    --text-color: #ffffff;
    --highlight: #2ed573;
    --ticket-placement: #1e90ff;
    --ticket-upgrade: #ffa502;
    --ticket-charge: #a55eea;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    user-select: none;
}

#app {
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.screen {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle, #2d3436 0%, #000000 100%);
}

.hidden {
    display: none !important;
}

h1 {
    font-size: 3rem;
    text-shadow: 0 0 10px var(--accent);
    margin-bottom: 2rem;
}

.peak-btn {
    background: linear-gradient(45deg, #ff4757, #ff6b81);
    border: none;
    padding: 15px 30px;
    margin: 10px;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    text-transform: uppercase;
}

.peak-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.6);
}

.peak-btn:active {
    transform: translateY(1px);
}

.peak-btn.small {
    padding: 8px 16px;
    font-size: 1rem;
}

.peak-btn.danger {
    background: linear-gradient(45deg, #57606f, #2f3542);
    box-shadow: none;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
}

.mode-cards {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.mode-card {
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    width: 200px;
    text-align: center;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.mode-card:hover {
    border-color: var(--accent);
}

.gacha-container {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.gacha-box {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    width: 250px;
}

.gacha-box.op {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid gold;
}

/* Game Interface */
#game-interface {
    justify-content: flex-start;
}

#game-top-bar {
    width: 100%;
    height: 60px;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: space-around;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    z-index: 10;
}

#game-canvas-container {
    position: relative;
    flex-grow: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #222;
    overflow: hidden;
}

canvas {
    background: #333;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
}

#game-bottom-bar {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
    z-index: 10;
}

.tickets-info {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    justify-content: center;
}

.ticket {
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
}

.ticket.placement { background-color: var(--ticket-placement); }
.ticket.upgrade { background-color: var(--ticket-upgrade); color: black; }
.ticket.charge { background-color: var(--ticket-charge); }

#tower-selector {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
    justify-content: center;
}

.tower-card {
    background: #444;
    min-width: 80px;
    height: 80px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 0.8rem;
    border: 2px solid transparent;
}

.tower-card:hover {
    background: #555;
}

.tower-card.selected {
    border-color: var(--highlight);
}

.tower-card .cost {
    font-size: 0.7rem;
    color: #ccc;
}

#tower-panel {
    position: absolute;
    bottom: 140px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    padding: 15px;
    border-radius: 10px;
    width: 250px;
    border: 1px solid #555;
    z-index: 20;
}

#tower-panel h3 {
    margin-top: 0;
    color: var(--highlight);
}

.tower-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

#weather-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.weather-sandstorm {
    background: rgba(194, 178, 128, 0.3);
    animation: flicker 2s infinite;
}

.weather-rain {
    background: rgba(0, 0, 255, 0.1);
}

.weather-sunlight {
    background: rgba(255, 255, 0, 0.2);
}

@keyframes flicker {
    0% { opacity: 0.2; }
    50% { opacity: 0.4; }
    100% { opacity: 0.2; }
}
