:root { --blue: #1f6bff; --ink: #0b0b0c; --line: #d9dce1; --soft: #f4f5f7; }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; color: var(--ink); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
button { font: inherit; cursor: pointer; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 12px; color: inherit; }
button.primary { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
button.danger { color: #c0262d; border-color: #f1c4c6; }
input, select { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; width: 100%; background: #fff; color: inherit; }
label { display: block; font-size: 13px; color: #555; margin: 8px 0; }
label input, label select { margin-top: 4px; color: var(--ink); }
.hint { color: #666; font-size: 13px; }
.top { background: #000; color: #fff; display: flex; align-items: center; gap: 12px; padding: 8px 14px; position: sticky; top: 0; z-index: 5; }
.top .logo { height: 34px; }
.team-line { flex: 1; font-size: 13px; color: #cfd3da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save { font-size: 12px; color: #8fb3ff; }
.tabs { display: flex; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 50px; z-index: 4; overflow-x: auto; }
.tabs button { border: 0; border-radius: 0; padding: 12px 14px; flex: 1; color: #666; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--blue); font-weight: 600; }
main { max-width: 900px; margin: 0 auto; padding: 12px; }
.bar, .row { display: flex; gap: 8px; margin: 8px 0; }
.row.end { justify-content: space-between; }
.grp { font-size: 12px; letter-spacing: .08em; color: #888; margin: 16px 0 6px; }
.play { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; width: 100%; text-align: left; margin: 4px 0; padding: 10px 12px; }
.play .call { font-weight: 700; flex: 1 1 60%; }
.play .sub { color: #777; font-size: 13px; }
.badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.tagrow { display: grid; grid-template-columns: 52px 1fr 2fr 44px; gap: 6px; margin: 6px 0; align-items: center; }
.tagrow .emo { font-size: 26px; padding: 4px; }
.tagrow .word { font-weight: 700; text-transform: uppercase; }
.clip { padding: 10px 12px; border-radius: 10px; font-weight: 600; margin-bottom: 10px; }
.clip.good { background: #e6f6ea; color: #17692c; } .clip.bad { background: #fdeaea; color: #a3242a; }
.pair { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin-bottom: 14px; }
.pair-head { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.sw { font-weight: 700; padding: 4px 10px; border-radius: 8px; }
.mir { display: flex; align-items: center; gap: 6px; margin: 0 0 0 auto; color: #444; }
.mir input { width: auto; margin: 0; }
.slot { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 6px; align-items: center; margin: 3px 0; }
.slot select { padding: 6px; font-size: 14px; }
.num { display: inline-flex; justify-content: center; align-items: center; min-width: 26px; height: 26px; border-radius: 6px; font-weight: 700; font-size: 13px; }
.partner { display: flex; gap: 6px; align-items: center; font-size: 13px; color: #444; overflow: hidden; white-space: nowrap; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin: 8px 0; }
.seg button { flex: 1; border: 0; border-radius: 0; }
.seg button.on { background: var(--ink); color: #fff; }
.seg.small button { font-size: 13px; padding: 6px; }
.preview-wrap { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; position: relative; }
#preview { border: 0; transform-origin: 0 0; display: block; background: #fff; }
.fliprow { display: grid; grid-template-columns: 1fr auto 1fr 44px; gap: 6px; align-items: center; margin: 6px 0; }
/* bottom sheets */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { background: #fff; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; border-radius: 16px 16px 0 0; padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.x { border: 0; font-size: 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1.4fr .6fr; gap: 6px; }
.printed { background: var(--soft); border-radius: 10px; padding: 8px 10px; margin: 6px 0; }
.printed div { display: flex; gap: 8px; align-items: baseline; }
.lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #888; min-width: 44px; }
.out { font-weight: 700; font-size: 17px; }
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 4px 0; min-height: 30px; }
.chip { padding: 3px 8px; font-size: 13px; border-radius: 999px; background: var(--soft); }
.keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 6px; background: #e9ebef; padding: 8px; border-radius: 12px; margin: 8px 0; }
.key { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 8px; box-shadow: 0 1px 0 rgba(0,0,0,.15); }
.key .e { font-size: 24px; line-height: 1.1; } .key .w { font-size: 10px; font-weight: 700; color: #555; }
.key.on { background: var(--blue); color: #fff; } .key.on .w { color: #fff; }
.covs { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.cov { font-size: 13px; opacity: .55; } .cov.good { opacity: 1; border-color: var(--ink); font-weight: 600; } .cov.alert { opacity: 1; background: #fff4d6; border-color: #e0a400; font-weight: 600; }
.cats { display: flex; gap: 4px; overflow-x: auto; margin: 6px 0; }
.cats button { font-size: 12px; padding: 5px 9px; white-space: nowrap; }
.cats button.on { background: var(--ink); color: #fff; }
.egrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 4px; background: #e9ebef; padding: 6px; border-radius: 12px; }
.egrid button { font-size: 26px; padding: 4px 0; border: 0; }
.egrid button.used { opacity: .35; }
.custom { display: grid; grid-template-columns: 1fr auto; gap: 6px; align-items: end; }
.custom input { grid-column: 1; } .custom button { grid-column: 2; }
textarea { font: 14px/1.4 ui-monospace, Menlo, monospace; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
.chip.add { background: #eef3ff; border-color: #c9d8ff; }
.cvcolor { border: 1px solid var(--line); border-radius: 12px; padding: 8px; margin: 10px 0; }
.cvcolor .sw { display: inline-block; margin-bottom: 6px; }
.cvrow { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 8px; align-items: center; margin: 3px 0; font-size: 14px; }
.cvrow .from { color: #666; } .cvrow .to { font-weight: 700; }
.slot.solo { grid-template-columns: 28px 1fr; }
.unlink { font-size: 12px; padding: 4px 8px; }
.colorrow { display: grid; grid-template-columns: 44px 44px 1fr 64px 1.3fr auto; gap: 6px; align-items: center; margin: 6px 0; }
.colorrow .pos { font-size: 11px; color: #888; font-weight: 700; }
.colorrow input[type=color] { padding: 2px; height: 38px; }
.colorrow .cabbr { text-transform: uppercase; }
.colorrow .mv button { padding: 6px 8px; }
@media (max-width: 520px) { .colorrow { grid-template-columns: 40px 40px 1fr 56px; } .colorrow .follow { grid-column: 2 / 4; } .colorrow .mv { grid-column: 4; } }
.libgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.libgrid textarea { margin-top: 4px; }
.sug { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; margin: -2px 0 6px; }
.sug .chip { white-space: nowrap; }
.slotbtn { text-align: left; padding: 6px 10px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slotbtn.empty { color: #999; border-style: dashed; font-weight: 400; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); } label.check input { width: auto; margin: 0; }
.sigedit { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 8px 0; }
.sigedit summary { font-weight: 600; cursor: pointer; }
.sigrow { display: grid; grid-template-columns: 24px 44px 1fr 44px 52px; gap: 6px; align-items: center; margin: 5px 0; }
.sigrow .pos { font-size: 11px; color: #888; font-weight: 700; }
.sigprev { height: 38px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 20px; border: 1px solid var(--line); }
.sigrow input[type=color] { padding: 2px; height: 38px; }
.sbrow { display: grid; grid-template-columns: 52px 1fr 1.3fr 52px; gap: 6px; align-items: center; margin: 5px 0; }
.sbrow .pos { font-size: 11px; color: #888; font-weight: 700; }
.sbrow input[type=color] { padding: 2px; height: 38px; }
.sbbg { display: flex; gap: 4px; } .sbbg select { min-width: 0; } .sbcustom { width: 44px; padding: 2px; height: 38px; flex: none; }
.upsell { border: 1px solid #c9d8ff; background: linear-gradient(180deg, #f3f7ff, #fff); border-radius: 12px; padding: 12px; margin: 14px 0; }
.up-head { font-weight: 700; display: flex; gap: 8px; align-items: center; }
.tagpill { font-size: 11px; background: var(--blue); color: #fff; border-radius: 999px; padding: 2px 8px; }
.btnlink { display: inline-block; text-decoration: none; padding: 8px 14px; border-radius: 10px; background: var(--blue); color: #fff; font-weight: 600; }

/* defense */
.dcolors { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.dcol { border: 1px solid var(--line); border-radius: 10px; padding: 6px; display: grid; gap: 4px; }
.dcol input[type=color] { height: 32px; padding: 2px; }
.dcol input { padding: 5px 7px; font-size: 13px; }
.dboard { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dboard .dc { display: grid; gap: 3px; }
.dboard .dh { font-weight: 700; text-align: center; border-radius: 8px; padding: 4px; font-size: 13px; }
.dslot { display: grid; grid-template-columns: 24px 1fr; gap: 4px; align-items: center; }
.dslot select { padding: 4px 6px; font-size: 13px; font-weight: 600; }
.dslot .coach { grid-column: 2; font-size: 11px; color: #666; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: -2px; }
.dslot select.empty { border-style: dashed; color: #999; }
@media (max-width: 700px) { .dboard, .dcolors { grid-template-columns: repeat(2, 1fr); } }
.dsheet-wrap { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 10px; }
.dsheet { border-collapse: collapse; font-size: 13px; }
.dsheet th, .dsheet td { border: 1px solid var(--line); padding: 0; }
.dsheet th { position: sticky; top: 0; background: #0b0b0c; color: #fff; z-index: 1; }
.dsheet th input { background: transparent; color: #fff; border: 0; font-weight: 700; min-width: 110px; }
.dsheet td input { border: 0; border-radius: 0; min-width: 110px; padding: 6px 8px; }
.dsheet td.dlab input { font-weight: 700; min-width: 100px; }
.dsheet td.coach input { min-width: 170px; background: #f6f8ff; }
.dsheet .sticky { position: sticky; left: 0; background: #fff; z-index: 2; }
.dsheet th.sticky { background: #0b0b0c; z-index: 3; }
.dsheet .rm { border: 0; padding: 4px 8px; color: #c0262d; }
.dsheet .where { font-size: 11px; color: #777; padding: 0 6px; white-space: nowrap; }
.dsheet th > input + .rm, .dsheet th .rm { color: #ff8a8a; }
.dsheet th:has(.cardname) { white-space: nowrap; }
.dsheet th .cardname { display: inline-block; width: calc(100% - 30px); min-width: 90px; vertical-align: middle; }
.dsheet th .rm { display: inline-block; vertical-align: middle; padding: 2px 6px; background: transparent; }
.dsheet th { padding: 0 4px; text-align: left; }
#tab-defense .bar button { white-space: nowrap; flex: none; }
#dPreview { border: 0; transform-origin: 0 0; display: block; background: #fff; }

.dsheet td.num2 { text-align: center; font-weight: 700; min-width: 32px; }
.dsheet .sticky2 { position: sticky; left: 32px; z-index: 2; }
.dsheet th.sticky2 { background: #0b0b0c; z-index: 3; }
.dsheet tr.cband td { font-weight: 700; padding: 4px 8px; }
.dsheet td.coach input { min-width: 190px; background: #f6f8ff; font-weight: 600; }
.dsheet.roster td input { min-width: 90px; } .dsheet.roster td input.w4 { min-width: 44px; width: 52px; }
.dsheet.roster select { border: 0; border-radius: 0; min-width: 130px; }
.dsheet td.ctr { text-align: center; } .dsheet td.ctr input { width: auto; min-width: 0; }
label.inline { display: flex; align-items: center; gap: 6px; margin: 0; white-space: nowrap; } label.inline input { width: 70px; margin: 0; }
#assetPreview { border: 0; transform-origin: 0 0; display: block; background: #fff; }
.grid1 { display: grid; grid-template-columns: 1fr; }
.libchip { background: #fff; border: 1px solid var(--line); }
.foot { max-width: 900px; margin: 24px auto 32px; padding: 0 12px; font-size: 11px; color: #888; }
.foot a { color: #888; }
.beta { background: var(--blue); color: #fff; font-weight: 700; border-radius: 4px; padding: 1px 5px; font-size: 10px; }
.row.wrap { flex-wrap: wrap; }
.btnlike { display: inline-block; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin: 0; color: var(--ink); font-size: 15px; cursor: pointer; }
