@font-face {
    font-family: 'Speen3';
    src: url('font/SPEEN3__.TTF') format('truetype');
    font-weight: normal;
    font-style: normal;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

:root {
    --primary-color: #1d3555;
    --primary-hover: #152740;
    --error-color: #f27474;
    /* Soft Red */
    --success-color: #76c893;
    /* Soft Green */
    --text-main: #333;
    --text-muted: #777;
    --bg-light: #f8f9fa;
    --border-color: #ddd;
    --earth: #8D6E63;
    --air: #81C784;
    --water: #64B5F6;
    --fire: #E57373;

    /* Dino Game CSS Variables */
    --game-height: 170px;
    --road-height: 35px;
    --player-size: 38px;
    --entity-size: 28px;
}

@media (max-width: 768px) {
    :root {
        --game-height: 125px;
        --road-height: 25px;
        --player-size: 28px;
        --entity-size: 20px;
    }
}

body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--bg-light);
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding-bottom: var(--game-height);
    box-sizing: border-box;
}

/* Background Animation */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(180deg, #bae6fd 0%, #f8f9fa 100%);
}

/* Login Card */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 500px;
    padding: 20px;
    margin: auto;
}

.login-card {
    background: #fff;
    padding: 30px 40px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.logo-container {
    width: 60px;
    height: 60px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    margin: 0 auto 20px;
}

.login-logo-icon {
    font-size: 5rem;
}

h1 {
    color: var(--primary-color);
    font-family: 'Speen3', cursive;
    font-size: 67px;
    font-weight: normal;
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    font-style: italic;
}

/* Form Styles */
.form-group {
    text-align: left;
    margin-bottom: 15px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-main);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    outline: none;
}

.form-group textarea {
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 53, 85, 0.1);
}

.password-input-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
}

/* Captcha */
.captcha-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    height: 46px;
}

.captcha-container input,
.captcha-container .captcha-display,
.captcha-container .btn-icon {
    height: 100% !important;
}

.captcha-group .captcha-container input {
    flex: 1;
    width: auto;
    min-width: 50px;
}

.captcha-display {
    flex: 0 0 120px;
    white-space: nowrap;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: normal;
    text-decoration: none;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: none;
    color: var(--primary-color);
    background-image: repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(0, 0, 0, 0.02) 10px, rgba(0, 0, 0, 0.02) 20px);
}

.btn-icon {
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    border-radius: 8px;
    cursor: pointer;
    color: #5a738e;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    outline: none;
}

.btn-icon:hover {
    background: #e8eef3;
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(29, 53, 85, 0.1);
}

/* Hide input number spinner arrows */
.captcha-container input[type=number]::-webkit-outer-spin-button,
.captcha-container input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.captcha-container input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.reset-notice {
    margin-top: 15px;
    padding: 12px 15px;
    background-color: #f2f7fc;
    border: 1px dashed #c0d3eb;
    border-radius: 8px;
    color: #5a738e;
    font-size: 13px;
    text-align: center;
    line-height: 1.5;
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    flex-wrap: wrap;
    gap: 10px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-main);
}

.remember-me input {
    accent-color: #1d3555;
    cursor: pointer;
}

.forgot-password {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.forgot-password:hover {
    text-decoration: underline;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 13px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-support {
    margin-top: 15px;
    background: #e8eef3;
    border: 1px solid rgba(29, 53, 85, 0.12);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.3s, border-color 0.3s;
    text-decoration: none;
}

.btn-support:hover {
    background: #dde6ef;
    border-color: rgba(29, 53, 85, 0.2);
}

.btn-support i {
    font-size: 16px;
}

/* Footer Links */
.footer-links {
    margin: 15px auto 0 auto;
    max-width: 410px;
    font-size: 12px;
    color: #8fa0b5;
    line-height: 1.6;
    text-align: center;
}

.footer-links a {
    color: #5a738e;
    text-decoration: underline;
    font-weight: 500;
}

.footer-links a:hover {
    color: var(--primary-color);
}

/* Error States */
.error-msg {
    display: none;
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
    align-items: center;
    gap: 5px;
}

.has-error input,
.has-error textarea {
    border-color: var(--error-color) !important;
}

.has-error .error-msg {
    display: flex;
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 100;
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: #fff;
    width: 100%;
    max-width: 450px;
    height: 100vh;
    position: absolute;
    right: -100%;
    top: 0;
    transition: right 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

.modal.slide-left.active {
    right: 0;
}

.modal.center-modal {
    position: relative;
    right: auto;
    height: auto;
    max-height: 80vh;
    border-radius: 16px;
    margin: auto;
    transform: scale(0.9);
    transition: transform 0.3s ease-out;
}

.modal-overlay.active .modal.center-modal {
    transform: scale(1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    flex: 1;
    text-align: center;
}

.btn-back,
.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px;
}

.btn-back:hover,
.btn-close:hover {
    color: var(--text-main);
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.agreement-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agreement-text {
    max-height: 40vh;
    overflow-y: auto;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    padding-right: 10px;
}

.modal.slide-left .agreement-text {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
}

.agreement-text p {
    margin-bottom: 15px;
}

/* Custom Scrollbar for modal */
.agreement-text::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 6px;
}

.agreement-text::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.agreement-text::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.agreement-text::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ==========================================================================
   MINI DINO GAME STYLES (EDUCATION THEME)
   ========================================================================== */

.dino-game-section {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--game-height);
    z-index: 10;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
}

.dino-game-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Sky & Clouds */
.game-sky {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

.game-cloud {
    position: absolute;
    top: 15%;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.85);
    z-index: 0;
    pointer-events: none;
    filter: drop-shadow(0 2px 4px rgba(255, 255, 255, 0.5));
}

.game-background-tree {
    position: absolute;
    bottom: var(--road-height);
    font-size: 38px;
    color: #64748b; /* Slate gray */
    opacity: 0.25;  /* Yarı saydam */
    z-index: 1;     /* Yolun ve diğer elemanların arkasında */
    pointer-events: none;
    transform-origin: bottom center;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.05));
}

@media (max-width: 768px) {
    .game-cloud {
        font-size: 20px;
    }
}



/* Road / Ground */
.game-road {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: var(--road-height);
    background-image:
        repeating-linear-gradient(120deg,
            transparent,
            transparent 50px,
            rgba(255, 255, 255, 0.3) 50px,
            rgba(255, 255, 255, 0.3) 52px,
            transparent 52px,
            transparent 120px,
            rgba(255, 255, 255, 0.15) 120px,
            rgba(255, 255, 255, 0.15) 123px),
        linear-gradient(180deg, #e0f2fe 0%, #bae6fd 100%);
    z-index: 3;
    border-top: 3px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        0 -2px 10px rgba(186, 230, 253, 0.3);
}

/* Entities & Player */
.game-entities {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 4;
}

.game-player {
    position: absolute;
    left: 60px;
    bottom: var(--road-height);
    width: var(--player-size);
    height: var(--player-size);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--player-size);
    color: var(--primary-color);
    z-index: 5;
    -webkit-box-reflect: below -2px linear-gradient(transparent, rgba(255, 255, 255, 0.15));
}

/* Skating Animation - Bobbing & Tilting */
.game-player.skating i {
    animation: skateEffect 0.6s infinite alternate ease-in-out;
}

@keyframes skateEffect {
    0% {
        transform: translateY(0) rotate(-3deg);
    }

    100% {
        transform: translateY(-3px) rotate(4deg);
    }
}

/* Jumping pose */
.game-player.jumping i {
    transform: rotate(-15deg);
    transition: transform 0.1s ease-out;
}

/* Crash state */
.game-player.crashed i {
    color: var(--error-color) !important;
    transform: rotate(75deg) scale(0.9);
    transition: transform 0.15s ease-out;
}

/* General Entity (Obstacles / Rewards / Flags) */
.game-entity {
    position: absolute;
    width: var(--entity-size);
    height: var(--entity-size);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: var(--entity-size);
    z-index: 4;
    transition: opacity 0.2s ease;
}

/* Obstacles (Red) */
.game-entity.obstacle {
    color: var(--error-color);
    filter: drop-shadow(0 2px 4px rgba(242, 116, 116, 0.4));
}

/* tree obstacle styling removed */

/* Rewards (Green) */
.game-entity.reward {
    color: var(--success-color);
    filter: drop-shadow(0 0 8px rgba(118, 200, 147, 0.6));
    animation: rewardPulse 1.2s infinite ease-in-out alternate;
}

@keyframes rewardPulse {
    0% {
        transform: translateY(0) scale(1);
    }

    100% {
        transform: translateY(-4px) scale(1.08);
    }
}

/* Finish Line */
.game-entity.finish-line {
    color: #2c3e50;
    font-size: calc(var(--player-size) * 1.3);
    width: calc(var(--player-size) * 1.3);
    height: calc(var(--player-size) * 1.5);
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

/* HUD System */
.game-hud {
    position: absolute;
    bottom: 5px;
    right: 20px;
    padding: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.score-display {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background: rgba(29, 53, 85, 0.15);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), #5ebd79);
    width: 0%;
    transition: width 0.3s ease-out;
}

/* Timer System */
.game-timer-container {
    position: absolute;
    bottom: 5px;
    left: 20px;
    padding: 0;
    z-index: 6;
    display: flex;
    align-items: center;
    height: 30px;
}

.game-timer {
    font-size: 14px;
    font-weight: 600;
    color: var(--primary-color);
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .game-hud {
        bottom: 4px;
        right: 10px;
        padding: 0;
        min-width: 110px;
        gap: 2px;
    }

    .score-display {
        font-size: 11px;
    }

    .progress-bar-container {
        height: 4px;
    }

    .game-timer-container {
        bottom: 4px;
        left: 10px;
        height: 20px;
    }

    .game-timer {
        font-size: 11px;
    }
}

.game-overlay {
    position: absolute;
    bottom: 0;
    left: 120px;
    width: calc(100% - 300px);
    height: var(--road-height);
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.game-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

#gameStartOverlay,
#gameOverOverlay,
#gameWinOverlay {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#gameStartOverlay h3 {
    background: rgba(29, 53, 85, 0.08);
    padding: 3px 8px;
    border-radius: 20px;
}

.overlay-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
}

.overlay-content h3 {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.overlay-content p {
    font-size: 11px;
    color: var(--primary-color);
    margin-bottom: 0;
}

/* Pause state animations */
.game-paused * {
    animation-play-state: paused !important;
}

.controls-info {
    font-size: 11px;
    color: var(--primary-color);
    font-weight: 500;
    display: inline-block;
}

.btn-play-again {
    background-color: rgba(29, 53, 85, 0.08);
    color: var(--primary-color);
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    box-shadow: none;
}

.btn-play-again:hover {
    background-color: rgba(29, 53, 85, 0.15);
    transform: translateY(-1px);
}

.btn-play-again:active {
    transform: translateY(1px);
}

@media (max-width: 768px) {
    .game-overlay {
        left: 100px;
        width: calc(100% - 220px);
        height: var(--road-height);
    }

    .overlay-content {
        padding: 0;
        gap: 6px;
    }

    .overlay-content h3 {
        font-size: 11px;
        margin-bottom: 0;
    }

    #gameStartOverlay h3 {
        padding: 2px 6px;
    }

    .overlay-content p {
        font-size: 10px;
        margin-bottom: 0;
    }

    .controls-info {
        display: none;
        /* Hide on mobile to save space */
    }

    .btn-play-again {
        padding: 2px 8px;
        font-size: 10px;
    }
}

/* Helpers & Utilities */
.text-danger {
    color: var(--error-color) !important;
}

.text-success {
    color: var(--success-color) !important;
}

.hide-mobile {
    display: inline;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

/* Floating Popup Points */
.floating-text {
    position: absolute;
    font-weight: 800;
    font-size: 16px;
    z-index: 10;
    pointer-events: none;
    animation: floatUpAndFade 0.8s forwards ease-out;
}

.floating-text.green {
    color: var(--success-color);
    text-shadow: 0 0 5px rgba(118, 200, 147, 0.6);
}

@keyframes floatUpAndFade {
    0% {
        transform: translateY(0);
        opacity: 1;
    }

    100% {
        transform: translateY(-35px);
        opacity: 0;
    }
}

/* Camera Shake on Collision */
.shake-camera {
    animation: cameraShake 0.4s ease-in-out;
}

@keyframes cameraShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translate(-3px, 2px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translate(3px, -2px);
    }
}

/* Mobile Responsiveness for Login Card and Typography */
@media (max-width: 576px) {
    .login-container {
        padding: 15px 10px;
    }
    .login-card {
        padding: 24px 16px;
        border-radius: 12px;
    }
    .login-logo-icon {
        font-size: 3.5rem !important;
    }
    h1 {
        font-size: 40px !important;
        margin-bottom: 5px;
    }
    .subtitle {
        font-size: 13px;
        margin-bottom: 20px;
    }
    .form-group {
        margin-bottom: 12px;
    }
    .form-group label {
        margin-bottom: 6px;
        font-size: 13px;
    }
    .form-group input,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 14px;
    }
    .captcha-group .captcha-container {
        gap: 8px;
    }
    .captcha-display {
        font-size: 14px;
    }
    .btn-icon {
        width: 40px;
        height: 40px;
    }
    .form-actions {
        margin-bottom: 15px;
        font-size: 13px;
    }
    .btn-primary {
        padding: 12px;
        font-size: 16px;
        border-radius: 8px;
    }
    .footer-links {
        margin-top: 15px;
        font-size: 11px;
    }
    .btn-support {
        margin-top: 15px;
        padding: 8px 16px;
        font-size: 13px;
    }
}

/* Accordion Details styling inside agreement modal */
details.editor-details {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    margin-bottom: 1rem;
    background-color: rgba(0, 0, 0, 0.015);
    transition: border-color 0.2s ease, background-color 0.2s ease;
    width: 100%;
}
details.editor-details[open] {
    background-color: rgba(0, 0, 0, 0.03);
    border-color: var(--primary-color);
}
details.editor-details summary {
    font-weight: 600;
    cursor: pointer;
    outline: none;
    color: var(--primary-color);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
details.editor-details summary::-webkit-details-marker {
    display: none;
}
details.editor-details[open] summary i {
    transform: rotate(180deg);
}