.demo-page {
    min-height: 100vh;
    overflow: hidden;
    justify-content: center;
}

.demo-header {
    width: min(90vw, 500px);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px 12px;
    margin-bottom: 12px;
    color: #fff;
    text-shadow: 0 0 8px #00ffff;
    position: relative;
    z-index: 5;
}

.demo-label {
    font-size: 0.8rem;
    letter-spacing: 2px;
    opacity: 0.75;
}

.demo-mode {
    text-align: right;
    font-size: 0.8rem;
    color: #ff007f;
    letter-spacing: 2px;
}

#demo-timer {
    grid-column: 2;
    text-align: right;
    font-size: 1.7rem;
    line-height: 1;
    color: #fff;
    text-shadow: 0 0 12px #ff007f;
    font-weight: bold;
}

.demo-hidden {
    display: none !important;
}

#game-wrapper {
    z-index: 2;
}

.demo-help {
    width: min(90vw, 500px);
    margin-top: 10px;
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 0.68rem;
    letter-spacing: 1px;
    line-height: 1.7;
    position: relative;
    z-index: 5;
}

.demo-help span:first-child {
    color: #ffcc00;
}

.mobile-help {
    display: block;
    color: rgba(255,255,255,0.42);
}

.demo-result {
    position: absolute;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(2, 2, 8, 0.94);
    backdrop-filter: blur(5px);
}

.demo-result-scan {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(255,255,255,0) 0px,
        rgba(255,255,255,0) 3px,
        rgba(0,255,255,0.07) 4px,
        rgba(255,255,255,0) 5px
    );
    pointer-events: none;
    animation: demoScan 1.5s linear infinite;
}

@keyframes demoScan {
    from { transform: translateY(-10px); }
    to { transform: translateY(10px); }
}

.demo-result-content {
    width: 88%;
    text-align: center;
    position: relative;
    z-index: 2;
}

.demo-result-system {
    color: #00ffff;
    font-size: 0.72rem;
    letter-spacing: 4px;
    margin-bottom: 10px;
}

#demo-result-title {
    margin: 0 0 18px;
    color: #fff;
    font-size: clamp(1.35rem, 6vw, 2rem);
    letter-spacing: 3px;
    text-shadow: 0 0 12px #ff007f;
}

#demo-result-message {
    color: rgba(255,255,255,0.78);
    font-size: 0.78rem;
    line-height: 1.9;
    margin: 0 auto 18px;
}

.demo-score {
    color: #ffcc00;
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 22px;
}

#demo-result-score {
    font-size: 1.3rem;
    font-weight: bold;
    margin-left: 8px;
}

.demo-result-buttons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.demo-result-buttons button,
.demo-result-buttons a {
    width: min(88%, 300px);
    box-sizing: border-box;
    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,0.45);
    background: transparent;
    color: #fff;
    font-family: monospace;
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-decoration: none;
    cursor: pointer;
    transition: 0.25s ease;
}

.demo-result-buttons button:hover,
.demo-result-buttons a:hover {
    color: #000;
    background: #00ffff;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0,255,255,0.45);
}

.demo-result-buttons a {
    border-color: #ff007f;
    color: #ff8abb;
}

.demo-result-buttons a:hover {
    background: #ff007f;
    border-color: #ff007f;
    color: #000;
    box-shadow: 0 0 20px rgba(255,0,127,0.5);
}

@media (max-width: 600px) {
    .demo-header {
        margin-bottom: 8px;
    }

    #demo-timer {
        font-size: 1.45rem;
    }

    .demo-help {
        font-size: 0.58rem;
    }
}
