/* ========================================
   BullDozer - Tropik Ada İnşaat Oyunu
   Pixel Art Game Styles
   ======================================== */

/* --- Reset & Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --pixel-font: 'Press Start 2P', monospace;
    --hud-bg: rgba(10, 15, 30, 0.85);
    --hud-border: rgba(80, 200, 255, 0.6);
    --hud-glow: rgba(80, 200, 255, 0.3);
    --accent-cyan: #50c8ff;
    --accent-gold: #ffd700;
    --accent-green: #50ff80;
    --accent-red: #ff5070;
    --accent-orange: #ff9050;
    --text-primary: #e8f0ff;
    --text-dim: rgba(200, 220, 255, 0.6);
    --panel-radius: 8px;
}

body {
    background: #0a0f1e;
    overflow: hidden;
    font-family: var(--pixel-font);
    color: var(--text-primary);
    -webkit-font-smoothing: none;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    user-select: none;
}

/* --- Game Container --- */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: crosshair;
}

/* --- HUD Overlay --- */
#hud {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 10;
}

#hud>* {
    pointer-events: auto;
}

/* --- Task Panel (Sol Üst) --- */
#task-panel {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 280px;
    background: var(--hud-bg);
    border: 2px solid var(--hud-border);
    border-radius: var(--panel-radius);
    padding: 12px;
    box-shadow: 0 0 20px var(--hud-glow), inset 0 0 10px rgba(80, 200, 255, 0.05);
    backdrop-filter: blur(8px);
}

.panel-header {
    font-size: 10px;
    font-weight: bold;
    color: var(--accent-cyan);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(80, 200, 255, 0.2);
    letter-spacing: 1px;
}

.panel-icon {
    margin-right: 6px;
}

.task-item {
    font-size: 8px;
    padding: 6px 8px;
    margin-bottom: 4px;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    line-height: 1.4;
}

.task-item.active {
    background: rgba(80, 200, 255, 0.15);
    border-left: 3px solid var(--accent-cyan);
    color: var(--text-primary);
}

.task-item.completed {
    background: rgba(80, 255, 128, 0.1);
    border-left: 3px solid var(--accent-green);
    color: var(--accent-green);
    text-decoration: line-through;
    opacity: 0.7;
}

.task-item.locked {
    color: var(--text-dim);
    opacity: 0.4;
}

.task-check {
    width: 14px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    flex-shrink: 0;
}

.task-item.completed .task-check {
    background: var(--accent-green);
    color: #0a0f1e;
}

/* --- Info Panel (Sağ Üst) --- */
#info-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    background: var(--hud-bg);
    border: 2px solid var(--hud-border);
    border-radius: var(--panel-radius);
    padding: 10px 16px;
    box-shadow: 0 0 20px var(--hud-glow);
    backdrop-filter: blur(8px);
    display: flex;
    gap: 20px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.info-icon {
    font-size: 16px;
}

/* --- Notification --- */
#notification {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: var(--hud-bg);
    border: 3px solid var(--accent-gold);
    border-radius: 12px;
    padding: 24px 36px;
    text-align: center;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.4);
    backdrop-filter: blur(12px);
    z-index: 50;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#notification.show {
    transform: translate(-50%, -50%) scale(1);
}

#notification-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: bounce 0.6s ease infinite alternate;
}

#notification-text {
    font-size: 10px;
    line-height: 1.6;
    color: var(--accent-gold);
}

@keyframes bounce {
    from {
        transform: translateY(0);
    }

    to {
        transform: translateY(-8px);
    }
}

/* --- Build Toolbar (Alt) --- */
#build-toolbar {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hud-bg);
    border: 2px solid var(--accent-orange);
    border-radius: var(--panel-radius);
    padding: 10px 16px;
    box-shadow: 0 0 20px rgba(255, 144, 80, 0.3);
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#build-toolbar.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(20px);
}

.toolbar-header {
    font-size: 8px;
    color: var(--accent-orange);
    text-align: center;
    margin-bottom: 8px;
    letter-spacing: 1px;
}

#toolbar-items {
    display: flex;
    gap: 8px;
}

.toolbar-item {
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    position: relative;
}

.toolbar-item:hover {
    border-color: var(--accent-orange);
    background: rgba(255, 144, 80, 0.15);
    transform: translateY(-4px);
}

.toolbar-item.selected {
    border-color: var(--accent-gold);
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

.toolbar-item.locked {
    opacity: 0.3;
    cursor: not-allowed;
    filter: grayscale(1);
}

.toolbar-item-icon {
    font-size: 24px;
}

.toolbar-item-label {
    font-size: 5px;
    margin-top: 4px;
    color: var(--text-dim);
}

/* --- Controls Hint (Alt Orta) --- */
#controls-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    font-size: 7px;
    color: var(--text-dim);
    letter-spacing: 0.5px;
}

/* --- Start Screen --- */
#start-screen {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #0a1628 0%, #0d2137 30%, #0a1628 60%, #1a0a28 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: opacity 0.8s ease;
}

#start-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

.start-content {
    text-align: center;
}

.game-title {
    font-family: var(--pixel-font);
    font-size: 36px;
    color: var(--accent-gold);
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 4px 0 #b8860b,
        0 6px 0 #8b6914;
    margin-bottom: 12px;
    animation: titlePulse 2s ease-in-out infinite;
}

@keyframes titlePulse {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(255, 215, 0, 0.5), 0 4px 0 #b8860b, 0 6px 0 #8b6914;
    }

    50% {
        text-shadow: 0 0 40px rgba(255, 215, 0, 0.8), 0 4px 0 #b8860b, 0 6px 0 #8b6914;
    }
}

.game-subtitle {
    font-size: 10px;
    color: var(--accent-cyan);
    margin-bottom: 30px;
    letter-spacing: 2px;
}

.start-island-art {
    font-size: 64px;
    margin-bottom: 40px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }
}

.pixel-btn {
    font-family: var(--pixel-font);
    font-size: 14px;
    padding: 16px 40px;
    background: linear-gradient(180deg, var(--accent-cyan), #2090d0);
    color: #0a0f1e;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    box-shadow:
        0 4px 0 #1060a0,
        0 6px 20px rgba(80, 200, 255, 0.3);
    transition: all 0.15s ease;
    letter-spacing: 2px;
}

.pixel-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 0 #1060a0,
        0 8px 30px rgba(80, 200, 255, 0.5);
}

.pixel-btn:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 0 #1060a0,
        0 3px 10px rgba(80, 200, 255, 0.2);
}

.start-hint {
    font-size: 7px;
    color: var(--text-dim);
    margin-top: 24px;
    animation: blink 1.5s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* --- Island Indicator (Üst Orta) --- */
#island-indicator {
    position: absolute;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--hud-bg);
    border: 2px solid var(--accent-gold);
    border-radius: var(--panel-radius);
    padding: 8px 20px;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(8px);
    font-size: 9px;
    color: var(--accent-gold);
    letter-spacing: 1px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 12px;
}

#day-phase-icon {
    font-size: 14px;
}

/* --- Envanter Panel (Sağ Orta) --- */
#inventory-panel {
    position: absolute;
    top: 50%;
    right: 16px;
    transform: translateY(-50%);
    background: var(--hud-bg);
    border: 2px solid rgba(180, 140, 80, 0.6);
    border-radius: var(--panel-radius);
    padding: 8px 12px;
    box-shadow: 0 0 12px rgba(180, 140, 80, 0.2);
    backdrop-filter: blur(8px);
}

#inventory-panel .panel-header {
    font-size: 8px;
    color: rgba(180, 140, 80, 0.9);
    margin-bottom: 6px;
}

#inventory-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inv-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}

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

/* --- Hava Durumu Göstergesi --- */
#weather-indicator {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 20px;
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.3));
}

/* --- Geçiş Videoları --- */
#transition-video-volkan,
#transition-video-buzul {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 90;
    background: #000;
}

/* --- Feature Tags (Start Screen) --- */
.feature-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 30px;
}

.feature-tag {
    font-family: var(--pixel-font);
    font-size: 7px;
    padding: 6px 12px;
    background: rgba(80, 200, 255, 0.1);
    border: 1px solid rgba(80, 200, 255, 0.3);
    border-radius: 4px;
    color: var(--accent-cyan);
    letter-spacing: 0.5px;
}

/* --- Toolbar overflow --- */
#toolbar-items {
    overflow-x: auto;
    max-width: 80vw;
    scrollbar-width: thin;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    #task-panel {
        width: 200px;
        font-size: 7px;
    }

    .game-title {
        font-size: 20px;
    }

    .pixel-btn {
        font-size: 10px;
        padding: 12px 24px;
    }

    #controls-hint {
        font-size: 6px;
        gap: 8px;
    }

    #island-indicator {
        font-size: 7px;
        padding: 6px 12px;
    }

    #build-toolbar {
        max-width: 95vw;
    }

    #inventory-panel {
        right: 8px;
    }

    .feature-tag {
        font-size: 6px;
        padding: 4px 8px;
    }
}