/* --------------------------------------------------
   Global Layout
-------------------------------------------------- */

html {
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Alef", Arial, sans-serif;
    background: #F3F6FA;
    color: #2E3A4F;
    text-align: center;

    /* חשוב */
    overflow-x: hidden;
    overflow-y: auto;
}


.container {
    max-width: 430px;
    margin: auto;
    padding: 20px 16px;
    box-sizing: border-box;
}

h1 {
    font-size: 28px;
    margin-top: 30px;
    margin-bottom: 10px;
}

h2 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 10px;
    color: #4A90E2;
}

/* --------------------------------------------------
   Buttons (Menu + Quiz)
-------------------------------------------------- */

.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.btn {
    background: white;
    padding: 14px;
    border-radius: 10px;
    font-size: 18px;
    flex: 1 1 calc(50% - 10px);
    max-width: 180px;
    text-decoration: none;
    color: #2E3A4F;
    border: 2px solid #D9E3F0;
    transition: 0.2s ease;
    box-sizing: border-box;
}

.btn:hover {
    background: #E8EEF5;
    border-color: #4A90E2;
    transform: translateY(-2px);
}

#nextBtn {
    margin-top: 20px;
}

/* Back button */
.back-btn {
    display: inline-block;
    padding: 12px 20px;
    margin-top: 25px;
    font-size: 18px;
    border-radius: 10px;
    background: #ffffff;
    border: 2px solid #DCE2E9;
    text-decoration: none;
    color: #2E3A4F;
}

/* --------------------------------------------------
   Quiz Screen
-------------------------------------------------- */

#questionBox {
    font-size: 24px;
    margin: 20px 0;
    padding: 10px;
}

.option {
    width: 100%;
    background: #ffffff;
    margin: 10px auto;
    padding: 14px;
    border-radius: 10px;
    font-size: 18px;
    border: 2px solid #D9E3F0;
    cursor: pointer;
    transition: 0.2s ease;
    box-sizing: border-box;
}

.option:hover {
    background: #E8EEF5;
}

.correct {
    background: #d9f8dd !important;
    border-color: #32c759 !important;
}

.wrong {
    background: #ffe2e2 !important;
    border-color: #ff3b30 !important;
}

/* Score animation */
#score-anim {
    font-size: 22px;
    color: #4A90E2;
    margin-top: 5px;
    opacity: 0;
}

#score-anim.pop {
    animation: scorePop 0.5s forwards;
}

@keyframes scorePop {
    0% { transform: scale(0.8); opacity: 0; }
    40% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* --------------------------------------------------
   Match Game
-------------------------------------------------- */

#top-row {
    display: flex;
    justify-content: space-between;
    margin: 15px auto;
    max-width: 380px;
    font-size: 18px;
    font-weight: bold;
}

#grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 15px;
}

/* Cards */
.card {
    background: white;
    border: 2px solid #DCE2E9;
    padding: 12px;
    border-radius: 10px;
    min-height: 55px;
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s ease;
    box-sizing: border-box;
}

/* Tap animation */
.card.tap {
    transform: scale(1.07);
}

/* Correct match */
.card.correct {
    background: #d9f8dd !important;
    border-color: #32c759 !important;
}

/* Wrong match (shake) */
.card.wrong {
    background: #ffe2e2 !important;
    border-color: #ff3b30 !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-4px); }
    100% { transform: translateX(0); }
}

/* Win message */
#win-message {
    font-size: 24px;
    color: #4A90E2;
    margin-top: 20px;
}

.hidden {
    display: none;
}

/* --------------------------------------------------
   Tables (scores.html)
-------------------------------------------------- */

table {
    width: 95%;
    margin: 15px auto;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #DCE2E9;
}

th, td {
    padding: 10px;
    border-bottom: 1px solid #e9eef4;
    font-size: 15px;
}

th {
    background: #E8EEF5;
    color: #2E3A4F;
}

tr.correct-row {
    background: #e9f9ee;
}

tr.wrong-row {
    background: #ffe8e8;
}

/* --------------------------------------------------
   Clear Button
-------------------------------------------------- */

#clearBtn {
    margin-top: 20px;
    padding: 10px 20px;
    font-size: 17px;
    border: none;
    border-radius: 8px;
    background: #4A90E2;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

#clearBtn:hover {
    background: #3578c8;
}


/* Highlight vocabulary words inside Unseen text */
.vocab-highlight {
    background-color: #fff3b0; /* צהוב עדין */
    padding: 2px 4px;
    border-radius: 4px;
    font-weight: 500;
}


/* --------------------------------------------------
   Page Transition (Parrot)
-------------------------------------------------- */

#page-transition {
    position: fixed;
    inset: 0;
    background: #f3f6fa;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;

    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

#page-transition.active {
    opacity: 1;
    pointer-events: all;
}

#page-transition img {
    width: 120px;
    animation: parrotPop 0.5s ease;
}

@keyframes parrotPop {
    0%   { transform: scale(0.7); opacity: 0; }
    60%  { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); }
}
/* --------------------------------------------------
   Responsive Design