/* ============================================
   GRIMM GIMTADIENIS – Main Styles
   ============================================ */

/* Reset & base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* Three.js canvas – fills entire background */
#cloud-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* UI overlay on top of canvas */
#app-overlay {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* ============================================
   LOGIN CARD
   ============================================ */
.login-card {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 48px 40px;
    max-width: 440px;
    width: 90%;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.04);
    text-align: center;
    animation: cardAppear 0.8s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-card h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: #1a365d;
}

.login-card .subtitle {
    font-size: 1rem;
    color: #64748b;
    margin-bottom: 32px;
}

.login-card .emoji-title {
    font-size: 3rem;
    margin-bottom: 12px;
    display: block;
}

.login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 16px;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: rgba(255, 255, 255, 0.7);
}

.form-group input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.15);
}

.form-group input::placeholder {
    color: #94a3b8;
}

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
}

.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Error messages */
.form-errors {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 20px;
    text-align: left;
}

.form-errors ul {
    list-style: none;
    padding: 0;
}

.form-errors li {
    color: #dc2626;
    font-size: 0.9rem;
    padding: 2px 0;
}

.field-error {
    color: #dc2626;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ============================================
   SPIN PAGE
   ============================================ */
.spin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
}

.wheel-wrapper {
    position: relative;
    width: 800px;
    height: 800px;
    animation: wheelAppear 1s ease-out;
}

@keyframes wheelAppear {
    from {
        opacity: 0;
        transform: translateY(80px) scale(0.7);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wheel-wrapper canvas {
    width: 100%;
    height: 100%;
}

/* Pointer / indicator arrow */
.wheel-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 30px solid #dc2626;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    z-index: 20;
}

/* Center spin button */
.spin-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #374151, #111827);
    color: white;
    border: 4px solid #f1f5f9;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.35);
    transition: transform 0.15s;
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 1px;
}
    z-index: 20;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spin-btn:hover {
    transform: translate(-50%, -50%) scale(1.05);
}

.spin-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: translate(-50%, -50%);
}

/* ============================================
   WIN MODAL
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 24px;
    padding: 48px;
    max-width: 460px;
    width: 90%;
    text-align: center;
    animation: modalPop 0.5s ease-out;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

@keyframes modalPop {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.modal-content .modal-emoji {
    font-size: 4rem;
    margin-bottom: 16px;
    display: block;
}

.modal-content h2 {
    font-size: 1.8rem;
    color: #1a365d;
    margin-bottom: 12px;
}

.modal-content .prize-name {
    font-size: 1.4rem;
    color: #059669;
    font-weight: 700;
    margin-bottom: 24px;
}

.modal-content .modal-text {
    color: #64748b;
    margin-bottom: 24px;
    line-height: 1.6;
}

.modal-content .btn-close {
    padding: 12px 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s;
}

.modal-content .btn-close:hover {
    transform: translateY(-1px);
}

/* ============================================
   CONFETTI CANVAS
   ============================================ */
#confetti-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99;
    pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: 32px 24px;
    }

    .wheel-wrapper {
        width: 92vw;
        height: 92vw;
    }

    .spin-btn {
        width: 70px;
        height: 70px;
        font-size: 0.8rem;
    }

    .modal-content {
        padding: 32px 24px;
    }
}
