:root {
    --primary-color: #013819; /* Verde escuro do site */
    --secondary-color: #FFD700; /* Amarelo da logo */
    --bg-color: #FAFAFA;
    --text-color: #404040;
    --heading-font: 'Oswald', sans-serif;
    --body-font: 'Source Sans Pro', sans-serif;
    --white: #FFFFFF;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: var(--primary-color);
    color: var(--secondary-color);
    padding: 20px 0;
    text-align: center;
}

.logo {
    max-width: 200px;
    margin-bottom: 10px;
}

h1, h2, h3 {
    font-family: var(--heading-font);
    text-transform: uppercase;
}

h1 { font-size: 2rem; }
h2 { color: var(--primary-color); margin: 20px 0; }

.game-menu {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 15px;
    font-family: var(--heading-font);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

button:hover {
    background-color: #025a29;
}

.back-btn {
    margin-top: 30px;
    background-color: #666;
    width: 100%;
}

/* Crossword Styles - NYT Style */
#crossword-container {
    display: grid;
    grid-template-columns: repeat(15, 1fr);
    gap: 1px;
    background: #333;
    border: 1px solid #333;
    margin: 20px auto;
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    overflow: auto;
}

.cw-cell {
    aspect-ratio: 1;
    background: #333;
    position: relative;
}

.cw-cell.white { background: white; }

.cw-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: clamp(10px, 3vw, 18px);
    text-transform: uppercase;
    font-weight: bold;
    background: transparent;
    padding: 0;
    appearance: none;
    border-radius: 0;
}

.cw-cell .num {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: 0.6rem;
    color: #666;
    pointer-events: none;
}

.cw-cell.correct { background: #e2f3e5; }
.cw-cell.selected { background: #fff9c4; }

.clues {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 20px;
    text-align: left;
}

@media (min-width: 600px) {
    .clues { grid-template-columns: 1fr 1fr; }
}

.clue-list h3 { font-size: 1rem; margin-bottom: 10px; border-bottom: 2px solid var(--primary-color); }
.clue-list div { margin-bottom: 5px; font-size: 0.9rem; }

/* Sudoku Styles */
#sudoku-container {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #333;
    border: 3px solid #333;
    margin: 20px auto;
    max-width: 450px;
    overflow: auto;
}

.sd-cell {
    aspect-ratio: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sd-cell input {
    width: 100%;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.sd-cell.readonly { background: #f0f0f0; }
.sd-cell.readonly input { color: #000; }

/* Thick borders for 3x3 blocks */
.sd-cell:nth-child(3n) { border-right: 2px solid #333; }
.sd-cell:nth-child(9n) { border-right: none; }
.sd-cell:nth-child(n+19):nth-child(-n+27),
.sd-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid #333; }

.sudoku-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 10px;
}

.sudoku-controls button {
    flex: 1;
    max-width: 150px;
}

/* Wordsearch Styles */
.wordsearch-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 2px;
    background: #ccc;
    margin: 20px 0;
}

.ws-cell {
    aspect-ratio: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    touch-action: none; /* Previne scroll ao arrastar no jogo */
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    transition: background 0.1s;
}

.ws-cell.selected { background: var(--secondary-color); color: var(--primary-color); }
.ws-cell.found { background: #90EE90; color: #013819; }

.wordsearch-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1px;
    background: #333;
    border: 2px solid #333;
    margin: 20px 0;
    touch-action: none;
}

#word-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.word-item {
    padding: 5px 10px;
    background: #eee;
    border-radius: 3px;
}

.word-item.found {
    text-decoration: line-through;
    color: #999;
}

/* Quiz Styles */
.option-btn {
    display: block;
    width: 100%;
    text-align: left;
    margin-bottom: 10px;
    background: white;
    color: var(--text-color);
    border: 2px solid var(--primary-color);
    padding: 15px;
}

.option-btn:hover {
    background: #f0f0f0;
}

#quiz-result {
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    margin-top: 20px;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .crossword-grid { grid-template-columns: repeat(15, 1fr); }
    .cell input { font-size: 0.8rem; }
    .wordsearch-grid { grid-template-columns: repeat(10, 1fr); }
}
