/* === ASCENSION WAR IDLE — WEB PORT === */
:root {
    --bg-dark: #0a0a12;
    --bg-panel: #12121e;
    --bg-card: #1a1a2e;
    --accent: #6c2bd9;
    --accent-glow: #8b5cf6;
    --gold: #f5a623;
    --red: #e74c3c;
    --green: #2ecc71;
    --text: #e0e0f0;
    --text-dim: #7a7a9a;
    --border: #2a2a3e;
}

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

body {
    background: var(--bg-dark);
    color: var(--text);
    font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
}

#game-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* === HEADER === */
#game-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

#game-header h1 {
    font-size: 1.4rem;
    letter-spacing: 4px;
    color: var(--accent-glow);
    text-shadow: 0 0 20px rgba(108, 43, 217, 0.5);
    margin-bottom: 12px;
}

#stats-bar {
    display: flex;
    justify-content: space-around;
    gap: 8px;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--gold);
}

/* === COMBAT AREA === */
#combat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

#combat-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: background-image 0.8s ease;
    z-index: 0;
}

#enemy-container {
    z-index: 1;
}

#enemy-container {
    text-align: center;
    width: 100%;
    position: relative;
}

#enemy-name {
    font-size: 1rem;
    color: var(--red);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

#health-bar-container {
    width: 80%;
    height: 24px;
    background: #1a1a2e;
    border-radius: 12px;
    margin: 0 auto 20px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

#health-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--red), #ff6b6b);
    border-radius: 12px;
    transition: width 0.15s ease;
}

#health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.7rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* Enemy Visual (CSS Procedural Character) */
#enemy-visual {
    width: 160px;
    height: 160px;
    margin: 0 auto 20px;
    position: relative;
}

#enemy-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(108, 43, 217, 0.6));
    animation: img-float 3s ease-in-out infinite;
    border-radius: 12px;
}

#enemy-image.shake {
    animation: img-shake 0.15s ease;
}

@keyframes img-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes img-shake {
    0%, 100% { transform: translateY(0); }
    25% { transform: translateY(-3px) rotate(2deg); }
    75% { transform: translateY(3px) rotate(-2deg); }
}

#enemy-image.loaded ~ #enemy-body {
    display: none;
}

#enemy-body {
    width: 60px;
    height: 90px;
    background: linear-gradient(135deg, #4a0e8f, #2d0a5a);
    border-radius: 8px;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(108, 43, 217, 0.4);
    animation: float 3s ease-in-out infinite;
}

#enemy-head {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #6c2bd9, #4a0e8f);
    border-radius: 50%;
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 15px rgba(139, 92, 246, 0.5);
}

#enemy-weapon {
    width: 8px;
    height: 70px;
    background: linear-gradient(to bottom, #ff6b35, #ff4500);
    position: absolute;
    top: -10px;
    right: -20px;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.6);
    transform: rotate(15deg);
}

@keyframes float {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-8px); }
}

/* Damage Numbers */
#damage-numbers {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
}

.damage-number {
    position: absolute;
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--gold);
    text-shadow: 0 0 8px rgba(245, 166, 35, 0.6);
    animation: damage-fly 1s ease-out forwards;
    pointer-events: none;
}

.damage-number.crit {
    font-size: 1.6rem;
    color: #ff4444;
    text-shadow: 0 0 12px rgba(255, 68, 68, 0.8);
}

@keyframes damage-fly {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.5); }
}

/* Tap Button */
#tap-button {
    width: 200px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent), #4a1a9e);
    border: 2px solid var(--accent-glow);
    border-radius: 28px;
    color: white;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.1s ease;
    margin: 16px 0 8px;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

#tap-button:active {
    transform: scale(0.95);
    box-shadow: 0 0 30px rgba(108, 43, 217, 0.6);
}

/* Player HP Bar */
#player-hp-container {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    margin: 8px auto 4px;
}

#player-hp-label {
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--green);
    letter-spacing: 1px;
}

#player-health-bar-container {
    flex: 1;
    height: 18px;
    background: #1a1a2e;
    border-radius: 9px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

#player-health-bar {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--green), #58d68d);
    border-radius: 9px;
    transition: width 0.2s ease;
}

#player-health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.6rem;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

#player-health-bar.hit-flash {
    animation: hp-flash 0.3s ease;
}

@keyframes hp-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(2) hue-rotate(-30deg); }
    100% { filter: brightness(1); }
}

#dps-display {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* === TABS === */
#tab-bar {
    display: flex;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.tab {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
}

.tab.active {
    color: var(--accent-glow);
    border-bottom: 2px solid var(--accent-glow);
    background: rgba(108, 43, 217, 0.1);
}

/* === PANELS === */
#panels {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* Upgrades */
.upgrade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.upgrade-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.upgrade-name {
    font-weight: bold;
    font-size: 0.9rem;
}

.upgrade-desc {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.upgrade-level {
    font-size: 0.7rem;
    color: var(--accent-glow);
}

.upgrade-btn {
    padding: 8px 16px;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}

.upgrade-btn:hover:not(:disabled) {
    background: var(--accent-glow);
    box-shadow: 0 0 15px rgba(108, 43, 217, 0.4);
}

.upgrade-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Ascension Panel */
#ascension-info {
    text-align: center;
    padding: 20px;
}

#ascension-info h2 {
    font-size: 1.4rem;
    color: var(--gold);
    letter-spacing: 3px;
    margin-bottom: 16px;
    text-shadow: 0 0 20px rgba(245, 166, 35, 0.4);
}

#ascension-info p {
    margin-bottom: 8px;
    color: var(--text-dim);
}

.ascension-bonus {
    color: var(--green) !important;
    font-weight: bold;
    margin-top: 12px !important;
}

.ascend-btn {
    margin-top: 20px;
    padding: 14px 40px;
    background: linear-gradient(135deg, #f5a623, #e6930a);
    border: 2px solid #f5a623;
    border-radius: 12px;
    color: #0a0a12;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    transition: all 0.2s;
}

.ascend-btn:hover:not(:disabled) {
    box-shadow: 0 0 30px rgba(245, 166, 35, 0.6);
    transform: scale(1.05);
}

.ascend-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Stats Panel */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: 6px;
    font-size: 0.85rem;
}

.stat-row span:last-child {
    color: var(--gold);
    font-weight: bold;
}

/* Settings Panel */
.settings-section {
    text-align: center;
    padding: 20px;
}

.settings-section h3 {
    font-size: 1.1rem;
    color: var(--red);
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.settings-desc {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.reset-btn {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--red);
    border-radius: 10px;
    color: var(--red);
    font-size: 0.9rem;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

.reset-btn:hover {
    background: rgba(231, 76, 60, 0.15);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

.reset-warning {
    color: var(--red);
    font-weight: bold;
    margin: 16px 0;
    font-size: 0.85rem;
}

.reset-confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.reset-confirm-yes {
    padding: 10px 24px;
    background: var(--red);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
}

.reset-confirm-no {
    padding: 10px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-weight: bold;
    font-size: 0.85rem;
    cursor: pointer;
}

/* Passive Ticker */
#passive-ticker {
    position: fixed;
    bottom: 8px;
    right: 8px;
    background: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.3);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 0.75rem;
    color: var(--green);
}

/* Shake on hit */
.shake {
    animation: shake 0.15s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    25% { transform: translateX(-50%) translateY(-3px) rotate(2deg); }
    75% { transform: translateX(-50%) translateY(3px) rotate(-2deg); }
}

/* Enemy death flash */
.death-flash {
    animation: death-flash 0.4s ease;
}

@keyframes death-flash {
    0% { filter: brightness(1); }
    50% { filter: brightness(3); }
    100% { filter: brightness(1); }
}
