/* Caça-Palavras - Estilo Vektor Web */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #12122a;
    --bg-card: #1a1a3a;
    --gradient-main: linear-gradient(135deg, #00d4ff 0%, #00ff88 20%, #ffdd00 40%, #ff8800 60%, #ff0080 80%, #8000ff 100%);
    --color-cyan: #00d4ff;
    --color-green: #00ff88;
    --color-yellow: #ffd700;
    --color-orange: #ff8800;
    --color-red: #ff3366;
    --color-purple: #9b59b6;
    --text-primary: #ffffff;
    --text-secondary: #b0b0c0;
    --border-radius: 12px;
    --transition-fast: 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: var(--bg-primary); color: var(--text-primary); min-height: 100vh; line-height: 1.6; overflow-x: hidden; }

.game-container { min-height: calc(100vh - 70px); display: flex; flex-direction: column; }

.game-header {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem 2rem;
    background: linear-gradient(90deg, #1a1a3a 0%, #0d0d1a 50%, #1a1a3a 100%);
    border-bottom: 2px solid rgba(255, 215, 0, 0.3);
    gap: 1rem;
}

.stats-bar { display: flex; gap: 2rem; justify-content: center; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-label { font-size: 0.7rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 1px; }
.stat-value { font-size: 1.1rem; font-weight: 700; }
.stat-value.gold { background: linear-gradient(135deg, #ffd700, #ffaa00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-value.green { color: var(--color-green); }

.header-left { text-align: center; }
.header-left h1 {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
}

.game-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-secondary);
    flex-wrap: wrap;
}

.difficulty-select {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border: 2px solid rgba(255, 215, 0, 0.3);
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-fast);
}
.difficulty-select:hover { border-color: var(--color-cyan); }
.difficulty-select:focus { outline: none; border-color: var(--color-cyan); box-shadow: 0 0 15px rgba(0, 212, 255, 0.3); }

.game-board-wrapper {
    flex: 1;
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 2rem;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    flex-wrap: wrap;
}

.word-list {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid rgba(255, 215, 0, 0.2);
    min-width: 200px;
}
.word-list h3 { font-size: 0.9rem; color: var(--color-yellow); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 1rem; }
.word-item {
    padding: 0.5rem;
    margin: 0.25rem 0;
    border-radius: 6px;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-weight: 500;
}
.word-item.found {
    color: var(--color-green);
    background: rgba(0, 255, 136, 0.1);
    text-decoration: line-through;
}

.puzzle-grid {
    display: grid;
    gap: 2px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px;
    border-radius: 8px;
    border: 2px solid rgba(255, 215, 0, 0.2);
    touch-action: none;
    user-select: none;
}

.cell {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--bg-card);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
}
.cell:hover { background: #2a2d4a; }
.cell.selected { background: var(--color-cyan); color: #fff; transform: scale(1.1); }
.cell.found { background: var(--color-green); color: #fff; }
.cell.error { background: var(--color-red); animation: shake 0.3s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.btn { padding: 1rem 2rem; font-size: 1rem; font-weight: 700; border: none; border-radius: var(--border-radius); cursor: pointer; transition: all var(--transition-fast); text-transform: uppercase; letter-spacing: 2px; }
.btn-primary { background: var(--gradient-main); color: #fff; box-shadow: 0 4px 20px rgba(0, 212, 255, 0.4); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 30px rgba(0, 212, 255, 0.6); }

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s ease;
}
.modal-overlay.hidden { opacity: 0; pointer-events: none; }

.modal {
    background: transparent;
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 450px;
    width: 90%;
}
.modal h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.modal p { color: var(--text-primary); font-size: 1.2rem; margin-bottom: 2rem; }

@media (max-width: 768px) {
    .cell { width: 38px; height: 38px; font-size: 0.9rem; }
    .game-board-wrapper { flex-direction: column-reverse; align-items: center; }
    .word-list { width: 100%; max-width: 450px; }
    .puzzle-grid { width: 100%; overflow-x: auto; justify-content: center; touch-action: pan-x; }
}

@media (min-width: 601px) and (max-width: 1024px) {
    .game-header { padding: 0.75rem 1.5rem; }
    .header-left h1 { font-size: 1.5rem; }
    .stats-bar { gap: 1.5rem; }
    .cell { width: 42px; height: 42px; font-size: 1rem; }
    .game-controls { gap: 0.75rem; padding: 1rem; }
    .difficulty-select { padding: 0.6rem 1.2rem; font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .cell { width: 32px; height: 32px; font-size: 0.8rem; }
    .stats-bar { gap: 1rem; }
    .game-controls { gap: 0.5rem; padding: 0.75rem; }
    .difficulty-select { padding: 0.5rem 1rem; font-size: 0.8rem; }
}
