body {
    font-family: Arial, sans-serif;
    background-color: #f0f0f0;
    margin: 0;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    display: flex;
    gap: 40px;
    align-items: center;
    max-width: 1400px;
    width: 100%;
    justify-content: space-between;
}

.controls-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 280px;
    flex-shrink: 0;
    background-color: #1a1a1a;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.score-panel {
    display: flex;
    flex-direction: column;
    width: 280px;
    flex-shrink: 0;
}

/* Score Board Styles */
.score-board {
    background-color: white;
    border: 2px solid #333;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-board h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.score-blocks {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.score-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: 10px;
    font-weight: bold;
    color: white;
    min-height: 50px;
    transition: transform 0.2s ease;
}

.score-block:hover {
    transform: scale(1.02);
}

.x-block {
    background-color: #818169;
}

.o-block {
    background-color: #515f5f;
}

.draw-block {
    background-color: #ff9800;
}

.score-symbol {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
}

.score-number {
    font-size: 28px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.score-reset-btn {
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #333333;
    border-radius: 0;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    font-family: 'Courier New', monospace;
    width: 100%;
    text-transform: uppercase;
}

.score-reset-btn:hover {
    box-shadow: 4px 4px 0px #333333;
    transform: translate(-2px, -2px);
}

.score-reset-btn:active {
    box-shadow: 2px 2px 0px #333333;
    transform: translate(-1px, -1px);
}

.game-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 3px;   
    background-color: #333;
    border: 5px solid #333;
    width: 600px;
    height: 600px;
    padding: 9px;
    box-sizing: border-box;
    border-radius: 10px;
    justify-content: center;
    align-content: center;
    place-content: center;
}

.cell {
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 3rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
    border-radius: 4px;
}
.cell:hover {
    background-color: #ddd;
}

.cell.cell-x {
    background-color: #818169;
    color: #fff;
}

.cell.cell-o {
    background-color: #515f5f;
    color: #fff;
}

.cell.cell-x:hover {
    background-color: #4a4a3f;
}

.cell.cell-o:hover {
    background-color: #3f4a4a;
}

.cell.winning-cell {
    background-color: #48804b !important;
    box-shadow: 0 0 20px rgba(46, 125, 50, 0.6), 
                inset 0 0 20px rgba(46, 125, 50, 0.3);
    animation: winningGlow 1s ease-in-out;
}

.cell.winning-cell.line-hover {
    background-color: #2e7d32 !important;
}

@keyframes winningGlow {
    0% {
        box-shadow: 0 0 5px rgba(46, 125, 50, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 30px rgba(46, 125, 50, 0.8), 
                    inset 0 0 20px rgba(46, 125, 50, 0.5);
        transform: scale(1.08);
    }
    100% {
        box-shadow: 0 0 20px rgba(46, 125, 50, 0.6), 
                    inset 0 0 20px rgba(46, 125, 50, 0.3);
        transform: scale(1.05);
    }
}

#status {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.5em;
    color: #444;
    text-align: center;
    margin: 0;
    background-color: rgba(255, 255, 255, 0.95);
    padding: 12px 24px;
    border-radius: 25px;
    z-index: 1000;
    font-weight: 500;
    white-space: nowrap;
    border: 2px solid #e0e0e0;
}

#symbol-selection {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#symbol-selection > label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.symbol-options {
    display: flex;
    gap: 12px;
    padding: 8px;
    border: 1px solid #404040;
    border-radius: 10px;
    background-color: #2a2a2a;
    justify-content: center;
}

.symbol-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.symbol-choice:hover {
    background-color: #3a3a3a;
}

.symbol-choice input[type="radio"] {
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #666;
    border-radius: 50%;
    background-color: #2a2a2a;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.symbol-choice input[type="radio"]:checked {
    background-color: #4f8ef7;
    border-color: #4f8ef7;
}

.symbol-choice input[type="radio"]:checked::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: white;
}

.symbol-choice label {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
}

.symbol-choice:hover input[type="radio"] {
    border-color: #888;
}

.symbol-choice:hover label {
    color: #f0f0f0;
}

#grid-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#grid-controls label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#k-alignment-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#k-alignment-controls label {
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

#grid-size-input {
    width: 100%;
    padding: 12px 70px 12px 16px;
    border: 1px solid #404040;
    border-radius: 10px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    font-family: Arial, sans-serif;
    background-color: #2a2a2a;
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

/* Hide number input spinners */
#grid-size-input::-webkit-outer-spin-button,
#grid-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#grid-size-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

#grid-size-input:focus {
    border-color: #4f8ef7;
    background-color: #333333;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.1);
}

#k-alignment-input {
    width: 100%;
    padding: 12px 70px 12px 16px;
    border: 1px solid #404040;
    border-radius: 10px;
    text-align: left;
    font-size: 16px;
    font-weight: 500;
    font-family: Arial, sans-serif;
    background-color: #2a2a2a;
    color: #ffffff;
    outline: none;
    transition: all 0.2s ease;
}

/* Hide number input spinners */
#k-alignment-input::-webkit-outer-spin-button,
#k-alignment-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#k-alignment-input[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

#k-alignment-input:focus {
    border-color: #4f8ef7;
    background-color: #333333;
    box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.1);
}

#apply-size-btn {
    position: absolute;
    right: 8px;
    margin: 0;
    padding: 6px 14px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #333333;
    border-radius: 0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    height: 32px;
    transition: all 0.1s;
    text-transform: uppercase;
}

#apply-size-btn:hover {
    box-shadow: 4px 4px 0px #333333;
    transform: translate(-2px, -2px);
}

#apply-size-btn:active {
    box-shadow: 2px 2px 0px #333333;
    transform: translate(-1px, -1px);
}

#apply-k-btn {
    position: absolute;
    right: 8px;
    margin: 0;
    padding: 6px 14px;
    background-color: #000000;
    color: #ffffff;
    border: 2px solid #333333;
    border-radius: 0;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    height: 32px;
    transition: all 0.1s;
    text-transform: uppercase;
}

#apply-k-btn:hover {
    box-shadow: 4px 4px 0px #333333;
    transform: translate(-2px, -2px);
}

#apply-k-btn:active {
    box-shadow: 2px 2px 0px #333333;
    transform: translate(-1px, -1px);
}

.md3-button {
    padding: 12px 24px;
    background-color: #ffffff;
    color: #000000;
    border: 2px solid #000000;
    border-radius: 0;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    font-family: 'Courier New', monospace;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
}

.md3-button:hover {
    box-shadow: 4px 4px 0px #000000;
    transform: translate(-2px, -2px);
}

.md3-button:active {
    box-shadow: 2px 2px 0px #000000;
    transform: translate(-1px, -1px);
}

/* Responsive design */
@media (max-width: 1200px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        gap: 30px;
    }
    
    .controls-panel, .score-panel {
        width: 100%;
        max-width: 400px;
    }
    
    #game-board {
        width: 500px;
        height: 500px;
    }
}

@media (max-width: 768px) {
    .controls-panel, .score-panel {
        max-width: 300px;
    }
    
    #game-board {
        width: 450px;
        height: 450px;
    }
}