:root {
  --ink: #eef1f6;
  --panel: #ffffff;
  --panel-line: #dfe4ec;
  --text: #1f2937;
  --text-dim: #6b7280;
  --amber: #f5a623;
  --amber-dim: #d98c1f;
  --good: #1fa971;
  --bad: #e15361;
  --page-bg: #f6f8fb;
  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-ui);
  min-height: 100vh;
}

.screen { min-height: 100vh; }
[hidden] { display: none !important; }

/* ---------- Sign-in ---------- */
#signin-screen { display: flex; align-items: center; justify-content: center; }
.signin-card {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 14px;
  padding: 48px 40px;
  text-align: center;
  width: 340px;
  box-shadow: 0 12px 32px -18px rgba(31,41,55,0.18);
}
.mark { font-size: 28px; letter-spacing: 4px; color: var(--amber); display: inline-block; margin-bottom: 12px; }
.mark.small { font-size: 18px; margin: 0; }
.signin-card h1 { font-size: 20px; margin: 0 0 8px; }
.sub { color: var(--text-dim); font-size: 14px; margin: 0 0 24px; }
#g_id_signin_container { display: flex; justify-content: center; }

/* ---------- App shell ---------- */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 32px; border-bottom: 1px solid var(--panel-line);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tab-nav { display: flex; gap: 4px; }
.tab-btn {
  background: none; border: none; color: var(--text-dim); font-size: 13px;
  font-family: var(--font-ui); padding: 8px 14px; border-radius: 6px;
  cursor: pointer; transition: background .15s ease, color .15s ease;
}
.tab-btn:hover { color: var(--text); background: rgba(31,41,55,0.05); }
.tab-btn.active { color: #1f2937; background: var(--amber); font-weight: 600; }
.user-chip { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-dim); }
.avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background-color: var(--amber-dim); background-size: cover; background-position: center;
  color: #ffffff; font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.link-btn { background: none; border: none; color: var(--text-dim); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 0; }
.link-btn:hover { color: var(--text); }

.layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 24px; padding: 32px;
  max-width: 1100px; margin: 0 auto; align-items: start;
  transition: grid-template-columns .2s ease;
}
.layout.centered { grid-template-columns: 1fr; justify-items: center; padding-top: 64px; }
.layout.centered .inputs { width: 100%; max-width: 420px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 24px; box-shadow: 0 8px 28px -18px rgba(31,41,55,0.15);
}
.panel h2 { font-size: 15px; display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.panel h2:not(:first-child) { margin-top: 28px; }
.step {
  width: 22px; height: 22px; border-radius: 50%; background: var(--amber); color: #1f2937;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

.dropzone {
  border: 1px dashed var(--panel-line); border-radius: 10px; padding: 16px; margin-bottom: 12px;
  cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.dropzone:hover, .dropzone.dragover { border-color: var(--amber-dim); background: rgba(224, 167, 51, 0.06); }
.dropzone.has-file { border-style: solid; border-color: var(--good); }
.drop-label strong { display: block; font-size: 13px; }
.filename { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li {
  display: flex; justify-content: space-between; align-items: center; font-family: var(--font-mono);
  font-size: 12px; color: var(--text); background: rgba(31,41,55,0.035); border-radius: 6px; padding: 6px 8px;
}
.remove-file-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 4px; }
.remove-file-btn:hover { color: var(--bad); }

.date-row { display: flex; gap: 12px; margin-bottom: 20px; }
.date-row label { flex: 1; font-size: 12px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px; }
.hint { font-size: 12px; color: var(--text-dim); margin: -10px 0 14px; }
.primary-btn {
  width: 100%; background: var(--amber); color: #1f2937; border: none; border-radius: 8px;
  padding: 12px; font-weight: 600; font-size: 14px; cursor: pointer; transition: opacity .15s ease;
}
.primary-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.primary-btn:not(:disabled):hover { opacity: 0.9; }

.error-text { color: var(--bad); font-size: 13px; margin-top: 10px; }

.summary { font-size: 13px; color: var(--text-dim); margin-bottom: 16px; }
.summary strong { color: var(--text); }

.diff-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 20px; }
.diff-table th { text-align: left; color: var(--text-dim); font-weight: 500; border-bottom: 1px solid var(--panel-line); padding: 8px 6px; }
.diff-table td { padding: 8px 6px; border-bottom: 1px solid var(--panel-line); font-family: var(--font-mono); vertical-align: top; }
.diff-table .old-date { color: var(--bad); text-decoration: line-through; opacity: .7; }
.diff-table .new-date { color: var(--good); }
.diff-table .source-file { color: var(--text-dim); font-size: 11px; }

.missing-block { background: rgba(217, 112, 90, 0.1); border: 1px solid var(--bad); border-radius: 8px; padding: 10px 12px; font-size: 12px; margin-bottom: 16px; }
#missing-ids { font-family: var(--font-mono); }
.duplicates-block { background: rgba(224, 167, 51, 0.1); border: 1px solid var(--amber-dim); border-radius: 8px; padding: 10px 12px; font-size: 12px; margin-bottom: 16px; }

/* The split-confirm gate. Amber like the other "worth reading" notices rather
   than red: nothing has gone wrong, the range just needs more than one file. */
.split-confirm { border-color: var(--amber-dim); }
.split-confirm .step { background: var(--amber); }
.split-confirm .reason-list { margin: 0 0 14px; }
.split-ack { display: flex; align-items: center; gap: 8px; font-size: 13px;
  margin: 4px 0 14px; cursor: pointer; }
.split-ack input { width: 16px; height: 16px; cursor: pointer; }
.split-confirm .secondary-btn { width: 100%; margin-top: 8px; }
.download-list { display: flex; flex-direction: column; gap: 8px; }
#duplicate-ids { font-family: var(--font-mono); }

/* ---------- Tournament Reference (economy) page ---------- */
.economy-layout {
  max-width: 1920px; margin: 0 auto; padding: 32px 24px;
  display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; align-items: start;
}
@media (max-width: 1000px) { .economy-layout { grid-template-columns: 1fr; } }
.economy-sidebar { position: sticky; top: 32px; display: flex; flex-direction: column; gap: 10px; }
.economy-add-new-btn { width: 100%; }
.economy-sidebar-list { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.sidebar-item {
  text-align: left; background: none; border: 1px solid transparent; color: var(--text-dim);
  font-size: 13px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.sidebar-item:hover { background: rgba(31,41,55,0.05); color: var(--text); }
.sidebar-item.active { background: rgba(224, 167, 51, 0.12); border-color: var(--amber-dim); color: var(--amber-dim); font-weight: 600; }
.economy-detail { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.economy-detail-panel h3 { margin: 0 0 4px; font-size: 16px; }
.economy-detail-panel h4 { font-size: 13px; color: var(--text-dim); margin: 20px 0 4px; }

/* The table was display:block with thead and tbody each display:table,
   width:100%, table-layout:fixed. Two consequences, both reported as
   "adding a column hides information": fixed layout at exactly 100% width
   squeezed every column instead of letting the table grow and scroll, and
   because thead and tbody were separate tables their column widths were
   computed independently, so header and body drifted out of line. It is a
   normal table again, sized by its content, inside a scrolling wrapper. */
.table-scroll { overflow-x: auto; margin-top: 8px; }
.economy-segment-table { width: 100%; min-width: max-content; font-size: 11px; table-layout: auto; }
.economy-segment-table th, .economy-segment-table td { white-space: nowrap; }
.economy-segment-table th:first-child, .economy-segment-table td:first-child {
  white-space: normal; word-break: break-word; min-width: 90px;
}
.prizes-cell { font-family: var(--font-mono); font-size: 10px; color: var(--good); white-space: nowrap; }

.economy-add-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.economy-add-tab-btn {
  background: none; border: 1px solid var(--panel-line); color: var(--text-dim); font-size: 12px;
  font-family: var(--font-ui); padding: 6px 12px; border-radius: 6px; cursor: pointer;
}
.economy-add-tab-btn.active { border-color: var(--amber); color: var(--amber-dim); }

.manual-field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-dim); margin-bottom: 16px; }
.manual-field input {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 8px; font-family: var(--font-mono); font-size: 13px;
}

.economy-upload h4 { font-size: 13px; color: var(--text-dim); display: flex; align-items: center; gap: 10px; margin: 20px 0 4px; flex-wrap: wrap; }
.add-row-btn { background: none; border: 1px solid var(--panel-line); color: var(--amber-dim); font-size: 11px; padding: 3px 8px; border-radius: 5px; cursor: pointer; }
.add-row-btn:hover { border-color: var(--amber-dim); }
/* Writes to every id at once, so it reads as an action rather than an "add". */
.generate-ids-btn { border-color: var(--good); color: var(--good); }
.generate-ids-btn:hover { background: rgba(31, 169, 113, 0.1); border-color: var(--good); }
.manual-table-wrap { border: 1px solid var(--panel-line); border-radius: 8px; padding: 8px; overflow-x: auto; }
.manual-table-header {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: .03em;
  padding: 0 0 6px; border-bottom: 1px solid var(--panel-line); margin-bottom: 6px;
}
.manual-table-header span:last-child { text-align: center; }
.manual-row { margin-bottom: 8px; align-items: center; gap: 6px; }
.manual-row input, .manual-row select {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 6px 8px; font-family: var(--font-mono); font-size: 11px; width: 100%; min-width: 0;
}
.remove-row-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 16px; padding: 0 6px; }
.remove-row-btn:hover { color: var(--bad); }

.economy-card-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.economy-card-actions { display: flex; gap: 8px; }
.secondary-btn { background: none; border: 1px solid var(--panel-line); color: var(--text-dim); border-radius: 6px; padding: 4px 12px; font-size: 11px; cursor: pointer; }
.secondary-btn:hover { color: var(--text); border-color: var(--text-dim); }
.delete-catalog-btn { border: 1px solid var(--bad); border-radius: 6px; padding: 4px 10px; font-size: 11px; color: var(--bad); background: none; cursor: pointer; }
.delete-catalog-btn:hover { background: rgba(217, 112, 90, 0.1); }
/* Renaming a type: the name becomes a real input in edit mode, sized to sit
   inside the h3 without changing the header's height or alignment. */
.edit-name-input {
  font: inherit;
  color: inherit;
  padding: 2px 8px;
  min-width: 260px;
  max-width: 100%;
  border: 1px solid var(--amber-dim);
  border-radius: 4px;
  background: #fff;
  vertical-align: middle;
}
.edit-name-input:focus { outline: 2px solid var(--amber-dim); outline-offset: 1px; }

.editing-badge { font-size: 10px; color: var(--amber-dim); border: 1px solid var(--amber-dim); border-radius: 4px; padding: 1px 6px; vertical-align: middle; margin-left: 6px; text-transform: uppercase; }
.row-btns { display: flex; gap: 2px; align-items: center; justify-content: center; }
.drag-handle { cursor: grab; color: var(--text-dim); font-size: 14px; padding: 0 4px; user-select: none; }
.drag-handle:hover { color: var(--text); }
.drag-handle:active { cursor: grabbing; }
.row-dragging { opacity: 0.4; }
.draggable-col-header { cursor: grab; border-radius: 4px; padding: 2px 4px; margin: -2px -4px; }
.draggable-col-header:hover { background: rgba(31,41,55,0.06); }
.col-dragging { opacity: 0.3; }
.dup-row-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 13px; padding: 0 4px; }
.dup-row-btn:hover { color: var(--amber-dim); }
.computed-field { color: var(--good) !important; opacity: 0.9; cursor: not-allowed; }
.y-field { border-color: var(--amber-dim) !important; }

/* ---------- EF Tiers: self-labeled flex fields (edit mode) ----------
   No shared column grid — each field carries its own label, so a field
   (like EF Before Discount) can be genuinely absent from one row with
   zero effect on any other row's layout or alignment. This is what
   replaced the earlier grid-based approach after both display:none
   (broke alignment — see CLAUDE.md) and visibility:hidden (kept
   alignment but left a permanent blank gap) turned out to be dead ends. */
.tier-flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-line);
}
.tier-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 10px;
  color: var(--text-dim);
  min-width: 90px;
}
.tier-field input, .tier-field select {
  background: var(--ink);
  border: 1px solid var(--panel-line);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  width: 100%;
}
.tier-field-select { min-width: 100px; }
.tier-field-checkbox {
  flex-direction: row;
  align-items: center;
  gap: 6px;
  min-width: auto;
}
.tier-field-checkbox input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--amber); order: -1; }
.tier-prizes-btn-wrap { display: flex; flex-direction: column; min-width: 90px; justify-content: flex-end; }

/* ---------- Prizes sub-table (Position -> Prize) ---------- */
.tier-block { margin-bottom: 10px; }
.prizes-toggle-btn { background: rgba(31, 169, 113, 0.1); border: 1px solid var(--good); color: var(--good); border-radius: 6px; padding: 4px 6px; font-size: 10px; cursor: pointer; width: 100%; }
.prizes-toggle-btn:hover { background: rgba(31, 169, 113, 0.2); }
.prizes-subtable { margin: 8px 0 8px 0; padding: 10px; background: rgba(31,41,55,0.03); border: 1px solid var(--panel-line); border-radius: 8px; }
.prizes-subtable-header { display: grid; grid-template-columns: 50px 1fr 96px 24px; gap: 6px; font-size: 10px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 6px; }
.prize-row { display: grid; grid-template-columns: 50px 1fr 96px 24px; gap: 6px; margin-bottom: 6px; align-items: center; }
.prize-row select {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 6px 4px; font-family: var(--font-mono); font-size: 11px; width: 100%;
}
.prize-position-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-dim); text-align: center; }
.prize-row input {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 6px 8px; font-family: var(--font-mono); font-size: 11px; width: 100%;
}
.add-position-btn { background: none; border: 1px dashed var(--panel-line); color: var(--amber-dim); font-size: 11px; padding: 4px 10px; border-radius: 6px; cursor: pointer; width: 100%; margin-top: 4px; }

/* ---------- EF Tier cards (view mode) ---------- */
.tier-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 10px; }
.tier-card { background: rgba(31,41,55,0.02); border: 1px solid var(--panel-line); border-radius: 10px; padding: 14px; }
.tier-card-id { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--amber-dim); word-break: break-word; margin-bottom: 10px; padding-bottom: 8px; border-bottom: 1px solid var(--panel-line); }
.tier-card-segments { font-size: 11px; font-family: var(--font-mono); color: var(--text); margin: -4px 0 10px; }
.tier-card-segments .tcf-label { font-family: var(--font-ui); margin-right: 6px; }
.tier-card-fields { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.tier-card-field { display: flex; justify-content: space-between; font-size: 11px; gap: 8px; }
.tcf-label { color: var(--text-dim); }
.tcf-value { font-family: var(--font-mono); color: var(--text); text-align: right; }
.tier-card-prizes { border-top: 1px solid var(--panel-line); padding-top: 8px; }
.prizes-view-table { width: 100%; font-size: 11px; border-collapse: collapse; }
.prizes-view-table th { text-align: left; color: var(--text-dim); font-weight: 500; padding: 2px 4px; font-size: 10px; text-transform: uppercase; }
.prizes-view-table td { padding: 2px 4px; font-family: var(--font-mono); color: var(--good); }
.prizes-view-table td:first-child { color: var(--text-dim); }
.prizes-view-table .prize-type-cell { color: var(--text-dim); font-family: var(--font-ui); }

/* ---------- Toast notifications ---------- */
#toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--panel); border: 1px solid var(--panel-line); border-left: 4px solid var(--good);
  border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--text); min-width: 220px;
  box-shadow: 0 8px 24px -10px rgba(31,41,55,0.25); animation: toast-in .2s ease;
}
.toast.toast-error { border-left-color: var(--bad); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Import TournamentsSettings straight from the BB config bucket, as an
   alternative to picking the file by hand. */
.s3-import-row { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; flex-wrap: wrap; }
.s3-import-row .hint { margin: 0; font-family: var(--font-mono); font-size: 11px; word-break: break-all; }

/* ---------- Apply-the-calendar-plan block ---------- */
.calendar-plan { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--panel-line); }
.calendar-plan .date-row { margin-bottom: 14px; }
.calendar-plan input[type="date"] {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 8px; font-family: var(--font-mono); font-size: 13px; width: 100%;
}
/* Every calendar entry that was NOT rescheduled is listed with its reason —
   a planned tournament silently doing nothing is the failure worth shouting about. */
.reason-list { margin: 6px 0 0; padding-left: 18px; }
.reason-list li { margin-bottom: 3px; }
.reason-list .reason-title { font-family: var(--font-mono); }
.reason-list .reason-why { color: var(--text-dim); }

.game-field select {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 8px; font-family: var(--font-mono); font-size: 13px; width: 100%;
}
.calendar-plan input[type="time"], .calendar-plan input[type="number"] {
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 8px; font-family: var(--font-mono); font-size: 13px; width: 100%;
}

/* ---------- Dictionary backup (export / import) ---------- */
.catalog-backup { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--panel-line); display: flex; flex-wrap: wrap; gap: 8px; }
.catalog-backup .secondary-btn { flex: 1; white-space: nowrap; }
.catalog-backup .hint { flex-basis: 100%; margin: 4px 0 0; }

/* ---------- Import picker ---------- */
.import-panel .import-file { font-family: var(--font-mono); font-size: 12px; color: var(--text-dim); font-weight: 400; }
.import-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 12px; }
.import-overwrite { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-dim); margin-left: auto; }
.import-overwrite input { width: 16px; height: 16px; accent-color: var(--amber); cursor: pointer; }
.import-list { border: 1px solid var(--panel-line); border-radius: 8px; max-height: 420px; overflow-y: auto; margin-bottom: 14px; }
.import-row { display: grid; grid-template-columns: 26px 1fr 150px 130px; gap: 8px; align-items: center; padding: 8px 10px; border-bottom: 1px solid var(--panel-line); font-size: 12px; }
.import-row:last-child { border-bottom: none; }
.import-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--amber); cursor: pointer; }
.import-row-name { font-family: var(--font-mono); word-break: break-word; }
.import-row-counts { color: var(--text-dim); font-size: 11px; }
/* "exists" is the state worth noticing: importing it replaces existing work. */
.import-row-state { font-size: 11px; text-align: right; }
.import-row-state.is-new { color: var(--good); }
.import-row-state.is-existing { color: var(--amber-dim); }
.import-row.is-disabled { opacity: .55; }

.prizes-total { font-size: 11px; color: var(--text); margin: 8px 0 2px; padding-top: 8px; border-top: 1px solid var(--panel-line); }
.prizes-total strong { font-family: var(--font-mono); }
.prizes-total-warn { color: var(--bad); }

/* Column headers carry a remove button; it must not swallow the drag-to-reorder. */
.manual-table-header span { display: inline-flex; align-items: center; gap: 4px; }
.remove-col-btn {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 13px; line-height: 1; padding: 0 2px; opacity: 0; transition: opacity .12s ease;
}
.manual-table-header span:hover .remove-col-btn { opacity: 1; }
.remove-col-btn:hover { color: var(--bad); }

/* Pack entry-fee ratios: a folded-away settings table, not a per-run input. */
.pack-ratios { margin-top: 18px; border-top: 1px solid var(--panel-line); padding-top: 14px; }
.pack-ratios summary { cursor: pointer; font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.pack-ratios code { font-family: var(--font-mono); font-size: 11px; }
/* A fixed four-column grid, shared by the header and every row, so each label
   sits over the field it names. Safe here in a way it would not be for the EF
   Tiers rows: every pack row always has exactly these four cells, with no
   field present on one row and absent on the next. */
/* Three lines per row. One line cannot hold a 23-character combination label
   ("Flash1 50% / Silver 50%") AND a tournament name in a panel this narrow --
   something always truncated. The pack and its ratio share the first line,
   the name gets the second and the badge texture id the third, so nothing is
   cut off. */
.pack-head, .pack-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px 20px;
  gap: 6px 8px;
  align-items: center;
}
.pack-row { padding-bottom: 8px; border-bottom: 1px solid var(--panel-line); }
.pack-row:last-child { border-bottom: none; }
.pack-row .pack-tournament-name, .pack-row .pack-badge { grid-column: 1 / -1; }
.pack-head {
  font-size: 10px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-dim); padding: 0 2px 2px;
}
.pack-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.pack-row input {
  width: 100%; min-width: 0; box-sizing: border-box;
  background: var(--ink); border: 1px solid var(--panel-line); color: var(--text);
  border-radius: 6px; padding: 7px 8px; font-size: 13px;
}
/* Pack label, ratio and badge texture id are config values; the tournament
   name is display text players see, so it alone reads in the normal face
   rather than mono. */
.pack-row .pack-name, .pack-row .pack-ratio,
.pack-row .pack-badge { font-family: var(--font-mono); }
.pack-row .pack-badge { font-size: 12px; }
.pack-row .pack-ratio { text-align: right; }
/* The combination labels are long; the panel is narrow. The input scrolls
   rather than losing anything, and the title shows it whole on hover. */
.pack-row .pack-name { font-size: 12px; }
.ratio-change { color: var(--amber); font-size: 10px; }
.packs-unsaved { color: var(--amber); font-weight: 600; }
.endless-note { color: var(--text-dim); font-size: 10px; }
