@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a0a0a;
    color: #e0e0e0;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #000000 0%, #0a0a0a 100%);
    z-index: -1;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    gap: 20px;
}

/* Header */
.header {
    position: relative;
    text-align: center;
    margin-bottom: 10px;
    padding: 20px 80px 20px 20px;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.title span {
    color: #cc3333;
}

.subtitle {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 600;
    min-height: 24px;
}

/* Settings Icon Button */
.settings-icon-btn {
    position: absolute;
    top: 50%;
    right: 25px;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 10px;
    background: rgba(40, 40, 40, 0.9);
    color: #cccccc;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.settings-icon-btn:hover {
    background: rgba(50, 50, 50, 0.95);
    color: #ffffff;
    /* transform: translateY(-50%) rotate(30deg); */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    flex: 1;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 992px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .side-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .side-panel .panel-content {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        gap: 15px;
    }
    
    .side-panel {
        grid-template-columns: 1fr;
    }
}

/* Side Panels */
.side-panel {
    display: flex;
}

.side-panel .panel-content {
    width: 100%;
    padding: 20px;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.panel-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.panel-header h3 i {
    color: #cc3333;
    font-size: 1.1rem;
}

.reset-stats-btn {
    background: transparent;
    border: none;
    color: #cccccc;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    /* border: 1px solid rgba(255, 255, 255, 0.05); */
}

.reset-stats-btn:hover {
    background: transparent;
    color: #cc3333;
    transform: rotate(180deg);
    /* border-color: rgba(204, 51, 51, 0.3); */
}

/* Stats Grid */
.stats-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.stat-item:hover {
    background: rgba(35, 35, 35, 0.95);
    border-color: rgba(255, 255, 255, 0.08);
}

.stat-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.4rem;
    font-weight: bold;
    flex-shrink: 0;
}

.stat-icon.x {
    background: rgba(204, 51, 51, 0.1);
    color: #cc3333;
    border: 1px solid rgba(204, 51, 51, 0.2);
}

.stat-icon.o {
    background: rgba(74, 124, 255, 0.1);
    color: #4a7cff;
    border: 1px solid rgba(74, 124, 255, 0.2);
}

.stat-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: #aaaaaa;
    font-weight: 500;
}

.stat-content strong {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.draws .stat-content strong {
    color: #cccccc;
}

/* Info Grid */
.info-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.info-item i {
    font-size: 1.3rem;
    color: #cc3333;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(204, 51, 51, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(204, 51, 51, 0.2);
}

.info-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.info-content span {
    font-size: 0.85rem;
    color: #aaaaaa;
    font-weight: 500;
}

.info-content strong {
    font-size: 1.2rem;
    font-weight: 600;
    color: #ffffff;
}

/* Quick Settings */
.quick-settings {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quick-settings h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.quick-settings h4 i {
    color: #cc3333;
    font-size: 1.1rem;
}

.settings-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.switch {
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    padding: 12px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.switch:hover {
    background: rgba(35, 35, 35, 0.95);
}

.switch input {
    display: none;
}

.slider {
    width: 44px;
    height: 24px;
    background: rgba(40, 40, 40, 0.95);
    border-radius: 12px;
    position: relative;
    transition: background-color 0.3s ease;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.slider::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background: #cccccc;
    border-radius: 50%;
    top: 2px;
    left: 3px;
    transition: transform 0.3s ease;
}

.switch input:checked + .slider {
    background: rgba(204, 51, 51, 0.3);
    border-color: rgba(204, 51, 51, 0.4);
}

.switch input:checked + .slider::after {
    transform: translateX(20px);
    background: #cc3333;
}

.switch-label {
    color: #cccccc;
    font-size: 0.9rem;
    font-weight: 500;
    flex: 1;
}

/* Center Panel */
.center-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Game Board Container */
.game-board-container {
    background: rgba(20, 20, 20, 0.95);
    border-radius: 16px;
    padding: 25px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    gap: 25px;
    flex: 1;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 768px) {
    .board-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .player-turn, .board-info {
        width: 100%;
    }
    
    .board-info {
        align-items: flex-start;
    }
}

.player-turn {
    display: flex;
    align-items: center;
    gap: 15px;
}

.turn-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(30, 30, 30, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.turn-symbol {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.turn-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.board-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

@media (max-width: 768px) {
    .board-info {
        align-items: stretch;
    }
}

.board-size-display {
    font-size: 0.95rem;
    color: #cccccc;
    font-weight: 500;
}

.win-streak {
    font-size: 0.9rem;
    color: #cccccc;
}

.win-streak strong {
    color: #ffffff;
    font-weight: 600;
}

/* Game Board */
.game-board {
    display: grid;
    aspect-ratio: 1;
    width: 100%;
    max-width: 550px;
    margin: 0 auto;
    position: relative;
    background: rgba(25, 25, 25, 0.9);
    border-radius: 14px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Board sizes with proper gaps - Increased */
.game-board.size-3 {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    max-width: 500px;
    gap: 12px;
    padding: 15px;
}

.game-board.size-4 {
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    max-width: 550px;
    gap: 10px;
    padding: 15px;
}

.game-board.size-5 {
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    max-width: 600px;
    gap: 9px;
    padding: 15px;
}

.game-board.size-6 {
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(6, 1fr);
    max-width: 650px;
    gap: 8px;
    padding: 15px;
}

.cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(30, 30, 30, 0.95);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.cell:hover {
    background: rgba(40, 40, 40, 0.95);
    /* transform: translateY(-3px); */
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.cell.x, .cell.o {
    position: relative;
}

.cell.x::before, .cell.o::before {
    content: '';
    position: absolute;
    width: 80%;
    height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell.x::before {
    content: 'X';
    color: #cc3333;
    text-shadow: 0 0 5px rgba(255, 50, 50, 0.2);
}

.cell.o::before {
    content: 'O';
    color: #4a7cff;
    text-shadow: 0 0 5px rgba(50, 50, 255, 0.2);
}

/* Adjust font sizes based on board size - Increased */
.game-board.size-3 .cell.x::before,
.game-board.size-3 .cell.o::before {
    font-size: 4rem;
}

.game-board.size-4 .cell.x::before,
.game-board.size-4 .cell.o::before {
    font-size: 3rem;
}

.game-board.size-5 .cell.x::before,
.game-board.size-5 .cell.o::before {
    font-size: 2.5rem;
}

.game-board.size-6 .cell.x::before,
.game-board.size-6 .cell.o::before {
    font-size: 2rem;
}

/* WIN HIGHLIGHTING */
.cell.winner {
    background: rgba(255, 255, 255, 0.15) !important;
    border: 2px solid #ffffff !important;
    animation: winnerGlow 1.5s ease-in-out infinite alternate;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2), inset 0 0 5px rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.cell.winner.x::before {
    color: #cc3333 !important;
    text-shadow: 0 0 8px rgba(255, 50, 50, 0.3);
}

.cell.winner.o::before {
    color: #4a7cff !important;
    text-shadow: 0 0 8px rgba(50, 100, 255, 0.3);
}

@keyframes winnerGlow {
    0% {
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.2), inset 0 0 5px rgba(255, 255, 255, 0.1);
        transform: scale(1);
    }
    100% {
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.3), inset 0 0 8px rgba(255, 255, 255, 0.2);
        transform: scale(1.02);
    }
}

.cell.disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Game Controls */
.game-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .game-controls {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .game-controls {
        grid-template-columns: 1fr;
    }
}

.btn {
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn i {
    font-size: 1.1rem;
}

.primary-btn {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
}

.primary-btn:hover {
    background: rgba(50, 50, 50, 0.95);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.secondary-btn {
    background: rgba(30, 30, 30, 0.9);
    color: #cccccc;
}

.secondary-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

.hint-btn {
    background: rgba(30, 30, 30, 0.9);
    color: #cccccc;
}

.hint-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Settings Modal */
.settings-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.settings-modal.active {
    display: flex;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: rgba(25, 25, 25, 0.98);
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
    z-index: 1001;
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.95);
    border-radius: 20px 20px 0 0;
}

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header i {
    color: #cc3333;
}

.close-modal {
    background: transparent;
    border: none;
    color: #cccccc;
    font-size: 1.2rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: #ffffff;
    background: transparent;
    transform: rotate(90deg);
}

.modal-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.setting-section {
    padding-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.setting-section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.setting-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 18px;
    color: #cccccc;
    display: flex;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-section h4 i {
    color: #cc3333;
    font-size: 1.1rem;
}

.options-row {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.option-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.9);
    color: #cccccc;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.option-btn:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.option-btn.active {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.option-btn i {
    font-size: 1.2rem;
}

.option-btn span {
    font-size: 0.9rem;
    font-weight: 500;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.size-option {
    padding: 16px 8px;
    border: none;
    border-radius: 10px;
    background: rgba(30, 30, 30, 0.9);
    color: #cccccc;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.size-option:hover {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.1);
}

.size-option.active {
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.size-label {
    font-size: 1.1rem;
    font-weight: 600;
}

.setting-info {
    background: rgba(30, 30, 30, 0.9);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: #cccccc;
}

.setting-info p {
    display: flex;
    align-items: center;
    gap: 8px;
}

#aiSymbol, #winCondition {
    color: #ffffff;
    font-weight: bold;
    margin-left: 5px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
}

.modal-btn {
    padding: 14px 28px;
    background: rgba(40, 40, 40, 0.95);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-btn:hover {
    background: rgba(50, 50, 50, 0.95);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Footer */
.footer {
    margin-top: 10px;
    padding: 20px;
    background: rgba(15, 15, 15, 0.95);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #aaaaaa;
    font-size: 0.9rem;
    text-align: center;
}

.footer-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

@media (max-width: 480px) {
    .footer-info {
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }
}

.footer-info span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
}

.footer-info i {
    color: #cc3333;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    70% {
        transform: scale(1.1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar styling */
.settings-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

.settings-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(30, 30, 30, 0.5);
    border-radius: 4px;
}

.settings-modal .modal-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

.settings-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .title {
        font-size: 2.2rem;
    }
    
    .settings-icon-btn {
        right: 20px;
        width: 40px;
        height: 40px;
    }
    
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .title {
        font-size: 1.8rem;
        margin-right: 40px;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .game-board-container {
        padding: 15px;
    }
    
    .settings-icon-btn {
        right: 15px;
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }
    
    .modal-header {
        padding: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

/* Landscape mode adjustments */
@media (max-height: 700px) and (orientation: landscape) {
    .container {
        padding: 10px;
        gap: 10px;
    }
    
    .header {
        padding: 15px 70px 15px 15px;
        margin-bottom: 5px;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .modal-content {
        max-height: 80vh;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .cell {
        min-height: 50px;
    }
    
    .btn {
        min-height: 44px;
    }
    
    .option-btn, .size-option {
        min-height: 44px;
    }
}