:root {
    --bg-1: #090014;
    --bg-2: #140027;
    --panel: rgba(10, 8, 24, 0.9);
    --border: #3b2070;
    --text: #e8e5ff;
    --muted: #b6a6de;
    --ok: #22c55e;
    --bad: #ef4444;
    --primary: #00f0ff;
    --primary-2: #ff4fd8;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--text);
    font-family: 'Manrope', sans-serif;
    background:
        radial-gradient(circle at 12% 8%, rgba(0, 240, 255, 0.24), transparent 30%),
        radial-gradient(circle at 88% 6%, rgba(255, 79, 216, 0.22), transparent 34%),
        linear-gradient(160deg, var(--bg-1), var(--bg-2));
    min-height: 100vh;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 100% 3px;
    opacity: 0.2;
    z-index: 0;
}

.layout {
    max-width: 1050px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px;
    backdrop-filter: blur(8px);
    box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.11), 0 0 24px rgba(0, 240, 255, 0.13);
}

.hero h1 {
    margin: 8px 0 4px;
    font-size: clamp(1.6rem, 3.2vw, 2.4rem);
    text-shadow: 0 0 14px rgba(255, 79, 216, 0.35);
}

.kicker {
    margin: 0;
    color: #86f6ff;
    font-family: 'Space Mono', monospace;
    font-size: 0.82rem;
}

.muted {
    color: var(--muted);
}

.actions {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid transparent;
    padding: 9px 12px;
    font-weight: 800;
    cursor: pointer;
    font-family: inherit;
}

.btn-primary {
    color: #090014;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
    color: var(--text);
    border-color: var(--border);
    background: #130826;
}

.status {
    margin: 10px 0 0;
    font-size: 0.92rem;
    color: #86f6ff;
}

.grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 10px;
}

.game-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 8, 36, 0.72);
    display: grid;
    gap: 8px;
    box-shadow: inset 0 0 18px rgba(255, 79, 216, 0.09);
}

.game-card h3 {
    margin: 0;
    font-size: 1.02rem;
}

.meta {
    font-size: 0.82rem;
    color: #86f6ff;
}

.steps {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #d9d2ff;
    display: grid;
    gap: 6px;
}

.form-grid {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.field label {
    display: block;
    font-size: 0.88rem;
    color: #cbd5e1;
    font-weight: 700;
    margin-bottom: 5px;
}

.field input,
.field select {
    width: 100%;
    border: 1px solid #475569;
    border-radius: 10px;
    padding: 10px;
    background: #130826;
    color: var(--text);
    font-family: inherit;
}

.field input:focus,
.field select:focus,
.textarea:focus {
    outline: 2px solid rgba(0, 240, 255, 0.3);
    border-color: #00f0ff;
}

.hidden { display: none; }

.profile-chip {
    margin-top: 8px;
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid rgba(0, 240, 255, 0.35);
    color: #9bf8ff;
    padding: 8px 10px;
    border-radius: 10px;
    display: inline-flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 0.86rem;
    font-weight: 700;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    font-size: 0.9rem;
}

.dash-table th,
.dash-table td {
    border: 1px solid #334155;
    padding: 8px;
    text-align: left;
}

.dash-table th {
    color: #9bf8ff;
    font-weight: 800;
    background: rgba(9, 4, 26, 0.9);
}

.dash-table td {
    color: #dfd7ff;
    background: rgba(12, 6, 30, 0.72);
}

.topline {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.timer {
    font-weight: 800;
    color: #f8ff8a;
    text-shadow: 0 0 12px rgba(248, 255, 138, 0.6);
}

.question {
    margin-top: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 8, 36, 0.72);
}

.question p {
    margin: 0 0 8px;
    font-weight: 700;
}

.opts {
    display: grid;
    gap: 6px;
}

.opts label {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    color: #dfd7ff;
}

.opts input[type="radio"] {
    margin-top: 2px;
    accent-color: var(--primary);
}

.textarea {
    width: 100%;
    border: 1px solid #475569;
    border-radius: 10px;
    padding: 10px;
    background: #130826;
    color: var(--text);
    font-family: inherit;
    min-height: 100px;
    resize: vertical;
}

.result-ok { color: #86efac; font-weight: 800; }
.result-bad { color: #fca5a5; font-weight: 800; }

.ghost-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
}

.pac-ghost {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 14px 14px 6px 6px;
    opacity: 0.9;
    box-shadow: 0 0 10px currentColor;
    animation: ghost-float linear infinite;
}

.pac-ghost::before,
.pac-ghost::after {
    content: "";
    position: absolute;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #f8fafc;
}

.pac-ghost::before { left: 7px; }
.pac-ghost::after { right: 7px; }

.pac-ghost i {
    position: absolute;
    bottom: -1px;
    left: 3px;
    right: 3px;
    height: 6px;
    background:
        radial-gradient(circle at 3px 0, transparent 4px, #000 4px) 0 0/8px 6px repeat-x;
    opacity: 0.35;
}

.ghost-cyan { background: #00f0ff; color: #00f0ff; }
.ghost-pink { background: #ff4fd8; color: #ff4fd8; }
.ghost-orange { background: #ff9a1f; color: #ff9a1f; }
.ghost-red { background: #ff4b4b; color: #ff4b4b; }

@keyframes ghost-float {
    0% {
        transform: translateX(-8vw) translateY(0);
    }
    50% {
        transform: translateX(55vw) translateY(-12px);
    }
    100% {
        transform: translateX(112vw) translateY(4px);
    }
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 900;
    border-radius: 6px;
    padding: 2px 6px;
    border: 1px solid transparent;
    font-size: 0.76rem;
    letter-spacing: 0.03em;
}

.rank-gold {
    background: rgba(251, 191, 36, 0.2);
    color: #fde68a;
    border-color: rgba(251, 191, 36, 0.45);
}

.rank-silver {
    background: rgba(203, 213, 225, 0.2);
    color: #e2e8f0;
    border-color: rgba(203, 213, 225, 0.45);
}

.rank-bronze {
    background: rgba(180, 83, 9, 0.22);
    color: #fdba74;
    border-color: rgba(180, 83, 9, 0.45);
}
