/* Victory Cinema 2.0 — Mobile-first responsive styles */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #141929;
    --bg-card: #1c2236;
    --text-primary: #e8eaf0;
    --text-secondary: #8b92a8;
    --accent: #4f8cff;
    --accent-glow: rgba(79, 140, 255, 0.3);
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #f87171;
    --radius: 16px;
    --radius-sm: 8px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* Screens */
.screen {
    display: none;
    position: absolute;
    inset: 0;
    overflow-y: auto;
    transition: opacity 0.3s ease;
}

.screen.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    text-align: center;
}

/* Welcome screen */
.logo-area {
    margin-bottom: 32px;
}

.logo-icon {
    color: var(--accent);
    margin-bottom: 16px;
}

h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
}

.version {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.description {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 40px;
}

.hint {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* Buttons */
.btn-primary {
    display: inline-block;
    padding: 16px 48px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    touch-action: manipulation;
    transition: transform 0.15s, box-shadow 0.15s;
    min-height: 56px;
    min-width: 200px;
}

.btn-primary:hover {
    transform: scale(1.03);
    box-shadow: 0 0 30px var(--accent-glow);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 50px;
    cursor: pointer;
    touch-action: manipulation;
    min-height: 48px;
    transition: background 0.15s;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
}

/* Stage progress */
.stage-progress {
    margin-bottom: 24px;
}

.stage-bar {
    height: 4px;
    background: var(--bg-card);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.stage-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.stage-label {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Visualizer */
.visualizer-area {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 32px 0;
}

#visualizer {
    width: 200px;
    height: 200px;
}

.status-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-top: 16px;
    min-height: 24px;
}

/* Chat log */
.chat-log {
    height: 160px;
    overflow-y: auto;
    margin-bottom: 24px;
    padding: 4px 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: var(--bg-card) transparent;
}

.chat-log::-webkit-scrollbar {
    width: 4px;
}

.chat-log::-webkit-scrollbar-thumb {
    background: var(--bg-card);
    border-radius: 2px;
}

.chat-message {
    font-size: 14px;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    max-width: 92%;
    word-break: break-word;
    text-align: left;
}

.chat-message.user {
    background: var(--bg-card);
    color: var(--text-primary);
    font-style: italic;
    align-self: flex-end;
}

.chat-message.assistant {
    color: var(--text-secondary);
    align-self: flex-start;
}

.chat-message.system {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.5;
    align-self: center;
    padding: 2px 6px;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 16px;
}

/* Results screen */
h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
}

.results-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 32px;
}

.suds-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.suds-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.suds-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.suds-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--accent);
}

.suds-arrow {
    font-size: 24px;
    color: var(--text-secondary);
}

.anchor-section {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
    margin-bottom: 16px;
}

.anchor-section h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--success);
}

.anchor-section p {
    font-size: 15px;
    color: var(--text-secondary);
}

.summary-text {
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 16px;
}

/* Animations */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.08); opacity: 1; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.status-listening .logo-icon {
    animation: pulse 2s ease-in-out infinite;
}

/* Responsive */
@media (min-width: 768px) {
    .container {
        max-width: 560px;
        padding: 32px;
    }

    h1 { font-size: 36px; }
    .description { font-size: 18px; }

    #visualizer {
        width: 260px;
        height: 260px;
    }
}

@media (min-width: 1024px) {
    .container {
        max-width: 640px;
        padding: 40px;
    }

    h1 { font-size: 42px; }
}
