:root {
  --paper: #fffaf2;
  --surface: #ffffff;
  --surface-2: #f4f7ff;
  --ink: #18213f;
  --muted: #5d6787;
  --line: #d8deef;
  --blue: #2647df;
  --blue-deep: #142c91;
  --blue-soft: #e8edff;
  --orange: #f26a21;
  --orange-deep: #9b3d0b;
  --orange-soft: #fff0e5;
  --green: #128060;
  --green-soft: #e5f7ef;
  --shadow: 0 24px 80px rgba(31, 43, 83, 0.14);
  --radius: 8px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: ui-rounded, "SF Pro Rounded", "Segoe UI", var(--font);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.92), rgba(238, 244, 255, 0.92)),
    repeating-linear-gradient(90deg, rgba(38, 71, 223, 0.04) 0 1px, transparent 1px 84px);
  color: var(--ink);
  font-family: var(--font);
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 80px;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.workspace.equal-height {
  align-items: stretch;
}

.workspace.equal-height .brand-panel {
  display: flex;
  flex-direction: column;
}

.workspace.equal-height .timer-launch {
  margin-top: auto;
}

.brand-panel,
.generator-panel,
.panel,
.sheet,
.station-card,
.preset-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-width: 0;
}

.brand-panel {
  position: sticky;
  top: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.brand-image {
  display: block;
  width: 100%;
  aspect-ratio: 1640 / 856;
  object-fit: cover;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.brand-copy {
  padding: 20px 20px 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--orange-deep);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--display);
  line-height: 1.05;
  letter-spacing: 0;
}

h1 {
  color: var(--blue);
  font-size: clamp(2.35rem, 3.15vw, 3.45rem);
  overflow-wrap: normal;
  word-break: keep-all;
}

h2 {
  color: var(--blue-deep);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
}

h3 {
  color: var(--blue);
  font-size: 1.25rem;
}

.brand-copy p:last-child,
.hint {
  margin: 12px 0 0;
  color: var(--muted);
}

.lesson-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0;
  background: var(--line);
  border-top: 1px solid var(--line);
}

.lesson-stats div {
  padding: 14px 12px;
  background: var(--surface-2);
}

.lesson-stats dt {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.lesson-stats dd {
  margin: 0;
  color: var(--blue-deep);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  font-weight: 900;
}

.generator-panel {
  min-width: 0;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.account-bar {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}

.account-bar div {
  display: grid;
  min-width: 0;
}

.account-bar strong {
  color: var(--blue-deep);
  font-size: 0.9rem;
}

.account-bar span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-bar .account-bar-actions {
  display: flex;
  flex: 0 0 auto;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.account-trigger {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 38px;
  align-items: center;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 900;
  text-decoration: none;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.step-chip {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 800;
  min-height: 42px;
}

.step-chip span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--blue);
  font-size: 0.82rem;
}

.step-chip.active {
  border-color: var(--blue);
  color: var(--blue-deep);
  box-shadow: 0 8px 20px rgba(38, 71, 223, 0.14);
}

.step-chip.active span {
  background: var(--blue);
  color: #fff;
}

.step-chip.done {
  border-color: rgba(18, 128, 96, 0.38);
  color: var(--green);
}

.step-chip.done span {
  background: var(--green);
  color: #fff;
}

.panel {
  border: 0;
  border-radius: 0;
  padding: clamp(18px, 3vw, 30px);
}

.panel.hidden,
.hidden {
  display: none !important;
}

.panel-heading {
  margin-bottom: 18px;
}

.heading-with-help,
.label-with-help,
.table-help,
.timer-label-with-help {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
}

.heading-with-help {
  align-items: flex-start;
}

.heading-with-help h2,
.heading-with-help h3 {
  min-width: 0;
}

.heading-with-help.compact {
  gap: 6px;
}

.info-tip {
  display: inline-grid;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border: 1px solid rgba(38, 71, 223, 0.42);
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--blue-deep);
  font-size: 0.75rem;
  font-weight: 950;
  line-height: 1;
  text-transform: none;
  box-shadow: none;
}

.info-tip:hover,
.info-tip[aria-expanded="true"] {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.info-tip.inverse {
  border-color: rgba(255, 255, 255, 0.62);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.info-tip.inverse:hover,
.info-tip.inverse[aria-expanded="true"] {
  background: #fff;
  color: var(--blue-deep);
}

.help-popover {
  position: fixed;
  z-index: 200;
  width: min(280px, calc(100vw - 24px));
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--ink);
  color: #fff;
  box-shadow: 0 16px 40px rgba(24, 33, 63, 0.3);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.4;
  pointer-events: none;
}

.action-with-help {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.preset-card {
  min-height: 84px;
  padding: 14px;
  text-align: left;
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.preset-card:hover {
  border-color: var(--blue);
  box-shadow: 0 12px 32px rgba(38, 71, 223, 0.12);
  transform: translateY(-1px);
}

.preset-card strong {
  display: block;
  color: var(--blue-deep);
  font-size: 1rem;
}

.preset-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.87rem;
}

.saved-presets {
  margin: -4px 0 22px;
  padding: 18px 0 2px;
  border-top: 1px solid var(--line);
}

.saved-presets-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.saved-presets-head .eyebrow {
  margin-bottom: 4px;
}

.saved-preset-grid {
  margin-bottom: 0;
}

.saved-preset-grid .preset-card {
  min-height: 78px;
}

.field-grid {
  display: grid;
  gap: 12px;
  align-items: end;
}

.field-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
  display: grid;
  gap: 7px;
  color: var(--blue-deep);
  font-size: 0.9rem;
  font-weight: 800;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  min-height: 44px;
  padding: 9px 12px;
}

textarea {
  resize: vertical;
  font: inherit;
}

select {
  text-overflow: ellipsis;
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible {
  outline: 3px solid rgba(242, 106, 33, 0.36);
  outline-offset: 2px;
}

.calc-strip,
.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.calc-box,
.summary-item {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: center;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.calc-box strong,
.summary-item strong {
  display: block;
  color: var(--blue);
  font-size: 2rem;
  line-height: 1;
}

.calc-box span,
.summary-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-transform: uppercase;
}

.notice {
  margin: 14px 0 0;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.92rem;
}

.notice.info {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.notice.warning {
  border: 1px solid #f6c59e;
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.btn {
  border: 0;
  border-radius: 999px;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 900;
}

.btn.primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 24px rgba(38, 71, 223, 0.24);
}

.btn.secondary {
  background: var(--orange);
  color: #fff;
  box-shadow: 0 10px 24px rgba(242, 106, 33, 0.22);
}

.btn.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--blue-deep);
}

.btn[disabled] {
  cursor: not-allowed;
  opacity: 0.48;
  box-shadow: none;
}

.timer-launch {
  width: calc(100% - 40px);
  min-height: 48px;
  margin: 18px 20px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(242, 106, 33, 0.2);
}

.custom-add {
  margin-bottom: 16px;
  border: 1px dashed rgba(242, 106, 33, 0.65);
  border-radius: var(--radius);
  background: var(--orange-soft);
  padding: 14px;
}

.custom-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 8px;
}

.custom-auth-note {
  margin: 7px 0 0;
  color: var(--orange-deep);
  font-size: 0.82rem;
  font-weight: 750;
}

.custom-auth-note a {
  color: var(--blue-deep);
  font-weight: 900;
}

.collection-randomizer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  border-block: 1px solid var(--line);
  padding: 14px 0;
}

.collection-randomizer > div {
  display: grid;
}

.collection-randomizer strong {
  color: var(--blue-deep);
}

.collection-randomizer span:not(.action-with-help) {
  color: var(--muted);
  font-size: 0.82rem;
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 10px;
}

.station-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  background: var(--surface-2);
}

.station-card.duplicate {
  border-color: var(--orange);
  background: #fff7f0;
}

.station-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.range-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.range-table th {
  padding: 10px;
  background: var(--blue);
  color: #fff;
  text-align: left;
}

.range-table td {
  padding: 9px 10px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
}

.range-table tr:nth-child(even) td {
  background: #fbfcff;
}

.range-table input {
  width: 74px;
  min-height: 38px;
  text-align: center;
  font-weight: 900;
}

.range-table input[readonly] {
  background: #f3f5fb;
  color: var(--muted);
}

.game-name {
  font-weight: 900;
}

.seq-preview {
  color: var(--blue-deep);
  font-weight: 900;
  white-space: nowrap;
}

.seq-preview.b {
  color: var(--orange-deep);
}

.print-area {
  margin-top: 18px;
}

.preview-note {
  max-width: 210mm;
  margin: 0 auto 12px;
}

.sheet {
  width: min(100%, 210mm);
  margin: 0 auto 16px;
  padding: 10mm;
  box-shadow: 0 10px 32px rgba(31, 43, 83, 0.12);
}

.player-card {
  break-inside: avoid;
  page-break-inside: avoid;
  margin-bottom: 6mm;
  border: 2px solid var(--blue);
  border-radius: var(--radius);
  background: #fff;
  padding: 9px 10px;
}

.player-card.b-card {
  border-color: var(--orange);
}

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  padding-bottom: 6px;
  margin-bottom: 7px;
  border-bottom: 2px solid var(--line);
}

.card-title {
  color: var(--blue);
  font-family: var(--display);
  font-size: 0.98rem;
  font-weight: 900;
  line-height: 1.05;
}

.card-title small {
  display: block;
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-left: auto;
}

.pill {
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.pill.pair {
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.pill.a {
  background: var(--blue);
  color: #fff;
}

.pill.b {
  background: var(--orange);
  color: #fff;
}

.name-line {
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.blank {
  display: inline-block;
  min-width: 138px;
  height: 13px;
  border-bottom: 1.5px solid currentColor;
  vertical-align: bottom;
}

.stations-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.print-station {
  display: flex;
  min-height: 122px;
  flex-direction: column;
  gap: 5px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  padding: 7px;
}

.station-tag {
  align-self: start;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  padding: 2px 7px;
  font-size: 0.66rem;
  font-weight: 900;
}

.b-card .station-tag {
  background: var(--orange);
}

.print-game {
  min-height: 31px;
  color: var(--blue-deep);
  font-family: var(--display);
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.13;
}

.task-label {
  color: var(--muted);
  font-size: 0.6rem;
  font-weight: 900;
  text-transform: uppercase;
}

.seq {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.seq b {
  display: grid;
  min-width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 0.76rem;
}

.b-card .seq b {
  border-color: #f5c29b;
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.results {
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
  color: var(--ink);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.7;
}

.results .blank {
  min-width: 42px;
  height: 11px;
}

.results .blank.short {
  min-width: 26px;
}

.card-total {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 7px;
}

.total-box {
  display: flex;
  gap: 6px;
  align-items: baseline;
  border: 1.5px solid var(--blue);
  border-radius: var(--radius);
  padding: 6px 8px;
  color: var(--blue-deep);
  font-size: 0.72rem;
  font-weight: 900;
}

.b-card .total-box {
  border-color: var(--orange);
  color: var(--orange-deep);
}

.total-box .blank {
  flex: 1;
  min-width: 48px;
}

.trio-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.teacher-sheet h3 {
  margin-bottom: 2px;
}

.teacher-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.teacher-rules {
  margin: 0 0 12px;
  border-radius: var(--radius);
  background: var(--blue-soft);
  color: var(--blue-deep);
  padding: 10px 12px;
  font-size: 0.76rem;
}

.teacher-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 12px;
}

.teacher-sheet table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
}

.teacher-sheet th {
  background: var(--blue);
  color: #fff;
  padding: 6px;
  text-align: left;
}

.teacher-sheet td {
  border: 1px solid var(--line);
  padding: 5px 6px;
  vertical-align: top;
}

.teacher-sheet tr:nth-child(even) td {
  background: #f7f9ff;
}

.teacher-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.timer-open {
  overflow: hidden;
}

.account-open {
  overflow: hidden;
}

.account-page-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 64px;
}

.account-back-link {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  margin-bottom: 14px;
  color: var(--blue-deep);
  font-weight: 900;
  text-decoration: none;
}

.account-back-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-page .account-overlay {
  position: static;
  display: block;
  overflow: visible;
  padding: 0;
  background: transparent;
}

.account-page .account-shell {
  width: 100%;
  max-height: none;
  overflow: visible;
}

.account-page .account-top h1 {
  font-size: clamp(2rem, 4vw, 3.1rem);
}

.account-page .account-close {
  text-decoration: none;
}

.account-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: clamp(12px, 3vw, 30px);
  background: rgba(24, 33, 63, 0.64);
}

.account-shell {
  width: min(1120px, 100%);
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 28px 90px rgba(15, 24, 58, 0.34);
  padding: clamp(18px, 3vw, 30px);
}

.account-top,
.account-identity,
.account-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.account-top {
  margin-bottom: 20px;
}

.account-close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.account-intro,
.account-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
}

.google-button {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.google-button span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #4285f4;
  font-size: 1.08rem;
  box-shadow: inset 0 0 0 1px var(--line);
}

.account-divider {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.account-divider::before,
.account-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-actions {
  display: flex;
  grid-column: 1 / -1;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--blue-deep);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-message {
  margin: 16px 0 0;
  border-radius: var(--radius);
  padding: 11px 13px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-weight: 700;
}

.account-message.error {
  background: var(--orange-soft);
  color: var(--orange-deep);
}

.account-identity {
  align-items: center;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.account-identity div {
  display: grid;
}

.account-identity span {
  color: var(--muted);
  font-size: 0.76rem;
}

.account-identity strong {
  overflow-wrap: anywhere;
  color: var(--blue-deep);
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.account-tabs button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-weight: 900;
}

.account-tabs button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-deep);
}

.account-section-head {
  margin-bottom: 14px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 16px;
}

.inline-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.collection-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  border-block: 1px solid var(--line);
  padding: 10px 0;
}

.collection-summary strong {
  color: var(--blue-deep);
}

.collection-summary span {
  color: var(--muted);
  font-size: 0.8rem;
}

.game-collection-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.collection-game {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 76px;
  grid-template-columns: 32px minmax(0, 1fr) 62px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  overflow: visible;
  transition: border-color 120ms ease, background-color 120ms ease;
}

.collection-game.owned {
  border-color: rgba(18, 128, 96, 0.5);
  background: var(--green-soft);
}

.wishlist-grid .collection-game.wanted {
  border-color: rgba(242, 106, 33, 0.56);
  background: var(--orange-soft);
}

.collection-check {
  display: grid;
  height: 100%;
  place-items: center;
  border-right: 1px solid var(--line);
  cursor: pointer;
}

.collection-check input {
  position: absolute;
  width: 1px;
  min-height: 1px;
  opacity: 0;
}

.collection-check span {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: transparent;
  font-size: 0.78rem;
  font-weight: 950;
}

.collection-check input:checked + span {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.collection-check input:focus-visible + span {
  outline: 3px solid rgba(242, 106, 33, 0.36);
  outline-offset: 2px;
}

.collection-product {
  display: grid;
  min-width: 0;
  grid-template-columns: 54px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  color: inherit;
  text-decoration: none;
}

.collection-preview {
  position: relative;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 4px;
  background: #fff;
  overflow: visible;
}

.collection-preview img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(216, 222, 239, 0.7);
  border-radius: 4px;
  background: #fff;
  object-fit: contain;
  transform-origin: left center;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .collection-game:hover,
  .collection-game:focus-within {
    z-index: 12;
  }

  .collection-preview:hover img,
  .collection-product:focus-visible .collection-preview img {
    z-index: 20;
    box-shadow: 0 14px 36px rgba(24, 33, 63, 0.3);
    transform: scale(2.45);
  }
}

.collection-game.image-missing .collection-preview::after {
  color: var(--muted);
  content: "Brak zdjęcia";
  font-size: 0.58rem;
  line-height: 1.1;
  text-align: center;
}

.collection-game.image-missing .collection-preview img {
  display: none;
}

.collection-product-copy {
  display: grid;
  min-width: 0;
}

.collection-product-copy strong {
  overflow: hidden;
  color: var(--blue-deep);
  font-size: 0.82rem;
  line-height: 1.2;
  text-overflow: ellipsis;
}

.collection-product-copy span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.66rem;
}

.collection-product:hover .collection-product-copy strong {
  color: var(--orange-deep);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.collection-quantity {
  display: grid;
  align-self: stretch;
  align-content: center;
  gap: 3px;
  border-left: 1px solid var(--line);
  padding: 6px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  text-align: center;
}

.collection-quantity input {
  min-height: 34px;
  padding: 4px;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.collection-quantity input:disabled {
  background: #f3f4f8;
  color: #9299ad;
}

.wishlist-purpose-note {
  margin: 0 0 14px;
}

.wishlist-purpose-note strong {
  display: block;
  margin-bottom: 3px;
}

.wishlist-summary strong {
  color: var(--orange-deep);
}

.custom-quantity {
  display: inline-grid;
  grid-template-columns: auto 64px;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.custom-quantity input {
  min-height: 36px;
  padding: 6px;
  text-align: center;
}

.custom-library {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.custom-library h4 {
  margin: 0;
  color: var(--blue-deep);
  font-size: 1rem;
}

.custom-library > div:first-child p {
  margin: 4px 0 14px;
  color: var(--muted);
  font-size: 0.82rem;
}

.account-list {
  display: grid;
  border-top: 1px solid var(--line);
}

.account-list-empty {
  margin: 0;
  padding: 18px 0;
  color: var(--muted);
}

.account-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 58px;
  border-bottom: 1px solid var(--line);
  padding: 9px 0;
}

.account-list-copy {
  display: grid;
  min-width: 0;
}

.account-list-copy strong {
  overflow: hidden;
  color: var(--blue-deep);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-list-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.account-list-actions {
  display: flex;
  gap: 8px;
}

.small-button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--blue-deep);
  padding: 7px 11px;
  font-weight: 900;
}

.small-button.danger {
  color: var(--orange-deep);
}

.small-button.primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
}

.custom-title-edit {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
}

.custom-title-edit input {
  min-height: 38px;
  padding: 7px 10px;
}

.custom-title-edit-actions {
  display: flex;
  gap: 8px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat {
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 16px;
}

.admin-stat strong {
  display: block;
  color: var(--blue);
  font-size: 2rem;
}

.admin-stat span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.timer-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: clamp(14px, 3vw, 34px);
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #172a91, #2547df 54%, #112063);
  color: #fff;
}

.timer-overlay[data-group="B"] {
  background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.18), transparent 34%),
    linear-gradient(135deg, #8f3209, #f26a21 54%, #5f2105);
}

.timer-overlay.timer-done {
  animation: timerPulse 900ms ease-in-out infinite alternate;
}

.timer-shell {
  display: grid;
  width: min(1280px, 100%);
  min-height: min(820px, 100%);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  gap: clamp(12px, 2vh, 22px);
}

.timer-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.timer-top .eyebrow {
  color: rgba(255, 255, 255, 0.78);
}

.timer-top h2 {
  color: #fff;
  font-size: clamp(2rem, 5vw, 4.8rem);
}

.timer-close {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
}

.timer-settings {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(160px, 1fr) minmax(110px, 0.55fr) minmax(110px, 0.55fr) auto;
  gap: 10px;
  align-items: end;
}

.timer-setting-block {
  display: grid;
  gap: 6px;
}

.timer-label-with-help {
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timer-group-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.timer-group,
.timer-presets button,
.timer-field input,
.timer-check {
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.timer-group,
.timer-presets button {
  font-weight: 900;
}

.timer-group.active {
  background: #fff;
  color: var(--blue-deep);
}

.timer-overlay[data-group="B"] .timer-group.active {
  color: var(--orange-deep);
}

.timer-field {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
}

.timer-field input {
  width: 100%;
  padding: 10px 12px;
  font-size: 1.1rem;
  font-weight: 900;
}

.timer-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  font-weight: 900;
  white-space: nowrap;
}

.timer-check input {
  width: 18px;
  min-height: 18px;
}

.timer-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.timer-display-wrap {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: calc(var(--radius) * 2);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.timer-round {
  font-size: clamp(1.2rem, 2.7vw, 2.2rem);
  font-weight: 900;
  text-transform: uppercase;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  font-size: clamp(6rem, 23vw, 18rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.95;
  text-align: center;
}

.timer-status {
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(1.2rem, 3vw, 2.4rem);
  font-weight: 900;
}

.timer-actions {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 10px;
}

.timer-actions .btn {
  min-height: 64px;
  font-size: 1.15rem;
}

.timer-actions .action-with-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
}

.timer-actions .action-with-help .btn {
  width: 100%;
}

@keyframes timerPulse {
  from {
    filter: saturate(1);
  }
  to {
    filter: saturate(1.28) brightness(1.12);
  }
}

@media (max-width: 900px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    position: static;
  }

  .brand-image {
    max-height: 310px;
  }

  .game-collection-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app {
    width: min(100% - 20px, 1220px);
    padding-top: 10px;
  }

  .stepper,
  .preset-grid,
  .field-grid.two,
  .calc-strip,
  .summary-grid,
  .stations-3,
  .teacher-grid,
  .card-total {
    grid-template-columns: 1fr;
  }

  .stepper {
    gap: 6px;
  }

  .step-chip {
    justify-content: flex-start;
    padding-left: 12px;
  }

  .custom-row {
    grid-template-columns: 1fr;
  }

  .collection-randomizer,
  .collection-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .game-collection-grid {
    grid-template-columns: 1fr;
  }

  .account-bar {
    align-items: flex-start;
  }

  .account-bar span {
    white-space: normal;
  }

  .account-bar .account-bar-actions {
    align-self: center;
  }

  .auth-form,
  .inline-form,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .inline-form-actions .btn {
    flex: 1 1 180px;
  }

  .account-actions {
    grid-column: auto;
  }

  .account-list-row {
    grid-template-columns: 1fr;
  }

  .account-list-actions {
    justify-content: flex-start;
  }

  .custom-title-edit {
    grid-template-columns: 1fr;
  }

  .timer-settings,
  .timer-presets,
  .timer-actions {
    grid-template-columns: 1fr;
  }

  .timer-actions .action-with-help {
    width: 100%;
  }

  .timer-display {
    font-size: clamp(5.4rem, 28vw, 9rem);
  }
}

@media print {
  body {
    background: #fff;
  }

  .app {
    width: auto;
    padding: 0;
  }

  .app-ui,
  .timer-overlay,
  .help-popover,
  .preview-note {
    display: none !important;
  }

  .print-area {
    margin: 0;
  }

  .sheet {
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .sheet.page {
    break-after: page;
    page-break-after: always;
  }

  .sheet.page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .player-card {
    margin-bottom: 6mm;
  }

  @page {
    size: A4;
    margin: 11mm 10mm;
  }
}
