/* ─── Reset & Globals ──────────────────────────────────────────── */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #050505;
    --surface: rgba(255, 255, 255, 0.03);
    --surface-hover: rgba(255, 255, 255, 0.06);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.18);
    --text: #e8e8e8;
    --text-muted: #707070;
    --accent: #b0b0b0;
    --accent-dim: rgba(255, 255, 255, 0.12);
    --red: #cc3333;
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
}

/* ─── Particle Canvas ─────────────────────────────────────────── */

#particleCanvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
}

/* ─── Screens ─────────────────────────────────────────────────── */

.screen {
    position: fixed;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}
.screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* ─── Scenario Selection ──────────────────────────────────────── */

.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-logo {
    max-width: 220px;
    height: auto;
    opacity: 0.9;
}

.hero .subtitle {
    font-size: 1rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    margin-top: 0.5rem;
}

.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 900px;
    width: 90%;
}

@media (max-width: 768px) {
    .scenario-grid {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
}

.scenario-card {
    position: relative;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
    text-align: center;
}
.scenario-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.02);
    opacity: 0;
    transition: opacity 0.3s;
}
.scenario-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(255, 255, 255, 0.04);
}
.scenario-card:hover::before {
    opacity: 1;
}

.scenario-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.scenario-icon svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent);
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.scenario-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
    position: relative;
}

.scenario-card .scenario-subtitle {
    font-size: 0.8rem;
    color: var(--accent);
    margin-bottom: 0.6rem;
    position: relative;
}

.scenario-tag {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a1a00;
    background: #e8c840;
    padding: 0.15rem 0.5rem;
    border-radius: 100px;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.scenario-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    position: relative;
}

/* ─── Conversation Screen ─────────────────────────────────────── */

.conversation-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    z-index: 20;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(10px);
}
.icon-btn:hover {
    background: var(--surface-hover);
    border-color: var(--border-hover);
    color: var(--text);
}
.icon-btn svg {
    width: 18px;
    height: 18px;
}

.char-name {
    font-family: var(--font-heading);
    font-weight: 500;
    font-size: 0.95rem;
    flex: 1;
}

.status {
    font-size: 0.75rem;
    color: var(--accent);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ─── Text Bubbles ────────────────────────────────────────────── */

.conversation-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 5rem 1.5rem 10rem;
}

.text-bubble {
    max-width: 600px;
    width: 90%;
    padding: 1.5rem 2rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    backdrop-filter: blur(30px);
    transition: opacity 0.3s;
}
.text-bubble.hidden {
    display: none;
}
.text-bubble p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text);
    min-height: 1.7em;
}

.user-bubble {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}
.user-bubble p {
    color: #c0c0c0;
}

/* ─── Record Button ───────────────────────────────────────────── */

.conversation-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 2.5rem;
    gap: 0.8rem;
    z-index: 20;
}

/* ─── Recorder Panel ─────────────────────────────────────────── */

.recorder-panel {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(30px);
    border: 1px solid var(--border);
    border-radius: 100px;
    transition: all 0.3s;
}

.recorder-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.record-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
    transition: all 0.3s;
}
.record-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.rec-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
}

.record-btn.ready {
    border-color: rgba(255, 255, 255, 0.4);
    animation: readyPulse 2s ease-in-out infinite;
}
.record-btn.ready .rec-dot {
    background: rgba(255, 255, 255, 0.6);
}

@keyframes readyPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.06); }
    50%      { box-shadow: 0 0 25px rgba(255, 255, 255, 0.15); }
}

.record-btn.recording {
    border-color: #ffffff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    animation: recordPulse 1s ease-in-out infinite;
}
.record-btn.recording .rec-dot {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    background: #ffffff;
}

@keyframes recordPulse {
    0%, 100% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.1); }
    50%      { box-shadow: 0 0 30px rgba(255, 255, 255, 0.25); }
}

/* ─── Waveform ───────────────────────────────────────────────── */

.waveform-wrap {
    width: 220px;
    height: 40px;
    position: relative;
    overflow: hidden;
    border-radius: 4px;
}
.waveform-wrap canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.record-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    min-height: 1.2em;
}

/* ─── Scrollbar ───────────────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}
