:root {
  --collection-yellow: #f4c04a;
  --collection-red: #ff7874;
  --collection-pink: #f392c8;
  --collection-panel: #1c1e21;
  --collection-inset: #141619;
  --collection-line: #ffffff18;
  --collection-muted: #b3b7bd;
  --collection-radius: 24px;
  --collection-space: 16px;
}
/* Roulette follows the current source's reel, red actions, gold marker and podium. */
.spin-actions { display: grid; grid-template-columns: minmax(0,1fr) 56px; gap: 8px; align-items: stretch; }
.spin-actions .btn.spin { min-width: 0; font-size: 16px; padding: 16px 12px; }
.spin-actions .quick-spin { display: flex; align-items: center; justify-content: center; min-height: 56px; padding: 8px; border: 0; border-radius: 999px; background: var(--red); color: #fff; box-shadow: 0 8px 32px rgba(229, 50, 43, .45); }
.spin-actions .quick-spin .ic { color: inherit; }
.spin-actions .btn.spin:disabled,
.spin-actions .quick-spin:disabled { background: var(--panel-2); color: var(--dim); opacity: 1; box-shadow: none; }
#root[data-screen="wheel"] .reel .track { height: 200px; }
#root[data-screen="wheel"] .reel .mark { height: 200px; }
#root[data-screen="wheel"] .reel .wcard { height: 192px; }
#root[data-screen="wheel"] .reel .wcard small { font-size: 11px; }
#root[data-screen="wheel"] .wgrid { grid-template-columns: repeat(3,minmax(0,1fr)); }
#root[data-screen="wheel"] .wgrid .wcard { grid-template-rows: 88px 20px auto; padding: 12px 8px; }
#root[data-screen="wheel"] .wgrid .wpic { height: 88px; }
#root[data-screen="wheel"] .wgrid .wcard small { font-size: 12px; }
.collection-entry { position: relative; display: grid; align-content: center; text-align: left !important; gap: 8px; color: var(--gold); box-shadow: inset 0 0 0 1px #f4c04a40; }
.collection-entry-label { display: block; font-weight: 700; font-size: clamp(11px,3.1vw,14px); line-height: 1.4; }
.collection-entry-label > span { display: block; }
.collection-entry small { color: var(--collection-muted); font-size: 11px; }
.mini-progress { display: block; width: 100%; height: 3px; background: #ffffff12; border-radius: 4px; }
.mini-progress > i { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.history-note { margin: 4px 0 12px; color: var(--collection-muted); font-size: 12px; }
.history-period { display: block; color: var(--collection-muted); font: 11px/1.5 var(--body); margin-top: 4px; }
.history-row time { font-size: 11px; max-width: 96px; white-space: normal; }
.collection-panel { padding: var(--collection-space); border-radius: var(--collection-radius); background: var(--panel); --od-gap: 12px; }
.collection-panel h2,.rarity-section h2 { font-size: 16px; line-height: 1.5; font-weight: 700; }
.collection-copy { font-size: 13px; line-height: 1.6; color: var(--collection-muted); }
.collection-section-heading { justify-content: space-between; align-items: baseline; gap: 12px; }
.collection-section-heading > span { flex: none; font-size: 12px; }
.collection-hero { display: grid; grid-template-columns: minmax(0,1fr) 88px; align-items: center; gap: 16px; padding: 24px; border: 1px solid #f4c04a40; border-radius: var(--collection-radius); background: var(--panel); }
.collection-hero-copy { --od-gap: 8px; }
.collection-hero h1 { font-family: var(--display); font-size: clamp(17px,4.4vw,22px); line-height: 1.45; font-weight: 700; letter-spacing: -.02em; }
.collection-hero-art { display: flex; align-items: center; justify-content: center; min-width: 0; }
.collection-hero-art img { display: block; width: 100%; height: auto; filter: drop-shadow(0 8px 16px #0005); }
.collection-total { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); white-space: nowrap; }
.collection-total b { font-size: clamp(32px,9vw,44px); line-height: 1.3; color: var(--gold); }
.collection-total > span { font-size: 20px; color: var(--collection-muted); }
.collection-hero progress { grid-column: 1 / -1; display: block; appearance: none; border: 0; width: 100%; height: 8px; border-radius: 8px; overflow: hidden; background: var(--panel-2); color: var(--gold); }
.collection-hero progress::-webkit-progress-bar { background: var(--panel-2); }
.collection-hero progress::-webkit-progress-value { background: var(--gold); border-radius: 8px; }
.collection-hero progress::-moz-progress-bar { background: var(--gold); border-radius: 8px; }
.collection-deadline { padding: 16px; border-radius: 16px; background: var(--panel); }
.collection-deadline > .ic { color: var(--gold); }
.collection-deadline b { font-family: var(--display); font-size: 13px; font-weight: 600; line-height: 1.6; }
.collection-deadline small { font-size: 12px; color: var(--collection-muted); }
.rarity-section { display: flex; flex-direction: column; gap: 12px; margin: 8px 0; --rarity: var(--gold); }
.rarity-yellow { --rarity: var(--collection-yellow); }
.rarity-red { --rarity: var(--collection-red); }
.rarity-pink { --rarity: var(--collection-pink); }
.rarity-section .collection-section-heading { padding: 0 4px; color: var(--rarity); }
.rarity-section .collection-section-heading h2 { font-size: 15px; }
.component-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.component-card { display: grid; grid-template-rows: 112px 1fr auto; justify-items: stretch; min-width: 0; gap: 12px; padding: 16px 12px; border: 1px solid var(--collection-line); border-radius: 20px; background: var(--panel); text-align: left; color: var(--text); }
.component-card.obtained { border-color: var(--rarity); }
.component-art { display: flex; align-items: center; justify-content: center; width: 100%; height: 112px; }
.component-art img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.component-card.missing .component-art { filter: grayscale(1); opacity: .4; }
.component-name { display: block; font-size: 13px; font-weight: 600; line-height: 1.5; overflow-wrap: anywhere; }
.component-state { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; font-size: 11px; line-height: 1.5; color: var(--collection-muted); }
.obtained .component-state { color: var(--rarity); }
.component-detail { align-items: center; }
.component-detail > img { display: block; width: auto; height: auto; max-width: 100%; max-height: 240px; object-fit: contain; }
.award-place { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--collection-line); padding-top: 16px; }
.award-place-head small { font-size: 12px; }
.award-place-head > b { font-size: 14px; }
.collection-prize-line { gap: 12px; }
.award-art { display: flex; flex: none; width: 48px; height: 48px; align-items: center; justify-content: center; }
.award-art img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.collection-prize-line b { font-size: 14px; }
.collection-prize-line small { font-size: 12px; }
.claim-panel { border: 1px solid #f4c04a70; }
.claim-panel h2 { font-family: var(--display); font-size: 18px; }
.claim-bundle + .claim-bundle { border-top: 1px solid var(--collection-line); padding-top: 12px; }
.issued-label { color: #80dda0; font-size: 12px; }
.code-button { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; padding: 12px; border: 1px dashed var(--line-3); border-radius: 12px; background: var(--collection-inset); text-align: left; }
.code-button code,.archive-code { font-size: 13px; color: var(--gold); overflow-wrap: anywhere; }
.code-button > span { font-size: 11px; color: var(--collection-muted); }
.collection-navigation { display: flex; flex-direction: column; gap: 8px; }
.text-action { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px; font-size: 13px; color: var(--text-2); }
.archive-period summary,.code-pool summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; list-style: none; cursor: pointer; }
.archive-period summary::-webkit-details-marker,.code-pool summary::-webkit-details-marker { display: none; }
.archive-period summary b { font-size: 14px; }
.archive-period summary small { font-size: 12px; color: var(--collection-muted); }
.archive-body { padding-top: 16px; }
.archive-items { display: flex; flex-direction: column; gap: 8px; }
.archive-item { font-size: 12px; gap: 8px; }
.archive-thumb,.settings-item-thumb { display: flex; flex: none; width: 36px; height: 44px; align-items: center; justify-content: center; }
.archive-thumb img,.settings-item-thumb img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.collection-form-feedback { padding: 12px; border-radius: 12px; background: #e5322b18; color: #ffb8b4; font-size: 13px; line-height: 1.5; }
.settings-field { gap: 8px; min-width: 0; }
.settings-field > span { font-size: 13px; font-weight: 600; }
.settings-field small { font-size: 12px; line-height: 1.5; color: var(--collection-muted); }
#root[data-screen="collectionSettings"] input:not([type="checkbox"]),#root[data-screen="collectionSettings"] select,#root[data-screen="collectionSettings"] textarea {
  display: block; width: 100%; min-width: 0; min-height: 44px; padding: 12px; border: 1px solid var(--line-3); border-radius: 12px; background: var(--collection-inset); color: var(--text); font: 14px/1.5 var(--body);
}
#root[data-screen="collectionSettings"] textarea { resize: vertical; }
#root[data-screen="collectionSettings"] select { cursor: pointer; }
#root[data-screen="collectionSettings"] input:focus-visible,#root[data-screen="collectionSettings"] select:focus-visible,#root[data-screen="collectionSettings"] textarea:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.settings-loot-item,.settings-place { padding: 12px; border: 1px solid var(--collection-line); border-radius: 16px; background: var(--collection-inset); }
.settings-loot-item b { font-size: 13px; line-height: 1.5; }
.settings-item-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.small-control { display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-3); border-radius: 12px; background: var(--panel-2); color: var(--text); font-size: 12px; }
.small-control:disabled { color: var(--muted); opacity: .5; }
.settings-bundle { padding-top: 12px; border-top: 1px solid var(--collection-line); }
.settings-bundle .settings-field { flex: 1; }
.settings-bundle input[type="number"] { max-width: 112px; }
.check-field { display: flex; gap: 12px; align-items: center; min-height: 44px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.check-field input { display: block; width: 20px; height: 20px; flex: none; accent-color: var(--red); }
.code-pool { border-top: 1px solid var(--collection-line); padding-top: 8px; }
.code-pool summary { font-size: 14px; }
.code-pool summary small { font-size: 12px; white-space: nowrap; }
.code-pool > label { margin-top: 8px; }
.referral-preview h2 { font-family: var(--display); font-size: 17px; }
@media(max-width:359px) {
  .collection-hero { grid-template-columns: minmax(0,1fr) 64px; padding: 16px; gap: 12px; }
  .collection-hero h1 { font-size: 16px; }
  .collection-entry-label { font-size: 11px; }
  .component-card { padding: 12px 8px; grid-template-rows: 96px 1fr auto; }
  .component-art { height: 96px; }
  .component-grid { gap: 8px; }
  .collection-section-heading { flex-wrap: wrap; gap: 4px; }
  .spin-actions { grid-template-columns: minmax(0,1fr) 56px; }
  .collection-panel { padding: 16px 12px; }
}
@media(min-width:768px) {
  #root[data-screen="collection"],#root[data-screen="collectionSettings"],#root[data-screen="collectionArchive"] { max-width: 560px; }
  .component-art { height: 128px; }
  .component-card { grid-template-rows: 128px 1fr auto; }
}

/* Collection spans the row; the two period statistics share compact geometry. */
.wheel-stats { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; align-items: stretch; }
.wheel-stats .tile {
  display: grid; grid-template-rows: auto auto; gap: 4px;
  min-width: 0; padding: 12px 16px;
  align-content: center; text-align: left;
}
.wheel-stats .tile > small { margin: 0; color: var(--collection-muted); font-size: 12px; line-height: 1.5; }
.wheel-stats .collection-entry { grid-column: 1 / -1; grid-template-rows: auto auto auto; gap: 8px; }
.wheel-stats .collection-entry-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; min-width: 0; }
.wheel-stats .collection-entry-label { font-size: 14px; line-height: 1.5; }
.wheel-stats .collection-entry-link { flex: none; font-size: 12px; line-height: 1.5; }
.wheel-stats .collection-entry > small { color: var(--text); }
.wheel-stats .stat-value { margin: 0; font-family: var(--display); font-size: clamp(18px,4.8vw,20px); line-height: 1.4; white-space: nowrap; }
.wheel-stats .stat-footer { display: none; }
.quick-result .wres { animation: metro-quick-result 200ms ease-out both; }
@keyframes metro-quick-result { from { opacity: .45; box-shadow: inset 0 0 0 1px var(--gold); } to { opacity: 1; box-shadow: inset 0 0 0 1px transparent; } }
.preview-links { position: relative; z-index: 2; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; max-width: 560px; margin: 0 auto; padding: 12px 16px; border-bottom: 1px solid var(--line-2); background: var(--base); }
.preview-links a { display: flex; align-items: center; min-height: 32px; color: var(--text-2); font: 12px/1.4 var(--body); text-decoration: none; }
.preview-links a[aria-current] { color: var(--gold); text-decoration: underline; text-underline-offset: 4px; }
.preview-links a:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.admin-heading { display: flex; flex-direction: column; gap: 4px; padding: 16px 0; }
.admin-heading h1 { font: 700 20px/1.5 var(--display); }
.admin-heading p { font-size: 12px; color: var(--collection-muted); }
.settings-group,.component-picker-entry { padding: 12px; border: 1px solid var(--line-3); border-radius: 16px; background: var(--collection-inset); }
.group-swatch { display: block; width: 20px; height: 20px; flex: none; border: 1px solid var(--line-3); border-radius: 50%; }
.settings-saved { padding: 12px; border: 1px solid #80dda055; border-radius: 12px; background: #80dda00c; color: #80dda0; font-size: 13px; }
#root[data-screen="collectionSettings"] input[type="color"] { max-width: 96px; height: 44px; padding: 4px; cursor: pointer; }
#demo { width: calc(100% - 32px); max-width: 400px; max-height: 85dvh; overflow-y: auto; padding: 24px; border: 1px solid var(--line-3); border-radius: 24px; background: var(--panel-solid); color: var(--text); font: inherit; line-height: 1.5; }
#demo::backdrop { background: #000a; }
#demo .dialog-title { font-family: var(--display); font-size: 16px; }
#demo p { margin: 8px 0; }
#demo.loot-picker-dialog { max-width: 520px; }
.loot-picker-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.loot-picker-option { display: grid; grid-template-rows: 88px 1fr auto; gap: 8px; padding: 12px; border: 1px solid var(--line-3); border-radius: 16px; color: var(--text); background: var(--collection-inset); text-align: left; }
.loot-picker-option.selected { border-color: var(--gold); }
.loot-picker-option:disabled { opacity: .4; }
.loot-picker-art { display: flex; align-items: center; justify-content: center; height: 88px; }
.loot-picker-art img { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.loot-picker-option b { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.loot-picker-option small { font-size: 11px; color: var(--collection-muted); }
.loot-picker-dialog input[type="search"] { display: block; min-width: 0; width: 100%; min-height: 44px; padding: 12px; border: 1px solid var(--line-3); border-radius: 12px; background: var(--collection-inset); color: var(--text); font: inherit; }
@media(prefers-reduced-motion:reduce) { .quick-result .wres { animation: none; } }
.reward-selected b { overflow-wrap: anywhere; }
.reward-upload-art { display: flex; align-items: center; justify-content: center; min-height: 96px; padding: 12px; border: 1px dashed var(--collection-line); border-radius: 12px; background: var(--collection-inset); }
.reward-upload-art img { display: block; width: auto; height: auto; max-width: 100%; max-height: 160px; object-fit: contain; }
.settings-bundle input[type="file"] { width: 100%; min-width: 0; white-space: normal; }
.settings-bundle input[type="file"]::file-selector-button { margin-right: 8px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--panel-2); color: var(--text); font: inherit; }
.collection-hero-reward-name { display: block; color: var(--gold); font: 700 14px/1.5 var(--body); overflow-wrap: anywhere; }
#hero-reward-settings .settings-bundle { border-top: 0; padding-top: 0; }
/* Compact responsive ranking and reward flows. */
.ranking-row { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 4px 8px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--collection-line); }
.rank-name { min-width: 0; overflow-wrap: anywhere; }
.rank-score { white-space: nowrap; color: var(--gold); font-weight: 700; }
.rank-state { grid-column: 2 / -1; color: var(--collection-muted); }
.own-rank { padding-top: 8px; color: var(--gold); font-weight: 700; font-size: 14px; }
.haul-top h2 { font-size: 16px; }
.haul-row { display: grid; grid-template-columns: 28px minmax(0,1fr) 112px; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--collection-line); }
.haul-row-prizes { grid-column: 3; display: grid; gap: 8px; min-width: 0; }
.haul-row .collection-prize-line { align-items: center; gap: 8px; }
.haul-row .award-art { width: 32px; height: 32px; }
.haul-row .collection-prize-line b { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.haul-row .collection-prize-line small { font-size: 11px; }
.haul-top .podium { gap: 8px; }
.haul-top .pod { min-width: 0; }
.haul-top .pod .name,.haul-top .pod-prize span { white-space: normal; overflow-wrap: anywhere; }
.haul-top .pod-prize img { max-width: 100%; height: auto; object-fit: contain; }
.haul-top .pod-prize { min-width: 0; }
.reward-credit-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; padding: 12px 0; }
.reward-credit-grid small { font-size: 12px; color: var(--collection-muted); }
.daily-task .btn { height: auto; min-height: 44px; padding: 12px; white-space: normal; overflow-wrap: anywhere; text-decoration: none; }
.daily-task .od-row { flex-wrap: wrap; }
.haul-place-settings summary,.demo-scenarios summary { cursor: pointer; min-height: 44px; padding: 12px 0; overflow-wrap: anywhere; }
.settings-place { min-width: 0; }
.collection-panel h2,.collection-panel b,.settings-field span { overflow-wrap: anywhere; }
.settings-field input,.settings-field select,.settings-field textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
@media(max-width:430px) { .haul-top .pod-prize span { font-size: 10px; line-height: 1.4; } .haul-top .pod .name { font-size: 10px; } }

.od-stack{display:flex;flex-direction:column;gap:12px}.od-row{display:flex;align-items:center;gap:12px}.od-fill{flex:1;min-width:0}.od-field{display:flex;flex-direction:column;gap:4px;min-width:0}.gold{color:var(--gold)}.muted{color:var(--dim)}.archive-body{padding-top:16px}.top-place-reward{grid-column:2/-1;color:var(--gold);overflow-wrap:anywhere}
