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

.container {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%;
    max-width: 500px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
}

h2 {
    color: #444;
}

/* Screens */
.screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.hidden {
    display: none !important;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: bold;
    min-width: 150px;
}

.btn:active {
    transform: scale(0.98);
}

.btn.primary {
    background-color: #4CAF50;
    color: white;
}

.btn.primary:hover {
    background-color: #45a049;
}

.btn.secondary {
    background-color: #2196F3;
    color: white;
}

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

.btn.danger {
    background-color: #f44336;
    color: white;
}

.btn.skill {
    background-color: #FF9800;
    color: white;
    width: 100%;
}

.btn.skill:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Game Board */
.board {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
    width: 300px;
    height: 300px;
    background-color: #eee;
    padding: 10px;
    border-radius: 8px;
}

.cell {
    background-color: white;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 48px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.cell.player-o {
    background-color: #FFCCCC;
    /* Light Red */
    color: #D32F2F;
}

.cell.player-x {
    background-color: #CCCCFF;
    /* Light Blue */
    color: #1976D2;
}

.cell.blocked {
    background-color: #333;
    cursor: not-allowed;
    position: relative;
    /* 数字を中央に配置するため */
}

/* クールダウン数の表示スタイル */
.cell.cooldown {
    color: #ff5252;
    font-size: 36px;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
}

.cell.movable {
    background-color: #FFFF99;
    /* Light Yellow */
    border: 2px solid #FFD54F;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: left;
    width: 100%;
    max-width: 300px;
}

input[type="text"] {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    text-align: center;
    text-transform: uppercase;
}

.room-code {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 5px;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border: 2px dashed #ccc;
    margin: 10px 0;
}

/* Game Info */
.game-info {
    font-size: 18px;
    margin-bottom: 10px;
}

#turn-indicator {
    font-weight: bold;
    margin-bottom: 5px;
}

/* Modal */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 400px;
    width: 80%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#skill-hint {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

@media (max-width: 400px) {
    .board {
        width: 100%;
        height: 300px;
        /* Keep aspect ratio roughly */
    }
}