/**
 * Dungeon Crawler - Style Sheet
 * Dark dungeon roguelike theme
 */

/* ==================== BASE ==================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #0a0a14; }

.lg-game-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a14 0%, #1a1a2e 100%);
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
    border-radius: 0;
    box-shadow: none;
}

/* ==================== MENU OVERLAY ==================== */
.dc-menu {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(10,10,30,0.97), rgba(20,15,40,0.98));
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

.dc-menu h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: #00ddff;
    text-shadow: 0 3px 10px rgba(0,221,255,0.4), 0 0 40px rgba(0,221,255,0.2);
    margin-bottom: 8px;
    letter-spacing: 3px;
}

.dc-menu .dc-subtitle {
    font-size: 1rem;
    color: #8888aa;
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: 30px;
}

/* Difficulty Row */
.dc-section-label {
    color: #aaaacc;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.dc-diff-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 10px;
}

.dc-diff-btn {
    padding: 8px 20px;
    border: 2px solid #444466;
    border-radius: 6px;
    background: rgba(40,40,60,0.8);
    color: #aaaacc;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dc-diff-btn:hover {
    border-color: #00ddff;
    color: #00ddff;
}

.dc-diff-btn.selected {
    border-color: #00ddff;
    background: rgba(0,221,255,0.15);
    color: #00ddff;
    box-shadow: 0 0 10px rgba(0,221,255,0.3);
}

/* Buttons */
.dc-btn {
    display: block;
    width: 220px;
    padding: 14px 0;
    margin: 8px auto;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.dc-btn-primary {
    background: linear-gradient(135deg, #00aacc, #00ddff);
    color: #0a0a14;
    box-shadow: 0 4px 15px rgba(0,221,255,0.3);
}

.dc-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,221,255,0.5);
}

.dc-btn-secondary {
    background: rgba(40,40,60,0.8);
    color: #aaaacc;
    border: 2px solid #444466;
}

.dc-btn-secondary:hover {
    border-color: #00ddff;
    color: #00ddff;
}

/* ==================== HUD ==================== */
.dc-hud {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 50;
    font-family: 'Segoe UI', Tahoma, sans-serif;
}

.dc-hud * {
    pointer-events: auto;
}

/* Top HUD Bar */
.dc-hud-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
}

.dc-hud-item {
    color: #ddd;
    font-size: 0.85rem;
    font-weight: 600;
}

.dc-floor-label {
    color: #ffcc00;
    font-size: 0.95rem;
    text-shadow: 0 0 6px rgba(255,204,0,0.4);
}

.dc-level-label {
    color: #00ddff;
    font-size: 0.85rem;
}

/* HP Bar */
.dc-hp-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dc-hp-label {
    color: #ff4444;
    font-size: 0.8rem;
    font-weight: 700;
}

.dc-hp-bar {
    width: 120px;
    height: 12px;
    background: rgba(80,20,20,0.8);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #662222;
}

.dc-hp-fill {
    height: 100%;
    background: linear-gradient(90deg, #cc2222, #ff4444);
    border-radius: 6px;
    transition: width 0.3s;
}

/* XP Bar */
.dc-xp-container {
    display: flex;
    align-items: center;
    gap: 6px;
}

.dc-xp-label {
    color: #44cc44;
    font-size: 0.8rem;
    font-weight: 700;
}

.dc-xp-bar {
    width: 100px;
    height: 8px;
    background: rgba(20,60,20,0.8);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #226622;
}

.dc-xp-fill {
    height: 100%;
    background: linear-gradient(90deg, #22aa22, #44cc44);
    border-radius: 4px;
    transition: width 0.3s;
}

/* Bottom HUD */
.dc-hud-bottom {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
}

.dc-gold-label {
    color: #ffcc00;
    font-size: 0.9rem;
    font-weight: 700;
    text-shadow: 0 0 4px rgba(255,204,0,0.3);
}

.dc-stats-label {
    color: #aaaacc;
    font-size: 0.8rem;
}

/* Right side inventory */
.dc-inventory {
    position: absolute;
    top: 50px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dc-inv-slot {
    width: 36px;
    height: 36px;
    border: 2px solid #444466;
    border-radius: 4px;
    background: rgba(20,20,40,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    color: #888;
    position: relative;
    cursor: pointer;
}

.dc-inv-slot.filled {
    border-color: #666688;
}

.dc-inv-key {
    position: absolute;
    top: 1px;
    left: 3px;
    font-size: 0.55rem;
    color: #666;
}

.dc-inv-icon {
    font-size: 1rem;
}

/* Combat Log */
.dc-log {
    position: absolute;
    bottom: 40px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 280px;
}

.dc-log-msg {
    font-size: 0.7rem;
    color: #999;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
    padding: 2px 6px;
    background: rgba(0,0,0,0.4);
    border-radius: 3px;
    animation: dc-log-fade 4s forwards;
}

@keyframes dc-log-fade {
    0% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0.3; }
}

.dc-log-msg.dc-log-damage { color: #ff6666; }
.dc-log-msg.dc-log-heal { color: #66ff66; }
.dc-log-msg.dc-log-loot { color: #ffcc44; }
.dc-log-msg.dc-log-info { color: #66aaff; }
.dc-log-msg.dc-log-levelup { color: #ffaa00; font-weight: 700; }

/* ==================== GAME OVER OVERLAY ==================== */
.dc-gameover {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(10,5,15,0.92);
    z-index: 100;
    font-family: 'Segoe UI', Tahoma, sans-serif;
    text-align: center;
}

.dc-gameover h2 {
    font-size: 2.8rem;
    font-weight: 800;
    color: #ff4444;
    text-shadow: 0 3px 10px rgba(255,68,68,0.4);
    margin-bottom: 20px;
}

.dc-gameover-stats {
    color: #aaaacc;
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 25px;
}

.dc-gameover-stats span {
    color: #ffcc00;
    font-weight: 700;
}

/* ==================== LEVEL UP FLASH ==================== */
.dc-levelup-flash {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle, rgba(255,170,0,0.3), transparent 70%);
    pointer-events: none;
    z-index: 60;
    animation: dc-flash-pulse 0.8s ease-out forwards;
    display: none;
}

@keyframes dc-flash-pulse {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

/* ==================== TOUCH CONTROLS ==================== */
.dc-touch-controls {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 55;
    display: none;
}

.dc-touch-dpad {
    position: absolute;
    bottom: 60px;
    left: 20px;
    width: 140px;
    height: 140px;
    pointer-events: auto;
}

.dc-dpad-btn {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.dc-dpad-btn:active {
    background: rgba(0,221,255,0.3);
    border-color: #00ddff;
}

.dc-dpad-up { top: 0; left: 50%; transform: translateX(-50%); }
.dc-dpad-down { bottom: 0; left: 50%; transform: translateX(-50%); }
.dc-dpad-left { top: 50%; left: 0; transform: translateY(-50%); }
.dc-dpad-right { top: 50%; right: 0; transform: translateY(-50%); }

.dc-touch-wait {
    position: absolute;
    bottom: 70px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.12);
    border: 2px solid rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.7rem;
    font-weight: 700;
    pointer-events: auto;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.dc-touch-wait:active {
    background: rgba(0,221,255,0.3);
    border-color: #00ddff;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 600px) {
    .dc-menu h1 { font-size: 2rem; }
    .dc-btn { width: 180px; padding: 12px 0; font-size: 0.95rem; }
    .dc-diff-btn { padding: 6px 14px; font-size: 0.8rem; }
    .dc-hud-top { padding: 4px 8px; }
    .dc-hud-bottom { padding: 4px 8px; }
    .dc-hp-bar { width: 80px; }
    .dc-xp-bar { width: 60px; }
    .dc-inventory { top: 40px; }
    .dc-inv-slot { width: 30px; height: 30px; }
    .dc-log { max-width: 200px; }
    .dc-log-msg { font-size: 0.6rem; }
    .dc-touch-controls { display: block; }
}

@media (max-width: 400px) {
    .dc-menu h1 { font-size: 1.6rem; }
    .dc-menu .dc-subtitle { font-size: 0.75rem; }
    .dc-diff-row { flex-wrap: wrap; }
}
