* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Roboto', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    user-select: none;
}

:root {
    --primary-color: var(--theme-color, #2196f3);
    --secondary-color: #2980b9;
    --background-color: #f5f7fa;
    --cell-border-color: #bdc3c7;
    --cell-bg-color: var(--empty-cell-color, #ffffff);
    --cell-selected-color: #e3f2fd;
    --cell-highlighted-color: #bbdefb;
    --cell-correct-color: #c8e6c9;
    --cell-incorrect-color: #ff8a80;
    --text-color: #2c3e50;
    --clue-hover-color: #ecf0f1;
    --clue-active-color: #d6eaf8;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    background-size: 100% auto;
    background-repeat: no-repeat;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-color);
}

h1 {
    color: var(--keyword-color);
}

.timer {
    font-size: 0.7rem;
    font-weight: bold;
    position: absolute;
    left: 0;
    bottom: 0;
    transform: translateY(110%);
    opacity: 0.5;
}

.puzzle-header {
    margin: 0 0 30px 0;
    padding: 20px;
    background-color: rgb(255 255 255 / 40%);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.puzzle-title {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 10px;
    font-weight: bold;
}

.puzzle-subtitle {
    color: var(--text-color);
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

.game-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

@media (min-width: 768px) {
    .game-container {
        flex-direction: row;
    }
    
    .clues-container {
        flex: 1;
    }
}

.crossword-container {
    position: relative;
}

.crossword-grid {
    display: grid;
    gap: 1px;
    max-width: 800px;
    margin: 0 auto;
    overflow: auto;
}

.cell {
    background-color: var(--cell-bg-color);
    position: relative;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cell.black {
    background-color: var(--black-cell-color);
    cursor: default;
}

.cell.selected {
    background-color: var(--cell-selected-color);
}

.cell.highlighted {
    background-color: var(--cell-highlighted-color);
}

.cell.correct {
    background-color: var(--cell-correct-color);
}

.cell.incorrect {
    background-color: var(--cell-incorrect-color);
    transition: background-color 0.3s ease;
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.7rem;
    color: var(--text-color);
}

.cell-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    caret-color: transparent;
}

.cell-input:focus {
    outline: none;
}

.key-letter {
    position: relative;
}

.key-letter::after {
    content: attr(data-key-index);
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.75;
}

.clues {
    background-color: white;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: 100%;
    position: relative;
}

.clues h2 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.clues-tabs {
    display: flex;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.tab-btn {
    padding: 8px 15px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-color);
    opacity: 0.7;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.clue-list {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 80px;
}

.clue-item {
    padding: 10px;
    margin-bottom: 5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.clue-item:hover {
    background-color: var(--clue-hover-color);
}

.clue-item.active {
    background-color: var(--clue-active-color);
    font-weight: bold;
}

.clue-number {
    color: var(--primary-color);
    font-weight: bold;
    margin-right: 5px;
}

.hidden {
    display: none !important;
}

.key-word-container {
    margin: 30px 0;
    text-align: center;
}

.key-word {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 15px;
    flex-wrap: wrap;
    max-width: 100%;
    padding: 0 10px;
}

.key-letter-box {
    width: 50px;
    height: 50px;
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    background-color: white;
    position: relative;
    cursor: pointer;
    margin-bottom: 5px;
}

.key-letter-box::after {
    content: attr(data-key-index);
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0.75;
}

.key-letter-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    text-transform: uppercase;
    padding: 0;
    caret-color: transparent;
    cursor: pointer;
}

.key-letter-input:focus {
    outline: none;
    background-color: var(--cell-selected-color);
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.btn {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: var(--secondary-color);
}

.message {
    text-align: center;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
    font-weight: bold;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
}

.message.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
}

.modal-content {
    background-color: #fff;
    padding: 0;
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
    position: relative;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.modal-header {
    position: sticky;
    top: 0;
    padding: 1rem 1rem 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    z-index: 5;
}

.modal-body {
    padding: 1rem 2rem 2rem 2rem;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.btn-secondary {
    background-color: #9e9e9e;
}

.btn-secondary:hover {
    background-color: #757575;
}

.close {
    font-size: 24px;
    cursor: pointer;
    background: none;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: auto;
}

.close:hover {
    color: #333;
    background-color: rgba(240, 240, 240, 0.9);
}

footer {
    text-align: center;
    margin-top: 50px;
    padding: 20px;
    color: #7f8c8d;
}

/* Consolidating mobile media queries */
@media (max-width: 767px) {
    .container {
        padding: 0.5rem;
    }
    
    header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .crossword-grid {
        max-width: 100%;
    }
    
    .cell {
        font-size: 1rem;
    }
    
    .controls {
        flex-wrap: wrap;
    }
    
    .btn {
        flex: 1;
        min-width: 120px;
    }
    
    .modal {
        align-items: center;
        padding: 10px;
    }
    
    .modal-content {
        max-height: 85vh;
        width: 95%;
        margin: 0;
    }
    
    .modal-body {
        padding: 1rem 1.5rem 1.5rem 1.5rem;
    }
    
    .mobile-footer-image {
        display: block!important;
    }
    
    .header-image[data-style="space"] {
        height: var(--header-height-mobile, 150px);
    }
    
    .header-image h1 {
        display: none;
    }
}

@media (max-width: 480px) {
    
    .key-word {
        gap: 4px;
    }
    
    .modal-content {
        padding: 0;
        max-height: 90vh;
    }
    
    .modal-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem;
    }
    
    .modal-body {
        padding: 0.75rem 1rem 1rem 1rem;
    }
    
    .winner-form .form-group {
        margin-bottom: 10px;
    }
}

.cell.active-cell {
    background: var(--primary-color) !important;
}

.key-letter-box.active-key-letter {
    background: var(--primary-color);
}

.winner-form {
    margin: 1.5rem 0;
    text-align: left;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.form-message {
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 4px;
}

.form-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.btn:disabled,
.form-group input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

.btn:disabled:hover {
    background-color: var(--primary-color);
}

/* Header Styles */
.header-default {
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 2rem;
    color: white;
}

.header-image {
    position: relative;
    width: 100%;
    margin: 0;
    border: none;
}

.header-image[data-style="space"] {
    height: var(--header-height-desktop, 200px);
}

.header-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: none;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 1rem;
}

.header-image h1 {
    display: none;
}

.header-image .timer {
    margin: 0;
    font-size: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

/* Mobile Footer Image */
.mobile-footer-image {
    display: none;
    width: 100%;
    margin-top: 30px;
}

.mobile-footer-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* The following media queries are now consolidated in the main mobile media query section */
/* @media (max-width: 767px) {
    .mobile-footer-image {
        display: block;
    }
}

@media (max-width: 767px) {
    .header-image[data-style="space"] {
        height: var(--header-height-mobile, 150px);
    }
} */

/* Mobil cihazlar için anahtar kelime kutuları boyutunu ayarla */
@media (max-width: 480px) {
    .key-letter-box {
        width: 42px;
        height: 42px;
        font-size: 1rem;
    }
    
    .key-word {
        gap: 4px;
    }
    
    .modal-content {
        padding: 1rem;
        max-height: 90vh;
    }
    
    .winner-form .form-group {
        margin-bottom: 10px;
    }
}

/* Çok küçük ekranlar için daha da küçült */
@media (max-width: 360px) {
    .key-letter-box {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    
    .key-word {
        gap: 3px;
    }
} 