/* ==============================================================================
   GOVORI.UZ 3D GAMES HUB STYLES (Three.js WebGL + Glassmorphism UI)
   ============================================================================== */

:root {
    --bg-dark: #0f172a;
    --card-bg: rgba(15, 23, 42, 0.85);
    --card-border: rgba(255, 255, 255, 0.12);
    --accent-blue: #38bdf8;
    --accent-indigo: #6366f1;
    --accent-green: #10b981;
    --accent-gold: #fbbf24;
    --accent-red: #f43f5e;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --btn-grad: linear-gradient(135deg, #38bdf8, #6366f1);
    --btn-gold-grad: linear-gradient(135deg, #fbbf24, #f59e0b);
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --shadow-glow: 0 8px 32px 0 rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    color: var(--text-primary);
}

/* 3D WebGL Canvas */
#webgl-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
}

/* Top Floating HUD */
.hud-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    z-index: 20;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0) 100%);
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}

.btn-icon {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.btn-icon:active {
    transform: scale(0.92);
}

.hud-title-box {
    display: flex;
    flex-direction: column;
}

.brand-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--accent-blue);
    text-transform: uppercase;
}

.scene-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
}

.xp-pill {
    background: rgba(251, 191, 36, 0.15);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 13px;
    padding: 6px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(8px);
}

.btn-pill {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 12px;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

/* Scene Selector Chips */
.scene-chips-bar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 6px 16px;
    z-index: 20;
    pointer-events: auto;
}

.scene-chip {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
}

.scene-chip.active {
    background: var(--btn-grad);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.35);
}

/* 3D Camera Drag Hint */
.drag-hint {
    position: fixed;
    top: 104px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 11px;
    padding: 4px 12px;
    border-radius: 12px;
    z-index: 10;
    pointer-events: none;
    backdrop-filter: blur(6px);
    opacity: 0.85;
    animation: fadeInOut 5s forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; }
    20% { opacity: 0.9; }
    80% { opacity: 0.9; }
    100% { opacity: 0; display: none; }
}

/* Dialogue Floating Card */
.dialogue-card {
    position: fixed;
    bottom: 16px;
    left: 16px;
    right: 16px;
    max-width: 520px;
    margin: 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-glow);
    backdrop-filter: blur(16px);
    z-index: 25;
    pointer-events: auto;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.character-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.character-avatar {
    font-size: 26px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.character-name {
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
}

.step-indicator {
    font-size: 11px;
    color: var(--accent-blue);
    font-weight: 600;
}

/* Speech Bubble */
.speech-bubble {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-blue);
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 12px;
}

.speech-bubble p {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 600;
    color: #ffffff;
}

.speech-translation {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-style: italic;
}

/* Feedback Box */
.feedback-box {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.4);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin-bottom: 12px;
    animation: slideDown 0.25s ease;
}

.feedback-box.error {
    background: rgba(244, 63, 94, 0.12);
    border-color: rgba(244, 63, 94, 0.4);
}

.feedback-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 3px;
}

.feedback-box.error .feedback-title {
    color: var(--accent-red);
}

.feedback-text {
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.35;
}

/* Options List */
.options-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
}

.opt-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    line-height: 1.35;
    transition: all 0.2s ease;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

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

.opt-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(56, 189, 248, 0.4);
}

.opt-letter {
    color: var(--accent-blue);
    font-weight: 700;
    min-width: 16px;
}

.opt-btn.correct {
    background: rgba(16, 185, 129, 0.25);
    border-color: var(--accent-green);
    color: #ffffff;
}

.opt-btn.wrong {
    background: rgba(244, 63, 94, 0.25);
    border-color: var(--accent-red);
    color: #ffffff;
}

.opt-btn.disabled {
    pointer-events: none;
    opacity: 0.6;
}

/* Action Row */
.action-row {
    margin-top: 10px;
}

.btn-action {
    width: 100%;
    background: var(--btn-grad);
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 12px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: all 0.2s ease;
}

.btn-action:active {
    transform: scale(0.97);
}

/* Blitz HUD */
.blitz-hud {
    position: fixed;
    top: 120px;
    left: 16px;
    right: 16px;
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    z-index: 15;
    pointer-events: none;
}

.blitz-timer-pill {
    display: inline-block;
    background: rgba(244, 63, 94, 0.25);
    border: 1px solid var(--accent-red);
    color: #ffffff;
    font-size: 15px;
    font-weight: 800;
    padding: 4px 16px;
    border-radius: 20px;
    backdrop-filter: blur(8px);
    margin-bottom: 8px;
}

.blitz-target-prompt {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    padding: 12px 16px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(12px);
}

#blitzPromptText {
    font-size: 12px;
    color: var(--text-secondary);
}

.blitz-q-highlight {
    font-size: 16px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-top: 4px;
}

/* Celebration Modal */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 100;
}

.celebration-card {
    background: #1e293b;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 24px;
    padding: 24px 20px;
    width: 100%;
    max-width: 380px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(251, 191, 36, 0.2);
    animation: popUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popUp {
    0% { transform: scale(0.85); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideDown {
    0% { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.celebration-badge {
    display: inline-block;
    background: rgba(251, 191, 36, 0.2);
    color: var(--accent-gold);
    font-weight: 800;
    font-size: 11px;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.celebration-stars {
    font-size: 24px;
    margin-bottom: 8px;
}

.celebration-heading {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 6px;
}

.celebration-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 18px;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    padding: 10px;
}

.stat-num {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent-gold);
}

.stat-label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.celebration-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-primary {
    background: var(--btn-grad);
    border: none;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    padding: 13px;
    border-radius: var(--radius-md);
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    padding: 11px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

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

.hidden {
    display: none !important;
}
