/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg: #1a1a2e;
    --color-card: rgba(255, 255, 255, 0.06);
    --color-card-border: rgba(255, 255, 255, 0.12);
    --color-text: #f8f8f2;
    --color-text-muted: rgba(248, 248, 242, 0.55);
    --color-accent: #ff8fa3;
    --color-accent-light: #ffb3c1;
    --color-lavender: #d4b5f0;
    --color-mint: #a8e6cf;
    --color-peach: #ffd3b6;
    --color-sky: #a8d8ea;
    --color-lemon: #fdffb6;
    --shadow-soft: 0 20px 40px -12px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 50px rgba(255, 143, 163, 0.25);
    --top-height: 120px;
    --bottom-height: 140px;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    line-height: 1.6;
    position: relative;
}

/* Animated Background */
.background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.gradient-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s ease-in-out infinite;
}

.blob-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--color-lavender) 0%, transparent 70%);
    top: -150px;
    right: -100px;
    animation-delay: 0s;
    opacity: 0.5;
}

.blob-2 {
    width: 450px;
    height: 450px;
    background: radial-gradient(circle, var(--color-mint) 0%, transparent 70%);
    bottom: -100px;
    left: -80px;
    animation-delay: -7s;
    opacity: 0.45;
}

.blob-3 {
    width: 350px;
    height: 350px;
    background: radial-gradient(circle, var(--color-peach) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
    opacity: 0.4;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
    25% { transform: translate(30px, -30px) rotate(5deg) scale(1.05); }
    50% { transform: translate(-20px, 20px) rotate(-5deg) scale(0.95); }
    75% { transform: translate(20px, 30px) rotate(3deg) scale(1.02); }
}

/* Fixed Top Section */
.top-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-height);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(26, 26, 46, 0.98) 0%, rgba(26, 26, 46, 0.9) 60%, transparent 100%);
    padding: 1.5rem 1rem 1rem;
}

/* Hero */
.hero {
    text-align: center;
}

.title {
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.title .line {
    display: block;
}

.title .accent {
    color: var(--color-accent);
}

.subtitle {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

/* Scrollable Middle Content */
.middle-content {
    position: fixed;
    top: var(--top-height);
    bottom: var(--bottom-height);
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow: hidden;
    gap: 1rem;
}

/* Question Card */
.question-card {
    flex: 1;
    max-width: 600px;
}

.card-inner {
    background: var(--color-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--color-card-border);
    border-radius: 24px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-inner.is-done {
    border-color: rgba(168, 230, 207, 0.4);
    box-shadow: var(--shadow-soft), 0 0 30px rgba(168, 230, 207, 0.15);
}

.card-status {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(168, 230, 207, 0.8);
    box-shadow: 0 0 10px rgba(168, 230, 207, 0.6);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-inner.is-done .card-status {
    opacity: 1;
}

.card-inner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-inner:hover::before {
    opacity: 1;
}

.card-inner:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.875rem;
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-accent-light);
    margin-bottom: 1rem;
}

.category-badge.culture { background: rgba(212, 181, 240, 0.25); border-color: rgba(212, 181, 240, 0.4); color: #c9a07c; }
.category-badge.icebreaker { background: rgba(255, 143, 163, 0.25); border-color: rgba(255, 143, 163, 0.4); color: #d67a8b; }
.category-badge.team { background: rgba(168, 230, 207, 0.35); border-color: rgba(168, 230, 207, 0.5); color: #5a9b7e; }
.category-badge.personal { background: rgba(255, 211, 182, 0.35); border-color: rgba(255, 211, 182, 0.5); color: #c9916e; }
.category-badge.work { background: rgba(168, 216, 234, 0.35); border-color: rgba(168, 216, 234, 0.5); color: #5a8fa3; }
.category-badge.fun { background: rgba(253, 255, 182, 0.4); border-color: rgba(253, 255, 182, 0.6); color: #9a9b5c; }
.category-badge.reflection { background: rgba(212, 181, 240, 0.2); border-color: rgba(212, 181, 240, 0.35); color: #8b74a3; }

.question {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 1.5rem;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Button base styles */
.btn-copy, .btn-done, .btn-favorite {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    min-width: 100px;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 2;
}

.btn-ripple {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.3) 0%, transparent 70%);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
    z-index: 1;
}

.btn-copy:active .btn-ripple,
.btn-done:active .btn-ripple,
.btn-favorite:active .btn-ripple {
    opacity: 1;
    transform: scale(2);
    transition: all 0s;
}

.btn-copy:hover, .btn-done:hover, .btn-favorite:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.25);
}

.btn-copy:active, .btn-done:active, .btn-favorite:active {
    transform: translateY(0) scale(0.98);
}

/* Copy button specific */
.btn-copy svg {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.btn-copy .icon-check {
    display: none;
}

.btn-copy.copied {
    background: rgba(168, 230, 207, 0.25) !important;
    border-color: rgba(168, 230, 207, 0.5) !important;
    color: #a8e6cf !important;
    animation: pulse-success 0.4s ease;
}

.btn-copy.copied .icon-copy {
    display: none;
}

.btn-copy.copied .icon-check {
    display: block;
}

@keyframes pulse-success {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Favorite button specific */
.btn-favorite svg {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.btn-favorite .icon-star-filled {
    display: none;
}

.btn-favorite.is-favorite {
    background: rgba(255, 215, 0, 0.2) !important;
    border-color: rgba(255, 215, 0, 0.4) !important;
    color: #ffd700 !important;
}

.btn-favorite.is-favorite .icon-star {
    display: none;
}

.btn-favorite.is-favorite .icon-star-filled {
    display: block;
}

/* Done button specific */
.btn-done svg {
    width: 18px;
    height: 18px;
    transition: all 0.2s ease;
}

.btn-done .icon-check-filled {
    display: none;
}

.btn-done.is-done {
    background: rgba(168, 230, 207, 0.25) !important;
    border-color: rgba(168, 230, 207, 0.5) !important;
    color: #a8e6cf !important;
}

.btn-done.is-done .icon-circle {
    display: none;
}

.btn-done.is-done .icon-check-filled {
    display: block;
}

.btn-done.is-done .btn-text::after {
    content: 'd';
}

/* Surprise button */
.btn-surprise {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.625rem 1.25rem;
    background: rgba(255, 143, 163, 0.15);
    border: 1px solid rgba(255, 143, 163, 0.3);
    border-radius: 12px;
    color: var(--color-text);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-surprise:hover {
    background: rgba(255, 143, 163, 0.25);
    border-color: rgba(255, 143, 163, 0.4);
}

.btn-surprise:active {
    transform: scale(0.96);
}

/* Side Navigation Buttons */
.nav-btn--side {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.nav-btn--side:hover {
    background: rgba(255, 143, 163, 0.1);
    border-color: rgba(255, 143, 163, 0.25);
    transform: scale(1.05);
}

.nav-btn--side:active {
    transform: scale(0.95);
}

.nav-btn--side svg {
    width: 24px;
    height: 24px;
}

/* Fixed Bottom Section */
.bottom-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--bottom-height);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    z-index: 10;
    background: linear-gradient(to top, rgba(26, 26, 46, 0.98) 0%, rgba(26, 26, 46, 0.9) 60%, transparent 100%);
    padding: 0.75rem 1rem;
}

/* Categories */
.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.4rem;
    max-width: 100%;
}

.category-pill {
    padding: 0.4rem 0.875rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.category-pill:hover {
    background: rgba(255, 143, 163, 0.1);
    border-color: rgba(255, 143, 163, 0.2);
    color: var(--color-text);
}

.category-pill.active {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: #1a1a2e;
}

/* Bottom Actions */
.bottom-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.btn-export {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.875rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-export:hover {
    background: rgba(168, 230, 207, 0.2);
    border-color: rgba(168, 230, 207, 0.35);
    color: #a8e6cf;
}

.btn-export svg {
    width: 14px;
    height: 14px;
}

.progress-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(168, 230, 207, 0.15);
    border: 1px solid rgba(168, 230, 207, 0.25);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #a8e6cf;
}

.btn-reset {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.35rem 0.5rem;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.btn-reset:hover {
    color: var(--color-text);
    opacity: 1;
}

.btn-reset svg {
    width: 12px;
    height: 12px;
}

/* Footer Links */
.footer-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    justify-content: center;
}

.footer-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    text-decoration: underline;
    text-decoration-color: rgba(255, 143, 163, 0.3);
    text-underline-offset: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-link:hover {
    color: var(--color-accent);
    text-decoration-color: var(--color-accent);
}

.footer-link svg {
    width: 12px;
    height: 12px;
    opacity: 0.7;
}

/* Help Modal */
.help-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.help-modal-content {
    background: var(--color-bg);
    border: 1px solid var(--color-card-border);
    border-radius: 20px;
    padding: 2rem;
    max-width: 400px;
    width: 90%;
    position: relative;
    box-shadow: var(--shadow-soft), 0 0 60px rgba(255, 143, 163, 0.2);
}

.help-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.help-modal-close:hover {
    color: var(--color-text);
}

.help-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    text-align: center;
}

.help-shortcuts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.help-shortcut {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.help-shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 32px;
    padding: 0 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: monospace;
    color: var(--color-text);
}

.help-shortcut span {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Toast - subtle fade only */
.toast {
    position: fixed;
    bottom: calc(var(--bottom-height) + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 100;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* Print styles */
@media print {
    .background,
    .nav-btn--side,
    .bottom-section,
    .toast {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .card-inner {
        box-shadow: none;
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }
}

/* Improve touch targets on mobile */
@media (hover: none) and (pointer: coarse) {
    .btn-copy:hover, .btn-done:hover, .btn-favorite:hover,
    .nav-btn--side:hover, .category-pill:hover {
        transform: none;
    }
    
    .btn-copy:active, .btn-done:active, .btn-favorite:active,
    .nav-btn--side:active, .category-pill:active {
        transform: scale(0.96);
    }
}

/* Mobile - allow scrolling on small screens */
@media (max-width: 768px) {
    :root {
        --top-height: 120px;
        --bottom-height: 170px;
    }
    
    .title {
        font-size: clamp(1rem, 4vw, 1.3rem);
    }
    
    .subtitle {
        font-size: 0.8rem;
    }
    
    .btn-surprise {
        font-size: 0.8rem;
        padding: 0.4rem 0.875rem;
        margin-top: 0.5rem;
    }
    
    .middle-content {
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .question-card {
        max-width: 100%;
    }
    
    .nav-btn--side {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
    
    .nav-btn--side svg {
        width: 20px;
        height: 20px;
    }
    
    .card-inner {
        padding: 1.5rem 1rem;
        border-radius: 20px;
    }
    
    .category-badge {
        font-size: 0.65rem;
        padding: 0.3rem 0.75rem;
        margin-bottom: 0.75rem;
    }
    
    .question {
        font-size: clamp(1.2rem, 5vw, 1.6rem);
        min-height: 60px;
        margin-bottom: 1.25rem;
        line-height: 1.3;
    }
    
    .btn-copy, .btn-done, .btn-favorite {
        padding: 0.625rem 1.25rem;
        font-size: 0.875rem;
        min-height: 44px;
        min-width: 90px;
    }
    
    .categories {
        gap: 0.3rem;
    }
    
    .category-pill {
        padding: 0.4rem 0.75rem;
        font-size: 0.7rem;
        min-height: 32px;
    }
    
    .progress-indicator {
        font-size: 0.7rem;
        padding: 0.3rem 0.625rem;
    }
    
    .btn-reset, .btn-export {
        font-size: 0.7rem;
    }
    
    .footer-links {
        gap: 1rem;
    }
    
    .footer-link {
        font-size: 0.7rem;
    }
    
    .footer-link svg {
        width: 11px;
        height: 11px;
    }
    
    .toast {
        font-size: 0.85rem;
        padding: 0.75rem 1.25rem;
    }
    
    .help-modal-content {
        padding: 1.5rem;
    }
    
    .help-modal h3 {
        font-size: 1.1rem;
    }
    
    .help-shortcut kbd {
        min-width: 32px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .help-shortcut span {
        font-size: 0.85rem;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    :root {
        --top-height: 110px;
        --bottom-height: 160px;
    }
    
    .card-inner {
        padding: 1.25rem 0.875rem;
    }
    
    .question {
        font-size: 1.1rem;
    }
    
    .btn-copy, .btn-done, .btn-favorite {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .category-pill {
        padding: 0.35rem 0.625rem;
        font-size: 0.65rem;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
