/* ══════════════════════════════════════════════════════════════
   Demo Day — Wheel of Destiny Theme
   Color scheme inspired by FusionSol: Navy + Orange + Teal
   ══════════════════════════════════════════════════════════════ */

/* ── Theme Colors ─────────────────────────────────────────── */
.demo-day-theme {
    --dd-navy: #0a1628;
    --dd-navy-mid: #122044;
    --dd-navy-light: #1a2d5a;
    --dd-orange: #ff6b00;
    --dd-orange-light: #ff8c33;
    --dd-teal: #00bcd4;
    --dd-teal-light: #4dd0e1;
    --dd-gold: #ffd700;
    --dd-purple: #7c4dff;
    --dd-white: #ffffff;
    --dd-text: rgba(255, 255, 255, 0.92);
    --dd-text-dim: rgba(255, 255, 255, 0.6);
}

/* ── Override base dark theme for demo-day ────────────────── */
.demo-day-theme {
    background: linear-gradient(160deg, var(--dd-navy) 0%, var(--dd-navy-mid) 50%, #0d1a3a 100%);
}

.demo-day-theme .landing-header {
    background: transparent;
}

.demo-day-theme .landing-logo {
    color: var(--dd-teal-light);
    font-weight: 700;
    font-size: 1.3em;
    letter-spacing: 0.5px;
}

.demo-day-theme .lang-toggle {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--dd-text);
}

/* ── Start Page Hero ──────────────────────────────────────── */
.demo-day-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 32px;
    padding: 40px 24px;
    height: 100%;
    text-align: center;
    position: relative;
    box-sizing: border-box;
}

.demo-day-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.demo-day-orb-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 380px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 188, 212, 0.15) 0%, rgba(255, 107, 0, 0.08) 50%, transparent 70%);
    animation: dd-orb-pulse 4s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes dd-orb-pulse {
    0% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.6; }
    100% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
}

.demo-day-title {
    font-size: 2.2em;
    font-weight: 800;
    color: var(--dd-white);
    margin: 0;
    z-index: 1;
    text-shadow: 0 0 40px rgba(0, 188, 212, 0.3);
}

.demo-day-subtitle {
    font-size: 1.1em;
    color: var(--dd-text-dim);
    max-width: 340px;
    line-height: 1.6;
    margin: 0;
    z-index: 1;
}

/* ── Start Button ─────────────────────────────────────────── */
.btn-demo-start {
    background: linear-gradient(135deg, var(--dd-orange), var(--dd-orange-light));
    color: var(--dd-white);
    border: none;
    padding: 18px 56px;
    border-radius: 60px;
    font-size: 1.4em;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 30px rgba(255, 107, 0, 0.4), 0 0 60px rgba(255, 107, 0, 0.15);
    z-index: 1;
    letter-spacing: 0.5px;
}
.btn-demo-start:hover:not(:disabled) {
    transform: scale(1.06);
    box-shadow: 0 8px 40px rgba(255, 107, 0, 0.55);
}
.btn-demo-start:active:not(:disabled) {
    transform: scale(0.97);
}
.btn-demo-start:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

.demo-day-footer {
    font-size: 0.8em;
    color: var(--dd-text-dim);
    margin-top: 16px;
    z-index: 1;
}

/* ── Kiosk Mode Overrides ─────────────────────────────────── */
.kiosk-mode {
    cursor: none;
    user-select: none;
    -webkit-user-select: none;
    overflow: hidden;
}

.kiosk-mode body,
.kiosk-mode.demo-day-theme {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

.kiosk-mode button,
.kiosk-mode a,
.kiosk-mode select,
.kiosk-mode input {
    cursor: pointer;
}

.kiosk-mode .btn-demo-start {
    min-height: 64px;
    font-size: 1.6em;
    padding: 22px 70px;
}

/* ── Wheel of Destiny Overlay ─────────────────────────────── */
.wheel-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: linear-gradient(160deg, rgba(10, 22, 40, 0.97), rgba(18, 32, 68, 0.98));
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.wheel-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.wheel-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px 24px;
    max-width: 540px;
    width: 92vw;
    max-height: 100vh;
    overflow: hidden;
    box-sizing: border-box;
}

.wheel-close {
    position: absolute;
    top: 4px;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    z-index: 2;
    transition: color 0.2s;
}
.wheel-close:hover { color: #fff; }

.wheel-title {
    font-size: 1.7em;
    color: var(--dd-gold);
    margin: 0;
    text-align: center;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
    animation: wheel-glow 2.5s ease-in-out infinite alternate;
}

@keyframes wheel-glow {
    from { text-shadow: 0 0 10px rgba(255, 215, 0, 0.3); }
    to { text-shadow: 0 0 35px rgba(255, 215, 0, 0.8), 0 0 70px rgba(255, 215, 0, 0.2); }
}

.wheel-instruction {
    color: var(--dd-text);
    font-size: 1em;
    text-align: center;
    margin: 0;
}

.wheel-body {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 0;
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 0 0 40px rgba(0, 188, 212, 0.2), 0 0 80px rgba(255, 107, 0, 0.1);
}

.wheel-pointer-top {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 36px;
    color: var(--dd-orange);
    z-index: 2;
    filter: drop-shadow(0 2px 6px rgba(255, 107, 0, 0.7));
}

.wheel-voice-hint {
    background: rgba(0, 188, 212, 0.1);
    border: 1px solid rgba(0, 188, 212, 0.3);
    border-radius: 12px;
    padding: 10px 18px;
    color: var(--dd-teal-light);
    font-size: 0.9em;
    text-align: center;
    animation: hint-pulse 2s ease-in-out infinite;
}

@keyframes hint-pulse {
    0%, 100% { border-color: rgba(0, 188, 212, 0.3); }
    50% { border-color: rgba(0, 188, 212, 0.7); }
}

.wheel-voice-hint.listening {
    border-color: var(--dd-orange);
    background: rgba(255, 107, 0, 0.1);
    color: var(--dd-orange-light);
}

.wheel-result {
    text-align: center;
    animation: result-pop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes result-pop {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.wheel-result-text {
    font-size: 1.8em;
    font-weight: 800;
    margin: 8px 0;
    text-shadow: 0 0 20px currentColor;
}

.wheel-result-hint {
    color: var(--dd-text-dim);
    font-size: 0.95em;
    margin: 4px 0;
}

/* ── Chat screen adjustments for demo day ─────────────────── */
.demo-day-theme .chat-container {
    background: linear-gradient(180deg, var(--dd-navy) 0%, var(--dd-navy-mid) 100%);
}

.demo-day-theme .btn-mic {
    background: linear-gradient(135deg, var(--dd-orange), var(--dd-orange-light));
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.3);
}

.demo-day-theme .btn-close {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.demo-day-theme .orb-circle.c1 { background: var(--dd-teal); }
.demo-day-theme .orb-circle.c2 { background: var(--dd-orange); }
.demo-day-theme .orb-circle.c3 { background: var(--dd-purple); }
.demo-day-theme .orb-circle.c4 { background: var(--dd-teal-light); }

/* ── Demo Day: Larger transcript for booth readability ────── */
.demo-day-theme .transcript {
    font-size: 18px;
    line-height: 1.6;
    max-height: 120px;
    overflow-y: auto;
}

/* ── Demo Day: Larger thinking blob ───────────────────────── */
.demo-day-theme .thinking-blob {
    width: 180px;
    height: 180px;
}

/* ── Confetti animation for prize result ──────────────────── */
@keyframes confetti-fall {
    0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.confetti-piece {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    animation: confetti-fall 3s ease-out forwards;
    pointer-events: none;
    z-index: 10001;
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-height: 700px) {
    .demo-day-title { font-size: 1.7em; }
    .demo-day-orb-bg { width: 280px; height: 280px; }
    .btn-demo-start { padding: 14px 44px; font-size: 1.2em; }
    .wheel-title { font-size: 1.4em; }
    #wheel-canvas { width: 280px; height: 280px; }
}

@media (min-width: 768px) {
    .demo-day-title { font-size: 2.8em; }
    .demo-day-subtitle { font-size: 1.2em; max-width: 450px; }
    .btn-demo-start { padding: 20px 70px; font-size: 1.6em; }
}

/* ── Portrait screen (booth kiosk — tall display) ─────────── */
@media (orientation: portrait) and (min-height: 900px) {
    /* Landing page */
    .demo-day-theme .demo-day-title { font-size: 3em; }
    .demo-day-theme .demo-day-subtitle { font-size: 1.4em; max-width: 500px; }
    .demo-day-theme .btn-demo-start { padding: 24px 80px; font-size: 1.8em; }
    .demo-day-theme .demo-day-orb-bg { width: 440px; height: 440px; }

    /* Chat screen — orb + transcript */
    .demo-day-theme .orb-circle { width: 64px; height: 64px; }
    .demo-day-theme .voice-orb { gap: 16px; }
    .demo-day-theme .thinking-blob { width: 220px; height: 220px; }
    .demo-day-theme .transcript {
        font-size: 22px;
        line-height: 1.7;
        max-height: 180px;
        left: 16px;
        right: 16px;
    }
    .demo-day-theme .status-text { font-size: 20px; }

    /* Bonus question popup */
    .random-question-text { font-size: 1.4em; }
    .random-question-content { padding: 20px 32px; }
    .random-question-icon { font-size: 40px; }

    /* Wheel overlay */
    .demo-day-theme .wheel-container { gap: 12px; padding: 24px; max-width: 600px; }
    .demo-day-theme .wheel-title { font-size: 2.2em; }
    .demo-day-theme #wheel-canvas { width: 480px; height: 480px; }
    .demo-day-theme .wheel-instruction { font-size: 1.5em; }
    .demo-day-theme .wheel-voice-hint { font-size: 1.2em; padding: 14px 20px; }
    .demo-day-theme #wheel-result-text { font-size: 1.8em; }
    .demo-day-theme #wheel-result-hint { font-size: 1.2em; }
    .demo-day-theme #wheel-accept-btn { font-size: 1.5em; padding: 20px 50px; }
}
.lucky-wheel-done-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* ── Confetti ─────────────────────────────────────────────── */
.confetti-piece {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    left: var(--x, 50%);
    top: 30%;
    opacity: 0;
    animation: confetti-fall 2.5s ease-out var(--delay, 0s) forwards;
    transform: rotate(var(--rotation, 0deg));
}

@keyframes confetti-fall {
    0% {
        opacity: 1;
        transform: translateY(0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(300px) rotate(720deg) scale(0.5);
    }
}

/* ── Demo Day Prize Button (shown on chat screen) ─────────── */
.demo-prize-trigger {
    position: fixed;
    bottom: 100px;
    right: 16px;
    z-index: 100;
    background: linear-gradient(135deg, #FFD700, #FF6B6B);
    color: #222;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5);
    animation: prize-pulse 2s ease-in-out infinite;
    display: none; /* shown by app.js when demo-day mode */
}

.demo-prize-trigger.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes prize-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 4px 20px rgba(255, 215, 0, 0.5); }
    50% { transform: scale(1.1); box-shadow: 0 6px 30px rgba(255, 215, 0, 0.8); }
}

/* ── No Luck Overlay ──────────────────────────────────────── */
.fortune-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 22, 40, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s ease;
}

.fortune-overlay-content {
    text-align: center;
    max-width: 420px;
    padding: 40px 32px;
}

.no-luck-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.fortune-overlay-title {
    font-size: 1.6em;
    color: var(--dd-gold);
    margin-bottom: 16px;
    font-weight: 700;
}

.fortune-overlay-message {
    font-size: 1.1em;
    color: var(--dd-text);
    margin-bottom: 32px;
    line-height: 1.6;
}

.btn-demo-accept {
    display: inline-block;
    padding: 14px 48px;
    border: none;
    border-radius: 50px;
    font-size: 1.2em;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, var(--dd-orange), var(--dd-orange-light));
    color: #fff;
    box-shadow: 0 4px 20px rgba(255, 107, 0, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 12px;
}

.btn-demo-accept:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 28px rgba(255, 107, 0, 0.6);
}

/* ── Random Question Popup ────────────────────────────────── */
.random-question-popup {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
    pointer-events: none;
    animation: slideDown 0.5s ease;
}

.random-question-content {
    background: linear-gradient(135deg, var(--dd-navy-light), var(--dd-purple));
    border: 2px solid var(--dd-gold);
    border-radius: 20px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(124, 77, 255, 0.4);
    min-width: 280px;
    max-width: 90vw;
}

.random-question-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.random-question-text {
    color: var(--dd-white);
    font-size: 1.1em;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

@keyframes slideDown {
    0% { opacity: 0; transform: translateX(-50%) translateY(-30px); }
    100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
