/* Layout halaman: header, dua kolom (papan biru | info), footer. */

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem clamp(1rem, 3vw, 2.5rem);
    padding-top: max(0.75rem, env(safe-area-inset-top));
    border-bottom: 1px solid var(--line);
    background: var(--paper);
}

.brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1;
    color: var(--ink);
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.player {
    min-width: 0;
    max-width: 11rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--text-s);
    font-weight: 600;
    color: var(--ink-soft);
}

.score {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--done-bg);
    color: var(--done-ink);
    font-size: var(--text-s);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    min-height: calc(100dvh - 4.25rem);
}

/* Papan: kain biru bermotif kawung (SVG kecil, dibuat tipis supaya tidak ramai). */
.stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: clamp(1rem, 3vw, 2.25rem) clamp(1rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
    /* Lebar papan menyesuaikan tinggi layar supaya papan dan tombol muat tanpa scroll. */
    --stage-width: clamp(18rem, calc(100dvh - 24rem), 30rem);
    background-color: var(--stage);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' fill='none' stroke='white' stroke-opacity='.09' stroke-width='1.5'%3E%3Cellipse cx='32' cy='16' rx='9' ry='16'/%3E%3Cellipse cx='32' cy='48' rx='9' ry='16'/%3E%3Cellipse cx='16' cy='32' rx='16' ry='9'/%3E%3Cellipse cx='48' cy='32' rx='16' ry='9'/%3E%3C/svg%3E");
    background-size: 4rem;
    color: var(--stage-ink);
    --focus: var(--gold);
}

.reference {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: min(100%, var(--stage-width));
}

.reference__tile {
    flex: none;
    display: grid;
    place-items: center;
    width: 4.5rem;
    aspect-ratio: 1;
    border-radius: var(--radius-m);
    background: var(--wood);
    box-shadow: inset 0 0.125rem 0 var(--wood-hi), inset 0 -0.2rem 0 var(--wood-lo);
}

.reference__glyph {
    font-family: var(--font-aksara);
    font-weight: 600;
    font-size: 2.75rem;
    line-height: 1.4;
    color: var(--wood-ink);
    text-shadow: 0.04em 0.06em 0 var(--wood-hi);
}

.reference__name {
    font-family: var(--font-display);
    font-size: 1.75rem;
    line-height: 1.15;
}

.reference__group {
    color: var(--stage-soft);
    font-size: var(--text-s);
}

.panel {
    width: min(100%, var(--stage-width));
}

.status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.status__moves {
    color: var(--stage-soft);
}

.status__moves strong {
    margin-right: 0.15em;
    font-size: 1.75rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--stage-ink);
}

.status--done {
    display: block;
}

.status__title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    line-height: 1.25;
}

.status__title:focus {
    outline: none;
}

.status__detail {
    margin-top: 0.25rem;
    color: var(--stage-soft);
}

.status__sync {
    min-height: 1.5em;
    margin-top: 0.25rem;
    color: var(--stage-soft);
    font-size: var(--text-s);
}

.status__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    margin-top: 0.75rem;
}

/* Kolom info */
.info {
    width: 100%;
    max-width: 40rem;
    padding: clamp(1.5rem, 4vw, 3.25rem) clamp(1rem, 4vw, 3rem) 3rem;
}

.info__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-xl);
    line-height: 1.05;
    letter-spacing: -0.01em;
}

.info__lead {
    max-width: 34rem;
    margin-top: 0.75rem;
    color: var(--ink-soft);
    font-size: 1.0625rem;
}

.info__section {
    margin-top: 2.25rem;
}

.info__section h2 {
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
    font-weight: 400;
    font-size: var(--text-l);
}

.info__section > p {
    max-width: 36rem;
}

.info__note {
    max-width: 36rem;
    margin-top: 0.5rem;
    color: var(--ink-soft);
    font-size: var(--text-s);
}

.board-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: min(100%, var(--stage-width));
    color: var(--gold);
    font-weight: 600;
}

.site-footer {
    padding: 1.25rem clamp(1rem, 3vw, 2.5rem) max(1.25rem, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: var(--text-s);
}

@media (max-width: 62rem) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .info {
        margin-inline: auto;
    }
}

@media (max-width: 30rem) {
    .reference__tile {
        width: 3.75rem;
    }

    .reference__glyph {
        font-size: 2.25rem;
    }

    .status__actions .btn {
        flex: 1 1 auto;
    }
}
