#game-root {
    --sl-ink: #17303f;
    --sl-dot: #93a3a8;
    color: var(--cg-ink);
    font-family: Inter, Arial, sans-serif;
}

.sl-game {
    max-width: 980px;
    margin: 0 auto;
    padding: 2px 0 26px;
}

.sl-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.sl-stats,
.sl-tools,
.sl-status {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sl-stats > div,
.sl-status > div {
    flex: 1 1 0;
    min-width: 70px;
    padding: 7px 10px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.8);
}

.sl-stats span,
.sl-status span {
    display: block;
    color: var(--cg-muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sl-stats strong,
.sl-status strong {
    display: block;
    margin-top: 1px;
    font-size: 18px;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.sl-btn,
.sl-icon {
    font: inherit;
    color: var(--cg-ink);
    cursor: pointer;
    min-height: 44px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: var(--cg-panel);
    transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.sl-icon {
    width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 900;
}

.sl-btn {
    padding: 0 10px;
    font-weight: 800;
}

.sl-btn:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.sl-btn:not(:disabled):hover,
.sl-icon:hover {
    transform: translateY(-1px);
    border-color: rgba(49, 95, 157, 0.5);
}

.sl-btn:focus-visible,
.sl-icon:focus-visible,
.sl-svg:focus-visible {
    outline: 3px solid rgba(49, 95, 157, 0.34);
    outline-offset: 2px;
}

.sl-btn.sl-on {
    border-color: var(--cg-green);
    background: rgba(29, 127, 98, 0.1);
    box-shadow: inset 0 0 0 2px rgba(29, 127, 98, 0.16);
}

.sl-icon-svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.sl-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 264px;
    gap: 16px;
    align-items: start;
}

.sl-board-shell {
    min-width: 0;
}

.sl-board-wrap {
    position: relative;
    width: 100%;
    max-width: 700px;
    aspect-ratio: 1;
    margin: 0 auto;
}

.sl-board {
    width: 100%;
    height: 100%;
}

.sl-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    cursor: crosshair;
}

.sl-bgrect {
    fill: #fbfcf6;
    stroke: var(--cg-line);
    stroke-width: 2;
}

.sl-guide {
    stroke: #e3e9e3;
    stroke-width: 3;
    stroke-linecap: round;
}

.sl-clue {
    fill: #2b3d44;
    font-family: Inter, Arial, sans-serif;
    font-size: 46px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

.sl-clue.sl-full {
    fill: #6f8189;
}

.sl-clue.sl-bad {
    fill: var(--cg-red);
}

.sl-dot {
    fill: var(--sl-dot);
}

.sl-dot.sl-live {
    fill: var(--sl-ink);
}

.sl-dot.sl-bad {
    fill: var(--cg-red);
    r: 11;
}

.sl-cursor {
    fill: none;
    stroke: rgba(196, 122, 23, 0.85);
    stroke-width: 5;
}

.sl-seg {
    stroke: transparent;
    stroke-width: 14;
    stroke-linecap: round;
}

.sl-e.sl-hover .sl-seg {
    stroke: rgba(23, 48, 63, 0.22);
}

.sl-e.sl-on .sl-seg {
    stroke: var(--sl-ink);
}

.sl-x1,
.sl-x2 {
    stroke: transparent;
    stroke-width: 7;
    stroke-linecap: round;
}

.sl-e.sl-off .sl-x1,
.sl-e.sl-off .sl-x2 {
    stroke: #c1928c;
}

.sl-board.sl-won .sl-e.sl-on .sl-seg {
    stroke: var(--cg-green);
}

.sl-board.sl-won .sl-dot.sl-live {
    fill: var(--cg-green);
}

.sl-side {
    display: grid;
    gap: 10px;
    align-content: start;
}

.sl-acts,
.sl-tabs,
.sl-modes {
    display: grid;
    gap: 8px;
}

.sl-acts,
.sl-modes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sl-tabs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sl-hint {
    margin: 0;
    color: var(--cg-muted);
    font-size: 13px;
    line-height: 1.4;
}

.sl-cover {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: grid;
    place-items: center;
    padding: 14px;
    border-radius: 12px;
    background: rgba(246, 247, 242, 0.86);
    backdrop-filter: blur(4px);
}

.sl-cover[hidden],
.sl-modal[hidden] {
    display: none;
}

.sl-cover-card {
    width: min(280px, 94%);
    display: grid;
    gap: 9px;
    padding: 18px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
    text-align: center;
}

.sl-cover-card strong { font-size: 24px; }

.sl-cover-card span {
    color: var(--cg-muted);
    font-weight: 700;
}

.sl-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(30, 37, 40, 0.42);
    overflow-y: auto;
}

.sl-modal-card {
    width: min(470px, 100%);
    max-height: 92vh;
    overflow-y: auto;
    padding: 18px;
    border: 1px solid var(--cg-line);
    border-radius: 10px;
    background: var(--cg-panel);
    box-shadow: var(--cg-shadow);
}

.sl-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.sl-modal-head strong { font-size: 20px; }

.sl-modal-card p {
    margin: 9px 0 0;
    color: var(--cg-muted);
    font-size: 14px;
    line-height: 1.45;
}

.sl-modal-card b {
    color: var(--cg-ink);
}

.sl-example figcaption,
.sl-example p {
    margin: 6px 0 0;
    color: var(--cg-muted);
    font-size: 13px;
    text-align: center;
}

.sl-example {
    margin-top: 12px;
    padding: 8px;
    border: 1px solid var(--cg-line);
    border-radius: 8px;
    background: #fbfcf8;
}

.sl-ex {
    display: block;
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
}

.sl-ex-line {
    stroke: var(--sl-ink);
    stroke-width: 6;
    stroke-linecap: round;
}

.sl-ex-dot {
    fill: var(--sl-dot);
}

.sl-ex-clue {
    fill: #2b3d44;
    font-family: Inter, Arial, sans-serif;
    font-size: 20px;
    font-weight: 800;
    text-anchor: middle;
    dominant-baseline: central;
}

@media (max-width: 900px) {
    .sl-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .sl-side {
        max-width: 700px;
        width: 100%;
        margin: 0 auto;
    }

    .sl-acts,
    .sl-modes {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .sl-stats > div,
    .sl-status > div {
        min-width: 0;
        padding: 6px 7px;
    }

    .sl-stats strong,
    .sl-status strong {
        font-size: 15px;
    }

    .sl-stats span,
    .sl-status span {
        font-size: 10px;
    }

    .sl-btn {
        padding: 0 4px;
        font-size: 14px;
    }

    .sl-seg {
        stroke-width: 16;
    }
}
