/* Text screens (settings, how to play, credits) and the Categories screen */
/* ===== Text screens: settings, how to play, credits ===== */
.sheet { padding: 22px; display: flex; flex-direction: column; gap: 20px; max-width: 640px; }
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 22px; text-transform: uppercase; letter-spacing: 0.04em; margin: 0; }
.sheet p { margin: 0; max-width: 62ch; }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice button { font-size: 15px; padding: 8px 14px; }
.choice button[aria-pressed="true"] { border-color: var(--flag); color: var(--flag); }
input[type="text"], input[type="number"] { font: inherit; color: var(--fg); background: var(--asphalt); border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; width: 100%; max-width: 360px; }
.guide { display: flex; flex-direction: column; gap: 14px; }
.guide-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-tabs button, .rb-nav button { display: inline-flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; font-family: var(--body); font-weight: 500; font-size: 14px; }
.guide-tabs button[aria-selected="true"], .rb-nav button[aria-selected="true"] { border-color: var(--flag); color: var(--flag); }
.guide-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.guide-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--line, #2a2e35); border-radius: 12px; background: var(--panel, #1b1d22); min-height: 140px; }
.guide-card[data-tip] { cursor: help; }
.guide-card[data-tip]:hover, .guide-card[data-tip]:focus { border-color: var(--flag); }
.guide-card .gc-n { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--flag); }
.guide-card b { font-family: var(--display); font-size: 20px; font-weight: 600; letter-spacing: 0.02em; }
.guide-card p { margin: 0; color: var(--muted, #9aa0a6); font-size: 15px; line-height: 1.4; }
.guide-card .gc-more { margin-top: auto; font-size: 12px; color: var(--muted, #9aa0a6); opacity: 0.7; }
.link-btn { background: none; border: 0; padding: 0; color: var(--flag); text-decoration: underline; text-transform: none; letter-spacing: 0; font: inherit; cursor: pointer; }
.rulebook { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.rb-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 12px; }
.rb-nav button { justify-content: flex-start; text-align: left; padding: 8px 10px; font-size: 13px; }
.rb-body { border: 1px solid var(--line, #2a2e35); border-radius: 12px; background: var(--panel, #1b1d22); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rb-body h2 { margin: 0 0 4px; display: flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.rb-art { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; padding-top: 10px; border-top: 1px solid var(--line, #2a2e35); }
.rb-art p { margin: 0; line-height: 1.45; }
.rb-n { font-family: 'IBM Plex Mono', monospace; color: var(--flag); font-size: 14px; padding-top: 1px; }
.rb-table { overflow-x: auto; margin-top: 8px; }
.rb-table table { border-collapse: collapse; font-size: 13px; min-width: 100%; }
.rb-table th, .rb-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line, #2a2e35); white-space: nowrap; }
.rb-table th { font-family: var(--display); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; color: var(--muted, #9aa0a6); }
.rb-table td { font-family: 'IBM Plex Mono', monospace; }
.rb-table td:first-child { font-family: var(--body); }
.rb-table td { white-space: normal; min-width: 70px; }
.rb-table td:first-child { white-space: nowrap; }
.rb-foot { margin: 6px 0 0; font-size: 12px; color: var(--muted, #9aa0a6); }
@media (max-width: 760px) { .rulebook { grid-template-columns: 1fr; } .rb-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.steps { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; counter-increment: step; }
.steps li::before { content: counter(step); font-family: var(--display); font-weight: 600; font-size: 22px; color: var(--flag); line-height: 1.2; }
.saved { font-size: 13px; color: var(--muted); min-height: 20px; }

/* ===== Categories screen ===== */
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.tabs button { flex-shrink: 0; font-size: 15px; padding: 8px 14px; position: relative; }
.tabs button[aria-selected="true"] { background: var(--flag); color: var(--asphalt); border-color: var(--flag); }
.tabs button.mine::before { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--flag); }
.tabs button.mine[aria-selected="true"]::before { background: var(--asphalt); }
.cat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.lic-badge { flex-shrink: 0; display: inline-block; vertical-align: middle; }
.cat-label { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; }
.cat-title { display: flex; align-items: center; gap: 14px; }
.cat-title .lic-badge { width: clamp(46px, 8vw, 64px); height: auto; }
.cat-sub { display: block; font-family: var(--display); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.cat-name { font-family: var(--display); font-weight: 600; font-size: clamp(36px, 7vw, 56px); text-transform: uppercase; line-height: 0.95; margin: 0; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ok, .bad { font-size: 13px; padding: 3px 10px; border-radius: 4px; border: 1px solid; }
.ok { color: #3fc79a; border-color: #3fc79a; }
.bad { color: #e5484d; border-color: #e5484d; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.fact { background: var(--asphalt); border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.fact b { display: block; font-family: var(--display); font-weight: 600; font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.regionbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.cal { display: flex; flex-direction: column; }
.cal-row { display: grid; grid-template-columns: 34px 110px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 4px; border-top: 1px solid var(--line); font-size: 14px; font-variant-numeric: tabular-nums; }
.cal-row.past { color: var(--muted); }
.cal-row.next { background: color-mix(in srgb, var(--flag) 10%, transparent); }
.cal-row .rd { font-family: var(--display); font-weight: 600; font-size: 18px; }
.cal-row .trk { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.cal-row .tag { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--flag); }
@media (max-width: 520px) { .cal-row { grid-template-columns: 30px 88px minmax(0, 1fr); } .cal-row .tag { display: none; } }
.gc-table { margin-top: 8px; overflow: visible; } .gc-table table { width: 100%; font-size: 13px; table-layout: auto; }   /* a small table inside a How to play card */
.gc-table td, .gc-table th { padding: 4px 8px; white-space: normal; overflow: visible; text-overflow: clip; max-width: none; font-family: var(--body); }
.gc-table td:first-child { width: 42%; }
