body {
    margin: 0;
}

h1 {
    font-family: "Roboto", sans-serif;
    text-align: center;
    margin: 1.5rem 0 1rem;
}

.cell.selected {
    background-color: rgba(0, 106, 255, 0.35);
    border-radius: 999px;
}

.cell {
    --cell-size: clamp(
        1.15rem,
        min(
            calc(88vw / var(--grid-n, 10)),
            calc(58vh / var(--grid-n, 10))
        ),
        3.5rem
    );

    width: var(--cell-size);
    height: var(--cell-size);

    font-size: clamp(
        0.7rem,
        calc(var(--cell-size) * 0.55),
        2.4rem
    );
    font-weight: 600;

    background-color: transparent;
    border: none;
    padding: 0;
    text-align: center;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    z-index: 1;
}

.grid {
    --grid-n: 10;

    table-layout: fixed;
    border-collapse: collapse;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    margin: 0;

    font-family: "Roboto", sans-serif;
    color: #1a1a1a;
    background-color: transparent;
    position: relative;
    z-index: 1;
}

.parole-difficulty {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 0;
    min-width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    color: #3a3a38;
}

.parole-difficulty select {
    font: inherit;
    color: inherit;
    padding: 0.35rem 0.55rem;
    border: 1px solid #e2e2de;
    border-radius: 8px;
    background-color: #ffffff;
    cursor: pointer;
}

#game {
    position: relative;
    background-color: #ffffff;
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.word-highlight {
    position: absolute;
    border-radius: 999px;
    pointer-events: none;
    z-index: 0;
    transform-origin: center center;
}

.learning-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 0;
    min-width: 100%;
    box-sizing: border-box;
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    color: #3a3a38;
    cursor: pointer;
    user-select: none;
}

.learning-mode-toggle input {
    width: 1rem;
    height: 1rem;
    margin: 0;
    cursor: pointer;
}

.game-info {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;

    width: 0;
    min-width: 100%;
    box-sizing: border-box;
    text-align: center;

    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
}

#current-word {
    min-height: 1em;
    margin: 0;
    font-family: "Roboto", sans-serif;
    font-size: clamp(1.2rem, 2.5vw, 1.7rem);
}

#current-word:empty::before {
    content: "—";
    opacity: 0.5;
}

.puzzle-container {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;

    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
    text-align: center;
}

.roboto-grid{
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 200;
    font-style: normal;
    font-variation-settings:"wdth" 100;
}

#word-list {
    width: 0;
    min-width: 100%;
    box-sizing: border-box;

    padding: 0.75rem 0.5rem;

    background-color: #f7f7f5;
    border: 1px solid #e2e2de;
    border-radius: 8px;

    font-family: "Roboto", sans-serif;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.15rem 0.25rem;
}

.word-item {
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #3a3a38;
    padding: 0.35em 0.55em;
    transition: opacity 0.3s, color 0.3s;
}

.word-item.found {
    text-decoration: line-through;
    color: #9a9a96;
    opacity: 1;
}

#progress,
#timer {
    font-family: "Roboto", sans-serif;
    font-size: 1rem;
    opacity: 0.7;
    margin: 0;
}

.layout {
    display: flex;
    flex-direction: column;
    align-items: center;

    max-width: 1000px;
    margin: auto;
    padding: 1rem;
    box-sizing: border-box;
}

.parole-page {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
    box-sizing: border-box;
    font-family: "Roboto", sans-serif;
}

.parole-page .layout {
    padding-left: 0;
    padding-right: 0;
    max-width: none;
}

.parole-page .game-page__title {
    margin: 0.5rem 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: #1a1a1a;
}

.parole-page .game-copy {
    max-width: 36rem;
    margin: 1.5rem auto 0;
    padding: 0 0.15rem 0.5rem;
    font-size: 0.95rem;
    line-height: 1.55;
}

.parole-page .game-copy__lead {
    margin: 0 0 0.75rem;
    color: #1a1a1a;
    font-size: 1rem;
    line-height: 1.5;
}

.parole-page .game-copy h2 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1a1a1a;
}

.parole-page .game-copy p {
    margin: 0 0 0.75rem;
    color: #555;
}

.parole-page .game-copy__links {
    margin: 0 0 0.75rem;
    padding-left: 1.15rem;
    color: #555;
}

.parole-page .game-copy__links li {
    margin-bottom: 0.4rem;
}

.parole-page .game-copy a {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.parole-page .game-copy a:hover {
    color: #333;
}

.parole-page .game-copy__faq {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.parole-page .game-copy__faq-item {
    padding: 0.75rem 0.9rem;
    background: #f7f7f5;
    border: 1px solid #e2e2de;
    border-radius: 10px;
}

.parole-page .game-copy__faq-item summary {
    cursor: pointer;
    font-weight: 600;
    color: #1a1a1a;
    font-size: 0.95rem;
}

.parole-page .game-copy__faq-item p {
    margin: 0.55rem 0 0.1rem;
    color: #555;
    font-size: 0.9rem;
}

@media (min-width: 640px) {
    .parole-page .game-page__title {
        font-size: 1.5rem;
    }
}

@media (min-width: 768px) {
    .puzzle-container {
        gap: 2rem;
    }
}

#message {
    font-size: clamp(1.5rem, 2.5vw, 2.5rem);
    font-family: "Roboto", sans-serif;
    font-weight: 700;
    color: #2e7d32;
    text-align: center;
    margin: 1rem 0;
    min-height: 1.5em;
}

/* =========================
   Site navigation
   ========================= */

.site-header {
    width: 100%;
    background-color: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid rgba(15, 47, 58, 0.1);
    backdrop-filter: blur(8px);
}

.site-nav {
    --nav-ink: #1a2e35;
    --nav-muted: #5a6b70;
    --nav-accent: #1a7a72;
    --nav-accent-soft: rgba(26, 122, 114, 0.1);

    max-width: 1100px;
    margin: 0 auto;
    padding: 0.75rem 1.25rem;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-nav__brand {
    flex-shrink: 0;
    text-decoration: none;
    color: var(--nav-ink);
    font-family: "Roboto", system-ui, sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-nav__brand:hover {
    color: var(--nav-accent);
}

.site-nav__links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.site-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--nav-muted);
    font-family: "Roboto", system-ui, sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav__link:hover {
    color: var(--nav-ink);
    background-color: rgba(15, 47, 58, 0.05);
    text-decoration: none;
}

.site-nav__link[aria-current="page"] {
    color: var(--nav-accent);
    background-color: var(--nav-accent-soft);
}

.site-nav__icon {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    display: block;
}

.site-nav__dropdown {
    position: relative;
}

.site-nav__dropdown-trigger {
    appearance: none;
    border: none;
    background: transparent;
    cursor: pointer;
    font: inherit;
}

.site-nav__dropdown-trigger[aria-current="true"] {
    color: var(--nav-accent);
    background-color: var(--nav-accent-soft);
}

.site-nav__dropdown-chevron {
    width: 0.65rem;
    height: 0.65rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.15s ease;
}

.site-nav__dropdown.is-open .site-nav__dropdown-chevron {
    transform: rotate(180deg);
}

.site-nav__dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 50%;
    transform: translateX(-50%);
    min-width: 9.5rem;
    padding: 0.3rem;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(26, 46, 53, 0.1);
    box-shadow: 0 8px 24px rgba(15, 47, 58, 0.12);
    z-index: 40;
}

.site-nav__dropdown-menu[hidden] {
    display: none;
}

.site-nav__dropdown-item {
    display: block;
    padding: 0.55rem 0.75rem;
    border-radius: 7px;
    text-decoration: none;
    color: var(--nav-muted);
    font-family: "Roboto", system-ui, sans-serif;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.site-nav__dropdown-item:hover {
    color: var(--nav-ink);
    background-color: rgba(15, 47, 58, 0.05);
    text-decoration: none;
}

.site-nav__dropdown-item[aria-current="page"] {
    color: var(--nav-accent);
    background-color: var(--nav-accent-soft);
}

@media (max-width: 640px) {
    .site-nav {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        padding: 0.65rem 0.85rem;
    }

    .site-nav__links {
        justify-content: space-between;
        gap: 0.15rem;
    }

    .site-nav__link {
        flex: 1;
        justify-content: center;
        padding: 0.5rem 0.35rem;
        font-size: 0.7rem;
        gap: 0.25rem;
        flex-direction: column;
    }

    .site-nav__dropdown {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .site-nav__dropdown-trigger {
        width: 100%;
    }

    .site-nav__dropdown-chevron {
        display: none;
    }

    .site-nav__dropdown-menu {
        left: 50%;
        right: auto;
        min-width: 8.5rem;
    }

    .site-nav__link span,
    .site-nav__dropdown-trigger span {
        display: none;
    }

    .site-nav__icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* =========================
   Card with Word Meaning
   ========================= */

   #wordModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;

    width: min(90vw, 400px);
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    text-align: center;
    font-family: "Roboto", sans-serif;
}

#wordModal.visible {
    display: block;
}

#wordModal p {
    margin: 0 0 0.75rem;
}

#wordModalText,
#wordModalTextEn {
    font-size: 1.4rem;
    font-weight: 700;
    text-transform: capitalize;
    color: #1a1a1a;
    margin-bottom: 0.5rem;
}

#wordModalTextEn:empty {
    display: none;
}

#wordModalMeaning,
#wordModalMeaningEn {
    font-size: 1rem;
    line-height: 1.5;
    color: #4a4a4a;
    margin-bottom: 1rem;
}

#wordModalContinue {
    border: 0;
    padding: 0.75rem 1.25rem;
    border-radius: 999px;
    background: #2e7d32;
    color: #ffffff;
    font: inherit;
    cursor: pointer;
}

#wordModalContinue:hover {
    background: #256428;
}

.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 99;
}

.modal-backdrop.visible {
    display: block;
}

/*  */
.daily-share {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;

    margin: 1.4rem auto 2.5rem;
    padding: 0 1rem;
}

.daily-share[hidden] {
    display: none;
}

.daily-share__button,
.daily-share__whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    box-sizing: border-box;
    line-height: 1;

    padding: 0.65rem 1.1rem;

    border-radius: 9px;
    border: 1px solid transparent;

    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;

    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.daily-share__button {
    background: #222;
    color: white;
}

.daily-share__whatsapp {
    border: 1px solid #25d366;
    background: white;
    color: #16883f;
}

.daily-share__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* =========================
   Completion modal
   ========================= */

.completion-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;

    width: min(90vw, 420px);
    padding: 2rem 1.5rem;
    background: white;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    text-align: center;
    font-family: "Roboto", sans-serif;
}

.completion-modal.visible {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.completion-modal__text {
    font-size: clamp(1.3rem, 2.5vw, 2rem);
    font-weight: 700;
    color: #2e7d32;
    margin: 0;
}

.completion-modal .daily-share {
    margin: 0;
    padding: 0;
}

.completion-modal__actions {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.completion-modal__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;

    padding: 0.65rem 1.1rem;
    border-radius: 9px;
    border: 1px solid transparent;

    font-family: "Roboto", sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}

.completion-modal__btn--home {
    background: #f0f0ee;
    color: #1a2e35;
    border-color: #d8d8d4;
}

.completion-modal__btn--home:hover {
    background: #e4e4e0;
}

.completion-modal__btn--next {
    background: #1a7a72;
    color: #fff;
    border: none;
}

.completion-modal__btn--next:hover {
    background: #15655f;
}