/* ========== Mobile Responsive Styles ========== */

/* Large screens (desktop) */
@media (min-width: 1200px) {
    .container {
        max-width: 540px;
    }
    
    .sudoku-grid {
        max-width: 500px;
    }
}

/* Medium screens (tablets) */
@media (max-width: 768px) {
    .app-wrapper {
        padding: 5px;
    }
    
    .container {
        width: 95%;
        max-width: 500px;
        padding: 15px;
        border-radius: 20px;
    }
    
    .top-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 10px;
    }
    
    .logo-section {
        transform: scale(0.9);
    }
    
    .title {
        font-size: 2em;
    }
    
    .tagline {
        font-size: 0.8em;
    }
    
    /* Menu bar adjustments */
    .menu-bar {
        font-size: 0.85em;
    }
    
    .league-btn {
        padding: 8px 12px;
        font-size: 0.85em;
    }
    
    .stats-stack {
        font-size: 0.75em;
        padding: 5px 10px;
    }
    
    /* Sudoku grid adjustments */
    .sudoku-grid {
        padding: 6px;
        gap: 1.5px;
    }
    
    .sudoku-cell {
        font-size: 1em;
        min-height: 35px;
    }
    
    /* Game layout adjustments */
    .game-layout {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        padding: 10px;
    }
    
    .baseball-diamond {
        width: 120px;
        height: 120px;
    }
    
    .baseball-diamond img {
        width: 120px;
        height: 120px;
    }
    
    .position-btn {
        width: 50px;
        height: 50px;
        font-size: 0.85em;
        padding: 10px;
    }
    
    /* Status bar adjustments */
    .game-status-bar {
        padding: 6px 10px;
    }
    
    .status-bar-item {
        gap: 4px;
    }
    
    .status-icon {
        font-size: 1em;
    }
    
    .status-value {
        font-size: 0.9em;
    }
}

/* Small screens (mobile phones) */
@media (max-width: 480px) {
    body {
        background-attachment: scroll;
    }
    
    .container {
        width: 98%;
        padding: 10px;
        border-radius: 15px;
    }
    
    /* Hide decorative elements */
    .app-wrapper::before {
        display: none;
    }
    
    /* Logo and title adjustments */
    .logo-section {
        transform: scale(0.8);
        margin-bottom: 5px;
    }
    
    .title {
        font-size: 1.6em;
    }
    
    .tagline {
        font-size: 0.7em;
    }
    
    /* Menu bar adjustments */
    .menu-bar {
        grid-template-columns: repeat(9, 1fr);
        gap: 2px;
        margin-bottom: 8px;
    }
    
    .league-container {
        grid-column: span 5;
    }
    
    .league-btn {
        padding: 6px 8px;
        font-size: 0.75em;
    }
    
    .stats-stack {
        grid-column: span 4;
        font-size: 0.65em;
        padding: 4px 8px;
        line-height: 1.2em;
    }
    
    .stats-sep {
        padding: 0 4px;
    }
    
    /* Sudoku grid adjustments */
    .sudoku-grid {
        padding: 5px;
        gap: 1px;
        aspect-ratio: 1;
    }
    
    .sudoku-cell {
        font-size: 0.85em;
        min-height: 30px;
        border-radius: 4px;
    }
    
    .sudoku-cell:nth-child(3n) {
        margin-right: 2px;
    }
    
    .sudoku-cell:nth-child(n+19):nth-child(-n+27),
    .sudoku-cell:nth-child(n+46):nth-child(-n+54) {
        margin-bottom: 2px;
    }
    
    /* Game layout adjustments */
    .game-layout {
        padding: 8px;
        gap: 8px;
    }
    
    .baseball-diamond {
        width: 100px;
        height: 100px;
    }
    
    .baseball-diamond img {
        width: 100px;
        height: 100px;
    }
    
    .position-selector {
        gap: 5px;
        padding: 5px;
    }
    
    .position-row {
        gap: 5px;
    }
    
    .position-btn {
        width: 44px;
        height: 44px;
        font-size: 0.75em;
        padding: 8px;
    }
    
    /* Status bar adjustments */
    .game-status-bar {
        padding: 5px 8px;
        gap: 8px;
        font-size: 0.85em;
    }
    
    .status-bar-item {
        gap: 2px;
    }
    
    .status-icon {
        font-size: 0.9em;
    }
    
    .status-value {
        font-size: 0.85em;
    }
    
    /* Game info adjustments */
    .game-info-row {
        gap: 15px;
        margin: 10px 0;
    }
    
    .info-item span {
        font-size: 0.7em;
    }
    
    #new-game-btn {
        padding: 8px 12px;
    }
    
    /* Modal adjustments */
    .modal {
        width: 90vw;
        max-width: none;
        padding: 20px;
        border-radius: 20px;
    }
    
    .modal h2 {
        font-size: 1.5em;
    }
    
    #settings-modal {
        width: 90vw;
    }
    
    .theme-options {
        grid-template-columns: 1fr;
    }
    
    /* Notifications */
    .strike-notification {
        font-size: 3.5em;
    }
    
    .completion-notification {
        font-size: 2em;
        padding: 15px;
    }
    
    .toast {
        font-size: 0.9em;
        padding: 12px 20px;
        bottom: 20px;
    }
}

/* Extra small screens */
@media (max-width: 360px) {
    .container {
        padding: 8px;
    }
    
    .title {
        font-size: 1.4em;
    }
    
    .sudoku-cell {
        font-size: 0.75em;
        min-height: 26px;
    }
    
    .baseball-diamond {
        width: 80px;
        height: 80px;
    }
    
    .baseball-diamond img {
        width: 80px;
        height: 80px;
    }
    
    .position-btn {
        width: 40px;
        height: 40px;
        font-size: 0.7em;
    }
    
    .game-status-bar {
        font-size: 0.75em;
    }
    
    .status-icon {
        font-size: 0.8em;
    }
    
    .status-value {
        font-size: 0.75em;
    }
}

/* Landscape orientation adjustments */
@media (max-height: 600px) and (orientation: landscape) {
    .app-wrapper {
        padding: 5px;
        min-height: auto;
    }
    
    .container {
        max-width: 90vh;
    }
    
    .top-header {
        display: none;
    }
    
    .menu-bar {
        margin-bottom: 5px;
    }
    
    .sudoku-grid {
        max-width: 60vh;
        margin: 0 auto 5px;
    }
    
    .game-layout {
        padding: 5px;
    }
    
    .baseball-diamond {
        width: 80px;
        height: 80px;
    }
    
    .baseball-diamond img {
        width: 80px;
        height: 80px;
    }
    
    .position-btn {
        width: 40px;
        height: 40px;
        font-size: 0.7em;
    }
    
    .game-status-bar {
        padding: 4px 8px;
    }
    
    .banner-ad-space {
        display: none;
    }
}

/* Touch device adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .sudoku-cell:hover:not(.fixed) {
        transform: none;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    .position-btn:hover:not(.disabled) {
        background: linear-gradient(145deg, #ffffff, #f8f8f8);
        color: #1e3a5f;
        transform: none;
        box-shadow: 
            0 6px 20px rgba(0, 0, 0, 0.2),
            0 3px 8px rgba(0, 0, 0, 0.15),
            inset 0 2px 4px rgba(255, 255, 255, 0.9);
        border-color: #1e3a5f;
    }
    
    /* Larger touch targets */
    .modal-close {
        width: 44px;
        height: 44px;
    }
    
    .sound-toggle input[type="checkbox"] {
        width: 60px;
        height: 32px;
    }
    
    .sound-toggle input[type="checkbox"]::before {
        width: 26px;
        height: 26px;
        top: 3px;
        left: 3px;
    }
    
    .sound-toggle input[type="checkbox"]:checked::before {
        left: 31px;
    }
}

/* High DPI screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .sudoku-cell {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .position-btn {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
    }
    
    .app-wrapper {
        min-height: auto;
    }
    
    .container {
        box-shadow: none;
        background: white;
        border: 1px solid #ccc;
    }
    
    .menu-bar,
    .game-status-bar,
    .game-info-row,
    .banner-ad-space {
        display: none;
    }
    
    .sudoku-grid {
        border: 2px solid #000;
        box-shadow: none;
        transform: none;
    }
    
    .sudoku-cell {
        border: 1px solid #000;
        box-shadow: none;
    }
}

.game-status-bar {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 12px !important;
    max-width: 420px !important;
    margin: 18px auto !important;
} 