/* Custom Font - Nurse Holiday */
@font-face {
    font-family: 'Nurse Holiday';
    src: url('assets/nurse-holiday.regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

/* Fallback Serif fonts */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lora:wght@400;500;600&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nurse Holiday', 'Playfair Display', Georgia, serif;
    min-height: 100vh;
    background-image: url('assets/mentosbg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    color: white;
    letter-spacing: 0.1em;
    /* Increased global spacing as requested */
}

/* Game Container */
.game-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px 15px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: white;
    border-radius: 50px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-img {
    width: 80px;
    height: auto;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #1a5fb4;
    text-decoration: none;
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.7;
}

/* Game Title Section */
.game-title-section {
    text-align: center;
    margin-bottom: 12px;
}

.game-title {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.15em;
    margin-bottom: 10px;
    text-transform: uppercase;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.game-subtitle {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 14px;
    color: white;
    letter-spacing: 0.1em;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Cards Grid - 5x4 grid for 20 cards */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    max-width: 450px;
    margin: 0 auto 15px;
    padding: 15px;
    background: rgba(26, 95, 180, 0.7);
    border-radius: 15px;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

/* Card Styles */
.card {
    aspect-ratio: 1;
    cursor: pointer;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #1a4d8c;
    border: 2px solid rgba(255, 255, 255, 0.4);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover:not(.revealed):not(.disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.card.revealed {
    cursor: default;
}

.card.disabled {
    pointer-events: none;
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    backface-visibility: hidden;
}

.card-front {
    background: #1a4d8c;
}

.card-front img {
    width: 90%;
    height: 90%;
    object-fit: contain;
}

.card-back {
    background: #1a4d8c;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.card-back img {
    width: 75%;
    height: 75%;
    object-fit: contain;
}

.card.revealed .card-front {
    opacity: 0;
}

.card.revealed .card-back {
    opacity: 1;
    transform: scale(1);
}

/* Candy glow effect */
.card.revealed.candy {
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    border-color: rgba(255, 255, 255, 0.8);
}

/* Bomb shake effect */
.card.revealed.bomb {
    animation: bombShake 0.5s ease;
}

@keyframes bombShake {

    0%,
    100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px) rotate(-2deg);
    }

    40% {
        transform: translateX(5px) rotate(2deg);
    }

    60% {
        transform: translateX(-5px) rotate(-2deg);
    }

    80% {
        transform: translateX(5px) rotate(2deg);
    }
}

/* Pop animation for cards */
@keyframes cardPop {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.card.popping {
    animation: cardPop 0.4s ease;
}

/* Game Controls */
.game-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 450px;
    margin: 0 auto;
    position: relative;
    z-index: 100;
}

.difficulty-selector {
    width: 100%;
    background: white;
    border-radius: 12px;
    padding: 10px 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.difficulty-label {
    display: block;
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 12px;
    color: #003366;
    margin-bottom: 3px;
    letter-spacing: 0.05em;
}

.difficulty-dropdown {
    width: 100%;
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 16px;
    font-weight: 600;
    color: #1a5fb4;
    border: none;
    background: transparent;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%231a5fb4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    padding-right: 30px;
    letter-spacing: 0.05em;
}

.difficulty-dropdown option {
    font-family: 'Nurse Holiday', Georgia, serif;
    padding: 12px 15px;
    background: white;
    color: #1a5fb4;
}

.cashout-btn {
    width: 100%;
    background: linear-gradient(135deg, #1a5fb4 0%, #0d47a1 100%);
    border: 3px solid rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 101;
    pointer-events: auto;
}

.cashout-btn:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.cashout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.cashout-label,
.cashout-points {
    pointer-events: none;
}

.cashout-label {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.05em;
}

.cashout-points {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 24px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.05em;
}

/* Start Overlay */
.start-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 95, 180, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    backdrop-filter: blur(10px);
}

.start-overlay.active {
    display: flex;
}

.start-content {
    text-align: center;
    animation: fadeSlideIn 0.6s ease;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.start-logo {
    width: 150px;
    height: auto;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
}

.start-title {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 42px;
    font-weight: 700;
    color: white;
    letter-spacing: 0.15em;
    margin-bottom: 15px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.4);
}

.start-subtitle {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 0.1em;
    margin-bottom: 30px;
    line-height: 1.8;
}

.start-btn {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 20px;
    font-weight: 600;
    padding: 15px 50px;
    background: white;
    color: #1a5fb4;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    animation: buttonPop 1.5s ease-in-out infinite;
}

@keyframes buttonPop {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 8px 35px rgba(255, 255, 255, 0.4), 0 5px 20px rgba(0, 0, 0, 0.3);
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 95, 180, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    padding: 40px 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.5s ease;
    z-index: 1002;
    position: relative;
}

.gameover-modal {
    border: 4px solid #e74c3c;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-title {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 32px;
    font-weight: 700;
    color: #1a5fb4;
    margin-bottom: 15px;
    letter-spacing: 0.1em;
}

.gameover-title {
    color: #e74c3c;
}

.modal-text {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 18px;
    color: #333;
    margin-bottom: 25px;
    letter-spacing: 0.05em;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-btn {
    font-family: 'Nurse Holiday', Georgia, serif;
    font-size: 16px;
    font-weight: 500;
    padding: 12px 30px;
    background: #1a5fb4;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    letter-spacing: 0.1em;
}

.modal-btn:hover {
    background: #0d47a1;
    transform: scale(1.05);
}

.modal-btn-outline {
    background: transparent;
    border: 2px solid #1a5fb4;
    color: #1a5fb4;
}

.modal-btn-outline:hover {
    background: #1a5fb4;
    color: white;
}

/* --- THEMED REGISTRATION FORM --- */
#register-overlay .register-modal {
    max-width: 650px !important;
    /* Wider modal as requested */
    width: 90% !important;
    /* Standard width on smaller screens */
    margin: 20px !important;
    padding: 40px !important;
    /* More breathing room */
    border: 4px solid #1a5fb4 !important;
    background: #ffffff !important;
    border-radius: 30px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3) !important;
}

.score-container {
    margin: 5px 0 15px !important;
    /* Moved form up slightly */
    text-align: center !important;
}

.score-label {
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 14px !important;
    color: #888 !important;
    letter-spacing: 0.15em !important;
    margin-bottom: 2px !important;
}

.score-value {
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 84px !important;
    font-weight: 900 !important;
    color: #1a5fb4 !important;
    line-height: 0.9 !important;
    letter-spacing: 0em !important;
    text-shadow: 2px 2px 0px rgba(184, 212, 255, 0.5) !important;
}

.modal-subtitle-text {
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 13px !important;
    color: #666 !important;
    margin-bottom: 20px !important;
    letter-spacing: 0.05em !important;
    opacity: 0.8;
}

#register-form {
    display: flex !important;
    flex-direction: column !important;
    gap: 25px !important;
    /* Spaced out the fields */
    width: 100% !important;
}

#register-form .form-group {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    /* Spaced label from input */
    text-align: left !important;
    width: 100% !important;
}

#register-form label {
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #003366 !important;
    margin-left: 10px !important;
    letter-spacing: 0.12em !important;
    display: block !important;
}

#register-form input {
    width: 100% !important;
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 16px !important;
    padding: 14px 25px !important;
    /* Slightly taller inputs */
    border: 2px solid #b8d4ff !important;
    border-radius: 50px !important;
    background: #f8fbff !important;
    color: #1a5fb4 !important;
    outline: none !important;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05) !important;
    letter-spacing: 0.05em !important;
}

#register-form input::placeholder {
    color: #1a5fb4 !important;
    opacity: 0.3 !important;
    /* Faded placeholders as requested */
}

#register-form input:focus {
    border-color: #1a5fb4 !important;
    background: white !important;
    box-shadow: 0 0 10px rgba(26, 95, 180, 0.2) !important;
}

#register-form .form-buttons {
    display: flex !important;
    gap: 20px !important;
    /* More space between buttons */
    margin-top: 20px !important;
    width: 100% !important;
    flex-wrap: nowrap !important;
    /* Prevent buttons from "bending" or wrapping */
}

#register-form .modal-btn {
    flex: 1 !important;
    padding: 16px !important;
    white-space: nowrap !important;
    /* Keep text on one line */
}

.form-message {
    font-family: 'Nurse Holiday', Georgia, serif !important;
    font-size: 14px !important;
    margin-top: 15px !important;
    letter-spacing: 0.05em !important;
}

.form-message.success {
    color: #27ae60 !important;
}

.form-message.error {
    color: #e74c3c !important;
}

/* Responsive Design */
@media (max-width: 600px) {
    .game-container {
        padding: 8px;
    }

    .header {
        padding: 6px 15px;
        margin-bottom: 8px;
    }

    .logo-img {
        width: 60px;
    }

    .nav-links {
        gap: 15px;
    }

    .nav-link {
        font-size: 12px;
    }

    .game-title {
        font-size: 22px;
    }

    .game-subtitle {
        font-size: 12px;
    }

    .cards-grid {
        gap: 5px;
        padding: 10px;
        max-width: 100%;
    }

    .card {
        border-radius: 6px;
    }

    .game-controls {
        gap: 10px;
    }

    .difficulty-selector {
        padding: 8px 12px;
    }

    .difficulty-dropdown {
        font-size: 14px;
    }

    .cashout-btn {
        padding: 10px 15px;
    }

    .cashout-points {
        font-size: 20px;
    }

    .start-title {
        font-size: 28px;
    }

    .start-subtitle {
        font-size: 14px;
        padding: 0 20px;
    }

    .start-btn {
        font-size: 16px;
        padding: 12px 40px;
    }

    .modal {
        padding: 30px;
        margin: 20px;
    }

    .modal-title {
        font-size: 24px;
    }

    .modal-text {
        font-size: 14px;
    }

    #register-overlay .register-modal {
        padding: 25px 20px !important;
        width: 95% !important;
        margin: 10px !important;
        max-height: 90vh;
        /* Don't overflow screen */
        overflow-y: auto;
        /* Scroll if content is too long */
    }

    .score-value {
        font-size: 60px !important;
        /* Scale down score on mobile */
    }

    #register-form {
        gap: 15px !important;
        /* Tighter spacing on mobile */
    }

    #register-form .form-buttons {
        gap: 10px !important;
    }
}

@media (max-width: 400px) {
    .cards-grid {
        gap: 4px;
        padding: 8px;
    }

    .game-title {
        font-size: 18px;
    }

    .start-title {
        font-size: 22px;
    }
}