body {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(circle at top, #2a3052 0%, #151821 70%);
    color: #f5f5f5;
    font-family: "Noto Sans JP", "Helvetica Neue", Arial, sans-serif;
    text-align: center;
}

.container {
    max-width: 960px;
    margin: auto;
    padding: 24px;
    background: rgba(18, 24, 42, 0.92);
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 24px;
}

h1 {
    margin-bottom: 16px;
    font-size: clamp(2rem, 3vw, 3rem);
}

.menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-bottom: 18px;
}

button,
select {
    padding: 12px 18px;
    border: none;
    border-radius: 999px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #f5f5f5;
    transition: transform 0.15s ease, background 0.15s ease;
}

button:hover,
select:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateY(-1px);
}

button:active,
select:active {
    transform: translateY(0);
}

.win-line {
    outline: 3px solid rgba(255, 220, 100, 0.9);
    outline-offset: -2px;
    box-shadow: 0 0 24px rgba(255, 220, 100, 0.65);
}

#status {
    margin-bottom: 16px;
    padding: 14px 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-weight: 700;
}

#board {
    display: grid;
    justify-content: center;
    gap: 2px;
    margin: auto;
    padding: 10px;
    background: #1b233a;
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    width: min(100%, 560px);
}

.cell {
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, #cdc3a3 0%, #d9b273 100%);
    cursor: pointer;
    position: relative;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    aspect-ratio: 1 / 1;
}

.cell:hover {
    transform: scale(1.04);
}

#roomDetails {
    text-align: left;
    margin: 16px auto;
    max-width: 560px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
}

.field-row {
    margin-bottom: 10px;
}

.players-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.player-card,
.comment-card {
    padding: 12px;
    border-radius: 16px;
    background: rgba(0,0,0,0.15);
    border: 1px solid rgba(255,255,255,0.08);
}

.player-card small {
    display: block;
    margin-top: 8px;
    color: #cfd8ff;
    font-size: 0.9rem;
}

.comments-list {
    display: grid;
    gap: 10px;
    margin-bottom: 12px;
}

.comment-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.comment-form input {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.comment-form button {
    min-width: 110px;
}

.section-card {
    margin-bottom: 18px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

input, label {
    font-size: 16px;
}

input[type="text"], input[type="number"], textarea {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
}

textarea {
    width: 100%;
    min-height: 120px;
    resize: vertical;
}

button,
select,
input[type="text"],
input[type="number"],
textarea {
    outline: none;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    z-index: 1000;
}

.modal-box {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 460px);
    background: rgba(15, 19, 33, 0.98);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 18px;
    padding: 18px;
    z-index: 1001;
    box-shadow: 0 24px 90px rgba(0,0,0,0.45);
    color: #f5f5f5;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.modal-header button {
    border-radius: 12px;
    padding: 6px 10px;
}

.modal-content {
    line-height: 1.6;
}

.cell:hover {
    transform: scale(1.04);
}

.cell.black::after,
.cell.white::after {
    content: "";
    position: absolute;
    inset: 5px;
    border-radius: 50%;
}

.cell.black::after {
    background: radial-gradient(circle at 30% 30%, #444 0%, #000 75%);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.cell.white::after {
    background: radial-gradient(circle at 30% 30%, #fff 0%, #f6f6f6 80%);
    box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.14);
}

@media (max-width: 700px) {
    .container {
        margin: 12px;
        padding: 16px;
    }

    .menu {
        gap: 10px;
    }

    button,
    select {
        width: 100%;
    }

    .cell {
        width: 28px;
        height: 28px;
    }
}

a {
    color: #58a6ff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}