* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, system-ui, sans-serif; }
:root {
    --primary: #0f4c5c;
    --primary-dark: #0a3a46;
    --primary-light: #1a6a7a;
    --secondary: #e67e22;
    --secondary-light: #f39c12;
    --gold: #f4b942;
    --light: #fef9e6;
    --gray-bg: #f8f9fc;
    --success: #2ecc71;
    --error: #e74c3c;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 8px 30px rgba(0,0,0,0.08);
    --shadow-lg: 0 16px 48px rgba(0,0,0,0.12);
    --shadow-glow: 0 0 30px rgba(230,126,34,0.15);
    --radius: 28px;
    --radius-sm: 16px;
    --transition: 0.3s cubic-bezier(0.2, 0, 0, 1);
}

html, body { height: 100%; overflow: hidden; }
body {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    padding: 0.8rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ===== FORM CONTAINER - FIXED ===== */
.form-container {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    max-width: 1000px;
    width: 100%;
    height: 94vh;
    max-height: 800px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(15,76,92,0.05);
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.6s cubic-bezier(0.2, 0, 0, 1);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}
.form-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(244,185,66,0.03), transparent);
    pointer-events: none;
}

/* ===== GAME CONTAINER - FIXED for finish page ===== */
.game-container {
    background: rgba(255,255,255,0.97);
    backdrop-filter: blur(12px);
    border-radius: var(--radius);
    padding: 1.5rem 2rem;
    max-width: 1000px;
    width: 100%;
    height: 94vh;
    max-height: 800px;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(15,76,92,0.05);
    display: flex;
    flex-direction: column;
    animation: fadeUp 0.6s cubic-bezier(0.2, 0, 0, 1);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.2);
    position: relative;
}
.game-container::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -30%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(244,185,66,0.03), transparent);
    pointer-events: none;
}

/* ===== SCROLLABLE BODY ===== */
.form-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.3rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}
.form-body::-webkit-scrollbar { width: 4px; }
.form-body::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 10px; }
.form-body::-webkit-scrollbar-track { background: #f0f0f0; border-radius: 10px; }

.game-body {
    flex: 1;
    overflow: hidden;
    padding-right: 0.3rem;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    min-height: 0;
}

/* ===== STEP PROGRESS ===== */
.step-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1rem;
    background: var(--gray-bg);
    border-radius: 40px;
    flex-shrink: 0;
    margin-bottom: 0.6rem;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.04);
    position: relative;
    z-index: 1;
}
.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    background: #ddd;
    color: #999;
    transition: var(--transition);
    position: relative;
}
.step-dot.active {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    box-shadow: 0 0 0 4px rgba(230,126,34,0.2), 0 4px 16px rgba(230,126,34,0.25);
    transform: scale(1.05);
}
.step-dot.done {
    background: var(--success);
    color: white;
    box-shadow: 0 0 0 4px rgba(46,204,113,0.15);
}
.step-line {
    width: 32px;
    height: 2px;
    background: #ddd;
    border-radius: 2px;
    transition: var(--transition);
}
.step-line.done {
    background: linear-gradient(90deg, var(--success), var(--secondary));
}
.step-label {
    font-size: 0.6rem;
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-left: 0.2rem;
}

/* ===== FORM HEADER ===== */
.form-header, .game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    margin-bottom: 0.3rem;
    position: relative;
    z-index: 1;
}
.form-header h2, .game-header h2 {
    color: var(--primary);
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}
.form-header h2 i, .game-header h2 i {
    background: linear-gradient(135deg, var(--gold), #f39c12);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.2rem 0.6rem;
    transition: var(--transition);
    border-radius: 40px;
}
.back-btn:hover {
    background: var(--light);
    color: #d35400;
    transform: translateX(-3px);
}
.back-btn i { font-size: 0.85rem; }

/* ===== SUBHEAD ===== */
.subhead {
    text-align: center;
    color: #5a6e7a;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--light);
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

/* ===== INFO MESSAGE ===== */
.info-message {
    background: linear-gradient(135deg, #e8f4f8, #f0f8fc);
    border-left: 5px solid var(--secondary);
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.6rem;
    font-size: 0.8rem;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    transition: var(--transition);
}
.info-message:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}
.info-message i { color: var(--secondary); margin-right: 0.3rem; }

/* ===== TEACHER NAME GROUP ===== */
.teacher-name-group { margin-bottom: 0.5rem; }
.teacher-name-group label {
    display: block;
    margin-bottom: 0.15rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
}

/* ===== INPUT WITH MIC ===== */
.input-with-mic {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.input-with-mic input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--gray-bg);
}
.input-with-mic input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 4px rgba(230,126,34,0.08);
}

.mic-btn {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    border: none;
    border-radius: 50%;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(230,126,34,0.25);
}
.mic-btn:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,126,34,0.35);
}
.mic-btn.listening {
    background: var(--error);
    animation: pulseMic 1s infinite;
}
@keyframes pulseMic {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ===== VOICE STATUS ===== */
.voice-status {
    font-size: 0.6rem;
    margin-top: 0.15rem;
    padding: 0.1rem 0.5rem;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}
.voice-status.success { background: #d4edda; color: #155724; }
.voice-status.error { background: #f8d7da; color: #721c24; }
.voice-status.listening { background: #fff3cd; color: #856404; }

/* ===== FORM GROUP ===== */
.form-group { margin-bottom: 0.5rem; }
.form-group.full-width { width: 100%; }
.form-group label {
    display: block;
    margin-bottom: 0.15rem;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.78rem;
}
.form-group input {
    width: 100%;
    padding: 0.45rem 0.8rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    background: var(--gray-bg);
}
.form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 4px rgba(230,126,34,0.08);
}

/* ===== BUTTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    padding: 0.7rem;
    border-radius: 40px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    transition: var(--transition);
    margin-top: 1.5rem;
    box-shadow: 0 4px 16px rgba(230,126,34,0.25);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}
.btn-primary:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 30px rgba(230,126,34,0.35);
}
.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: rotate(45deg);
    transition: 0.6s;
}
.btn-primary:hover::after {
    left: 100%;
}

/* ===== REVEAL BUTTON ===== */
.reveal-btn {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    padding: 0.7rem;
    border-radius: 40px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(230,126,34,0.25);
    flex-shrink: 0;
}
.reveal-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(230,126,34,0.35);
}
.reveal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== SUCCESS MODAL ===== */
.success-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.success-modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 1.8rem;
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.5s cubic-bezier(0.2,0,0,1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
}
@keyframes slideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-close-btn:hover {
    background: #f0f0f0;
    color: var(--error);
    transform: rotate(90deg);
}

.success-modal-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--success), #27ae60);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
    font-size: 2.5rem;
    color: white;
    animation: pop 0.6s cubic-bezier(0.2,0,0,1);
    box-shadow: 0 8px 30px rgba(46,204,113,0.3);
}
@keyframes pop {
    0% { transform: scale(0); }
    60% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

.success-modal h3 {
    color: var(--primary);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
    font-weight: 800;
}
.success-modal p {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 0.8rem;
    line-height: 1.4;
}

.success-modal-btn {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    border: none;
    padding: 0.7rem 1.8rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 16px rgba(230,126,34,0.25);
}
.success-modal-btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 30px rgba(230,126,34,0.35);
}

/* ===== CONFETTI ===== */
.confetti-particle {
    position: fixed;
    pointer-events: none;
    z-index: 10001;
    font-size: 1rem;
    animation: confettiFall 2.8s linear forwards;
}
@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* ===== FRIENDS INPUT ===== */
.friends-input-area {
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    margin-bottom: 0.6rem;
    border: 2px solid #e8ecf0;
    transition: var(--transition);
}
.friends-input-area:focus-within {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(230,126,34,0.08);
}

.friends-list-container {
    background: white;
    border-radius: var(--radius-sm);
    border: 1px solid #e0e5e7;
    margin-bottom: 0.5rem;
    min-height: 40px;
    max-height: 100px;
    overflow-y: auto;
    padding: 0.3rem;
}
.friend-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #e8f4f8, #d4e8f0);
    padding: 0.2rem 0.7rem;
    margin: 0.15rem;
    border-radius: 40px;
    font-size: 0.75rem;
    gap: 6px;
    font-weight: 600;
    color: var(--primary);
}
.friend-tag .remove {
    cursor: pointer;
    color: #999;
    font-weight: bold;
    transition: var(--transition);
    font-size: 0.8rem;
}
.friend-tag .remove:hover {
    color: var(--error);
    transform: scale(1.2);
}

.add-friend-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
}
.add-friend-row input {
    flex: 1;
    padding: 0.4rem 0.8rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    background: white;
}
.add-friend-row input:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(230,126,34,0.08);
}
.add-friend-row button {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    border: none;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(230,126,34,0.25);
    white-space: nowrap;
}
.add-friend-row button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,126,34,0.35);
}

.friend-feedback {
    font-size: 0.65rem;
    min-height: 1.2rem;
    margin-top: 0.2rem;
}
.friend-count {
    font-size: 0.7rem;
    color: #5a6e7a;
    margin-top: 0.2rem;
    font-weight: 600;
}

/* ===== SLIDING PANEL ===== */
#slidingPanel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    border-radius: var(--radius-sm);
    padding: 0.4rem 1rem 0.6rem;
    transform: translateY(110%);
    transition: transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 10;
    box-shadow: 0 -10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#slidingPanel.active {
    transform: translateY(0);
}

.panel-close-btn {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #999;
    cursor: pointer;
    transition: var(--transition);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}
.panel-close-btn:hover {
    background: #f0f0f0;
    color: var(--error);
    transform: rotate(90deg);
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 0.1rem 0;
}

/* ===== LOTTERY BALL ===== */
.lottery-ball {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.2rem;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
}
.ball-number {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}
.ball-label {
    font-size: 0.6rem;
    opacity: 0.9;
}
.lottery-ball.sun {
    background: radial-gradient(circle at 30% 30%, #ffd700, #ff8c00);
    box-shadow: 0 0 30px rgba(255,215,0,0.7);
}
.lottery-ball.moon {
    background: radial-gradient(circle at 30% 30%, #e0e0e0, #a0a0a0);
    box-shadow: 0 0 20px rgba(192,192,192,0.5);
}
.lottery-ball.earth {
    background: radial-gradient(circle at 30% 30%, #90ee90, #3cb371);
    box-shadow: 0 0 15px rgba(144,238,144,0.4);
}

.aura-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: auraPulse 3s ease-in-out infinite;
}
.aura-ring.ring1 { border: 2px solid; animation-delay: 0s; }
.aura-ring.ring2 { border: 2px solid; width: 115%; height: 115%; animation-delay: 1s; }
.aura-ring.ring3 { border: 2px solid; width: 130%; height: 130%; animation-delay: 2s; }
.aura-ring.gold { border-color: #ffd700; }
.aura-ring.silver { border-color: #c0c0c0; }
.aura-ring.green { border-color: #90ee90; }

@keyframes auraPulse {
    0% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.2; transform: translate(-50%, -50%) scale(1.1); }
    100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.8rem;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: bold;
    margin: 0.15rem 0;
}
.badge-ultra {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #4a3000;
}
.badge-luckier {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
    color: #333;
}
.badge-lucky {
    background: linear-gradient(135deg, #90ee90, #3cb371);
    color: #1a4d1a;
}

.lucky-friend-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    margin: 0.1rem 0;
}

.result-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 340px;
    margin: 0.1rem 0;
}
.result-row .result-box,
.result-row .contribution-box {
    flex: 1;
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    padding: 0.3rem 0.2rem;
    text-align: center;
    margin: 0;
}
.result-row .result-label,
.result-row .contribution-label {
    font-size: 0.7rem;
    color: #5a6e7a;
    margin-bottom: 0.05rem;
}
.result-row .result-amount,
.result-row .contribution-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary);
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.2rem;
    width: 100%;
    max-width: 340px;
}
.btn-tryagain, .btn-lock {
    flex: 1;
    padding: 0.4rem;
    border-radius: 40px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    font-size: 0.75rem;
    transition: var(--transition);
}
.btn-tryagain {
    background: #eef2f3;
    color: var(--primary);
}
.btn-tryagain:hover {
    background: #e0e5e7;
    transform: translateY(-2px);
}
.btn-lock {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    box-shadow: 0 4px 12px rgba(230,126,34,0.25);
}
.btn-lock:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230,126,34,0.35);
}

/* ===== EXTRA MODAL ===== */
.extra-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.extra-modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 1.8rem;
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: slideUp 0.5s cubic-bezier(0.2,0,0,1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
@keyframes slideUp {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.extra-modal-content .form-group {
    text-align: left;
    margin-bottom: 0.8rem;
}
.extra-modal-content .form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 0.15rem;
}
.extra-modal-content .form-group .sub-label {
    font-size: 0.65rem;
    font-weight: 400;
    color: #5a6e7a;
}

.photo-upload-area {
    border: 2px dashed #ddd;
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    margin-top: 0.2rem;
}
.photo-upload-area:hover {
    border-color: var(--secondary);
    background: var(--light);
}
.photo-upload-area i {
    font-size: 1.5rem;
    color: var(--secondary);
    margin-bottom: 0.2rem;
}
.photo-upload-area p {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--primary);
}
.photo-upload-area small {
    font-size: 0.6rem;
    color: #666;
    line-height: 1.3;
    display: block;
}

.photo-preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.3rem;
}
.photo-preview-item {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--gold);
}
.photo-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.photo-preview-item .remove-photo {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--error);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    cursor: pointer;
    font-size: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.privacy-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.4rem 0;
    padding: 0.4rem;
    background: var(--light);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success);
    text-align: left;
}
.privacy-checkbox input {
    width: 16px;
    height: 16px;
    cursor: pointer;
    margin-top: 0.1rem;
    flex-shrink: 0;
}
.privacy-checkbox label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
}
.privacy-checkbox small {
    font-size: 0.6rem;
    color: #666;
    display: block;
    margin-top: 0.1rem;
    font-weight: 400;
}

/* ===== PAYMENT SECTION ===== */
.payment-section {
    background: var(--light);
    border-radius: var(--radius-sm);
    padding: 0.8rem;
    margin: 0.4rem 0;
    text-align: center;
    border: 2px solid var(--gold);
    flex-shrink: 0;
}
.payment-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 0.3rem;
}
.payment-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--secondary);
    margin: 0.3rem 0;
}
.payment-instruction {
    font-size: 0.7rem;
    color: #5a6e7a;
    margin-bottom: 0.5rem;
}

.razorpay-pay-btn {
    background: var(--success);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 40px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    transition: var(--transition);
}
.razorpay-pay-btn:hover {
    background: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46,204,113,0.3);
}
.razorpay-pay-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.instruction-note {
    background: #e8f4f8;
    border-radius: var(--radius-sm);
    padding: 0.4rem;
    font-size: 0.65rem;
    color: var(--primary);
    text-align: center;
    margin-top: 0.3rem;
}

.group-info, .invite-section {
    background: var(--gray-bg);
    border-radius: var(--radius-sm);
    padding: 0.6rem;
    margin: 0.4rem 0;
    flex-shrink: 0;
}
.invite-link-box {
    display: flex;
    gap: 0.4rem;
    margin: 0.3rem 0;
    flex-wrap: wrap;
}
.invite-link-box input {
    flex: 1;
    padding: 0.3rem 0.6rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    background: white;
}
.copy-link-btn {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    border: none;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 700;
    transition: var(--transition);
}
.copy-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230,126,34,0.25);
}

#qrcode {
    display: flex;
    justify-content: center;
    margin: 0.3rem 0;
}
#qrcode img {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--gold);
}

.chat-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin: 0.4rem 0;
    flex-shrink: 0;
}
.chat-primary-btn {
    background: linear-gradient(135deg, var(--secondary), #d35400);
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    width: 100%;
    transition: var(--transition);
}
.chat-primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(230,126,34,0.25);
}
.whatsapp-backup-btn {
    background: #25D366;
    color: white;
    border: none;
    padding: 0.5rem;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
}
.whatsapp-backup-btn:hover {
    background: #128C7E;
    transform: translateY(-2px);
}

.success-msg {
    background: #d4edda;
    color: #155724;
    padding: 0.6rem;
    border-radius: var(--radius-sm);
    text-align: center;
    flex-shrink: 0;
}
.success-msg h3 {
    margin: 0.2rem 0;
    font-size: 1.1rem;
}

/* ===== GIFT MODAL ===== */
.gift-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    z-index: 10002;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}
.gift-modal-content {
    background: white;
    border-radius: var(--radius);
    padding: 1.8rem;
    max-width: 450px;
    width: 90%;
    text-align: left;
    animation: slideUp 0.5s cubic-bezier(0.2,0,0,1);
    box-shadow: 0 30px 60px rgba(0,0,0,0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}
.gift-modal-content .form-group {
    margin-bottom: 0.8rem;
}
.gift-modal-content .form-group label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
    display: block;
    margin-bottom: 0.15rem;
}
.gift-modal-content .form-group input {
    width: 100%;
    padding: 0.5rem 0.8rem;
    border: 2px solid #e8ecf0;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    transition: var(--transition);
    background: var(--gray-bg);
}
.gift-modal-content .form-group input:focus {
    outline: none;
    border-color: var(--secondary);
    background: white;
    box-shadow: 0 0 0 4px rgba(230,126,34,0.08);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    body { padding: 0.5rem; }
    .form-container, .game-container {
        padding: 0.8rem 1rem;
        max-height: 98vh;
        height: 98vh;
    }
    .form-header h2, .game-header h2 { font-size: 1.5rem; }
    .step-progress { gap: 0.3rem; padding: 0.2rem 0.6rem; }
    .step-dot { width: 26px; height: 26px; font-size: 0.55rem; }
    .step-line { width: 20px; }
    .step-label { font-size: 0.5rem; }
    .subhead { font-size: 0.7rem; }
    .btn-primary, .reveal-btn { font-size: 0.8rem; padding: 0.5rem; margin-top: 1rem; }
    .input-with-mic { flex-wrap: wrap; }
    .mic-btn { width: 100%; border-radius: 40px; height: 36px; }
    .success-modal-content, .extra-modal-content, .gift-modal-content { padding: 1.2rem; }
    .success-modal-icon { width: 60px; height: 60px; font-size: 2rem; }
    .form-group input { font-size: 0.8rem; padding: 0.4rem 0.6rem; }
    .info-message { font-size: 0.7rem; padding: 0.4rem 0.6rem; }
    .form-group label { font-size: 0.7rem; }
   
    .ball-number { font-size: 2rem; }
   
    #slidingPanel { padding: 0.3rem 0.6rem 0.4rem; }
    .invite-link-box { flex-direction: column; }
    .copy-link-btn { width: 100%; }
    .result-row { max-width: 100%; }
    .result-row .result-amount,
    .result-row .contribution-amount { font-size: 1.2rem; }
}

@media (max-width: 480px) {
    .form-container, .game-container { padding: 0.5rem 0.7rem; }
    .form-header h2, .game-header h2 { font-size: 1.2rem; }
    .back-btn { font-size: 0.65rem; }
    .form-group label { font-size: 0.65rem; }
    .lottery-ball { width: 75px; height: 75px; }
    .ball-number { font-size: 1.6rem; }
}

/* ============================================================
   📱 MOBILE FIX - Extra styles to match homepage responsiveness
   ============================================================ */
@media (max-width: 700px) {
    .form-container, .game-container {
        max-height: 98vh !important;
        height: auto !important;
        padding: 0.8rem 1rem !important;
        border-radius: 20px !important;
        overflow-y: auto !important;
    }
    
    .form-body {
        overflow-y: auto !important;
        padding-bottom: 1rem !important;
        justify-content: center !important;
    }
    
    .game-body {
        overflow: hidden !important;  /* ✅ KEPT HIDDEN — THIS FIXES THE SCREEN SHIFT */
        padding-bottom: 1rem !important;
        justify-content: center !important;
    }

        /* ===== PANEL SCROLLING FIX FOR MOBILE ===== */
    /* Allows scrolling inside the sliding panel on mobile devices */
    #slidingPanel {
        overflow-y: auto !important;  /* Enables vertical scroll inside panel */
    }
    
    /* ===== PANEL CONTENT ADJUSTMENTS ===== */
    /* Makes the panel content fit better on small screens */
    .panel-content {
        padding: 0.5rem 0 !important;
        justify-content: flex-start !important;  /* Aligns content from top */
    }
    
    /* ===== SMALLER LOTTERY BALL FOR MOBILE ===== */
    .lottery-ball {
        width: 70px !important;
        height: 70px !important;
    }
    
    .ball-number {
        font-size: 1.5rem !important;
    }
    
    /* ===== SMALLER RESULT TEXT ===== */
    .result-row .result-amount,
    .result-row .contribution-amount {
        font-size: 1rem !important;
    }
    
    /* ===== PANEL BUTTONS IN ROW ===== */
    /* Keeps buttons side by side on mobile (not stacked) */
    .panel-actions {
        flex-direction: row !important;
        gap: 0.3rem !important;
    }
    
    .btn-tryagain, .btn-lock {
        font-size: 0.65rem !important;
        padding: 0.3rem !important;
    }
    
    .step-progress {
        flex-wrap: wrap !important;
        padding: 0.3rem 0.6rem !important;
        gap: 0.3rem !important;
    }
    
    .btn-primary, .reveal-btn {
        font-size: 0.8rem !important;
        padding: 0.5rem !important;
        margin-top: 0.5rem !important;
    }
    
    .input-with-mic {
        flex-wrap: wrap !important;
    }
    
    .mic-btn {
        width: 100% !important;
        border-radius: 40px !important;
        height: 36px !important;
    }
    
    .subhead {
        font-size: 0.7rem !important;
    }
    
    .info-message {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    .form-group label {
        font-size: 0.7rem !important;
    }
    
    .form-group input {
        font-size: 0.8rem !important;
        padding: 0.4rem 0.6rem !important;
    }
    
    .step-dot {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.55rem !important;
    }
    
    .step-line {
        width: 20px !important;
    }
    
    .step-label {
        font-size: 0.5rem !important;
    }
    
    .form-header h2, .game-header h2 {
        font-size: 1.3rem !important;
    }
    
    .back-btn {
        font-size: 0.65rem !important;
    }
    
    .panel-content {
        padding: 0.2rem 0 !important;
    }
    
    .lottery-ball {
        width: 80px !important;
        height: 80px !important;
    }
    
    .ball-number {
        font-size: 1.8rem !important;
    }
    
    .result-row .result-amount,
    .result-row .contribution-amount {
        font-size: 1.2rem !important;
    }
    
    .friends-list-container {
        max-height: 80px !important;
    }
    
    .add-friend-row {
        flex-direction: column !important;
    }
    
    .add-friend-row button {
        width: 100% !important;
    }
    
    .panel-actions {
        flex-direction: column !important;
    }
    
    .extra-modal-content {
        padding: 1rem !important;
    }
    
    .gift-modal-content {
        padding: 1rem !important;
    }
    
    .success-modal-content {
        padding: 1rem !important;
    }
}

@media (max-width: 480px) {
    .form-container, .game-container {
        padding: 0.4rem 0.6rem !important;
    }
    
    .form-header h2, .game-header h2 {
        font-size: 1.1rem !important;
    }
    
    .back-btn {
        font-size: 0.55rem !important;
    }
    
    .step-dot {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.45rem !important;
    }
    
    .step-line {
        width: 14px !important;
    }
    
    .step-label {
        font-size: 0.4rem !important;
    }
    
    .subhead {
        font-size: 0.6rem !important;
    }
    
    .info-message {
        font-size: 0.6rem !important;
        padding: 0.3rem 0.5rem !important;
    }
    
    .btn-primary, .reveal-btn {
        font-size: 0.7rem !important;
        padding: 0.4rem !important;
    }
    
    .form-group label {
        font-size: 0.6rem !important;
    }
    
    .form-group input {
        font-size: 0.7rem !important;
        padding: 0.3rem 0.5rem !important;
    }
    
    .lottery-ball {
        width: 65px !important;
        height: 65px !important;
    }
    
    .ball-number {
        font-size: 1.4rem !important;
    }
    
    .panel-content {
        padding: 0.1rem 0 !important;
    }
    
    .result-row .result-amount,
    .result-row .contribution-amount {
        font-size: 1rem !important;
    }
}