* {
    box-sizing: border-box;
}

:root {
    --bg: #111214;
    --panel: #191b20;
    --panel-soft: #23262d;
    --text: #f5f7fb;
    --muted: #a7afbd;
    --line: rgba(255, 255, 255, 0.12);
    --lime: #b6f24a;
    --cyan: #39d5ff;
    --pink: #ff5ca8;
    --yellow: #ffd166;
    --board: #d6a85d;
    --board-dark: #93642c;
    --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        linear-gradient(120deg, rgba(57, 213, 255, 0.16), transparent 32rem),
        linear-gradient(240deg, rgba(255, 92, 168, 0.16), transparent 30rem),
        var(--bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 18px 0;
    backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.button {
    display: inline-flex;
    align-items: center;
}

.brand {
    gap: 0.75rem;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    color: #111214;
    background: var(--lime);
    border-radius: 10px;
    box-shadow: 0 0 28px rgba(182, 242, 74, 0.28);
}

.nav-links {
    gap: 0.35rem;
    padding: 6px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.nav-links a {
    padding: 0.65rem 0.9rem;
    border-radius: 999px;
    font-size: 0.92rem;
    transition: background-color 160ms ease, color 160ms ease;
}

.nav-links a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.1);
}

main {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 3rem;
    align-items: center;
    min-height: calc(100vh - 78px);
    padding: 4rem 0;
}

.eyebrow {
    margin: 0 0 1rem;
    color: var(--lime);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 780px;
    margin-bottom: 1.25rem;
    font-size: clamp(3rem, 8vw, 6.4rem);
    line-height: 0.98;
}

h2 {
    margin-bottom: 0.75rem;
    font-size: clamp(2.1rem, 5vw, 4rem);
    line-height: 1;
}

h3 {
    margin-bottom: 0.65rem;
    font-size: 1.2rem;
}

.hero-copy,
.game-header p,
.feature-card p,
.turn-card p,
.rules-card li {
    color: var(--muted);
    line-height: 1.7;
}

.turn-card .message-error {
    color: #ff5c8a;
    font-weight: 900;
    text-shadow: 0 0 18px rgba(255, 47, 109, 0.5);
}

.hero-copy {
    max-width: 660px;
    font-size: 1.16rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 2rem;
}

.button {
    justify-content: center;
    min-height: 48px;
    padding: 0.85rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

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

.button.primary {
    color: #111214;
    background: var(--lime);
    box-shadow: 0 14px 34px rgba(182, 242, 74, 0.22);
}

.button.ghost {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--line);
}

.hero-panel,
.feature-card,
.game-side > *,
.score-board,
.board-shell {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 1.25rem;
    border-radius: 24px;
}

.game-preview {
    position: relative;
    display: grid;
    min-height: 250px;
    place-items: center;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(17, 18, 20, 0.16) 1px, transparent 1px),
        linear-gradient(rgba(17, 18, 20, 0.16) 1px, transparent 1px),
        var(--board);
    background-size: 34px 34px;
    border: 10px solid #b77a36;
    border-radius: 18px;
}

.preview-stone {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
}

.preview-stone.black {
    background: radial-gradient(circle at 32% 28%, #59606c, #070809 68%);
}

.preview-stone.white {
    background: radial-gradient(circle at 30% 25%, #ffffff, #d8dce4 70%);
}

.preview-stone:nth-child(1) {
    transform: translate(-68px, -42px);
}

.preview-stone:nth-child(2) {
    transform: translate(-18px, 6px);
}

.preview-stone:nth-child(3) {
    transform: translate(32px, 54px);
}

.preview-stone:nth-child(4) {
    transform: translate(82px, -20px);
}

.panel-divider {
    height: 1px;
    margin: 1rem 0;
    background: var(--line);
}

.status-card {
    display: flex;
    gap: 0.8rem;
    align-items: flex-start;
}

.status-card p {
    margin: 0.25rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.status-dot {
    flex: 0 0 auto;
    width: 12px;
    height: 12px;
    margin-top: 0.35rem;
    background: var(--cyan);
    border-radius: 999px;
    box-shadow: 0 0 0 6px rgba(57, 213, 255, 0.13);
}

.section,
.game-section {
    padding: 5rem 0;
}

.section-heading,
.game-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.feature-card {
    min-height: 250px;
    padding: 1.25rem;
    border-radius: 18px;
}

.card-icon {
    display: inline-flex;
    margin-bottom: 3.25rem;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.card-icon.live {
    color: #111214;
    background: var(--lime);
}

.card-icon.soon {
    color: var(--text);
    background: rgba(255, 255, 255, 0.12);
}

.card-link {
    display: inline-flex;
    margin-top: 1rem;
    color: var(--cyan);
    font-weight: 900;
}

.game-section {
    border-top: 1px solid var(--line);
}

.game-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.25rem;
    align-items: start;
}

.board-shell {
    display: grid;
    place-items: center;
    padding: clamp(0.75rem, 2.5vw, 1.5rem);
    border-radius: 22px;
}

.omok-board {
    --cell: min(5.6vw, 38px);
    display: grid;
    grid-template-columns: repeat(15, var(--cell));
    grid-template-rows: repeat(15, var(--cell));
    padding: calc(var(--cell) * 0.48);
    background:
        linear-gradient(90deg, transparent calc(50% - 1px), rgba(72, 43, 16, 0.72) calc(50% - 1px), rgba(72, 43, 16, 0.72) calc(50% + 1px), transparent calc(50% + 1px)),
        linear-gradient(transparent calc(50% - 1px), rgba(72, 43, 16, 0.72) calc(50% - 1px), rgba(72, 43, 16, 0.72) calc(50% + 1px), transparent calc(50% + 1px)),
        var(--board);
    background-size: var(--cell) var(--cell);
    background-position: calc(var(--cell) * 0.5) calc(var(--cell) * 0.5);
    border: 12px solid #9d6730;
    border-radius: 18px;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.cell {
    position: relative;
    display: grid;
    width: var(--cell);
    height: var(--cell);
    place-items: center;
    padding: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.cell::before {
    content: "";
    width: 74%;
    height: 74%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 120ms ease, transform 120ms ease;
}

.cell:hover::before,
.cell:focus-visible::before {
    opacity: 0.28;
    transform: scale(0.9);
    background: currentColor;
}

.cell.black,
.cell.white {
    cursor: default;
}

.cell.black::before,
.cell.white::before {
    opacity: 1;
    transform: scale(1);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.28);
}

.cell.black::before {
    background: radial-gradient(circle at 32% 28%, #626a76, #070809 68%);
}

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

.cell.win::after {
    content: "";
    position: absolute;
    width: 42%;
    height: 42%;
    border: 3px solid var(--pink);
    border-radius: 50%;
}

.cell.foul::before {
    background: radial-gradient(circle at 32% 28%, #ff8aa8, #ff2f6d 58%, #6f001f 100%);
    box-shadow:
        0 0 0 3px rgba(255, 47, 109, 0.3),
        0 0 24px rgba(255, 47, 109, 0.8),
        0 8px 14px rgba(0, 0, 0, 0.34);
}

.cell.foul::after {
    content: "!";
    position: absolute;
    display: grid;
    width: 50%;
    height: 50%;
    place-items: center;
    color: #fff;
    background: rgba(255, 47, 109, 0.92);
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    font-size: 0.85rem;
    font-weight: 900;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 18px rgba(255, 47, 109, 0.8);
}

.shake {
    animation: foul-shake 120ms ease-in-out 0s 6;
}

@keyframes foul-shake {
    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

.game-side {
    display: grid;
    gap: 1rem;
}

.turn-card,
.rules-card {
    padding: 1.2rem;
    border-radius: 18px;
}

.turn-label {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
}

.turn-player {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    margin: 0.7rem 0 0.5rem;
    font-size: 1.45rem;
}

.turn-stone {
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.turn-stone.black {
    background: radial-gradient(circle at 32% 28%, #626a76, #070809 68%);
}

.turn-stone.white {
    background: radial-gradient(circle at 30% 25%, #ffffff, #d9dde5 70%);
}

.control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.rules-card ul {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding-left: 1.15rem;
}

.score-board {
    display: grid;
    grid-template-columns: repeat(2, 90px);
    gap: 0.7rem;
    padding: 0.8rem;
    border-radius: 16px;
}

.score-board div {
    display: grid;
    gap: 0.25rem;
}

.score-board span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.score-board strong {
    font-size: 1.7rem;
}

@media (max-width: 920px) {
    .hero,
    .game-layout {
        grid-template-columns: 1fr;
    }

    .hero {
        min-height: auto;
        padding-top: 3rem;
    }

    .game-side {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rules-card {
        grid-column: 1 / -1;
    }
}

@media (max-width: 760px) {
    .site-header,
    .section-heading,
    .game-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .nav-links {
        width: 100%;
        justify-content: space-between;
    }

    .card-grid,
    .game-side {
        grid-template-columns: 1fr;
    }

    .rules-card {
        grid-column: auto;
    }
}

@media (max-width: 560px) {
    main,
    .site-header {
        width: min(100% - 24px, 1180px);
    }

    h1 {
        font-size: 3.15rem;
    }

    .hero-actions,
    .button {
        width: 100%;
    }

    .nav-links a {
        padding-inline: 0.52rem;
        font-size: 0.86rem;
    }

    .omok-board {
        --cell: calc((100vw - 88px) / 15);
        border-width: 8px;
    }

    .score-board {
        width: 100%;
        grid-template-columns: repeat(2, 1fr);
    }
}
