@import url('/lib/crt-effects.css');

:root { --cp-accent: #9d8bff; --cp-evil: #9b86e8; --cp-light: #f3e2a6; }

body { background: #08060d; margin: 0; overflow: hidden; }
#app { width: 100vw; height: calc(100vh - 48px); }
@media (max-width: 768px) { #app { height: calc(100vh - 40px); } }

* { box-sizing: border-box; }

.cp-root {
    position: relative; width: 100%; height: 100%;
    font-family: 'Space Grotesk', 'IBM Plex Mono', sans-serif;
    color: #e8e8f0; overflow: hidden;
}
.cp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: pointer; }

/* ---- Overlays ---- */
.cp-overlay {
    position: absolute; inset: 0; z-index: 10;
    display: flex; align-items: center; justify-content: center;
    background: rgba(8, 6, 13, 0.7); backdrop-filter: blur(3px);
}
.cp-overlay.soft { background: rgba(8, 6, 13, 0.5); }
.cp-panel {
    display: flex; flex-direction: column; align-items: center; gap: 16px;
    max-width: 520px; padding: 34px 40px; text-align: center;
    background: linear-gradient(180deg, rgba(24, 20, 38, 0.95), rgba(14, 12, 22, 0.95));
    border: 1px solid rgba(157, 139, 255, 0.16); border-radius: 6px;
    box-shadow: 0 24px 70px -30px #000;
    animation: cp-reveal 0.2s ease;
}
@keyframes cp-reveal { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

.cp-title {
    font-family: 'Space Mono', monospace; font-size: clamp(24px, 5vw, 38px); font-weight: 700;
    letter-spacing: 6px; color: #fff;
    text-shadow: 0 0 28px rgba(157, 139, 255, 0.5);
}
.cp-title.small { font-size: clamp(16px, 3.2vw, 24px); letter-spacing: 3px; }
.cp-tag { font-size: 13px; color: #a89ad0; letter-spacing: 0.5px; line-height: 1.5; max-width: 420px; }
.cp-btnrow { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.cp-start {
    display: inline-flex; align-items: center; justify-content: center;
    height: 44px; padding: 0 26px; border-radius: 3px;
    border: 1px solid var(--cp-accent); background: rgba(157, 139, 255, 0.14);
    color: var(--cp-accent); font-size: 15px; font-family: inherit; cursor: pointer; transition: all 0.15s;
}
.cp-start:hover { background: var(--cp-accent); color: #0b0b12; box-shadow: 0 0 22px -6px var(--cp-accent); }

/* ---- Pass toast ---- */
.cp-toast {
    position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9;
    padding: 8px 16px; border-radius: 3px;
    background: rgba(10, 8, 20, 0.92); border: 1px solid rgba(157, 139, 255, 0.4);
    font-family: 'Space Mono', monospace; font-size: 11px; color: #d8cff0; letter-spacing: 1px;
    animation: cp-reveal 0.25s ease;
}

/* ---- Bottom control bar (house style) ---- */
.cp-controls {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 11;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
    padding: 7px 12px;
    background: rgba(10, 8, 15, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    font-family: 'Space Mono', 'IBM Plex Mono', monospace;
}
.cp-play {
    display: inline-flex; align-items: center; justify-content: center;
    height: 30px; min-width: 40px; padding: 0 12px; border-radius: 3px;
    border: 1px solid var(--cp-accent); background: transparent;
    color: var(--cp-accent); font-size: 12px; font-family: inherit; cursor: pointer;
    line-height: 1; transition: all 0.15s;
}
.cp-play:hover { background: rgba(157, 139, 255, 0.16); }
.cp-play.playing { background: var(--cp-accent); color: #0b0b12; }
.cp-play.loading { font-size: 11px; cursor: default; }
.cp-play.idle { animation: cp-play-pulse 1.9s ease-in-out infinite; }
@keyframes cp-play-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(157, 139, 255, 0); } 50% { box-shadow: 0 0 12px -3px var(--cp-accent); } }

.cp-btn {
    display: inline-flex; align-items: center; height: 30px; padding: 0 10px;
    background: transparent; border: 1px solid rgba(255, 255, 255, 0.12);
    color: #8a8a98; border-radius: 3px; cursor: pointer; font-size: 11px;
    font-family: inherit; line-height: 1; transition: all 0.12s; white-space: nowrap;
}
.cp-btn:hover:not(:disabled) { border-color: var(--cp-accent); color: var(--cp-accent); }
.cp-btn:disabled { opacity: 0.3; cursor: default; }
.cp-btn.active { border-color: var(--cp-accent); color: var(--cp-accent); }

.cp-tempo {
    display: inline-flex; align-items: center; gap: 8px;
    height: 30px; padding: 0 10px; border-radius: 3px;
    border: 1px solid rgba(255, 255, 255, 0.12); background: transparent;
}
.cp-tempo-lbl { font-size: 10px; color: #667; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap; }
.cp-tempo-val { color: var(--cp-accent); font-weight: 700; }

.cp-slider {
    -webkit-appearance: none; appearance: none; display: block;
    width: 84px; height: 3px; outline: none; border-radius: 2px;
    background: #1c1a26; cursor: pointer;
}
.cp-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 11px; height: 11px; border-radius: 2px;
    background: var(--cp-accent); box-shadow: 0 0 6px var(--cp-accent); cursor: pointer;
}
.cp-slider::-moz-range-thumb {
    width: 11px; height: 11px; border-radius: 2px; border: none;
    background: var(--cp-accent); box-shadow: 0 0 6px var(--cp-accent); cursor: pointer;
}

@media (max-width: 640px) {
    .cp-panel { padding: 24px 20px; margin: 0 14px; }
    .cp-controls { gap: 6px; }
}
