/* Graphics panel – flat and square, same look as the clock page. */
.grid {
  display: grid; gap: 12px; padding: 8px 16px calc(24px + var(--safe-b)); max-width: 1500px; margin: 0 auto;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "game" "gfx" "events" "preview";
}
@media (min-width: 820px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "game game" "gfx events" "preview events"; align-items: start; }
}
@media (min-width: 1280px) {
  .grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr); grid-template-areas: "game game game" "gfx events preview"; }
}
.game { grid-area: game; }
.gfx { grid-area: gfx; }
.events { grid-area: events; }
.preview { grid-area: preview; }
.game .note { text-align: center; }
.take.span2 { grid-column: span 2; }
.statpick { display: flex; flex-direction: column; gap: 8px; }
.statpick .b { min-height: 52px; font-size: 16px; }
.statpick .b.on { outline: 2px solid var(--red); outline-offset: -2px; }
.sheet-actions.one { grid-template-columns: 1fr; }

.box { background: var(--box); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; min-width: 0; }
.box h2 {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; min-height: 32px;
  font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.note { color: var(--muted); font-size: 13px; font-weight: 600; margin: 10px 0 0; }
.note:empty { display: none; }
.note a { color: #4b8dff; }
.note b { color: var(--green); }
.note b.off { color: var(--muted); }
.in { width: 100%; min-height: 46px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r); padding: 9px 12px; outline: none; }
.in:focus { border-color: #4b8dff; }

/* ---------- graphics */
.takes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.take {
  appearance: none; min-height: 64px; border-radius: var(--r); border: 1px solid var(--line); background: var(--btn);
  font-weight: 900; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; transition: background .1s, transform .05s;
}
.take:active { transform: scale(.98); }
.take.on { background: var(--red); border-color: var(--red); color: #fff; }
.take.pending { opacity: .6; }
.take:disabled { opacity: .35; }
.scope { width: 100%; }
.scope > button { flex: 1; min-height: 40px; padding: 6px 4px; }

/* ---------- goals & penalties */
.auto { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); margin-bottom: 10px; gap: 12px; }
.auto b { color: var(--text); font-weight: 900; }
.auto small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; margin-top: 2px; }
.auto.on { border-color: #2c6b45; background: #12241a; }
.auto.on small { color: #bff0d2; }
.auto.err small { color: #ff8a80; }
.quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.quick .b { min-height: 48px; font-size: 14px; }
.evlist { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 520px; overflow: auto; }
.evlist .msg { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.ev {
  appearance: none; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--btn); border-radius: var(--r);
  display: grid; grid-template-columns: 52px 40px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 10px; min-height: 56px;
}
.ev.on { background: var(--red); border-color: var(--red); }
.ev .et { font-weight: 800; font-size: 13px; color: var(--muted); line-height: 1.2; font-variant-numeric: tabular-nums; }
.ev.on .et { color: #ffe0dd; }
.ev .ep b { display: block; font-weight: 800; line-height: 1.35; }
.ev .ep small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; margin-top: 1px; }
.ev.on .ep small { color: #ffe0dd; }
.tag { display: inline-block; font-size: 11px; font-weight: 900; letter-spacing: .04em; padding: 2px 6px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
.tag.goal { background: var(--red); color: #fff; }
.tag.penalty { background: var(--maroon); color: #fff; }
.ev.on .tag { background: #fff; color: var(--red); }
.logo { width: 40px; height: 26px; background: #fff; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; overflow: hidden; flex: none; }
.logo img { max-width: 90%; max-height: 90%; object-fit: contain; }

/* ---------- penalties */
.pcols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pcol { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pteam { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pname { font-weight: 900; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.padd { display: grid; grid-template-columns: 1fr 1.3fr 1fr; gap: 6px; }
.padd .b { min-height: 50px; padding: 4px; font-size: 16px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plist .msg { color: var(--muted); font-size: 13px; padding: 2px; }
.plist li.p { display: flex; align-items: center; gap: 8px; border: 1px solid #8f1d17; background: var(--maroon); border-radius: var(--r); padding: 4px 4px 4px 10px; }
.plist li.p.wait { background: var(--btn); border-color: var(--line); }
.plist .pt { appearance: none; border: 0; background: none; padding: 0; font: var(--heavy); font-size: 22px; font-variant-numeric: tabular-nums; }
.plist .pd { flex: 1; font-size: 12px; color: #e7c3c0; font-weight: 700; }
.plist li.wait .pd { color: var(--muted); }
.plist .x { appearance: none; border: 0; width: 38px; height: 38px; border-radius: var(--r); background: rgba(0, 0, 0, .25); font-size: 16px; }
.strength { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; color: var(--muted); font-weight: 700; flex-wrap: wrap; }
.strength b { color: var(--text); margin-left: 6px; }

/* ---------- preview */
.preview h2 .tog { text-transform: none; letter-spacing: 0; }
.frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: #000; }
.frame iframe { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; border: 0; transform-origin: 0 0; pointer-events: none; }

/* ---------- custom goal / penalty sheet */
.evform { display: flex; flex-direction: column; gap: 10px; }
.evform .seg { width: 100%; }
.evform .seg > button { flex: 1; }
.evplayer { display: grid; grid-template-columns: 76px 1fr; gap: 8px; }
.evplayer #evNum { text-align: center; font: var(--heavy); font-size: 22px; }
