/* Custom Styling for Caption Blitz */

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

:root {
    --bg-dark: #08070d;
    --card-bg: rgba(15, 14, 23, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f4f4f7;
    --text-secondary: #a1a1aa;
    
    /* Accents */
    --accent-purple: #8b5cf6;
    --accent-purple-glow: rgba(139, 92, 246, 0.3);
    --accent-cyan: #06b6d4;
    --accent-cyan-glow: rgba(6, 182, 212, 0.3);
    --accent-pink: #ec4899;
    --accent-pink-glow: rgba(236, 72, 153, 0.3);
    --accent-yellow: #f59e0b;
    --accent-yellow-glow: rgba(245, 158, 11, 0.3);
    --accent-green: #10b981;
    
    /* Fonts */
    --font-heading: 'Fredoka', sans-serif;
    --font-body: 'Outfit', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Background Effects */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    mask-image: radial-gradient(circle 800px at center, black, transparent 80fr);
    -webkit-mask-image: radial-gradient(circle 800px at center, black, transparent);
    opacity: 0.8;
}

.glow-orb {
    position: fixed;
    border-radius: 50%;
    z-index: -1;
    filter: blur(120px);
    opacity: 0.45;
    pointer-events: none;
    mix-blend-mode: screen;
    animation: orb-float 15s infinite alternate ease-in-out;
}

.glow-orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--accent-purple) 0%, transparent 70%);
    top: -100px;
    left: -100px;
}

.glow-orb-2 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-cyan) 0%, transparent 70%);
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.glow-orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, var(--accent-pink) 0%, transparent 70%);
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -10s;
}

@keyframes orb-float {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(50px, -30px) scale(1.1);
    }
    100% {
        transform: translate(-30px, 40px) scale(0.95);
    }
}

/* App Container */
.app-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    height: 80px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-pink) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px var(--accent-purple-glow);
    font-size: 1.25rem;
    color: #fff;
    animation: pulse-glow 2.5s infinite alternate;
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 4px 15px var(--accent-purple-glow);
    }
    100% {
        box-shadow: 0 4px 25px rgba(236, 72, 153, 0.5);
    }
}

.logo-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.logo-highlight {
    background: linear-gradient(135deg, #ffd319, #ff2975);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-cyan) 100%);
    color: #fff;
    box-shadow: 0 4px 20px var(--accent-purple-glow);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
}

/* Main Layout */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4rem;
    padding-bottom: 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 2rem 0;
}

/* Hero Left: Title & Intro */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 0.4rem 0.85rem;
    border-radius: 99px;
    margin-bottom: 1.5rem;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent-purple);
    animation: blink 1.5s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.badge-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Friendly bounce letters title */
.friendly-title {
    font-family: var(--font-heading);
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3em;
    user-select: none;
}

.friendly-title .word {
    display: inline-flex;
}

.friendly-title .letter {
    display: inline-block;
    color: var(--text-primary);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.35), color 0.3s;
    animation: intro-bounce 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.35) both;
}

/* Letter Hover Animations */
.friendly-title .letter:hover {
    color: var(--accent-yellow);
    transform: translateY(-20px) scale(1.3) rotate(8deg);
    text-shadow: 0 10px 20px rgba(245, 158, 11, 0.4);
}

/* Alternating hover colours */
.friendly-title .letter:nth-child(even):hover {
    color: var(--accent-cyan);
    transform: translateY(-20px) scale(1.3) rotate(-8deg);
    text-shadow: 0 10px 20px rgba(6, 182, 212, 0.4);
}

.friendly-title .letter:nth-child(3n):hover {
    color: var(--accent-pink);
    transform: translateY(-20px) scale(1.3) rotate(12deg);
    text-shadow: 0 10px 20px rgba(236, 72, 153, 0.4);
}

/* Subtle entrance animation */
@keyframes intro-bounce {
    0% {
        opacity: 0;
        transform: translateY(40px) scale(0.3);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-subtitle {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 580px;
}

/* Notify Form Box */
.notify-box {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.notify-box h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
}

.notify-form {
    display: flex;
    gap: 0.75rem;
}

.input-wrapper {
    position: relative;
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s;
}

.notify-form input[type="email"] {
    width: 100%;
    padding: 0.95rem 1.2rem 0.95rem 3rem;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s;
}

.notify-form input[type="email"]:focus {
    outline: none;
    border-color: var(--accent-purple);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

.notify-form input[type="email"]:focus + .input-icon {
    color: var(--accent-purple);
}

.notify-form .btn {
    white-space: nowrap;
}

.form-feedback {
    margin-top: 0.85rem;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 20px;
    transition: color 0.3s;
}

.form-feedback.success {
    color: var(--accent-green);
}

.form-feedback.error {
    color: var(--accent-pink);
}

/* Hero Right: Interactive Caption Previewer */
.preview-card-wrapper {
    position: relative;
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
}

.card-glow {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: linear-gradient(135deg, var(--accent-purple), var(--accent-cyan), var(--accent-pink));
    border-radius: 28px;
    z-index: -1;
    filter: blur(20px);
    opacity: 0.35;
    transition: opacity 0.5s;
}

.preview-card-wrapper:hover .card-glow {
    opacity: 0.6;
}

.preview-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.window-dots {
    display: flex;
    gap: 6px;
}

.window-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.window-dots .red { background-color: #ef4444; }
.window-dots .yellow { background-color: #f59e0b; }
.window-dots .green { background-color: #10b981; }

.window-title {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    font-family: monospace;
}

/* Game Board Styling */
.game-container {
    display: flex;
    flex-direction: column;
}

.game-timer {
    background: rgba(0, 0, 0, 0.25);
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.timer-icon {
    color: var(--accent-pink);
    animation: pulse-timer 1.5s infinite alternate;
}

@keyframes pulse-timer {
    0% { transform: scale(1); opacity: 0.7; }
    100% { transform: scale(1.15); opacity: 1; text-shadow: 0 0 8px var(--accent-pink-glow); }
}

.game-image-wrapper {
    position: relative;
    height: 200px;
    background-color: #0b0a12;
    overflow: hidden;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.preview-card:hover .game-image {
    transform: scale(1.03);
}

.floating-emoji {
    position: absolute;
    font-size: 2.5rem;
    transform: scale(0);
    pointer-events: none;
    z-index: 5;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.3));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-emoji.show {
    transform: scale(1) translateY(-20px);
    animation: emoji-float-up 1.2s forwards ease-out;
}

@keyframes emoji-float-up {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    30% {
        opacity: 1;
        transform: scale(1.2) translateY(0) rotate(-10deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-80px) rotate(15deg);
    }
}

/* Captions List */
.captions-list {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
}

.caption-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    animation: slide-in-caption 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.caption-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateX(4px);
}

@keyframes slide-in-caption {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.caption-text {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--text-primary);
}

.vote-container {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.vote-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vote-btn:hover {
    color: var(--accent-yellow);
    transform: scale(1.25);
}

.vote-btn.voted {
    color: var(--accent-yellow);
    animation: vote-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.5) forwards;
}

@keyframes vote-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.4); }
    100% { transform: scale(1.2); }
}

.vote-count {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 24px;
    text-align: right;
    font-family: monospace;
}

.vote-btn.voted + .vote-count {
    color: var(--accent-yellow);
}

/* Submit Caption Area */
.game-controls {
    padding: 1rem 1.25rem;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border-color);
}

.game-submit-form {
    display: flex;
    gap: 0.75rem;
    width: 100%;
}

.game-submit-form input[type="text"] {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.65rem 0.9rem;
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.3s;
}

.game-submit-form input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-pink);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.15);
}

.game-submit-form .btn {
    border-radius: 10px;
}

/* Features Grid Section */
.features-section {
    padding: 2rem 0;
}

.section-title {
    font-family: var(--font-heading);
    text-align: center;
    font-size: 2.25rem;
    margin-bottom: 3rem;
    letter-spacing: -0.5px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2.25rem;
    backdrop-filter: blur(12px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: #fff;
    margin-bottom: 1.5rem;
}

.bg-purple {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);
}

.bg-pink {
    background: linear-gradient(135deg, #ec4899, #db2777);
    box-shadow: 0 4px 15px rgba(219, 39, 119, 0.3);
}

.bg-cyan {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    box-shadow: 0 4px 15px rgba(8, 145, 178, 0.3);
}

.feature-card h3 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Footer Section */
.site-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 1.25rem;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
}

.social-links a:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    
    .friendly-title {
        justify-content: center;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .notify-box {
        max-width: 600px;
        margin: 0 auto;
    }

    .preview-card-wrapper {
        max-width: 420px;
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .friendly-title {
        font-size: 3rem;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .notify-form {
        flex-direction: column;
    }

    .notify-form .btn {
        width: 100%;
        padding: 0.95rem;
    }

    .footer-content {
        flex-direction: column-reverse;
        gap: 1.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .friendly-title {
        font-size: 2.4rem;
    }
    
    .site-header {
        height: auto;
        padding: 1.5rem 0;
        flex-direction: column;
        gap: 1rem;
    }
}
