/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Page Layout with Ads */
.page-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    background: white;
}

/* Ad Sidebars */
.ad-sidebar {
    width: 160px;
    background: #f8f9fa;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 10px;
    position: sticky;
    top: 0;
}

.ad-left {
    border-right: 1px solid #e0e0e0;
}

.ad-right {
    border-left: 1px solid #e0e0e0;
}

.ad-container {
    width: 100%;
    max-width: 160px;
    min-height: 600px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
}

.ad-container:empty::before {
    content: "Ad Space";
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    padding: 10px 20px;
    max-width: 600px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.date {
    font-size: 1.54rem;
    color: #666;
    font-weight: 500;
    margin-bottom: 10px;
}

.score-container {
    background: white;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.score-label {
    color: #666;
    font-size: 0.9rem;
}

.score-value {
    color: #2196f3;
    font-size: 1.2rem;
    font-weight: 700;
}

.score-best {
    color: #999;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Crossword Grid */
.crossword-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

.grid-container {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.crossword-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    gap: 2px;
    background-color: #333;
    padding: 2px;
    border-radius: 8px;
}

.cell-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
}

.cell {
    width: 100%;
    height: 100%;
    background-color: white;
    border: none;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    padding-top: 8px; /* Make room for the number */
    /* Prevent zoom on mobile */
    font-size: 16px; /* Minimum font size to prevent iOS zoom */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.cell:focus {
    outline: none;
    background-color: #e3f2fd;
    box-shadow: 0 0 0 2px #2196f3;
}

.cell:hover {
    background-color: #f0f0f0;
}

.cell.unused {
    background-color: #e0e0e0;
    cursor: default;
    color: #999;
}

.cell.unused:hover {
    background-color: #e0e0e0;
}

.cell.correct {
    background-color: #4caf50;
    color: white;
}

.cell.incorrect {
    background-color: #f44336;
    color: white;
}

.cell.locked {
    background-color: #4caf50 !important;
    color: white !important;
    cursor: default;
    font-weight: 700;
}

.cell.locked:hover {
    background-color: #4caf50 !important;
    transform: none;
}

.cell.locked.highlighted {
    background-color: #4caf50 !important;
    color: white !important;
}

.cell.locked.active {
    background-color: #4caf50 !important;
    color: white !important;
    box-shadow: none !important;
}

.cell.highlighted {
    background-color: #fff3e0;
}

.cell.active {
    background-color: #e3f2fd;
    box-shadow: 0 0 0 2px #2196f3;
}

/* Cell numbers */
.cell-number {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #666;
    z-index: 1;
    pointer-events: none;
}

/* Controls */
.controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.instruction {
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    margin: 15px 0;
    font-style: italic;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: #2196f3;
    color: white;
}

.btn-primary:hover {
    background-color: #1976d2;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f5f5f5;
    color: #333;
    border: 2px solid #ddd;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
    transform: translateY(-1px);
}

/* Clues */
.clues-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.clues-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.clue-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    margin-bottom: 10px;
}

.clue-item:hover {
    background-color: #f5f5f5;
}

.clue-item.active {
    background-color: #e3f2fd;
    border-left: 4px solid #2196f3;
}

.clue-item.revealed {
    background-color: #d4edda;
    border-left: 4px solid #28a745;
}

.clue-number {
    font-weight: 700;
    color: #2196f3;
    min-width: 20px;
}

.clue-text {
    flex: 1;
    line-height: 1.4;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    margin: 0 auto;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    animation: modalSlideIn 0.3s ease;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-content h2 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #4caf50;
}

.modal-content p {
    margin-bottom: 25px;
    color: #666;
}

/* Clue Popup */
.clue-popup {
    display: none;
    position: fixed;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    max-width: 300px;
    min-width: 200px;
    animation: popupSlideIn 0.2s ease;
}

.clue-popup-content {
    padding: 15px;
    position: relative;
}

.clue-popup-number {
    font-weight: 700;
    color: #2196f3;
    margin-right: 8px;
}

.clue-popup-direction {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
    margin-right: 8px;
}

.clue-popup-text {
    color: #333;
    line-height: 1.4;
    display: block;
    margin-top: 5px;
}

.clue-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.clue-popup-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Header */
.main-header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin: 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    height: 70px;
}

.header-left {
    display: flex;
    align-items: center;
}

.header-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.header-nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #2196f3;
}

.nav-link.active {
    color: #2196f3;
    border-bottom-color: #2196f3;
}

.header-right {
    display: flex;
    align-items: center;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

.guest-view {
    display: flex;
    gap: 10px;
}

.user-view {
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.username {
    font-weight: 600;
    color: #333;
}

/* Button Styles */
.btn-outline {
    background: transparent;
    color: #2196f3;
    border: 2px solid #2196f3;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background: #2196f3;
    color: white;
}

/* Puzzle Header */
.puzzle-header {
    text-align: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

/* Auth Modal */
.auth-modal {
    max-width: 400px;
    padding: 0;
    overflow: hidden;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
}

.auth-tab {
    flex: 1;
    padding: 15px;
    background: none;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.auth-tab.active {
    color: #2196f3;
    border-bottom: 2px solid #2196f3;
}

.auth-form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #2196f3;
}

.auth-error {
    color: #f44336;
    font-size: 0.9rem;
    margin-top: 10px;
    min-height: 20px;
}

/* Mobile responsiveness */
/* Mobile Ad Layout - Hidden by default on desktop */
.mobile-ad-top {
    display: none;
    width: 100%;
    background: #f8f9fa;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    margin: 0;
}

.mobile-ad-bottom {
    display: none;
    width: 100%;
    background: #f8f9fa;
    padding: 15px;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

.mobile-ad-container {
    width: 100%;
    max-width: 320px;
    min-height: 100px;
    background: #f0f0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    margin: 0 auto;
}

.mobile-ad-container:empty::before {
    content: "Mobile Ad";
}

@media (max-width: 1200px) {
    .ad-sidebar {
        width: 120px;
    }
    
    .ad-container {
        max-width: 120px;
        min-height: 400px;
    }
}

@media (max-width: 1400px) {
    body {
        background-color: white;
        max-width: 100vw;
        width: 100vw;
        margin: 0;
        padding: 0;
    }
    
    .page-layout {
        flex-direction: column;
        max-width: 100%;
        width: 100%;
        margin: 0;
        background: white;
    }
    
    .ad-sidebar {
        display: none;
    }
    
    /* Mobile Ad Layout */
    .mobile-ad-top {
        display: block;
        width: 100%;
        background: #f8f9fa;
        padding: 5px 10px;
        border-bottom: 1px solid #e0e0e0;
        margin: 0;
    }
    
    .mobile-ad-bottom {
        display: block;
        width: 100%;
        background: #f8f9fa;
        padding: 10px;
        border-top: 1px solid #e0e0e0;
        margin-top: 10px;
    }
    
    .mobile-ad-container {
        width: 100%;
        max-width: 320px;
        min-height: 80px;
        background: #f0f0f0;
        border-radius: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #999;
        font-size: 0.9rem;
        text-align: center;
        padding: 10px;
        margin: 0 auto;
    }
    
    .mobile-ad-container:empty::before {
        content: "Mobile Ad";
    }
    
    .main-content {
        width: 100%;
        padding: 0;
        max-width: 100%;
        margin: 0;
    }
    
    /* Mobile Header */
    .main-header {
        margin: 0;
        padding: 0;
    }
    
    .header-container {
        padding: 0 10px;
        height: 50px;
    }
    
    .header-logo {
        font-size: 1.5rem;
    }
    
    .header-nav {
        display: none;
    }
    
    .guest-view {
        gap: 8px;
    }
    
    .btn-outline, .btn-primary {
        padding: 6px 12px;
        font-size: 0.9rem;
    }
    
    /* Puzzle Header */
    .puzzle-header {
        text-align: center;
        margin-bottom: 10px;
        padding-top: 5px;
    }
    
    h1 {
        font-size: 1.8rem;
        margin-bottom: 5px;
    }
    
    .date {
        font-size: 1.4rem;
        margin-bottom: 5px;
    }
    
    .score-container {
        padding: 8px 15px;
        font-size: 1rem;
        border-radius: 20px;
        margin: 10px 0;
    }
    
    .score-value {
        font-size: 1.2rem;
    }
    
    .score-label,
    .score-best {
        font-size: 0.9rem;
    }
    
    .crossword-container {
        padding: 10px;
        max-width: 400px;
        width: 100%;
        margin: 0 auto 15px auto;
        border-radius: 8px;
    }
    
    .grid-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .crossword-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 2px;
        background-color: #333;
        padding: 2px;
        border-radius: 8px;
        width: 100%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 1;
    }
    
    .cell-wrapper {
        width: 100%;
        height: 100%;
        aspect-ratio: 1;
    }
    
    .cell {
        width: 100%;
        height: 100%;
        font-size: 16px;
        min-height: 16px;
        min-width: 16px;
        padding: 0;
        margin: 0;
        border: none;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: white;
        color: #333;
        touch-action: manipulation;
        -webkit-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
    
    .cell:focus {
        background-color: #e3f2fd;
        box-shadow: 0 0 0 2px #2196f3;
    }
    
    .cell.highlighted {
        background-color: #fff3e0;
    }
    
    .cell.active {
        background-color: #e3f2fd;
        box-shadow: 0 0 0 2px #2196f3;
    }
    
    .cell.locked {
        background-color: #4caf50;
        color: white;
    }
    
    .cell.correct {
        background-color: #4caf50;
        color: white;
    }
    
    .cell.incorrect {
        background-color: #f44336;
        color: white;
    }
    
    .cell.unused {
        background-color: #e0e0e0;
        color: #999;
    }
    
    .clues-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px;
        max-width: 400px;
        width: 100%;
        margin: 0 auto;
        border-radius: 8px;
    }
    
    .clues-section h3 {
        font-size: 1.3rem;
        margin-bottom: 10px;
        padding-bottom: 5px;
    }
    
    .clue-item {
        padding: 8px;
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .clue-number {
        font-size: 1rem;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 10px;
    }
    
    .instruction {
        text-align: center;
        color: #666;
        font-size: 0.8rem;
        margin: 10px 0;
        font-style: italic;
    }
    
    .btn {
        width: 100%;
        max-width: 250px;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px 15px;
        max-width: 90%;
        max-height: 80vh;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
    }
    
    .modal-content p {
        font-size: 1rem;
    }
    
    .modal-actions .btn {
        margin: 5px;
        padding: 10px 15px;
        font-size: 1rem;
    }
    
    /* Mobile Auth Modal */
    .auth-modal {
        max-width: 95%;
        margin: 5% auto;
    }
    
    .auth-tab {
        padding: 10px;
        font-size: 1rem;
    }
    
    .auth-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 1rem;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 10px;
        font-size: 16px;
        border-radius: 6px;
    }
    
    .auth-error {
        font-size: 0.9rem;
        margin-top: 8px;
    }
    
    /* Mobile Close Button */
    .close {
        right: 8px;
        top: 8px;
        font-size: 20px;
        width: 30px;
        height: 30px;
    }
}

/* Prevent zoom on all inputs globally */
input[type="text"], input[type="email"], input[type="password"], textarea, select {
    font-size: 16px !important;
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    touch-action: manipulation !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

/* Additional zoom prevention for the body */
html, body {
    -webkit-text-size-adjust: 100% !important;
    -ms-text-size-adjust: 100% !important;
    text-size-adjust: 100% !important;
    touch-action: manipulation !important;
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

/* Mobile-specific zoom prevention */
@media screen and (max-width: 1400px) {
    html, body {
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        touch-action: manipulation !important;
        overflow-x: hidden !important;
        max-width: 100vw !important;
        width: 100vw !important;
    }
    
    input, textarea, select {
        font-size: 16px !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        touch-action: manipulation !important;
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
    }
    
    * {
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        touch-action: manipulation !important;
    }
}

/* Actual Mobile Devices - Larger UI Elements */
@media screen and (max-width: 768px) {
    html, body {
        background-color: white !important;
        max-width: 100vw !important;
        width: 100vw !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 18px !important;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        overflow-x: hidden !important;
    }
    
    .page-layout {
        flex-direction: column;
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        background: white !important;
        padding: 0 !important;
    }
    
    .ad-sidebar {
        display: none !important;
    }
    
    /* Mobile Ad Layout */
    .mobile-ad-top {
        display: block !important;
        width: 100% !important;
        background: #f8f9fa !important;
        padding: 5px 10px !important;
        border-bottom: 1px solid #e0e0e0 !important;
        margin: 0 !important;
    }
    
    .mobile-ad-bottom {
        display: block !important;
        width: 100% !important;
        background: #f8f9fa !important;
        padding: 10px !important;
        border-top: 1px solid #e0e0e0 !important;
        margin-top: 10px !important;
    }
    
    .main-content {
        width: 100% !important;
        padding: 0 !important;
        max-width: 100% !important;
        margin: 0 !important;
        background: white !important;
    }
    
    /* Mobile Header */
    .main-header {
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }
    
    .header-container {
        padding: 5px 15px !important;
        height: 60px !important;
        background: white !important;
    }
    
    .header-logo {
        font-size: 1.8rem !important;
    }
    
    .header-nav {
        display: none !important;
    }
    
    .guest-view {
        gap: 4px !important;
    }
    
    .btn-outline, .btn-primary {
        padding: 4px 8px !important; margin-top: 2px !important;
        font-size: 0.8rem !important;
    }
    
    /* Puzzle Header */
    .puzzle-header {
        text-align: center;
        margin-bottom: 10px !important;
        padding-top: 5px !important;
        background: white !important;
    }
    
    h1 {
        font-size: 1.8rem !important;
        margin-bottom: 5px !important;
    }
    
    .date {
        font-size: 1.12rem !important;
        margin-bottom: 5px !important;
    }
    
    .score-container {
        padding: 8px 15px !important;
        font-size: 0.8rem !important;
        border-radius: 20px !important;
        margin: 10px 0 !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .score-value {
        font-size: 1.2rem !important;
    }
    
    .score-label,
    .score-best {
        font-size: 0.8rem !important;
    }
    
    .crossword-container {
        padding: 10px !important;
        max-width: 400px !important;
        width: 100% !important;
        margin: 0 auto 15px auto !important;
        border-radius: 8px !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .grid-container {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 10px !important;
        background: transparent !important;
    }
    
    .crossword-grid {
        display: grid;
        grid-template-columns: repeat(8, 1fr);
        grid-template-rows: repeat(8, 1fr);
        gap: 2px;
        background-color: #333;
        padding: 2px;
        border-radius: 8px;
        width: 100% !important;
        max-width: 350px !important;
        height: auto;
        aspect-ratio: 1;
    }
    
    .cell-wrapper {
        width: 100%;
        height: 100%;
        aspect-ratio: 1;
    }
    
    .cell {
        width: 100%;
        height: 100%;
        font-size: 18px !important;
        min-height: 18px;
        min-width: 18px;
        padding: 0;
        margin: 0;
        border: none;
        outline: none;
        -webkit-appearance: none;
        -moz-appearance: none;
        appearance: none;
        background-color: white;
        color: #333;
        touch-action: manipulation;
        -webkit-text-size-adjust: 100% !important;
        -ms-text-size-adjust: 100% !important;
        text-size-adjust: 100% !important;
        font-weight: 600;
    }
    
    .cell:focus {
        background-color: #e3f2fd;
        box-shadow: 0 0 0 2px #2196f3;
    }
    
    .cell.highlighted {
        background-color: #fff3e0;
    }
    
    .cell.active {
        background-color: #e3f2fd;
        box-shadow: 0 0 0 2px #2196f3;
    }
    
    .cell.locked {
        background-color: #4caf50;
        color: white;
    }
    
    .cell.correct {
        background-color: #4caf50;
        color: white;
    }
    
    .cell.incorrect {
        background-color: #f44336;
        color: white;
    }
    
    .cell.unused {
        background-color: #e0e0e0;
        color: #999;
    }
    
    .cell-number {
        font-size: 0.8rem !important;
        top: 2px;
        left: 2px;
    }
    
    .clues-container {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 10px !important;
        max-width: 400px !important;
        width: 100% !important;
        margin: 0 auto !important;
        border-radius: 8px !important;
        background: white !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    }
    
    .clues-section h3 {
        font-size: 1.3rem !important;
        margin-bottom: 10px !important;
        padding-bottom: 5px !important;
    }
    
    .clue-item {
        padding: 8px !important;
        font-size: 0.8rem !important;
        margin-bottom: 5px !important;
        line-height: 1.4 !important;
    }
    
    .clue-number {
        font-size: 0.8rem !important;
    }
    
    .controls {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        margin-top: 10px !important;
        background: transparent !important;
    }
    
    .instruction {
        text-align: center;
        color: #666;
        font-size: 0.8rem;
        margin: 10px 0;
        font-style: italic;
    }
    
    .btn {
        width: 100% !important;
        max-width: 250px !important;
        padding: 12px 20px !important;
        font-size: 0.8rem !important;
        border-radius: 8px !important;
    }
    
    .modal-content {
        margin: 5% auto;
        padding: 20px 15px;
        max-width: 90%;
        max-height: 80vh;
        border-radius: 12px;
        background: white !important;
    }
    
    .modal-content h2 {
        font-size: 1.5rem !important;
    }
    
    .modal-content p {
        font-size: 0.8rem !important;
        line-height: 1.4;
    }
    
    .modal-actions .btn {
        margin: 5px;
        padding: 10px 15px;
        font-size: 0.8rem !important;
    }
    
    /* Mobile Auth Modal */
    .auth-modal {
        max-width: 95%;
        margin: 5% auto;
        border-radius: 12px;
        background: white !important;
    }
    
    .auth-tab {
        padding: 12px;
        font-size: 0.8rem !important;
    }
    
    .auth-form {
        padding: 15px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    .form-group label {
        font-size: 0.8rem !important;
        margin-bottom: 5px;
    }
    
    .form-group input {
        padding: 12px;
        font-size: 16px !important;
        border-radius: 6px;
    }
    
    .auth-error {
        font-size: 0.8rem !important;
        margin-top: 8px;
    }
    
    /* Mobile Close Button */
    .close {
        right: 10px;
        top: 10px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }
    
    /* Remove all other backgrounds and constraints */
    main {
        background: white !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    * {
        box-sizing: border-box !important;
    }
} 