/* bowling.css — "Learning to Code by Bowling" Go tutorial.
   Reuses the terminal theme from the /panel/tmux guide (dark hero with a green
   scan-line, white "postbox" separation cards, green accents, dark code blocks),
   but self-contained so this public page has no dependency on admin.css. */

/* Bluish-cream page background (this stylesheet only loads on the bowling
   page, so the body override is scoped to it). Replaces the site's grey. */
body { background-color: #e7edf1; }

.bowl-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: 8px 4px 80px;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: #1d2327;
}
.bowl-page .back-link {
    display: inline-block;
    margin-bottom: 18px;
    color: #14694a;
    font-size: .9rem;
    text-decoration: none;
    font-weight: 600;
}
.bowl-page .back-link:hover { text-decoration: underline; }

/* ── dark hero (black background, green scan-line) ─────────────────────── */
.bowl-hero {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 30px 32px;
    margin-bottom: 22px;
    color: #c9d1d9;
    position: relative;
    overflow: hidden;
}
.bowl-hero::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #39d353, #26a641, #39d353);
    background-size: 200% 100%;
    animation: bowl-scan 4s linear infinite;
}
@keyframes bowl-scan {
    0% { background-position: 0% 0; }
    100% { background-position: 200% 0; }
}
.bowl-hero .eyebrow {
    color: #39d353;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: .22em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.bowl-hero h1 {
    margin: 0 0 14px;
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    line-height: 1.1;
    color: #fff;
}
.bowl-hero h1 em { font-style: normal; color: #39d353; }
.bowl-hero .cursor {
    display: inline-block;
    width: 10px; height: 1em;
    background: #39d353;
    vertical-align: text-bottom;
    margin-left: 3px;
    animation: bowl-blink 1s step-end infinite;
}
@keyframes bowl-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}
.bowl-hero .lede {
    color: #8b949e;
    font-size: 1rem;
    line-height: 1.65;
    max-width: 920px;
    margin: 0;
}
.bowl-hero .lede code, .bowl-hero .lede em {
    color: #c9d1d9;
    font-style: normal;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .9em;
}

/* ── scoresheet grid inside the hero ───────────────────────────────────── */
.bowl-scoresheet { margin-top: 24px; }
.bowl-scoresheet .ss-label {
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .62rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #8b949e;
    margin-bottom: 10px;
}
.bowl-ss-grid {
    display: grid;
    grid-template-columns: repeat(9, 1fr) 1.4fr;
    gap: 1px;
    background: #30363d;
    border: 1px solid #30363d;
    border-radius: 4px;
    overflow: hidden;
}
.bowl-frame {
    background: #fff;
    padding: 9px 6px 10px;
    text-align: center;
    font-family: Consolas, Menlo, Monaco, monospace;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 74px;
}
.bowl-frame .rolls {
    display: flex; justify-content: flex-end; gap: 3px;
    font-size: .9rem; height: 20px; color: #000;
}
.bowl-frame .rolls span {
    min-width: 15px; padding: 0 2px;
    border-bottom: 1px solid #30363d;
}
.bowl-frame .rolls span.x { color: #000; font-weight: 700; }
.bowl-frame .total { font-size: 1.35rem; color: #1a56db; margin-top: 5px; }
.bowl-frame .idx { font-size: .62rem; letter-spacing: .1em; color: #000; margin-top: 4px; }
.bowl-final {
    text-align: right; margin-top: 12px;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .68rem; letter-spacing: .14em; text-transform: uppercase; color: #8b949e;
}
.bowl-final strong { font-size: 1.15rem; color: #39d353; letter-spacing: 0; margin-left: 8px; }

/* ── postbox separation cards ──────────────────────────────────────────── */
.bowl-page .postbox {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
    overflow: hidden;
}
.bowl-page .postbox-header {
    display: flex; align-items: center; gap: 14px;
    border-bottom: 1px solid #c3c4c7;
    padding: 12px 16px;
    background: #f6f7f7;
}
.bowl-page .postbox-header .frame-tag {
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .62rem; font-weight: 700; letter-spacing: .16em;
    color: #fff; background: #14694a;
    padding: 3px 8px; border-radius: 3px; flex-shrink: 0;
}
.bowl-page .postbox-header h2 { font-size: 1.05rem; font-weight: 600; color: #1d2327; margin: 0; }
.bowl-page .postbox-header h2 em { font-style: italic; color: #14694a; }
.bowl-page .inside { padding: 16px 18px; }
.bowl-page .inside p { color: #2c3338; line-height: 1.65; margin: 0 0 14px; max-width: none; }
.bowl-page .inside p:last-child { margin-bottom: 0; }
.bowl-page .inside strong { color: #1d2327; font-weight: 600; }
.bowl-page .inside em { color: #14694a; font-style: italic; }
.bowl-page .inside h3 {
    font-size: 1rem; color: #1d2327; margin: 22px 0 10px; font-weight: 600;
}
.bowl-page .inside h3 em { color: #14694a; }
.bowl-page .inside ul, .bowl-page .inside ol {
    padding-left: 22px; margin: 12px 0 16px; max-width: none;
}
.bowl-page .inside li { margin-bottom: 8px; line-height: 1.6; color: #2c3338; }
.bowl-page .inside code {
    background: #f0f0f1; border: 1px solid #e0e0e2; border-radius: 3px;
    padding: 1px 5px; font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .86em; color: #14332a;
}

/* ── dark code blocks with Go syntax highlighting ──────────────────────── */
.bowl-codelabel {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .64rem; letter-spacing: .12em; text-transform: uppercase;
    color: #646970; margin: 20px 0 6px;
}
.bowl-codelabel .lines { color: #14694a; font-weight: 700; }
.bowl-page pre.bd-code {
    background: #1d2327; color: #e7e8ea;
    border-radius: 5px; padding: 16px 18px; margin: 0 0 18px;
    overflow-x: auto;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .82rem; line-height: 1.6;
    white-space: pre;
}
.bowl-page pre.bd-code .cmt { color: #8f9aa3; font-style: italic; }
.bowl-page pre.bd-code .kw  { color: #a9c5a0; }
.bowl-page pre.bd-code .str { color: #e8c77a; }
.bowl-page pre.bd-code .num { color: #e8c77a; }
.bowl-page pre.bd-code .var { color: #e38b85; font-weight: 500; }
.bowl-page pre.bd-code .add {
    display: inline-block;
    background: rgba(57, 211, 83, 0.16);
    box-shadow: 4px 0 0 rgba(57, 211, 83, 0.16), -2px 0 0 rgba(57, 211, 83, 0.16);
}
/* copy button injected by bandwidth-docs.js */
.bowl-page .bd-code-wrap { position: relative; }
.bowl-page .bd-copy {
    position: absolute; top: 8px; right: 8px;
    padding: 4px 12px;
    font: 700 .72rem/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #eaf0ff; background: #1e40af; border: 1px solid #3b5bd6;
    border-radius: 4px; cursor: pointer; opacity: 1;
    transition: background .15s, color .15s;
}
.bowl-page .bd-copy:hover { background: #1d4ed8; color: #fff; }
.bowl-page .bd-copy.done { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ── expected-output block (dark, no copy button) ──────────────────────── */
.bowl-expected {
    background: #1d2327; color: #e7e8ea;
    border-radius: 5px; padding: 16px 18px; margin: 16px 0 18px;
    overflow-x: auto;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .82rem; line-height: 1.75; white-space: pre;
}
.bowl-expected .lbl { color: #8f9aa3; }
.bowl-expected .val { color: #e8c77a; }
.bowl-expected .final { color: #39d353; font-weight: 700; }

/* ── callout (green-accented note) ─────────────────────────────────────── */
.bowl-callout {
    background: #dcfce7;
    border-left: 4px solid #15803d;
    border-radius: 4px;
    padding: 14px 16px;
    margin: 16px 0;
    line-height: 1.6;
}
.bowl-callout .tag {
    display: block;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .62rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
    color: #15803d; margin-bottom: 8px;
}
.bowl-callout p { margin: 0 0 8px; color: #14532d; max-width: none; }
.bowl-callout p:last-child { margin-bottom: 0; }
.bowl-callout em { color: #166534; }

/* ── pull quote ────────────────────────────────────────────────────────── */
.bowl-pull {
    border-left: 3px solid #39d353;
    padding: 4px 0 4px 18px;
    margin: 18px 0;
    font-size: 1.15rem; line-height: 1.4; font-style: italic;
    color: #14332a; max-width: none;
}

/* ── step cards (frame-by-frame method recap) ──────────────────────────── */
.bowl-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px; margin: 6px 0;
}
.bowl-step {
    background: #f6f7f7; border: 1px solid #dcdcde; border-left: 4px solid #39d353;
    border-radius: 5px; padding: 14px 16px;
}
.bowl-step .num {
    display: inline-block; width: 22px; height: 22px; line-height: 22px;
    text-align: center; border-radius: 50%; background: #14694a; color: #fff;
    font-size: .78rem; font-weight: 700; margin-right: 8px;
}
.bowl-step h3 { display: inline; font-size: .98rem; color: #1d2327; margin: 0; }
.bowl-step p { margin: 8px 0 0; color: #3c434a; font-size: .9rem; max-width: none; }

/* ── collapsible full source ───────────────────────────────────────────── */
.bowl-full { margin: 20px 0; border: 1px solid #dcdcde; border-radius: 5px; overflow: hidden; }
.bowl-full summary {
    cursor: pointer; list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: #1e40af;
    font-weight: 600; color: #fff; font-size: .92rem;
    transition: background .15s ease;
}
.bowl-full summary:hover { background: #1d4ed8; }
.bowl-full summary::-webkit-details-marker { display: none; }
.bowl-full summary .sub { color: #c7d5f5; font-weight: 400; font-style: italic; font-size: .85rem; margin-left: 8px; }
.bowl-full summary .arrow { color: #bcd0ff; transition: transform .2s ease; flex-shrink: 0; }
.bowl-full[open] summary .arrow { transform: rotate(90deg); }
.bowl-full[open] summary { border-bottom: 1px solid #1e40af; }
.bowl-full { border-color: #c3cfe6; }
.bowl-full pre.bd-code { margin: 0; border-radius: 0; max-height: 560px; }

/* ── game transition divider ───────────────────────────────────────────── */
.bowl-divider {
    text-align: center; margin: 40px 0 24px;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: #646970;
}
.bowl-divider .x { color: #14694a; font-weight: 700; }
.bowl-transition {
    text-align: center; max-width: 820px; margin: 0 auto 28px;
    font-size: 1.3rem; line-height: 1.35; font-style: italic; color: #14332a;
}
.bowl-transition em { color: #14694a; font-style: normal; font-family: Consolas, Menlo, Monaco, monospace; }

.bowl-footer {
    margin-top: 24px; padding-top: 20px; border-top: 1px solid #c3c4c7;
    text-align: center;
    font-family: Consolas, Menlo, Monaco, monospace;
    font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #646970;
}
.bowl-footer .x { color: #14694a; font-weight: 700; }

@media (max-width: 620px) {
    .bowl-hero { padding: 22px 18px; }
    .bowl-ss-grid { grid-template-columns: repeat(5, 1fr); }
    .bowl-frame:nth-child(n+11) { display: none; }
    .bowl-page pre.bd-code, .bowl-expected { font-size: .74rem; padding: 13px 12px; }
    .bowl-page .postbox-header { flex-wrap: wrap; gap: 8px; }
}
