@font-face{font-family:'Komika Text Tight';font-weight:400;font-style:normal;font-display:swap;src:url('fonts/komika-text-tight-400.d588a41b.woff2') format('woff2')}
@font-face{font-family:'Komika Text';font-weight:400;font-style:normal;font-display:swap;src:url('fonts/komika-text-400.e12e9613.woff2') format('woff2')}
@font-face{font-family:'Komika Text';font-weight:700;font-style:normal;font-display:swap;src:url('fonts/komika-text-700.ddfe47eb.woff2') format('woff2')}
@font-face{font-family:'Komika Kaps';font-weight:700;font-style:normal;font-display:swap;src:url('fonts/komika-kaps-700.b4ab9849.woff2') format('woff2')}
@font-face{font-family:'Komika Logo';font-weight:700;font-style:normal;font-display:swap;src:url('fonts/komika-logo-700.389dc223.woff2') format('woff2')}

/* Retro comic look (Pitch 'n Roll rules 3.7 retro): light-blue halftone page, white cards with heavy ink outline and hard offset shadow */
:root {
  --sky: #9ccfea; --paper: #ffffff; --cream: #f8f7f4; --ink: #302d2c; --grass: #8cb157; --clay: #ebcbb4; --navy: #1e2a55; --red: #b23038;
  --bg: var(--sky); --panel: var(--paper); --muted: #6b6461; --line: #302d2c; --soft: #d9d4cf; --accent: var(--red); --accent-ink: #ffffff;
  --rowA: #ffffff; --rowB: #eaf5fb; --pill: #ffffff; --pill-def: #d6ecf8; --warn: var(--red);
  --board: var(--navy); --board-ink: var(--cream);
  --display: 'Komika Kaps', 'Komika Text', 'Comic Sans MS', sans-serif; --body: 'Komika Text', 'Comic Sans MS', sans-serif; --mono: 'Komika Text Tight', 'Komika Text', 'Comic Sans MS', sans-serif;
  --bw: 3px; --shadow: 4px 4px 0 var(--ink); --shadow-s: 2px 2px 0 var(--ink);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--sky); }
body { background-color: var(--sky); background-image: radial-gradient(rgba(30, 42, 85, .13) 1.1px, transparent 1.6px); background-size: 9px 9px; background-attachment: fixed;
  color: var(--ink); font-family: var(--body); font-size: 15px; margin: 0; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 16px; padding-block: 0 40px; }
/* sticky strip: board + always a band of blue page below it, so content never touches the board */
.boardwrap { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; margin-inline: -16px; padding: 12px 16px 14px;
  background-color: var(--sky); background-image: radial-gradient(rgba(30, 42, 85, .13) 1.1px, transparent 1.6px); background-size: 9px 9px; background-attachment: fixed; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
::selection { background: var(--clay); }

/* scoreboard – light cream board, logo like the rules title */
.board { position: relative; background: var(--clay); color: var(--ink);
  border: var(--bw) solid var(--ink); border-radius: 0; box-shadow: var(--shadow); padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 18px; }
.brand { display: grid; justify-items: center; line-height: .9; padding: 2px 4px 0 0; }
.brand .logo { font-family: 'Komika Logo', var(--display); font-weight: 700; font-size: 38px; letter-spacing: .01em; white-space: nowrap; color: var(--red);
  -webkit-text-stroke: 1.6px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink), 3px 3px 0 var(--ink), 4px 4px 0 var(--ink); }
.brand small { font-family: var(--body); font-weight: 700; font-size: 13px; letter-spacing: .14em; color: var(--ink); margin-top: 4px; }
.teams { display: flex; gap: 18px; align-items: center; }
.team { display: grid; justify-items: center; line-height: 1; }
.team small { font-family: var(--display); font-size: 13px; letter-spacing: .04em; color: #5a4a40; max-width: 120px; text-align: center; line-height: 1.1; overflow-wrap: normal; }
.team { align-content: end; }
.team b { font-family: var(--display); font-size: 40px; font-variant-numeric: tabular-nums; color: var(--ink); }
.team.batting small { color: var(--ink); }
.team.batting small::after { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--grass); border: 1.5px solid var(--ink); margin-left: 5px; vertical-align: 1px; }
.inn { display: grid; justify-items: center; line-height: 1; padding: 0 4px; }
.inn small { font-family: var(--display); font-size: 12px; letter-spacing: .04em; color: #5a4a40; }
.inn small.hl { font-size: 11px; margin-top: 1px; }
.innrow { display: flex; align-items: center; gap: 5px; }
.inn b { font-family: var(--display); font-size: 40px; color: var(--ink); }
.halves { width: 17px; height: 32px; }
.halves path { fill: var(--paper); stroke: var(--ink); stroke-width: 2; stroke-linejoin: round; }
.halves path.on { fill: var(--red); }
.stat { display: grid; gap: 4px; justify-items: center; }
.stat small { font-family: var(--display); letter-spacing: .04em; font-size: 12px; color: #5a4a40; }
.dots { display: flex; gap: 6px; }
.count { display: flex; gap: 22px; align-items: center; }
/* two-position switch: game record / team stats */
.viewsw { display: inline-flex; flex-direction: column; border: 2.5px solid var(--ink); box-shadow: var(--shadow-s); background: var(--paper); }
.viewsw button { border: 0; background: transparent; padding: 5px 12px 4px; font-family: var(--display); font-weight: 700; font-size: 13px; color: var(--ink); text-align: left; }
.viewsw button + button { border-top: 2.5px solid var(--ink); }
.viewsw button.on, .viewsw button.on:hover { background: var(--navy); color: var(--cream); }
.viewsw button:not(.on):hover { background: var(--cream); }
.wrap[data-view="log"] .grid2 { display: none; }
.wrap[data-view="team"] .grid { display: none; }
.tnote { margin: 14px 0 0; font-size: 12px; }
@media (max-width: 600px) { .count { gap: 16px; } }
.dot { width: 17px; height: 17px; border-radius: 50%; border: 2.5px solid var(--ink); background: var(--paper); padding: 0; }
.dot.on { background: var(--red); }
.dot.ball.on { background: var(--grass); }
.dot.strike.on { background: var(--red); }
.diamond { width: 74px; height: 64px; color: var(--ink); }
.diamond rect { fill: var(--paper); stroke: var(--ink); stroke-width: 2.5; cursor: pointer; }
.diamond rect.on { fill: var(--red); }
@media (max-width: 600px) { .boardwrap { position: relative; } .board { gap: 8px 16px; } .team b { font-size: 34px; } }
.board.pv::after { content: 'náhled rozepsaného řádku'; position: absolute; right: 16px; bottom: 2px; font-family: var(--mono); font-size: 11px; color: #5a4a40; }
.board .actions { margin-left: auto; display: flex; gap: 6px; }
.board .btn { padding: 6px 10px; }
.btn { border: 2.5px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 12px; padding: 7px 14px; font-family: var(--body); font-weight: 700; box-shadow: var(--shadow-s); }
.btn:hover:not(:disabled) { background: var(--cream); }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #9c2830; }
.btn:disabled { opacity: .45; cursor: default; box-shadow: none; }
.confirm { display: flex; gap: 6px; align-items: center; font-size: 13px; }

.banner { margin-top: 12px; background: var(--clay); border: 2.5px solid var(--ink); border-radius: 14px; box-shadow: var(--shadow-s); padding: 8px 12px; font-size: 14px; }
.grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; margin-top: 2px; align-items: start; }
@media (max-width: 900px) { .grid { grid-template-columns: minmax(0, 1fr); } }
.panel { overflow: clip; background: var(--paper); border: var(--bw) solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); padding: 14px 16px 16px; min-width: 0; }
/* card title = pill label like the rules' phase headers */
/* card title = comic narration caption in the card's top-left corner */
/* card title: plain lettering with a short red underline */
h2 { display: inline-block; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: .04em; color: var(--ink);
  margin: 0 0 12px; padding: 0 2px 4px; border-bottom: 3px solid var(--red); }

/* live line = speech bubble */
.live { position: relative; background: var(--cream); border: 2.5px solid var(--ink); border-radius: 16px; padding: 10px 14px; font-family: var(--mono); font-size: 17px; min-height: 48px; overflow-wrap: anywhere; }
.live .ph { color: var(--muted); }
.prompt { margin: 10px 0 4px; color: var(--muted); font-size: 14px; }
.prompt b { color: var(--ink); }

/* groups */
.group { padding: 8px 0; border-top: 2px dashed var(--soft); display: grid; grid-template-columns: 118px minmax(0,1fr); gap: 10px; align-items: center; }
.group:first-of-type { border-top: 0; }
.fixedgroups { border-bottom: 3px solid var(--ink); padding-bottom: 4px; }
.fixedgroups .group { padding: 5px 0; }
.group.fixed .glabel { color: var(--ink); }
.group.idle .glabel { color: var(--muted); opacity: .55; }
.group.fixed .pill { padding: 4px 11px 3px; font-size: 13px; }
.group .ph { color: var(--muted); font-size: 13px; }
/* one place where the current step changes – fixed height so nothing below jumps */
.stepslot { min-height: 190px; padding-top: 4px; }
.stepslot .group:first-child { border-top: 0; }
.stepdone { padding: 14px 0; color: var(--muted); font-size: 14px; }
@media (max-width: 520px) { .group { grid-template-columns: minmax(0,1fr); gap: 6px; } }
.glabel { font-family: var(--display); font-weight: 700; letter-spacing: .03em; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.glabel img { width: 22px; height: 22px; border: 1.5px solid var(--ink); border-radius: 5px; flex: none; }
.group.active .glabel { color: var(--red); }
.group.active .glabel::after { content: ''; width: 0; height: 0; border-block: 6px solid transparent; border-left: 8px solid var(--red); margin-left: auto; margin-right: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 9px; }
.row .die + .die { margin-left: 1px; }
/* dice = real faces from the rules */
.die { width: 52px; height: 52px; border: 2.5px solid var(--ink); border-radius: 11px; background: var(--paper); position: relative; padding: 0; overflow: visible;
  display: grid; place-items: center; box-shadow: var(--shadow-s); }
.die img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }
.die span { position: absolute; right: -6px; bottom: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink);
  display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 12px; line-height: 1; color: var(--ink); padding-top: 1px; }
.die:not(.x) span { display: none; }
.die.x { background: var(--cream); }
.die.x span { position: static; width: auto; height: auto; border: 0; background: none; font-size: 26px; color: var(--red); }
.face { width: 66px; border: 2.5px solid var(--ink); border-radius: 11px; background: var(--paper); padding: 4px 3px 3px; display: grid; justify-items: center; gap: 2px; box-shadow: var(--shadow-s); }
.face img { width: 46px; height: 46px; object-fit: contain; }
.face span { font-family: var(--display); font-weight: 700; font-size: 15px; line-height: 1; }
.face small { font-size: 10px; color: var(--muted); line-height: 1.1; text-align: center; }
.pill { border: 2.5px solid var(--ink); background: var(--pill); border-radius: 999px; padding: 6px 14px 5px; font-family: var(--body); font-weight: 700; font-size: 14px; box-shadow: var(--shadow-s); }
.pill:hover:not(:disabled) { background: var(--cream); }
.pill.def { background: var(--pill-def); }
.pill.def:hover:not(:disabled) { background: #c3e2f4; }
.playb { width: 72px; border: 2.5px solid var(--ink); border-radius: 11px; background: var(--paper); padding: 5px 4px 4px; display: grid; justify-items: center; gap: 3px; box-shadow: var(--shadow-s); }
.playb svg { width: 38px; height: 38px; display: block; pointer-events: none; }
.playb span { font-family: var(--display); font-weight: 700; font-size: 14px; line-height: 1; }
button.sel { outline: 3px solid var(--red); outline-offset: 2px; }
.row button:disabled { opacity: .3; cursor: default; filter: grayscale(.7); box-shadow: none; }
.dgrid { display: grid; grid-template-columns: repeat(6, 52px); gap: 10px 10px; }
.dgrid .gap { width: 52px; height: 52px; }
@media (max-width: 520px) { .die, .dgrid .gap { width: 44px; height: 44px; } .dgrid { grid-template-columns: repeat(6, 44px); gap: 9px 8px; } .face { width: 60px; } .playb { width: 64px; } .panel { padding: 12px 12px 14px; } }
.pill.tog.on { background: var(--grass); color: var(--ink); }
.pill.ok { background: var(--red); color: #fff; }
.mbtns { display: flex; gap: 7px; flex-wrap: wrap; width: 100%; }
.stat.who { justify-items: start; min-width: 0; }
.stat.who .batno { max-width: 100%; min-width: 0; }
.stat.who .pname { flex: 1 1 auto; min-width: 0; }
.stat.who .pst { display: block; width: 100%; overflow: hidden; }
/* desktop: board is always one line of constant size – long names are cut with … instead of wrapping */
@media (min-width: 1024px) {
  .board { flex-wrap: nowrap; height: 92px; }
  .brand, .teams, .count, .diamond, .viewsw { flex: none; }
  .team { width: 108px; }
  .team small { max-width: 108px; }
  .stat.who { flex: 0 1 170px; overflow: hidden; }
}
@media (min-width: 1024px) and (max-width: 1150px) { .board .brand .logo { font-size: 24px; } .board .brand small { font-size: 9px; } .diamond { width: 62px; height: 54px; } }
@media (min-width: 1024px) and (max-width: 1280px) { .count { gap: 14px; } .board { column-gap: 12px; padding-inline: 14px; } .team { width: 92px; } .team small { max-width: 92px; } }
@media (max-width: 1360px) { .board { column-gap: 16px; } .brand .logo { font-size: 30px; } .brand small { font-size: 10px; } }
@media (max-width: 600px) { .brand { flex: 1 1 100%; } .brand .logo { font-size: 32px; } }
.pname { display: grid; font-family: var(--body); font-weight: 700; font-size: 15px; line-height: 1.05; max-width: 150px; }
.pname .fit { display: block; white-space: nowrap; overflow: hidden; }
.pst { font-family: var(--mono); font-size: 12px; opacity: .85; white-space: nowrap; font-variant-numeric: tabular-nums; }
.batno { display: flex; align-items: center; gap: 5px; font-family: var(--display); font-size: 22px; }
.batno .bn { background: var(--paper); border: 1.5px solid var(--ink); color: var(--ink); border-radius: 6px; width: 22px; height: 24px; padding: 0; font-size: 16px; line-height: 1; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 560px), 1fr)); gap: 18px; margin-top: 2px; align-items: start; }
.tpanel h3 { font-family: var(--display); font-size: 13px; letter-spacing: .04em; color: var(--ink); margin: 14px 0 5px; }
table.st input { width: 136px; font: inherit; font-family: var(--body); font-size: 14px; font-weight: 700; color: var(--ink); background: transparent; border: 0; border-bottom: 2px dashed transparent; border-radius: 0; padding: 2px 0; outline: none; }
table.st input::placeholder { color: var(--muted); font-weight: 400; opacity: .75; }
table.st input:hover { border-bottom-color: var(--soft); }
table.st input:focus { border-bottom: 2px solid var(--red); }
table.st th:nth-child(2) { text-align: left; }
table.st tr.cur td { background: var(--rowB); }
table.st tr.cut td { border-bottom: 2.5px solid var(--ink); }
table.st tr.gone input { color: var(--muted); text-decoration: line-through; }
table.st tr.tot td { font-weight: 700; background: var(--clay); border-top: 2.5px solid var(--ink); border-bottom: 0; }
table.st tr.tot td.tl { text-align: left; font-family: var(--display); font-size: 12px; letter-spacing: .04em; color: var(--ink); }
table.st td.ord { color: var(--muted); font-weight: 700; text-align: right; padding-right: 6px; min-width: 14px; }
table.st tr.sub td.nmc { padding-left: 16px; position: relative; }
table.st tr.sub td.nmc::before { content: '↳'; position: absolute; left: 3px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 12px; font-family: system-ui, sans-serif; }
table.st tr.sub input { width: 120px; }
table.st tr.left input { color: var(--muted); }
table.bt th:nth-child(2) { text-align: right; }
table.bt th:nth-child(3) { text-align: left; }
table.st.tm th:nth-child(2) { text-align: center; }
table.st.tm th, table.st.tm td { min-width: 36px; text-align: center; }
table.st.tm td { font-family: var(--display); font-size: 16px; }
table.st td.mk { width: 14px; color: var(--red); padding-right: 0; }
.hint { color: #3c4a63; font-size: 13px; margin: -4px 0 10px; }
.rosters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 18px; }
.rteam h3, .steam h3 { font-family: var(--display); font-size: 17px; letter-spacing: .04em; margin: 0 0 8px; }
.rcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.rcols h4 { font-family: var(--display); font-size: 12px; letter-spacing: .04em; color: var(--muted); margin: 0 0 6px; }
.rcols ol { margin: 0; padding-left: 1.7em; display: grid; gap: 4px; }
.rcols input, .rcols select { width: 100%; font: inherit; font-size: 14px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 4px 6px; }
.rcols li { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: 10px; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px; background: var(--cream); border: 1.5px solid var(--ink); color: var(--ink); margin-top: 2px; }
.badge.on { background: var(--red); color: #fff; }
.steams { display: grid; gap: 18px; }
.stab { overflow-x: auto; margin-bottom: 10px; }
table.st { border-collapse: collapse; font-family: var(--mono); font-size: 14px; font-variant-numeric: tabular-nums; }
table.st th, table.st td { border-bottom: 1.5px dashed var(--soft); padding: 3px 6px; text-align: right; white-space: nowrap; }
table.st th { font-family: var(--display); letter-spacing: .02em; font-size: 12px; color: var(--cream); background: var(--navy); font-weight: 700; border-bottom: 0; padding-block: 5px 4px; }
table.st th:first-child { border-top-left-radius: 8px; }
table.st th:last-child { border-top-right-radius: 8px; }
table.st td:first-child, table.st th:first-child { text-align: left; }
table.st td.gone { color: var(--muted); }
.nm { font-family: var(--body); font-weight: 700; font-size: 13px; color: var(--red); margin-right: 4px; }
.bname { display: block; font-size: 11px; opacity: .8; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.rcols li.lu { font-size: 14px; color: var(--ink); padding: 4px 0; }
.rcols li.lu.up { font-weight: 700; color: var(--red); }
.sublbl { font-size: 13px; color: var(--muted); align-self: center; margin-right: 4px; }
.sth { font-family: var(--display); font-size: 17px; letter-spacing: .04em; margin: 0 0 6px; }
#console { scroll-margin-top: var(--boardH, 110px); }
@media (min-width: 901px) {
  /* both cards always the same height: one screen under the board, each scrolls inside */
  .grid { align-items: stretch; }
  .grid > .panel { position: sticky; top: var(--boardH, 110px); height: calc(100vh - var(--boardH, 110px) - 16px); min-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
  #logPanel { display: flex; flex-direction: column; }
  .wrap { padding-bottom: 12px; }
  .grid2 { align-items: stretch; }
  .grid2 > .panel { height: calc(100vh - var(--boardH, 110px) - 16px); min-height: 420px; overflow-y: auto; overscroll-behavior: contain; }
  #logPanel > * { flex: none; }
  #logPanel .logwrap { flex: 1 1 auto; min-height: 120px; max-height: none; }
}
.keys summary { cursor: pointer; }
.commitrow .spacer { flex: 1; }
.commitrow { display: flex; gap: 8px; justify-content: flex-end; padding-top: 12px; border-top: 2px dashed var(--soft); flex-wrap: wrap; }

/* log */
.logwrap { max-height: 70vh; overflow: auto; padding-right: 2px; }
.newbox { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 0 12px 12px; padding-top: 10px; border-top: 2px dashed var(--soft); }
.newbox .hint { margin: 0; font-size: 12.5px; }
.newbox .expbtns { align-items: center; }
#newBox { border-top: 0; padding-top: 0; }
.newbox .expbtns:not(:has(.exp:not([hidden]))) { display: none; }
.half { margin-top: 12px; }
.half h3 { font-family: var(--display); font-size: 14px; letter-spacing: .04em; color: var(--ink); margin: 0 0 6px; }
ol.lines { margin: 0; padding-left: 2.4em; font-family: var(--mono); font-size: 15px; line-height: 1.45; }
ol.lines li { padding: 3px 7px; overflow-wrap: anywhere; }
ol.lines li::marker { font-family: var(--display); font-size: 12px; color: var(--muted); }
ol.lines li.s0 { background: var(--rowA); }
ol.lines li.s1 { background: var(--rowB); }
ol.lines li.s1 + li.s0, ol.lines li.s0 + li.s1 { border-top: 1.5px dashed var(--soft); }
.endline { font-family: var(--mono); font-size: 14px; background: #d3e4bd; border: 2px solid var(--ink); border-radius: 10px; padding: 4px 10px; margin: 0 0 8px; }
.endline.final { background: var(--clay); font-weight: 700; }
.tablewrap { overflow-x: auto; margin-bottom: 12px; padding: 0 4px 4px 0; }
table.ls { border-collapse: separate; border-spacing: 0; font-family: var(--display); font-size: 16px; font-variant-numeric: tabular-nums; border: 2.5px solid var(--ink); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-s); }
table.ls th, table.ls td { border-right: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); padding: 4px 8px 3px; text-align: center; min-width: 28px; }
table.ls tr > :last-child { border-right: 0; }
table.ls tr:last-child > * { border-bottom: 0; }
table.ls th { background: var(--navy); color: var(--cream); font-weight: 700; font-size: 13px; letter-spacing: .03em; }
table.ls td.t { text-align: left; font-family: var(--body); font-weight: 700; font-size: 15px; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.ls td.tot { font-weight: 700; background: var(--clay); }
.setup { margin: 10px 0 12px; border: 2.5px solid var(--ink); border-radius: 14px; background: var(--paper); box-shadow: var(--shadow-s); }
.setup > summary { list-style: none; cursor: pointer; display: flex; gap: 8px; align-items: baseline; padding: 7px 12px 6px; border-radius: 12px; background: var(--cream); min-width: 0; }
.setup > summary::-webkit-details-marker { display: none; }
.setup > summary::before { content: '+'; font-family: var(--display); font-weight: 700; color: var(--red); width: 10px; flex: none; }
.setup[open] > summary::before { content: '–'; }
.setup[open] > summary { border-bottom: 2px dashed var(--soft); border-radius: 12px 12px 0 0; }
.setup .st-t { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: .03em; flex: none; }
.setup .st-v { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.setup > :not(summary) { margin-left: 12px; margin-right: 12px; }
.setup > .foldbar { margin-bottom: 12px; }
.loghead { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.loghead h2 { margin-bottom: 12px; }
.expbtns { display: flex; gap: 7px; flex-wrap: wrap; }
.meta { display: flex; flex-wrap: wrap; gap: 8px 12px; margin: 4px 0 6px; align-items: flex-start; }
.meta label { display: grid; gap: 3px; font-family: var(--display); font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.rules { margin: -4px 0 12px; font-size: 14px; }
.rules summary { cursor: pointer; color: var(--muted); }
.rulesgrid { display: grid; grid-template-columns: repeat(2, minmax(0, max-content)); gap: 8px 14px; margin-top: 8px; align-items: end; }
.rulesgrid label { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.rulesgrid label.chk { display: flex; gap: 6px; align-items: center; grid-column: 1 / -1; font-size: 14px; color: var(--ink); }
.rulesgrid input[type=number] { width: 80px; font: inherit; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 5px 8px; }
.rulesgrid input[type=checkbox] { accent-color: var(--red); width: 16px; height: 16px; }
.rnote { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.varsbox { margin-top: 10px; padding-top: 8px; border-top: 2px dashed var(--soft); display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.varsbox .varshead { flex: 1 1 100%; font-family: var(--display); font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.varsbox label.chk { display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--ink); }
.varsbox input[type=checkbox] { accent-color: var(--red); width: 16px; height: 16px; }
.varsbox.locked label.chk { opacity: .55; }
.varsbox .rnote { flex: 1 1 100%; margin-top: 2px; }
.meta label.wide { flex: 1 1 100%; }
.meta select.preset { font: inherit; font-family: var(--body); font-size: 13px; letter-spacing: 0; color: var(--ink); background: var(--rowB); border: 2px dashed var(--ink); border-radius: 8px; padding: 3px 6px; width: 165px; max-width: 100%; margin-top: 3px; }
.meta #teamV, .meta #teamH { width: 165px; }
.meta #gdate { width: 150px; }
.meta input[readonly] { background: var(--cream); border-style: dashed; cursor: default; }
.meta select.preset:disabled { opacity: .55; cursor: not-allowed; }
table.st input[readonly] { cursor: default; }
.meta textarea { font: inherit; font-family: var(--body); font-size: 14px; letter-spacing: 0; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 6px 8px; width: 100%; resize: vertical; }
.meta input { font: inherit; font-family: var(--body); font-size: 15px; letter-spacing: 0; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 9px; padding: 6px 8px 5px; width: 150px; max-width: 100%; }
.meta input:focus, .meta textarea:focus, .fold textarea:focus, .rulesgrid input:focus { outline: 3px solid var(--sky); outline-offset: 0; }
.toast { font-size: 14px; color: var(--red); font-weight: 700; }
#groups button:focus, #commit:focus { outline: 3px solid var(--red); outline-offset: 2px; }
.pill.q { font-weight: 700; }
.keys { font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.8; }
.keys kbd { font-family: var(--display); font-size: 11px; border: 1.5px solid var(--ink); border-bottom-width: 3px; border-radius: 5px; padding: 0 5px; background: var(--paper); color: var(--ink); }
.btn.sm { padding: 4px 11px; font-size: 13px; min-height: 0; }
.foldbar { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; margin: 8px 0 10px; }
.fold { display: block; }
.fold[open] { flex: 1 1 100%; }
.iobar .fold { order: -1; }
.iobar .fold[open] { order: 10; }
.fold > summary { list-style: none; cursor: pointer; font-size: 13px; color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 11px 2px; background: var(--cream); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: '+ '; font-weight: 700; color: var(--red); }
.fold[open] > summary { background: var(--rowB); }
.fold[open] > summary::before { content: '– '; }
.fold > summary { display: inline-block; }
.fold > :not(summary) { margin-top: 8px; }
.fold textarea { font: inherit; font-family: var(--body); font-size: 14px; color: var(--ink); background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 6px 8px; width: 100%; resize: vertical; }
.fold .rulesgrid, .fold .rnote { margin-top: 2px; }
.cloudmini { font-size: 12px; color: var(--muted); }
.iobar .savesbar { margin: 2px 0 6px; }

.saves { margin: -4px 0 12px; font-size: 14px; border: 2px solid var(--ink); border-radius: 12px; padding: 8px 12px; background: var(--cream); }
.saves summary { cursor: pointer; font-family: var(--display); font-weight: 700; letter-spacing: .03em; }
.savesbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.savesbar .hint { font-size: 13px; color: var(--muted); }
.savelist { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.savelist li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; background: var(--paper); border: 2px solid var(--ink); border-radius: 12px; padding: 6px 10px; }
.savelist li.curg { background: var(--rowB); }
.savelist .gi { min-width: 0; flex: 1 1 220px; }
.savelist .gt { font-weight: 700; }
.savelist .gs { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.savelist .ga { display: flex; gap: 6px; flex-wrap: wrap; }
.savelist .empty { color: var(--muted); background: none; border: 0; padding: 2px 0; }
.legend { font-size: 13px; color: var(--muted); margin-top: 14px; line-height: 1.6; border-top: 2px dashed var(--soft); padding-top: 10px; }
.legend code { font-family: var(--display); font-size: 12.5px; color: var(--ink); }
#copybox { border: 2px solid var(--ink); border-radius: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .btn, .pill, .die, .face, .playb { transition: transform .08s, box-shadow .08s; }
  .btn:hover:not(:disabled), .pill:hover:not(:disabled), .die:hover:not(:disabled), .face:hover:not(:disabled), .playb:hover:not(:disabled) { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
  button:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--ink) !important; }
}
