:root {
    --bg-color: #020202;
    --card-bg: #0b0b0b;
    --accent: #00f3ff;
    --accent-dim: #006066;
    --success: #00ff41;
    --error: #ff0055;
    --text-main: #e0e0e0;
    --border: #222;
    --font-stack: 'Courier New', 'Fira Code', monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-stack);
    overflow-x: hidden;
    background-image:
        linear-gradient(rgba(0, 255, 234, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 234, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* --- NAV --- */
nav {
    position: sticky;
    top: 0;
    background: rgba(2, 2, 2, 0.95);
    border-bottom: 1px solid var(--accent-dim);
    padding: 15px 30px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.1);
}

.brand {
    font-size: 1.4rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
}

.brand span {
    color: var(--accent);
}

.status-panel {
    font-size: 0.9rem;
    color: #888;
    font-weight: bold;
}

.status-panel strong {
    color: var(--accent);
    font-size: 1.1rem;
}

/* --- LAYOUT --- */
.container {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px 100px 20px;
    display: grid;
    gap: 30px;
}

/* --- CARDS --- */
.challenge-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}

.challenge-card:hover {
    border-color: #444;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.challenge-card.solved {
    border-left-color: var(--accent);
    background: linear-gradient(90deg, rgba(0, 243, 255, 0.02) 0%, rgba(0, 0, 0, 0) 100%);
}

.challenge-card.solved h2 {
    color: var(--accent);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.5);
}

.card-content {
    padding: 25px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 1px solid #222;
    padding-bottom: 10px;
}

h2 {
    margin: 0;
    font-size: 1.1rem;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.badge {
    font-size: 0.7rem;
    background: #222;
    padding: 3px 6px;
    border-radius: 2px;
    color: #888;
}

.solved .badge {
    background: var(--accent);
    color: #000;
    font-weight: bold;
}

/* --- SANDBOX & UI --- */
.sandbox {
    background: #000;
    border: 1px dashed #333;
    padding: 20px;
    margin: 15px 0;
}

button {
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: 0.3s;
    margin-top: 10px;
}

button:hover:not(:disabled) {
    background: var(--accent);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.5);
}

button:disabled {
    border-color: #333;
    color: #444;
    cursor: not-allowed;
    background: transparent;
}

input {
    background: #0f0f0f;
    border: 1px solid #333;
    color: #fff;
    padding: 12px;
    font-family: inherit;
    width: 100%;
    margin-bottom: 10px;
    outline: none;
    transition: 0.3s;
}

input:focus {
    border-color: var(--accent);
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1);
}

.console-output {
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: bold;
    min-height: 20px;
}

.msg-success {
    color: var(--accent);
}

.msg-error {
    color: var(--error);
}

.secret-display {
    display: none;
    margin-top: 15px;
    padding: 10px;
    border: 1px solid var(--accent);
    background: rgba(0, 243, 255, 0.1);
    color: #fff;
    text-align: center;
    font-size: 1.1rem;
    letter-spacing: 2px;
    animation: glow 2s infinite alternate;
}

@keyframes glow {
    from {
        box-shadow: 0 0 5px var(--accent-dim);
    }

    to {
        box-shadow: 0 0 15px var(--accent-dim);
    }
}

details {
    margin-top: 10px;
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
}

summary:hover {
    color: var(--accent);
}

/* --- DASHBOARD OVERLAY (NEW) --- */
#victory-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
}

.dashboard-panel {
    width: 100%;
    max-width: 600px;
    background: #050505;
    border: 2px solid var(--accent);
    box-shadow: 0 0 80px rgba(0, 243, 255, 0.2);
    position: relative;
}

.dashboard-panel::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 2;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.dash-header {
    background: var(--accent);
    color: #000;
    padding: 20px;
    text-align: center;
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 3px;
    text-shadow: 2px 2px 0px #fff;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    background: #222;
    /* Gap color */
    padding: 2px;
}

.dash-stat {
    background: #0a0a0a;
    padding: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    color: #666;
    font-size: 0.8rem;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-value {
    color: #fff;
    font-size: 1.5rem;
    font-weight: bold;
}

.stat-value.glow {
    color: var(--accent);
    text-shadow: 0 0 10px var(--accent);
}

.stat-value.danger {
    color: var(--error);
}

.dash-footer {
    padding: 20px;
    background: #080808;
    border-top: 1px solid #222;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-share {
    width: 100%;
    padding: 15px;
    font-size: 1rem;
    background: var(--accent);
    color: #000;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-close {
    background: transparent;
    border: 1px solid #333;
    color: #555;
}

.btn-close:hover {
    border-color: #fff;
    color: #fff;
    box-shadow: none;
    background: #111;
}