/* Word Search Game Styles */

:root {
    --grid-left-offset: 0rem;
    --grid-top-offset: 0rem;
    --word-list-left-offset: 0rem;
    --word-list-top-offset: 0rem;
}

/* Header title positioning (override main.css) */
.container > header {
    position: relative;
}

.container > header > .title {
    position: absolute;
    left: 4.75rem; /* 76px */
    top: 0;
    width: calc(100% - 4.75rem);
    height: 5.5rem;
    margin: 0;
    display: block;
}

.container > header > .title > h2 {
    position: absolute;
    left: 0;
    top: 2.5rem; /* 63px */
    width: 80rem;
    height: 2.3125rem; /* 37px */
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #00699F;
    line-height: 2.3125rem;
}

/* Screen Management */
.screen {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hidden {
    display: none;
}

/* Start Screen */
#start-screen {
    text-align: center;
}

#start-screen h2 {
    font-size: 3rem;
    color: #00699F;
    margin-bottom: 1rem;
}

#start-screen p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

#start-button {
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background-color: #00699F;
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
    font-family: "League Spartan", sans-serif;
}

#start-button:hover {
    background-color: #005080;
}

/* Game Screen */
body.game-page {
    background-image: url("rd8-2_Pl1_S01_001.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

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

/* Word Search Grid */
.word-search-container {
    position: absolute;
    inset: 0;
}

.word-search-grid {
    display: grid;
    gap: 0.25rem;
    background-color: #f0f0f0;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    position: absolute;
    left: -36.625rem;
    top: -0.25rem;
}

.grid-cell {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: white;
    border: 1px solid #e0e0e0;
    border-radius: 0.25rem;
    font-weight: bold;
    font-size: 1.2rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
}

.grid-cell:hover {
    background-color: #e8f4ff;
}

.grid-cell.selected {
    background-color: #b3d9ff;
}

.grid-cell.found {
    background-color: #d4edda;
    color: #00699F;
    font-weight: 700;
}

.selecting .grid-cell.highlighted {
    background-color: #b3d9ff;
}

/* Word List */
.word-list-container {
    position: absolute;
    left: 14.75rem;
    top: 1.75rem;
    width: 18rem;
    padding: 1rem;
}

.word-list-container.hidden {
    visibility: hidden;
    pointer-events: none;
}

.word-list-spacer {
    position: absolute;
    left: 59.75rem;
    top: 2.75rem;
    width: 18rem;
    padding: 1rem;
}

.word-list-container h3 {
    color: #00699F;
    margin-bottom: 1rem;
}

.word-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.word-list li {
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.2rem;
    line-height: 1.1;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 0.25rem;
    transition: all 0.5s ease;
    display: inline-block;
    width: fit-content;
}

.word-list li.found {
    transition: all 0.5s ease;
    text-decoration: line-through;
    color: #258174;
    background-color: rgba(37, 129, 116, 0.1);
    display: inline-block;
}

/* End Screen - Overlay */
#end-screen.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    background-color: rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

#end-screen.hidden{
display:none !important;
}

.congrats-message {
    z-index: 110;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.congrats-message h2 {
    font-size: 3rem;
    color: #00699F;
    margin-bottom: 1rem;
}

.congrats-message p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
}

.end-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.end-actions .start-link {
    cursor: pointer;
    border: none;
}

.start-link {
    display: inline-block;
    padding: 1rem 2rem;
    font-size: 1.5rem;
    background-color: #00699F;
    color: white;
    border-radius: 0.5rem;
    text-decoration: none;
    font-family: "League Spartan", sans-serif;
}

.start-link:hover {
    background-color: #005080;
}

/* Level navigation weights */
.container > header > .difficulty {
    position: absolute;
    top: -0.0625rem;
    right: 1.5rem;
    width: auto;
    height: 6rem;
    padding: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 0.5rem;
}

#weight-one,
#weight-two {
    border: none;
    margin-left: 0;
    cursor: pointer;
    text-decoration: none;
    background: url("assets/images/utez1.svg") no-repeat center;
    background-size: contain;
    transition: none;
}

#weight-one:hover,
#weight-two:hover {
    transform: none;
}

#weight-one {
    width: 1.5rem;
    height: 3.7rem;
}

#weight-two {
    width: 2.3rem;
    height: 4.8rem;
}

#weight-one.active,
#weight-two.active {
    background-image: url("assets/images/utez2.svg");
}

#confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 101;
    pointer-events: none;
}

.confetti {
    position: absolute;
    z-index: 102;
    animation-iteration-count: infinite !important;
} 

@keyframes confettiFall {
    0% {
        transform: translateY(-10rem) rotate(0deg);
    }
    100% {
        transform: translateY(60rem) rotate(360deg);
    }
}