.main-content-wrapper {
    padding: 40px 20px;
}

h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-top: 2rem;
    color: var(--c-primary);
    text-shadow: none;
}

.subtitle {
    text-align: center;
    margin-bottom: 30px;
    color: var(--c-text-sub);
    font-size: 1.1rem;
}

.eco-notice {
    background: white;
    padding: 15px;
    border: 2px dashed var(--c-accent);
    border-radius: var(--radius-card);
    text-align: center;
    margin-bottom: 25px;
    color: var(--c-text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.instructions {
    margin-bottom: 30px;
    background: white;
    padding: 30px;
    border-radius: var(--radius-card);
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.instructions h3 {
    color: var(--c-primary);
}

.game-area {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.grid-container {
    flex: 1;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 0px;
    margin-bottom: 20px;
    user-select: none;
    justify-content: center;
    max-width: 525px;
    width: 100%;
    margin: 0 auto 20px auto;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    border: 2px solid var(--c-primary);
}

.cell {
    aspect-ratio: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
    color: var(--c-text-main);
    font-family: var(--font-display);
}

.cell:hover {
    background: var(--c-bg);
    color: var(--c-primary);
}

.cell.selected {
    background: var(--c-accent);
    color: white;
    border-color: var(--c-accent);
}

.cell.found {
    background: var(--c-primary);
    color: white;
    border-color: var(--c-primary);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% {
        transform: scale(0.8);
        opacity: 0.5;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.words-list {
    min-width: 220px;
    background: white;
    padding: 20px;
    border-radius: var(--radius-card);
    box-shadow: none;
    border: 1px solid #e2e8f0;
}

.word-item {
    background: var(--c-bg);
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    transition: all 0.2s;
    color: var(--c-text-sub);
}

.word-item:hover {
    background: white;
    border-color: var(--c-accent);
    color: var(--c-accent);
}

.word-item.found {
    background: var(--c-primary);
    color: white;
    text-decoration: none;
    opacity: 0.8;
}

.progress {
    text-align: center;
    margin-top: 20px;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--c-primary-dark);
}

.celebration {
    text-align: center;
    color: var(--c-primary);
    font-size: 1.4rem;
    margin-top: 20px;
    font-weight: 800;
    display: none;
}

@media (max-width: 768px) {
    .game-area {
        flex-direction: column;
        gap: 20px;
    }

    .cell {
        font-size: 14px;
    }

    .word-grid {
        gap: 0px;
    }
}

@media (max-width: 480px) {
    .grid-container {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        scrollbar-width: thin;
        scrollbar-color: var(--c-primary) #e2e8f0;
    }

    .grid-container::-webkit-scrollbar {
        height: 8px;
    }

    .grid-container::-webkit-scrollbar-track {
        background: #e2e8f0;
        border-radius: 4px;
    }

    .grid-container::-webkit-scrollbar-thumb {
        background: var(--c-primary);
        border-radius: 4px;
    }

    .word-grid {
        width: max-content;
        min-width: 100%;
        max-width: none;
        grid-template-columns: repeat(15, minmax(28px, 1fr));
    }

    .cell {
        font-size: 14px;
        min-width: 28px;
        min-height: 28px;
    }
}

@media print {
    @page {
        margin: 1cm;
        size: A4 portrait;
    }

    body {
        padding: 0;
        background: white;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    nav,
    footer,
    .no-print,
    .eco-notice,
    .progress,
    .celebration,
    .subtitle a {
        display: none !important;
    }

    .main-content-wrapper {
        padding: 0;
    }

    .container {
        max-width: 100%;
        width: 100%;
        margin: 0;
    }

    h1 {
        font-size: 24pt;
        margin-bottom: 15px;
        color: black;
        margin-top: 0;
        text-align: left;
    }

    .subtitle {
        display: none;
    }

    .instructions {
        margin-bottom: 25px;
        border: 2px solid #000;
        padding: 15px;
        border-radius: 8px;
        background: none;
        box-shadow: none;
    }

    .instructions h3 {
        font-size: 14pt;
        margin-bottom: 5px;
        color: black;
        margin-top: 0;
    }

    .instructions ul {
        padding-left: 20px;
        margin: 0;
    }

    .instructions li {
        margin-bottom: 2px;
        font-size: 11pt;
        color: black;
    }

    .game-area {
        display: block;

        page-break-inside: avoid;
    }


    .game-area {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 20px;
    }

    .grid-container {
        width: 65%;

        flex: 0 0 65%;
    }

    .word-grid {
        width: 100%;
        max-width: none;
        margin: 0;
        border: 2px solid #000;
        box-shadow: none;
        background: none;

        grid-template-columns: repeat(15, 1fr);
        display: grid;
        aspect-ratio: 1;

    }

    .cell {
        border: 1px solid #000;
        color: black !important;
        background: white !important;
        font-size: 11pt;

        font-weight: bold;
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: 1;
        padding: 0;

        min-width: 0;
    }

    .words-list {
        width: 30%;
        flex: 0 0 30%;
        background: none;
        box-shadow: none;
        padding: 0;
        border: none;
    }

    .words-list h3 {
        font-size: 16pt;
        margin-top: 0;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
        margin-bottom: 10px;
        color: black;
    }

    #wordsList {
        display: block;
        column-count: 1;
    }

    .word-item {
        border: none;
        padding: 3px 0;
        margin: 0;
        background: transparent;
        font-size: 11pt;
        color: #000;
        border-bottom: 1px dashed #999;
        font-weight: normal;
    }
}