/* 알까기: a wooden baduk board on the yellow vinyl floor of a Korean living room. The board and the
   stones are drawn on the canvas (alkkagi/scene.js); the bars around it are the site's white cards
   with ink lines. Wood (the game's colour) marks the picked level and the cover. */
.alkkagi-page {
    --floor: #F1DCAE;
    --floor-line: #E6CB94;
    --stone-black: #1D1D1D;
    --stone-white: #FBFAF5;
}

.alkkagi-page .site-main {
    background-color: var(--floor);
    background-image:
        linear-gradient(var(--floor-line) 2px, transparent 2px),
        linear-gradient(90deg, var(--floor-line) 2px, transparent 2px);
    background-size: 84px 84px;
    background-position: -1px -1px;
}

.den { max-width: 600px; margin: 0 auto; padding: 18px 16px 48px; }
.tabular { font-variant-numeric: tabular-nums; }

.title h1 {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 40px;
    font-weight: 900;
    letter-spacing: -0.05em;
    line-height: 1.15;
}
.title-stones { display: inline-flex; }
.title-stones i { width: 30px; height: 30px; border-radius: 50%; border: var(--line); }
.title-stones i:first-child { background: var(--stone-black); }
.title-stones i:last-child { margin-left: -9px; background: var(--stone-white); }
.title p { margin: 6px 0 0; font-size: 14.5px; line-height: 1.6; color: var(--soft); }
.is-playing .title p { display: none; }

/* Each side's bar: stone, name, stones left, whose turn. The top bar turns round for two players face to face. */
.side {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding: 6px 8px 6px 12px;
    background: var(--paper);
    border: var(--line);
    border-radius: 999px;
    transition: box-shadow 0.15s ease;
}
.side[hidden] { display: none; }
.side.is-top { margin-bottom: -2px; }
.side.is-active { box-shadow: 3px 4px 0 var(--ink); }
.side.is-facing { transform: rotate(180deg); }
.side-stone { flex: none; width: 22px; height: 22px; border-radius: 50%; border: var(--line); }
.side-stone.is-black { background: var(--stone-black); }
.side-stone.is-white { background: var(--stone-white); }
.side-name { font-size: 15px; font-weight: 900; letter-spacing: -0.02em; white-space: nowrap; }
.pips { display: inline-flex; gap: 4px; }
.pips i { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); }
.pips i.is-gone { background: none; box-shadow: inset 0 0 0 1.5px #B4AC9A; }
.turn {
    margin-left: auto;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--alarm);
    color: var(--paper);
    font-size: 13px;
    font-weight: 900;
    visibility: hidden;
}
.side.is-active .turn { visibility: visible; }

/* The canvas runs into the side gutters so a stone can be seen falling off the board. */
.table { position: relative; margin: 6px -16px 0; }
.board { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; touch-action: none; user-select: none; -webkit-user-select: none; }
.table.is-idle .board { touch-action: auto; }

.finale {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(241, 220, 174, 0.5);
}
.finale[hidden] { display: none; }
.finale-card {
    width: min(340px, 100%);
    padding: 20px 20px 14px;
    background: var(--paper);
    border: var(--line);
    border-radius: 18px;
    box-shadow: 5px 6px 0 var(--ink);
    text-align: center;
}
.finale-kicker { margin: 0; font-size: 13px; font-weight: 800; color: var(--muted); }
.finale-title { margin: 2px 0 0; font-size: 36px; font-weight: 900; letter-spacing: -0.05em; line-height: 1.25; }
.finale-meta { margin: 4px 0 0; font-size: 14.5px; font-weight: 700; color: var(--soft); }
.finale-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.finale-actions .btn { min-height: 46px; padding: 0 12px; }
.finale-link {
    margin-top: 10px;
    padding: 6px 10px;
    border: 0;
    background: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
.toast { margin: 4px 0 0; font-size: 13px; font-weight: 700; }

.status { min-height: 1.6em; margin: 12px 0 0; text-align: center; font-size: 14.5px; font-weight: 800; }
.controls { display: flex; justify-content: center; gap: 8px; margin-top: 10px; }
.controls[hidden] { display: none; }
.tool {
    min-height: 40px;
    padding: 0 16px;
    border: var(--line);
    border-radius: 999px;
    background: var(--paper);
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

/* Choosing how to play: a card over the board, which waits behind it in its starting position. */
.menu {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(241, 220, 174, 0.3);
}
.menu[hidden] { display: none; }
.menu-card {
    width: min(320px, 100%);
    padding: 18px 18px 14px;
    background: var(--paper);
    border: var(--line);
    border-radius: 18px;
    box-shadow: 5px 6px 0 var(--ink);
    text-align: center;
}
.menu-card .btn { width: 100%; min-height: 48px; }
.menu-note { margin: 6px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.menu-or { margin: 12px 0 10px; display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 800; color: var(--muted); }
.menu-or::before, .menu-or::after { content: ""; flex: 1; border-top: 1.5px dashed #B4AC9A; }
.menu-label { margin: 0; font-size: 15px; font-weight: 900; }
.levels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; margin: 8px 0 10px; padding: 3px; border: var(--line); border-radius: 999px; }
.levels button { min-height: 34px; padding: 0; border: 0; border-radius: 999px; background: none; font-size: 13.5px; font-weight: 800; cursor: pointer; }
.levels [aria-checked="true"] { background: var(--wood); box-shadow: inset 0 0 0 1.5px var(--ink); }

.notes {
    margin-top: 22px;
    padding: 16px 18px;
    background: var(--paper);
    border: var(--line);
    border-radius: 16px;
}
.notes h2 { margin: 0 0 6px; font-size: 15px; font-weight: 900; }
.notes ol { margin: 0; padding-left: 1.2em; font-size: 14px; line-height: 1.65; color: var(--soft); }

@media (max-width: 640px) {
    .den { padding: 14px 16px 40px; }
    .title h1 { font-size: 32px; gap: 10px; }
    .title-stones i { width: 24px; height: 24px; }
    .title p { font-size: 13.5px; }
    .side { margin-top: 10px; padding: 5px 6px 5px 10px; gap: 8px; }
    .side-name { font-size: 14px; }
    .pips i { width: 9px; height: 9px; }
    .turn { font-size: 12.5px; padding: 2px 10px; }
    .finale-title { font-size: 32px; }
}

