:root {
    --bg: #0f172a;
    --panel: #111827;
    --card: #1f2937;
    --accent: #22c55e;
    --text: #e5e7eb;
    --muted: #94a3b8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at top, #1e293b, var(--bg));
    color: var(--text);
    font-family: Inter, Arial, sans-serif;
}

.layout {
    width: min(1080px, 96vw);
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.panel {
    background: rgba(17, 24, 39, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

h1 {
    margin-top: 0;
    font-size: 22px;
}

label,
.small,
.meta,
.status {
    font-size: 13px;
}

.group {
    margin-top: 12px;
}

.hidden {
    display: none;
}

select,
input,
button {
    width: 100%;
    margin-top: 6px;
    border: 1px solid #334155;
    border-radius: 10px;
    background: #0b1220;
    color: var(--text);
    padding: 10px;
}

button {
    cursor: pointer;
    transition: transform 0.12s ease, background-color 0.2s ease;
}

button:hover {
    transform: translateY(-1px);
}

#restartBtn,
#createRoomBtn,
#joinRoomBtn {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border: none;
    color: #08140c;
    font-weight: 700;
}

.row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.scoreboard {
    margin-top: 14px;
    border-top: 1px solid #334155;
    padding-top: 12px;
}

.scoreboard p {
    margin: 6px 0;
}

.status {
    min-height: 34px;
    color: #cbd5e1;
}

.meta {
    min-height: 20px;
    color: var(--muted);
}

.board {
    width: min(85vw, 680px);
    aspect-ratio: 1;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    background: #0a351f;
    border: 12px solid #291b0a;
    border-radius: 14px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.cell {
    border: 1px solid rgba(8, 14, 10, 0.35);
    background: linear-gradient(180deg, #1a6f42, #155d38);
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cell.playable:hover {
    background: linear-gradient(180deg, #22824e, #1a7043);
}

.cell.black::before,
.cell.white::before {
    content: '';
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    animation: dropIn 180ms ease-out;
}

.cell.black::before {
    background: radial-gradient(circle at 30% 25%, #444, #111);
}

.cell.white::before {
    background: radial-gradient(circle at 30% 25%, #fff, #d1d5db);
}

.cell.hint::after {
    content: '';
    position: absolute;
    width: 16%;
    height: 16%;
    left: 42%;
    top: 42%;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    animation: pulse 1.3s infinite;
}

.small {
    color: var(--muted);
    margin: 8px 0 0;
}

@keyframes dropIn {
    from {
        transform: scale(0.6);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.92);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.08);
    }
}

@media (max-width: 860px) {
    .layout {
        grid-template-columns: 1fr;
    }

    .board {
        width: min(94vw, 560px);
        margin: 0 auto;
    }
}
