/* ============================================
   JOHNSON McGINNIS - ESTATE PLANNING GAME
   Styles for 3D Car Decision Game
   ============================================ */

/* === RESET & BASE === */
* {
    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;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
}

/* === LOADING SCREEN === */
#loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #1a1a2e;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s;
}
#loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}
.loading-content {
    text-align: center;
}
.loading-spinner {
    width: 48px; height: 48px;
    border: 4px solid rgba(245,166,35,0.2);
    border-top-color: #f5a623;
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.loading-text {
    color: rgba(255,255,255,0.8);
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

body {
    background: #1a1a2e;
}

/* === 3D GAME CONTAINER === */
#game-container,
#game-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#game-container canvas,
#game-canvas canvas {
    display: block;
}

/* === SCREENS (Overlays) === */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.screen.active {
    display: flex;
}

/* === EMAIL CAPTURE SCREEN === */
#screen-email {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    overflow: hidden;
}

.home-bg-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.email-card {
    background: rgba(255, 255, 255,0.5);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px;
    max-width: 480px;
    opacity: 10;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideUp 0.6s ease-out;
    position: relative;
    z-index: 1;
}

.email-header h1 {
    font-size: 2.2rem;
    color: #261d1d;
    margin-bottom: 10px;
}

.email-header p {
    color: #261d1d;
    font-size: 1rem;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #261d1d;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input[type="email"] {
    width: 100%;
    padding: 15px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.form-group input[type="email"]:focus {
    outline: none;
    border-color: #f5a623;
    box-shadow: 0 0 0 4px rgba(245, 166, 35, 0.2);
}

.error-message {
    color: #e53e3e;
    font-size: 0.85rem;
    margin-top: 6px;
    display: block;
}

.checkbox-group {
    margin-bottom: 20px;
    text-align: left;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 10px 0;
    color: #261d1d;
    font-size: 0.95rem;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #f5a623;
}

.g-recaptcha {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    transform: scale(0.9);
    transform-origin: center;
}

.btn-primary {
    width: 100%;
    padding: 16px 30px;
    background: linear-gradient(135deg, #f5a623 0%, #f6ad3c 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 166, 35, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.privacy-note {
    margin-top: 20px;
    font-size: 0.8rem;
    color: #261d1d;
}

/* === PROFILE SELECTION SCREEN === */
#screen-profile {
    background: rgba(0, 0, 0, 0.85);
}

.profile-container {
    text-align: center;
    animation: fadeIn 0.5s ease-out;
}

.profile-container h2 {
    color: #261d1d;
    font-size: 2rem;
    margin-bottom: 10px;
}

.profile-container > p {
    color: #261d1d;
    font-size: 1.1rem;
    margin-bottom: 40px;
}

.profile-cards {
    display: flex;
    gap: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-card {
    background: white;
    border-radius: 16px;
    padding: 35px 30px;
    width: 200px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 3px solid transparent;
}

.profile-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(245, 166, 35, 0.3);
    border-color: #f5a623;
}

.profile-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.profile-card h3 {
    color: #261d1d;
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.profile-card p {
    color: #261d1d;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === GAME HUD SCREEN === */
#screen-hud {
    pointer-events: none;
    background: transparent;
    display: none;
}

#screen-hud.active {
    display: block;
}

/* Progress Dots */
.progress-dots {
    position: absolute;
    top: 20px;
    right: 25px;
    display: flex;
    gap: 10px;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: all 0.3s;
}

.dot.active {
    background: #f5a623;
    border-color: #f5a623;
    box-shadow: 0 0 10px rgba(245, 166, 35, 0.5);
}

.dot.completed {
    background: #48bb78;
    border-color: #48bb78;
}

/* Scenario Card */
.scenario-card {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(200, 230, 255, 0.85);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 20px 35px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    text-align: left;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, transform 0.4s;
}

.scenario-card.visible {
    opacity: 1;
    visibility: visible;
    animation: slideDown 0.4s ease-out;
}

.scenario-badge {
    display: inline-block;
    background: #f5a623;
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.scenario-card h2 {
    color: #261d1d;
    font-size: 1.4rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.scenario-card p {
    color: #261d1d;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Options Container */
.options-container {
    position: absolute;
    bottom: 240px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 270px;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s;
}

.options-container.visible {
    opacity: 1;
    visibility: visible;
}

.option-card {
    background: rgba(200, 255, 200, 0.85);
    backdrop-filter: blur(10px);
    border: 3px solid #4CAF50;
    border-radius: 12px;
    padding: 18px 22px;
    width: 220px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(76, 175, 80, 0.4);
    border-color: #388E3C;
}

.option-card:active {
    transform: translateY(-2px);
}

.option-header {
    color: #2E7D32;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.option-text {
    color: #261d1d;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Option positioning */
.option-left {
    animation: slideInLeft 0.5s ease-out;
}

.option-center {
    position: relative;
    bottom: 129px;
    animation: slideInUp 0.5s ease-out;
}

.option-right {
    animation: slideInRight 0.5s ease-out;
}

/* Feedback Toast */
.feedback-toast {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 30px 50px;
    text-align: center;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    max-width: 450px;
}

.feedback-toast.visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: popIn 0.4s ease-out;
}

.feedback-toast.correct {
    border: 3px solid #48bb78;
}

.feedback-toast.incorrect {
    border: 3px solid #e53e3e;
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.feedback-toast.correct .feedback-icon {
    color: #48bb78;
}

.feedback-toast.incorrect .feedback-icon {
    color: #e53e3e;
}

.feedback-text {
    color: #261d1d;
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.btn-ok {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-ok:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.feedback-toast.correct .btn-ok {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

.feedback-toast.incorrect .btn-ok {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
}

/* === END SCREEN === */
#screen-end {
    background: rgba(0, 0, 0, 0.9);
}

.end-card {
    background: white;
    border-radius: 20px;
    padding: 50px 60px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    animation: scaleIn 0.5s ease-out;
}

.end-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.end-card h1 {
    color: #261d1d;
    font-size: 2rem;
    margin-bottom: 25px;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 25px;
}

.score-value {
    font-size: 4rem;
    font-weight: 700;
    color: #f5a623;
    line-height: 1;
}

.score-label {
    font-size: 1.1rem;
    color: #261d1d;
    margin-top: 5px;
}

.end-message {
    color: #261d1d;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
    padding: 0 10px;
}

.btn-cta {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #f5a623 0%, #e6951a 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-bottom: 15px;
}

.btn-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(245, 166, 35, 0.4);
}

.btn-secondary {
    display: block;
    width: 100%;
    padding: 14px 30px;
    background: transparent;
    color: #261d1d;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 10px;
}

.btn-secondary:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #261d1d;
}

/* === ANIMATIONS === */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.05);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* === RESPONSIVE === */
@media (max-width: 900px) {
    .options-container {
        padding: 0 20px;
    }
    
    .option-card {
        width: 180px;
        padding: 14px 16px;
    }
    
    .option-center {
        bottom: 40px;
    }
    
    .scenario-card {
        padding: 18px 25px;
    }
    
    .scenario-card h2 {
        font-size: 1.2rem;
    }
}

@media (max-width: 700px) {
    .options-container {
        flex-direction: column;
        align-items: center;
        gap: 15px;
        bottom: 20px;
    }
    
    .option-card {
        width: 280px;
    }
    
    .option-center {
        bottom: auto;
    }
    
    .profile-cards {
        flex-direction: column;
        align-items: center;
    }
    
    .profile-card {
        width: 250px;
    }
    
    .email-card {
        padding: 35px 25px;
    }
    
    .email-header h1 {
        font-size: 1.8rem;
    }
    
    .end-card {
        padding: 35px 25px;
    }
}

/* === PAUSE BUTTON & OVERLAY === */
.pause-btn {
    position: fixed;
    top: 70px;
    right: 15px;
    z-index: 100;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.6);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    transition: background 0.2s, transform 0.15s;
    pointer-events: auto;
}
.pause-btn:hover {
    background: rgba(0, 0, 0, 0.55);
    transform: scale(1.08);
}

.pause-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}
.pause-overlay.visible {
    display: flex;
}
.pause-text {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.3em;
    text-shadow: 0 2px 12px rgba(0,0,0,0.5);
    margin-bottom: 30px;
}
.btn-resume {
    padding: 12px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background: rgba(76, 175, 80, 0.85);
    border: 2px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    pointer-events: auto;
}
.btn-resume:hover {
    background: rgba(76, 175, 80, 1);
    transform: scale(1.05);
}

/* === TOUCH / CANVAS === */
#game-container canvas,
#game-canvas canvas {
    touch-action: none;
}

/* === EXTRA SMALL SCREENS === */
@media (max-width: 400px) {
    .option-card { padding: 10px 12px; }
    .option-text { font-size: 0.8rem; }
    .option-header { font-size: 0.85rem; }
    .scenario-card { top: 5px; padding: 10px 14px; }
    .scenario-card h2 { font-size: 1rem; }
    .email-header h1 { font-size: 1.5rem; }
    .end-card h1 { font-size: 1.5rem; }
    .score-value { font-size: 3rem; }
    .profile-card { width: 220px; padding: 25px 20px; }
    .pause-text { font-size: 2rem; }
    .progress-dots { top: 10px; right: 15px; gap: 6px; }
    .dot { width: 10px; height: 10px; }
    .g-recaptcha { transform: scale(0.77); transform-origin: center; }
    .feedback-toast { padding: 20px 25px; max-width: 90%; }
}

/* === LANDSCAPE MOBILE === */
@media (max-height: 500px) {
    .options-container { flex-direction: row; bottom: 5px; gap: 8px; padding: 0 10px; }
    .option-card { width: auto; flex: 1; min-width: 0; padding: 8px 10px; }
    .option-center { bottom: auto; }
    .scenario-card { top: 5px; padding: 10px 16px; }
    .feedback-toast { padding: 15px 25px; }
    .email-card { padding: 20px; max-height: 90vh; overflow-y: auto; }
}

/* === SAFE AREA (notched phones) === */
@supports (padding: env(safe-area-inset-top)) {
    .progress-dots { top: calc(20px + env(safe-area-inset-top)); }
    .pause-btn { top: calc(70px + env(safe-area-inset-top)); }
}