@charset "utf-8";
/* CSS Document */

/* ==========================
   SAMSUNG SS BODY FONTS
   ========================== */

@font-face {
    font-family: "Samsung SS Body";
    src: url("fonts/SamsungSSBody-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: "Samsung SS Body";
    src: url("fonts/SamsungSSBody-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Samsung SS Body";
    src: url("fonts/SamsungSSBody-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
}

/* ==========================
   SAMSUNG SS HEAD FONTS
   ========================== */

@font-face {
    font-family: "Samsung SS Head";
    src: url("fonts/SamsungSSHead-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: "Samsung SS Head";
    src: url("fonts/SamsungSSHead-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: "Samsung SS Head";
    src: url("fonts/SamsungSSHead-Medium.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: "Samsung SS Head";
    src: url("fonts/SamsungSSHead-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
}

/* Viewport Lock Base */
html {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
}

/* Mobile-First Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: linear-gradient(0deg, #00d2ff 0%, #0099b8 100%);
    color: #ffffff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    padding: 10px 8px 8px 8px;
    gap: 6px;
}

/* ==========================
   START SCREEN
   ========================== */
.start-screen-container {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    justify-content: center;
    align-items: center;
    background-color: #fff;
    z-index: 200;
    transition: opacity 0.4s ease-in-out;
}

.start-screen-container.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

.start-screen-contents {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
    max-height: 100%;
    box-sizing: border-box;
}

#samsung-logo {
    display: block;
    max-width: 100%;
    width: 150px;
    padding-bottom: 40px;
}

#game-logo {
    display: block;
    max-width: 100%;
    width: 300px;
    padding-bottom: 20px;
}

.start-screen-contents p {
    font-family: "Samsung SS Body", sans-serif;
    font-weight: 400;
    font-size: 1.3rem;
    margin: 10px;
    text-align: center;
    color: #000;
    padding-bottom: 20px;
}

.game-start-button {
    width: 70%;
    padding-top: 15px;
    padding-bottom: 15px;
    font-family: "Samsung SS Head", sans-serif;
    font-size: 1.3rem;
    letter-spacing: 0.4px;
    font-weight: 700;
    border: none;
    border-radius: 40px;
    background-color: #00BBE3;
    color: #fff;
    cursor: pointer;
}

.start-screen-container.fading-out {
    opacity: 0;
    pointer-events: none;
}

/* ==========================
   TUTORIAL SECTION & ANIMATIONS
   ========================== */
#tutorial-container {
    display: grid;
    place-items: center;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.50);
    width: 100vw;
    height: 100dvh;
    z-index: 100;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: opacity 0.4s ease-in-out;
}

#tutorial-container.hidden {
    opacity: 0;
    pointer-events: none;
    display: none !important;
}

#tutorial-container > div {
    grid-area: 1/1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Smooth cross-fade transition using pure opacity and pointer-events */
.tut-1-content, 
.tut-2-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #fff;
    width: 400px;
    max-width: 90vw;
    min-height: 480px;
    height: 560px;
    justify-content: space-evenly;
    gap: 16px;
    padding: 30px;
    border-radius: 24px;
    
    transition: opacity 0.4s ease-in-out;
    opacity: 1;
    pointer-events: auto;
}

.tut-1-content.hidden, 
.tut-2-content.hidden {
    opacity: 0;
    pointer-events: none;
}

.tut-1-content h1, .tut-2-content h1 {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #000;
}

.tut-1-content img {
    display: block;
    max-width: 100%;
    width: 300px;
}

.tut-2-content img {
    display: block;
    max-width: 100%;
    width: 180px;
}

.tut-1-content h2, .tut-2-content h2 {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #000;
}

.tut-1-content p, .tut-2-content p {
    font-family: "Samsung SS Body", sans-serif;
    font-weight: 400;
    font-size: 1.1rem;
    color: #000;
}

p.tut-2-subtitle {
    font-family: "Samsung SS Body", sans-serif;
    font-weight: 200;
    font-size: 0.9rem;
    color: #000;
}

#tut-btn-1, #tut-btn-2 {
    background-color: #00BBE3;
    width: 90%;
    padding-top: 10px;
    padding-bottom: 10px;
    border-radius: 30px;
    border: none;
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #fff;
    cursor: pointer;
}

/* ==========================
   HEADER & GAME CONTAINER
   ========================== */
.game-header {
    width: 96%;
    max-width: 440px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 10px 4px;
}

.game-header h1 {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1.15rem;
    color: #ffffff;
}

.device-badge {
    font-family: "Samsung SS Head", sans-serif;
    font-size: 0.85rem;
    font-weight: 400;
    color: #ffffff;
}

.game-container {
    width: 96%;
    max-width: 440px;
    background-color: #ffffff;
    color: #0f172a;
    border-radius: 18px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: calc(100vh - 55px);
    overflow: hidden;
}

/* Prompt Box */
.prompt-box {
    background-color: #006572;
    color: #ffffff;
    padding: 12px 12px;
    border-radius: 12px;
    text-align: center;
}

.prompt-box h2 {
    font-family: "Samsung SS Head", sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 5px;
    letter-spacing: 0.3px;
}

.prompt-box p {
    font-family: "Samsung SS Body", sans-serif;
    font-weight: 400;
    font-size: 0.82rem;
    line-height: 1.35;
}

/* Game Tiles Grid */
#grid-container {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 0px;
    width: 100%;
    max-width: min(100%, 48vh);
    margin: 0 auto;
    background-color: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    aspect-ratio: 1/1;
    touch-action: none;
    overflow: hidden;
}

#grid-container button {
    aspect-ratio: 1;
    border: none;
    background-color: transparent;
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.1s ease, transform 0.1s ease, border-radius 0.1s ease;
    border-radius: 0px;
    color: #0f172a;
    margin: -0.5px;
}

/* Active Drag Selection */
#grid-container button.selected {
    background-color: #727272 !important;
    color: #ffffff !important;
    transform: scale(1.04);
    z-index: 10;
}

/* Directional Round Caps for Pill Shapes */
#grid-container button.cap-left {
    border-top-left-radius: 20px;
    border-bottom-left-radius: 20px;
}
#grid-container button.cap-right {
    border-top-right-radius: 20px;
    border-bottom-right-radius: 20px;
}
#grid-container button.cap-top {
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}
#grid-container button.cap-bottom {
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
}
#grid-container button.cap-single {
    border-radius: 20px;
}

/* Correct Matched Words Popup Animation */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

#grid-container button.correct {
    background-color: #97d653 !important;
    color: #ffffff !important;
    animation: pop 0.3s ease-in-out;
}

/* Incorrect Guesses Shake Animation */
@keyframes shake {
    0% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

#grid-container button.incorrect {
    background-color: #db0032 !important;
    color: #ffffff !important;
    animation: shake 0.4s ease-in-out;
}

/* Letter Tile Fallback */
.letter-tile {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    border: none;
    color: #0f172a;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    aspect-ratio: 1 / 1;
}

/* Score Counter Text */
.score-text {
    font-family: "Samsung SS Head", sans-serif;
    font-size: 0.8rem;
    font-weight: 400;
    text-align: center;
    color: #475569;
}

/* ==========================
   SUCCESS MODAL
   ========================== */
#success-modal {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.80);
    z-index: 100;
    transition: opacity 0.4s ease-in-out, visibility 0.4s ease-in-out;
    opacity: 1;
    visibility: visible;
}

#success-modal.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    display: flex !important;
}

.success-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: #ffffff;
    width: 90%;
    max-width: 420px;
    padding: 35px 30px;
    border-radius: 14px;
    gap: 18px;
}

.success-badge {
    font-family: "Samsung SS Head", sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 1.2px;
}

.success-card h2 {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: #00BBE3;
    margin: 0;
}

.correct-feature {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 2rem;
    color: #37D776;
    margin: 0;
}

.success-card p {
    font-family: "Samsung SS Body", sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

#correct-answer {
    width: 40%;
}

.success-next-btn {
    width: 80%;
    padding-top: 10px;
    padding-bottom: 10px;
    font-family: "Samsung SS Head", sans-serif;
    font-size: 1.1rem;
    letter-spacing: 0.4px;
    font-weight: 700;
    border: none;
    border-radius: 40px;
    background-color: #00BBE3;
    color: #fff;
    cursor: pointer;
}

#success-module-prompt {
    color: #00BBE3;
    font-size: 0.95rem;
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
}

/* ==========================
   WORD CARDS GRID
   ========================== */
.word-cards-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    width: 100% !important;
}

.word-card {
    font-family: "Samsung SS Head", sans-serif;
    font-weight: 700;
    font-size: 0.75rem;
    background-color: #e2e8f0;
    padding: 10px 8px;
    text-align: center;
    border-radius: 10px;
    color: #94a3b8;
}

.word-card.found {
    background-color: #b2ebf2;
    color: #006064;
}

/* Update the global hidden rule to exclude tutorial content and success modal */
.hidden:not(.tut-1-content):not(.tut-2-content):not(#success-modal) {
    display: none !important;
}

/* Let tutorial cards handle their own visibility/display via pure opacity */
.tut-1-content.hidden, 
.tut-2-content.hidden {
    opacity: 0;
    pointer-events: none;
}