/* ARTEX Defense Simulator - Game Styles */

.artex-defense-wrapper {
    --bg: #0a0e17;
    --panel: #111827;
    --border: #1f2937;
    --accent: #00f0ff;
    --accent-dim: #0e7490;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --text: #e5e7eb;
    --text-dim: #9ca3af;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    border-radius: 12px;
    overflow: hidden;
    max-width: 960px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px var(--border), 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    position: relative;
    min-height: 640px;
}

.artex-defense-wrapper * {
    box-sizing: border-box;
}

/* Header */
.artex-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 24px;
    background: linear-gradient(180deg, #0f172a 0%, #0a0e17 100%);
    border-bottom: 1px solid var(--border);
}

.artex-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.logo-icon {
    color: var(--accent);
    font-size: 1.4rem;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

.artex-score {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: var(--font-mono);
}

.artex-score .label {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

#score-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4);
}

/* Screens */
.game-screen {
    display: none;
    padding: 32px 28px;
    min-height: 540px;
}

.game-screen.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

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

/* Intro */
.intro-content {
    max-width: 520px;
    margin: 40px auto;
    text-align: center;
}

.intro-content h1 {
    font-size: 2.1rem;
    margin: 0 0 8px;
    background: linear-gradient(90deg, #00f0ff, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.intro-content .subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    margin-bottom: 24px;
}

.intro-content .desc {
    color: var(--text);
    line-height: 1.6;
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.35);
    color: #fbbf24;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 32px;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #00f0ff, #0ea5e9);
    color: #0a0e17;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 240, 255, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Status bar */
.status-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 24px;
}

.phase-info {
    display: flex;
    flex-direction: column;
}

.phase-label {
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.12em;
}

#phase-name {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--accent);
    font-family: var(--font-mono);
}

.integrity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    max-width: 340px;
}

.integrity .label {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.bar-container {
    flex: 1;
    height: 10px;
    background: #1f2937;
    border-radius: 5px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #10b981, #34d399);
    border-radius: 5px;
    transition: width 0.5s ease, background 0.3s ease;
}

#integrity-value {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    min-width: 42px;
    text-align: right;
}

/* Main area */
.main-area {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

@media (max-width: 700px) {
    .main-area {
        grid-template-columns: 1fr;
    }
}

.panel-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-dim);
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.log-panel, .action-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    min-height: 320px;
}

.log-content {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    line-height: 1.55;
    max-height: 280px;
    overflow-y: auto;
    color: var(--text-dim);
}

.log-entry {
    margin-bottom: 6px;
    padding: 4px 0;
    border-bottom: 1px solid rgba(31, 41, 55, 0.6);
    animation: logIn 0.3s ease;
}

@keyframes logIn {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-entry.attack {
    color: #f87171;
}

.log-entry.system {
    color: #60a5fa;
}

.log-entry.success {
    color: #34d399;
}

.log-entry.warning {
    color: #fbbf24;
}

.log-time {
    color: #4b5563;
    margin-right: 8px;
}

/* Actions */
.actions-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-btn {
    background: #1e293b;
    border: 1px solid #334155;
    color: var(--text);
    padding: 12px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    font-family: var(--font-sans);
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.action-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(0, 240, 255, 0.08);
    transform: translateX(3px);
}

.action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.action-btn.used {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.1);
}

.action-btn .action-name {
    font-weight: 600;
}

.action-btn .action-desc {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.action-btn .action-cost {
    font-size: 0.7rem;
    color: var(--accent-dim);
    margin-top: 2px;
}

/* Progress */
.progress-area {
    margin-top: 8px;
}

.wave-progress {
    display: flex;
    align-items: center;
    gap: 14px;
}

#wave-text {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    min-width: 90px;
}

.wave-bar {
    flex: 1;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    overflow: hidden;
}

.wave-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #00f0ff);
    border-radius: 3px;
    transition: width 0.4s ease;
}

/* Game Over */
.result-content {
    max-width: 480px;
    margin: 30px auto;
    text-align: center;
}

.result-content h1 {
    font-size: 1.9rem;
    margin-bottom: 16px;
}

.final-score {
    margin-bottom: 24px;
}

.final-score .label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

#final-score-value {
    font-size: 2.8rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent);
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.result-message {
    color: var(--text);
    line-height: 1.55;
    margin-bottom: 24px;
    font-size: 0.95rem;
}

.lessons-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 18px;
    text-align: left;
    margin-bottom: 28px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.lessons-box h3 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--accent);
}

.lessons-box ul {
    margin: 0;
    padding-left: 18px;
}

.lessons-box li {
    margin-bottom: 6px;
    color: var(--text-dim);
}

/* Scrollbar */
.log-content::-webkit-scrollbar {
    width: 6px;
}
.log-content::-webkit-scrollbar-track {
    background: transparent;
}
.log-content::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 3px;
}
