/* style.css - Kernel Kombat (Pixel Detective Layout & Cyberpunk Combat Theme) */
:root {
    --color-midnight: #090514;
    --color-glass: rgba(22, 12, 40, 0.92);
    --color-border: rgba(255, 107, 53, 0.35);
    --accent-orange: #ff6b35;
    --accent-cyan: #00f0ff;
    --accent-purple: #9d4edd;
    --accent-green: #00ff88;
    --color-text: #e2e8f0;
    --color-text-muted: #94a3b8;
    
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--color-midnight);
    color: var(--color-text);
    font-family: var(--font-ui);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 50% 30%, rgba(157, 78, 221, 0.2) 0%, var(--color-midnight) 100%),
        linear-gradient(rgba(255, 107, 53, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 107, 53, 0.04) 1px, transparent 1px);
    background-size: 100% 100%, 24px 24px, 24px 24px;
    min-height: 100vh;
}

.game-container-fluid {
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* Header / HUD */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: var(--color-glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-border);
    z-index: 100;
    margin-top: 50px;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.85rem;
}

.level-info {
    text-align: center;
    flex-grow: 1;
}

#level-title {
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--accent-orange);
    font-size: 1.05rem;
}

.progress-bar-container {
    width: 220px;
    height: 8px;
    background: rgba(0,0,0,0.6);
    border-radius: 4px;
    margin: 6px auto 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff6b35, #00ff88);
    box-shadow: 0 0 10px var(--accent-orange);
    transition: width 0.3s ease;
}

.score-container {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 1.1rem;
    color: #facc15;
}

/* Screen Container */
.screen-container {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

.screen {
    display: none !important;
    width: 100%;
    max-width: 920px;
}

.screen.active {
    display: block !important;
    animation: fadeIn 0.4s ease forwards;
}

.screen.hidden {
    display: none !important;
}

.level-ui {
    display: none !important;
    width: 100%;
}

.level-ui.active {
    display: block !important;
    animation: fadeIn 0.35s ease forwards;
}

.level-ui.hidden {
    display: none !important;
}

.combat-card {
    border: 1px solid var(--color-border);
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.1), 0 0 20px rgba(0, 0, 0, 0.8);
    padding: 2.2rem;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(22, 12, 40, 0.94) 0%, rgba(9, 5, 20, 0.96) 100%);
}

.combat-badge {
    display: inline-block;
    background: rgba(255, 107, 53, 0.12);
    border: 1px solid var(--accent-orange);
    color: var(--accent-orange);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 2px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 1rem;
}

.game-title {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: 3px;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 107, 53, 0.5);
    margin-bottom: 0.5rem;
}

.game-description {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.controls-legend-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 107, 53, 0.25);
    border-radius: 12px;
    padding: 1.2rem 1.5rem;
    line-height: 1.7;
    font-size: 0.95rem;
}

.start-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.combat-btn {
    background: linear-gradient(135deg, #ff6b35 0%, #d84315 100%) !important;
    color: #fff !important;
    font-weight: 800 !important;
    border: none;
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.4);
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.25s ease;
}
.combat-btn:hover {
    box-shadow: 0 0 30px rgba(255, 107, 53, 0.8);
    transform: translateY(-2px);
}

/* In-game concept */
.in-game-concept-box {
    background: rgba(22, 12, 40, 0.92);
    border-left: 4px solid var(--accent-orange);
    padding: 12px 18px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.concept-icon {
    font-size: 1.4rem;
}

.level-header-box {
    margin-bottom: 1rem;
}
.level-header-box h3 {
    color: var(--accent-orange);
    margin-bottom: 4px;
    font-size: 1.35rem;
}

/* 4-Column Arena Grid */
.arena-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    align-items: stretch;
    margin: 16px 0;
}

.image-panel, .action-panel {
    background: rgba(14, 7, 28, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 14px;
    padding: 12px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.image-panel h4, .action-panel h4 {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: 0 0 8px 0;
    text-transform: uppercase;
    font-family: var(--font-mono);
}

.image-panel canvas {
    border-radius: 8px;
    background: #000;
    display: block;
    image-rendering: pixelated;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-panel {
    border-color: var(--accent-orange);
    box-shadow: 0 0 20px rgba(255, 107, 53, 0.2);
}

/* Kernel Matrix */
.kernel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 6px auto;
    max-width: 160px;
}

.kernel-grid input {
    width: 100%;
    height: 36px;
    background: #000;
    border: 1px solid rgba(255, 107, 53, 0.6);
    border-radius: 6px;
    color: var(--accent-cyan);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: all 0.2s ease;
}
.kernel-grid input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.matrix-sum {
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--accent-green);
    margin: 6px 0;
    font-weight: 600;
}

.preset-btn-group {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}

.preset-btn {
    background: rgba(255, 107, 53, 0.15);
    border: 1px solid var(--accent-orange);
    color: var(--color-text);
    padding: 5px 9px;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.preset-btn:hover {
    border-color: var(--accent-cyan);
    background: rgba(0, 240, 255, 0.25);
    color: #fff;
    transform: translateY(-1px);
}

/* Slider Controls */
.slider-group-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    width: 100%;
    padding: 4px 0;
}
.slider-group-box input[type="range"] {
    width: 100%;
    accent-color: var(--accent-orange);
    cursor: pointer;
}
.text-accent {
    color: var(--accent-cyan);
    font-weight: 700;
}

/* Pipeline Box */
.pipeline-box {
    width: 100%;
    min-height: 48px;
    background: rgba(0,0,0,0.6);
    border: 1px dashed rgba(255, 107, 53, 0.5);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.pipeline-tag {
    display: inline-block;
    background: rgba(0,240,255,0.2);
    border: 1px solid #00f0ff;
    color: #00f0ff;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.pipeline-tag:hover {
    background: rgba(244, 63, 94, 0.3);
    border-color: #f43f5e;
    color: #fb7185;
}

/* Feedback */
.feedback {
    min-height: 32px;
    margin-top: 14px;
    font-weight: 700;
    font-size: 1rem;
    padding: 10px 16px;
    border-radius: 8px;
    display: none;
}
.feedback.correct {
    display: block;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.3);
}
.feedback.wrong {
    display: block;
    background: rgba(244, 63, 94, 0.2);
    border: 1px solid #f43f5e;
    color: #fb7185;
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.3);
}

/* Summary Box */
.summary-box {
    background: rgba(10, 5, 20, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.2rem;
}

.learning-summary {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 0.95rem;
    color: #cbd5e1;
    line-height: 1.6;
}
.learning-summary li strong {
    color: var(--accent-orange);
}

.pulse-anim {
    animation: pulseGlow 2s infinite;
}
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 107, 53, 0.4); }
    50% { box-shadow: 0 0 30px rgba(255, 107, 53, 0.8); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 820px) {
    .arena-grid { grid-template-columns: repeat(2, 1fr); }
    .game-title { font-size: 2.2rem; }
}
@media (max-width: 500px) {
    .arena-grid { grid-template-columns: 1fr; }
}
