/* 来集卡 2a skin for the simulator (design 开卡模拟器 2a, S1–S8). Loaded after style.css; only presentation.
   The 3D stage keeps its original size logic (750×1334 source frame); it is placed, not resized. */
:root {
  --n-navy: #071443; --n-red: #E3350D; --n-red-shade: #B42A0A; --n-gold: #F7C948; --n-gold-text: #F2B705;
  --n-text: #20232A; --n-text-2: #5E6470; --n-text-3: #6B7280; /* ≥ 4.5:1 on white (site audit 110) */ --n-dim: #9AA6CF; --n-dim-2: #7F8BB5;
  --n-glass: rgba(255,255,255,.08); --n-glass-2: rgba(255,255,255,.1); --n-glass-border: rgba(255,255,255,.14);
  --n-control: #F4F5F7; --n-border: #E7E9EE; --n-page: #F6F7F9;
  --n-cn: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif; --n-num: 'Nunito', 'Noto Sans SC', sans-serif;
  --tap: 44px;
  font-family: var(--n-cn); color: #fff; background: var(--n-navy);
}
html body { background: var(--n-navy); color: #fff; font-family: var(--n-cn); position: relative; }
html body::before, html body::after { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; }
html body::before { background: radial-gradient(45% 55% at 68% 58%, rgba(64,118,255,.5), transparent 65%), radial-gradient(40% 45% at 100% 0%, rgba(206,84,226,.35), transparent 60%), radial-gradient(40% 45% at 0% 100%, rgba(52,204,240,.25), transparent 60%); }
html body::after { opacity: .55; background-image: radial-gradient(rgba(255,255,255,.9) 1px, transparent 1.4px), radial-gradient(rgba(247,201,72,.9) 1px, transparent 1.5px); background-size: 120px 120px, 190px 190px; background-position: 10px 30px, 70px 90px; }
html body > * { position: relative; z-index: 1; }
html body > dialog { z-index: auto; }
.ic { fill: currentColor; flex-shrink: 0; }
html body .topbar, html body .pack-toolbar, html body main, html body footer, html body .preview-tools { background: transparent; }

/* ---------- header ---------- */
html body .topbar { max-width: none; width: 100%; height: 76px; padding: 0 40px; margin: 0; display: flex; align-items: center; gap: 14px; }
html body .laijika-brand { color: #fff; display: flex; align-items: center; column-gap: 10px; }
html body .laijika-logo { display: block; height: 36px; width: auto; }
html body .laijika-sub { font: 700 12px var(--n-cn); color: var(--n-gold); letter-spacing: .1em; }
html body .topbar .top-actions { margin-left: auto; gap: 10px; }
html body .laijika-back { height: 42px; padding: 0 16px !important; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; font: 700 14px var(--n-cn) !important; gap: 6px; }
html body .laijika-back:hover { background: var(--n-glass); color: #fff; }
html body .icon-button { width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--n-glass-2); color: #fff; font-size: 0; }
html body .icon-button:hover { background: rgba(255,255,255,.16); }
html body #collection-open { height: 42px; padding: 0 16px; border-radius: 999px; background: var(--n-glass-2); color: #fff; display: inline-flex; align-items: center; gap: 8px; font: 700 14px var(--n-cn); }
html body #collection-open .ic { color: var(--n-gold); }
html body #collection-count { font: 900 16px var(--n-num); margin-left: 0; }
html body #collection-total { font: 900 16px var(--n-num); color: #fff; opacity: .55; margin-left: 0; }

/* ---------- choose (S1) controls ---------- */
html body .pack-toolbar { max-width: none; margin: 0; padding: 12px 0 0; display: flex; flex-direction: column; gap: 18px; }
html body #series-control { position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 0; font: 700 12px var(--n-cn); color: var(--n-dim); }
html body #series-control select { max-width: none; width: 100%; height: 56px; min-height: 56px; border: 0; border-radius: 18px; background: #fff; color: var(--n-text); font: 700 16px var(--n-cn); padding: 0 44px 0 48px; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256' fill='%238A909C'%3E%3Cpath d='M216.49 104.49l-80 80a12 12 0 0 1-17 0l-80-80a12 12 0 0 1 17-17L128 159l71.51-71.52a12 12 0 0 1 17 17Z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; background-size: 16px; cursor: pointer; }
html body .series-icon { position: absolute; left: 18px; bottom: 18px; color: var(--n-red); pointer-events: none; display: flex; }
html body .pack-toolbar .pack-selector { margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; max-width: none; }
html body .pack-toolbar .pack-option, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option {
  position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 14px; row-gap: 2px; align-content: center; justify-items: start; text-align: left;
  flex: none; min-height: 88px; padding: 10px 16px 10px 10px; border-radius: 20px; background: var(--n-glass); border: 2px solid rgba(255,255,255,.14); color: #fff; box-shadow: none; }
html body .pack-toolbar .pack-option img, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option img { grid-row: 1 / 3; grid-column: 1; width: 64px; height: 64px; border-radius: 14px; object-fit: cover; object-position: 50% 30%; }
html body .pack-toolbar .pack-option span:not(.pack-check), html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option span:not(.pack-check) { grid-column: 2; grid-row: 1; align-self: end; font: 900 18px var(--n-cn); width: auto; min-height: 0; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
html body .pack-toolbar .pack-option small, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option small { grid-column: 2; grid-row: 2; align-self: start; font: 500 13px var(--n-cn); color: inherit; opacity: .7; }
html body .pack-toolbar .pack-option small::after { content: '可抽取'; }
html body .pack-check { grid-column: 3; grid-row: 1 / 3; align-self: center; }
html body .pack-toolbar .pack-option[aria-pressed="true"], html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option[aria-pressed="true"] { background: #fff; color: var(--n-text); border-color: var(--n-gold); box-shadow: none; }
html body .pack-check { display: none; color: var(--n-red); }
html body .pack-option[aria-pressed="true"] .pack-check { display: flex; }
html body .pack-toolbar .pack-option:hover:not([aria-pressed="true"]) { background: rgba(255,255,255,.12); }
html body .pack-selector.is-promo { flex-direction: row !important; overflow-x: auto; }
html body .pack-selector.is-promo .pack-option { flex: 0 0 200px !important; }
html body .pack-toolbar .mode-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin: 0; border-radius: 999px; background: var(--n-glass-2); }
html body .pack-toolbar .mode-switch button { height: 48px; border: 0; border-radius: 999px; padding: 0; background: transparent; color: #fff; font: 900 16px var(--n-cn); opacity: .8; }
html body .pack-toolbar .mode-switch button[aria-pressed=true] { background: #fff; color: var(--n-navy); opacity: 1; }
html body .pack-toolbar .pool-count { margin: 0; font: 500 13px var(--n-cn); color: var(--n-dim); text-align: center; }
html body .toolbar-links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
html body .toolbar-links .pool-open { width: 100%; height: 52px; border-radius: 18px; background: var(--n-glass); border: 1px solid var(--n-glass-border); color: #fff; display: flex; align-items: center; justify-content: center; gap: 8px; font: 700 15px var(--n-cn); padding: 0; }
html body .toolbar-links .pool-open:hover { background: rgba(255,255,255,.14); color: #fff; }
html body .toolbar-links #pool-open .ic { color: #7FC4FF; }
html body .toolbar-links #odds-open .ic { color: var(--n-gold); }

/* the 3D frame: navy instead of light studio grey; overlaid texts in light colours */
html body #choose, html body #tear, html body #reveal, html body .native-stage, html body #native-reveal-host, html body .native-card-loading { background: var(--n-navy); }
html body #choose .screen-heading .hint, html body #tear .screen-heading .hint, html body #reveal .screen-heading .hint, html body .hint { color: var(--n-dim); }
html body #choose #selected-pack, html body .quiet { color: var(--n-dim); }
html body .loading p { color: var(--n-dim); }
html body .loader { border-color: rgba(255,255,255,.2); border-top-color: var(--n-gold); }
html body .primary, html body #choose .primary, html body #tear .primary { background: var(--n-red); color: #fff; border-radius: 999px; box-shadow: 0 5px 0 #9E2508; font: 900 17px var(--n-cn); letter-spacing: 0; min-height: 54px; padding: 0 30px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
html body .primary:hover { background: #D22F0B; box-shadow: 0 5px 0 #9E2508; }
html body .primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 2px 0 #9E2508; }
html body .primary:disabled { opacity: .6; }
html body #choose .screen-actions { bottom: calc(26 * var(--ui-unit)); }
/* The source hint sat over the empty top of the portrait frame; wider frames put packs there, so it moves to the top edge. */
html body #choose .screen-heading { top: 3%; }

/* The opaque WebGL canvas is feathered into the starry page so its rectangle never shows. */
html body .native-stage canvas, html body #native-reveal-host canvas { -webkit-mask-image: linear-gradient(90deg, transparent, #000 11%, #000 89%, transparent), linear-gradient(0deg, transparent, #000 5%, #000 92%, transparent); -webkit-mask-composite: source-in; mask-image: linear-gradient(90deg, transparent, #000 11%, #000 89%, transparent), linear-gradient(0deg, transparent, #000 5%, #000 92%, transparent); mask-composite: intersect; }
html body #choose, html body #tear, html body #reveal, html body #native-reveal-host { background: transparent; }

/* ---------- tear (S3) ---------- */
html body #tear .back-button, html body #choose-again { background: var(--n-glass-2); color: #fff; border-radius: 999px; padding: 0 16px; min-height: var(--tap); font: 700 13px var(--n-cn); }
html body #auto-open { background: #fff; color: var(--n-navy); border-radius: 999px; min-height: 48px; padding: 0 26px; font: 900 15px var(--n-cn); box-shadow: 0 10px 24px rgba(0,0,0,.3); }
html body #auto-open:hover { color: var(--n-navy); background: #fff; }
html body .tear-meter { background: rgba(255,255,255,.18); }
html body .tear-meter span { background: var(--n-gold); }

/* ---------- reveal (S4) ---------- */
html body .reveal-browser-actions { gap: 12px; padding: 16px 12px; }
html body #reveal .reveal-browser-actions .reveal-actions { gap: 12px; }
html body #reveal #next-card { min-height: 52px; min-width: 132px; padding: 0 24px; border-radius: 999px; background: transparent; border: 1.5px solid rgba(255,255,255,.35); color: #fff; box-shadow: none; font: 900 15px var(--n-cn); }
html body #reveal #reveal-all { min-height: 52px; padding: 0 24px; border-radius: 999px; background: var(--n-red); color: #fff; box-shadow: 0 4px 0 var(--n-red-shade); font: 900 15px var(--n-cn); }
html body #reveal #reveal-all:hover { color: #fff; background: #D22F0B; }
html body #rare-preview-back, html body #reveal-immersive { color: #fff; background: var(--n-glass-2); border-radius: 999px; min-height: var(--tap); padding: 0 18px; }
html body #fast-forward { background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 999px; font: 700 13px var(--n-cn); }
html body #fast-forward[aria-pressed="true"] { background: #fff; color: var(--n-navy); }
html body .card-dots span { background: rgba(255,255,255,.3); }
html body .card-dots span.current { background: var(--n-gold); }
html body .card-dots span.done { background: rgba(255,255,255,.7); }

/* ---------- results (S5) ---------- */
html body #results .series { color: var(--n-gold-text); font: 800 12px var(--n-num); letter-spacing: .2em; }
html body #results h1 { font: 900 30px var(--n-cn); color: #fff; letter-spacing: 0; }
html body #result-caption { display: none; }
html body .result-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
html body .result-chips span { height: 28px; padding: 0 12px; border-radius: 999px; background: var(--n-glass-2); display: inline-flex; align-items: center; font: 700 12px var(--n-cn); }
html body .result-chips .gold { background: var(--n-gold); color: var(--n-navy); }
html body #results .screen-actions { flex-direction: column; gap: 12px; padding: 0 16px; }
html body #results #again { width: min(100%, 360px); }
html body #result-collection { width: min(100%, 360px); min-height: 52px; border-radius: 999px; border: 1.5px solid rgba(255,255,255,.35); color: #fff; font: 700 15px var(--n-cn); display: flex; align-items: center; justify-content: center; gap: 6px; }
html body #result-collection:hover { color: #fff; background: var(--n-glass); }
html body .result-item h3 { color: #fff; }

/* ---------- footer ---------- */
html body footer { color: var(--n-dim-2); font: 400 12px var(--n-cn); max-width: none; justify-content: flex-start; gap: 6px 10px; padding: 18px 0 28px; }
html body footer .footer-dot { color: var(--n-dim-2); }
html body footer .footer-link { color: #fff; font-size: 12px; text-decoration: underline; min-height: var(--tap); display: inline-flex; align-items: center; }
html body footer .footer-link:hover { color: var(--n-gold); }

/* ---------- dialogs (white, radius 28) ---------- */
html body dialog { background: #fff; color: var(--n-text); border: 0; border-radius: 28px; padding: 28px; box-shadow: 0 30px 100px rgba(7,20,67,.5); font-family: var(--n-cn); }
html body dialog::backdrop { background: rgba(7,20,67,.6); backdrop-filter: blur(4px); }
html body dialog h2 { font: 900 22px var(--n-cn); color: var(--n-text); letter-spacing: 0; }
html body dialog p, html body dialog .quiet { color: var(--n-text-2); }
html body .dialog-heading { background: #fff; align-items: center; }
html body .close-button { width: var(--tap); height: var(--tap); background: var(--n-control); color: var(--n-text); font-size: 22px; line-height: 1; }
html body dialog .text-button { color: var(--n-red); font-weight: 700; min-height: var(--tap); }
html body dialog select, html body dialog input { font-family: var(--n-cn); }
/* S2 odds */
html body .odds-view { display: flex; flex-direction: column; gap: 16px; margin-bottom: 14px; }
html body .odds-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--n-control); }
html body .odds-tabs button { flex: 1; min-height: var(--tap); border: 0; border-radius: 999px; background: transparent; color: var(--n-text-2); font: 700 14px var(--n-cn); }
html body .odds-tabs button[aria-selected=true] { background: var(--n-navy); color: #fff; }
html body .odds-bars { display: flex; flex-direction: column; }
html body .odds-bar { display: grid; grid-template-columns: 96px minmax(0, 1fr) 64px; gap: 12px; align-items: center; min-height: 40px; border-bottom: 1px solid #F0F1F4; }
html body .odds-bar__glyph .rarity-rating { --rating-icon-size: 16px; }
html body .odds-bar__track { height: 8px; border-radius: 999px; background: var(--n-control); overflow: hidden; }
html body .odds-bar__track span { display: block; height: 100%; border-radius: 999px; background: #3A8EDB; }
html body .odds-bar__v { text-align: right; font: 800 14px var(--n-num); }
html body .odds-full summary { cursor: pointer; font: 700 13px var(--n-cn); color: var(--n-text-2); min-height: var(--tap); display: flex; align-items: center; }
html body .odds-table thead th { background: var(--n-page); color: var(--n-text-2); }
html body #odds-source { font-size: 12px; }
html body .odds-notes { color: var(--n-text-2); font-size: 12px; }
/* S6 图鉴 */
html body .pool-dialog, html body .collection-dialog { max-width: 1088px; width: calc(100% - 32px); padding: 40px; }
html body .pool-dialog .dialog-heading { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; column-gap: 16px; }
html body .pool-icon { width: 56px; height: 56px; border-radius: 18px; background: #EDF5FD; color: #3A8EDB; display: grid; place-items: center; grid-row: 1 / 3; }
html body .pool-dialog h2 { font-size: 30px; }
html body .pool-progress { display: inline-block; width: 280px; max-width: 45%; height: 8px; border-radius: 999px; background: var(--n-control); vertical-align: middle; margin-right: 14px; overflow: hidden; }
html body .pool-progress span { display: block; height: 100%; min-width: 8px; background: var(--n-red); border-radius: 999px; }
html body #pool-summary { display: inline; font: 500 13px var(--n-cn); color: var(--n-text-2); }
html body .pool-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 22px 0 16px; }
html body .pool-filters label { position: relative; display: flex; flex-direction: row; align-items: center; gap: 8px; height: 54px; padding: 0 16px; border-radius: 16px; background: var(--n-page); font: 500 12px var(--n-cn); color: var(--n-text-3); white-space: nowrap; }
html body .pool-filters select, html body .pool-filters input { border: 0 !important; background: transparent !important; min-height: 44px; padding: 0 !important; font: 700 14px var(--n-cn) !important; color: var(--n-text); flex: 1; min-width: 0; outline-offset: 2px; }
html body .filter-icon { display: flex; }
html body .filter-icon--pool-set { color: var(--n-red); } html body .filter-icon--pool-pack { color: #9B5CC4; } html body .filter-icon--pool-availability { color: #3A8EDB; }
html body .filter-icon--pool-rarity { color: var(--n-text-3); } html body .filter-icon--pool-ownership { color: #1F9E57; } html body .filter-icon--pool-query { color: var(--n-text-3); }
html body .pool-rarity-counts { gap: 8px; margin-top: 10px; }
html body .pool-rarity-counts button { min-height: var(--tap); padding: 0 16px; border-radius: 999px; border: 2px solid var(--n-border); background: #fff; color: var(--n-text); font: 800 14px var(--n-num); display: inline-flex; align-items: center; gap: 6px; }
html body .pool-rarity-counts button[aria-pressed=true] { border-color: var(--n-red); background: #FFF1EC; color: var(--n-red); }
html body #pool-reset { color: var(--n-red); }
html body .collection-grid { gap: 20px 16px; }
html body .collection-item, html body .pool-item { padding: 10px; border-radius: 16px; background: var(--n-page); color: var(--n-text); transition: transform .15s, box-shadow .15s; }
html body .collection-item:hover { transform: translateY(-3px); box-shadow: 0 14px 36px rgba(7,20,67,.10); }
html body .collection-item h3 { font: 700 15px var(--n-cn); color: var(--n-text); }
html body .pool-meta { font: 500 12px var(--n-num); color: var(--n-text-3); }
html body .collection-item > span:not(.lock) { background: var(--n-navy); border-radius: 999px; font: 800 11px var(--n-num); top: 4px; right: 4px; }
html body .collection-item.is-missing > img { filter: grayscale(1); opacity: .4; }
html body .collection-item .lock { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.9); color: var(--n-text-2); display: none; place-items: center; z-index: 1; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
html body .collection-item.is-missing .lock { display: grid; }
/* S7 card detail */
html body .card-dialog { background: var(--n-navy); color: #fff; padding: 28px 24px 24px; }
html body .card-dialog h2, html body .card-dialog #detail-name { color: #fff; }
html body .card-dialog p.quiet, html body .card-dialog #detail-membership, html body #detail-position { color: var(--n-dim); }
html body .card-dialog > .close-button { background: rgba(255,255,255,.14); color: #fff; }
html body .card-dialog #detail-pools { border-top-color: rgba(255,255,255,.14); }
html body .card-dialog #detail-pools h3, html body .card-dialog #detail-pools p { color: #C9CFE0; }
html body .card-dialog .text-button { color: #fff; }
html body .card-links { display: flex; justify-content: center; gap: 10px; margin: 14px 0 4px; }
html body .card-link { min-height: 48px; padding: 0 20px; border-radius: 999px; background: #fff; color: var(--n-navy); display: inline-flex; align-items: center; gap: 6px; font: 900 14px var(--n-cn); text-decoration: none; }
html body .card-link[hidden] { display: none; }
/* S8 settings */
html body .settings-dialog { max-width: 420px; padding: 24px; }
html body .settings-group { border-radius: 20px; background: var(--n-page); padding: 4px 16px; margin-bottom: 14px; }
html body .settings-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; border: 0; background: transparent; padding: 0; text-align: left; color: var(--n-text); text-decoration: none; cursor: pointer; font: inherit; }
html body .settings-row + .settings-row { border-top: 1px solid var(--n-border); }
html body .settings-icon { width: 38px; height: 38px; border-radius: 12px; background: var(--s); color: var(--c); display: grid; place-items: center; flex-shrink: 0; }
html body .settings-text { flex: 1; display: flex; flex-direction: column; }
html body .settings-text b { font: 700 15px var(--n-cn); }
html body .settings-text small { font: 500 12px var(--n-cn); color: var(--n-text-3); }
html body .settings-row > .ic { color: var(--n-text-3); }
html body .settings-row--danger b { color: var(--n-red); }
html body .settings-row input[type=checkbox] { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; background: #D5D9E0; position: relative; cursor: pointer; flex-shrink: 0; transition: background .15s; margin: 7px 0; }
html body .settings-row input[type=checkbox]::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; transition: left .15s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
html body .settings-row input[type=checkbox]:checked { background: var(--n-red); }
html body .settings-row input[type=checkbox]:checked::after { left: 25px; }
html body .settings-row input[type=checkbox]:disabled { opacity: .5; }
html body .settings-foot { text-align: center; font: 400 12px/1.8 var(--n-cn); color: var(--n-text-3); margin: 8px 0 0; }
html body #rules-dialog { max-width: 560px; }
html body #rules-dialog h3 { color: var(--n-text); }
html body #rules-dialog a { color: var(--n-red); }

/* ---------- layout: desktop two columns ---------- */
@media (min-width: 1024px) {
  :root { --game-width: min(430px, calc((100svh - 200px) * 750 / 1334)); }
  html body { display: grid; grid-template-columns: 420px minmax(0, 1fr); grid-template-rows: 76px auto 1fr auto; column-gap: 32px; padding: 0 40px; min-height: 100svh; }
  html body .topbar { grid-column: 1 / -1; padding: 0; }
  html body .pack-toolbar { grid-column: 1; grid-row: 2; }
  html body main#app { grid-column: 2; grid-row: 2 / 4; max-width: none; margin: 0; min-height: 0; display: flex; justify-content: center; align-items: flex-start; }
  html body footer { grid-column: 1; grid-row: 3; align-self: end; }
  html body:has(.pack-toolbar[hidden]) main#app { grid-column: 1 / -1; }
  html body:has(.pack-toolbar[hidden]) footer { grid-column: 1 / -1; grid-row: 4; justify-content: center; }
  html body main#app > .screen, html body main#app > .loading, html body main#app > .fatal { width: var(--game-width); margin: 0 auto; }
  html body main#app > #reveal { margin-bottom: 110px; }
  /* Choose and tear use the whole right column; the renderer frames the pack ring to the canvas (verified). */
  :root { --ui-unit: .5733333333px; }
  /* Wide screens: the ring gets the whole column (up to 1320px) so its outer packs are no longer clipped. */
  html body main#app > #choose, html body main#app > #tear { width: 100%; max-width: 1320px; aspect-ratio: auto; height: max(560px, calc(100svh - 96px)); }
  html body #results { width: min(100%, 1080px) !important; }
  /* 「第 N 包」sits just above the open button instead of inside the floor reflections. */
  html body #choose #selected-pack { bottom: calc(26 * var(--ui-unit) + 66px); color: #fff; font-weight: 700; text-shadow: 0 2px 8px rgba(0,0,0,.6); }
  html body main#app::before { content: ''; position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); width: 520px; max-width: 90%; height: 90px; border-radius: 50%; background: radial-gradient(closest-side, rgba(127,196,255,.45), transparent); pointer-events: none; }
}

/* ---------- layout: phone ---------- */
@media (max-width: 1023px) {
  html body { display: flex; flex-direction: column; min-height: 100svh; }
  html body .topbar { height: 64px; padding: 0 12px; gap: 8px; order: 0; }
  html body .laijika-brand { column-gap: 6px; }
  html body .laijika-logo { height: 28px; }
  html body .laijika-sub { font-size: 10px; }
  html body .laijika-back { width: var(--tap); padding: 0 !important; justify-content: center; border: 0; background: var(--n-glass-2); }
  html body .laijika-back span { display: none; }
  html body .icon-button, html body #collection-open, html body .laijika-back { height: var(--tap); width: auto; min-width: var(--tap); }
  html body #collection-open { padding: 0 12px; gap: 6px; font-size: 13px; }
  html body #collection-open .collection-label { display: none; }
  html body #collection-count, html body #collection-total { font-size: 14px; }
  html body .topbar .top-actions { gap: 6px; }
  html body .pack-toolbar { display: contents; }
  html body .pack-toolbar[hidden] { display: none; }
  html body #series-control { order: 1; margin: 6px 16px 0; }
  html body #series-control { flex-direction: row; align-items: center; background: #fff; border-radius: 16px; height: 48px; padding: 0 0 0 14px; font-size: 12px; color: var(--n-text-3); font-weight: 500; white-space: nowrap; gap: 4px; }
  html body #series-control select { flex: 1; min-width: 0; }
  html body #series-control select { height: 48px; min-height: 48px; border-radius: 16px; padding: 0 36px 0 6px; font-size: 14px; background-position: right 14px center; background-size: 14px; }
  html body .series-icon { display: none; }
  html body .pack-toolbar .pack-selector { order: 2; margin: 12px 16px 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  html body .pack-toolbar .pack-selector.is-promo { display: flex; }
  html body .pack-toolbar .pack-option, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option { min-height: 52px; padding: 6px; column-gap: 8px; row-gap: 0; border-radius: 16px; grid-template-columns: 36px minmax(0, 1fr); }
  html body .pack-toolbar .pack-option img, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option img { width: 36px; height: 36px; border-radius: 9px; }
  html body .pack-toolbar .pack-option span:not(.pack-check), html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option span:not(.pack-check) { font-size: 13px; }
  html body .pack-toolbar .pack-option small, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option small { font-size: 10px; }
  html body .pack-toolbar .pack-option small::after { content: ''; }
  html body .pack-option[aria-pressed="true"] .pack-check { display: none; }
  /* Centred on every width; the choose ring uses the full width (up to 760px), the other screens keep the portrait frame. */
  html body main#app { order: 3; width: 100%; max-width: none; margin: 12px auto 0; }
  html body main#app > #choose { width: 100%; max-width: 760px; margin: 0 auto; aspect-ratio: auto; height: clamp(360px, calc(100svh - 380px), 520px); }
  /* The source HUD is laid out on the 750×1334 portrait frame; on the shorter choose stage it follows the stage box so its idle hint stays above the packs. */
  html body main#app[data-state=choose] > #original-hud { width: min(100%, 760px); height: clamp(360px, calc(100svh - 380px), 520px); aspect-ratio: auto; }
  html body #choose .screen-heading .hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  html body .pack-toolbar .mode-switch { order: 4; margin: 10px 16px 0; padding: 4px; }
  html body .pack-toolbar .mode-switch button { height: 46px; font-size: 15px; }
  html body .pack-toolbar .pool-count { order: 5; margin: 10px 16px 0; font-size: 11px; }
  html body .toolbar-links { order: 6; margin: 10px 16px 0; gap: 8px; }
  html body .toolbar-links .pool-open { height: 46px; border-radius: 16px; font-size: 13px; }
  html body footer { order: 7; padding: 16px 16px 24px; justify-content: center; }
  html body .pool-dialog, html body .collection-dialog { padding: 20px 16px; width: 100%; max-width: 100%; max-height: 92svh; margin: auto 0 0; border-radius: 28px 28px 0 0; }
  html body .pool-dialog .dialog-heading { grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: 10px; }
  html body .pool-icon { width: 44px; height: 44px; border-radius: 14px; }
  html body .pool-dialog h2 { font-size: 20px; }
  html body .pool-progress { display: none; }
  html body #pool-summary { font-size: 11px; }
  html body .pool-filters { grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 10px; }
  html body .pool-filters label { height: var(--tap); padding: 0 10px; border-radius: 999px; font-size: 0; }
  html body .pool-filters label.pool-search { grid-column: 1 / -1; order: -1; border-radius: 14px; }
  html body .pool-filters select, html body .pool-filters input { font-size: 13px !important; min-height: var(--tap); }
  html body .collection-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
  html body .collection-item h3 { font-size: 12px; }
  html body .pool-rarity-counts { flex-wrap: nowrap; overflow-x: auto; }
  html body .pool-rarity-counts button { flex: 0 0 auto; }
  html body dialog.settings-dialog, html body #odds-dialog { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 28px 28px 0 0; }
  html body .odds-bar { grid-template-columns: 80px minmax(0, 1fr) 52px; }
}
/* Narrow phones: the logo alone; the page title already says 开卡模拟器. */
@media (max-width: 440px) { html body .laijika-sub { display: none; } }
@media (max-width: 370px) {
  html body .laijika-back { display: none; }
  html body .topbar .top-actions { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after { transition: none !important; }
}

/* ---------- printed TCG rarity (30 周年): a gold label that pops in on the shared rarity timeline ---------- */
html body #native-rarity .native-rarity-icons.is-printed { color: inherit; font-size: inherit; }
html body #native-rarity .rating-printed { display: inline-flex; align-items: center; height: calc(var(--rating-icon-size) * .6); padding: 0 1.05em; border-radius: 999px; background: linear-gradient(180deg, #FFE58A, #F2B705); color: #3B2A00; font: 900 clamp(13px, calc(40 * var(--ui-unit)), 22px) var(--n-cn); letter-spacing: .06em; white-space: nowrap; box-shadow: 0 0 0 2px rgba(255,255,255,.75), 0 6px 20px rgba(242,183,5,.5); transform-origin: 50% 50%; will-change: transform, opacity; }
html body #native-rarity .rating-ghost { left: 0; top: 50%; width: var(--rating-icon-size); height: var(--rating-icon-size); margin: calc(var(--rating-icon-size) / -2) 0 0 0; }

/* ---------- 走查 112 ---------- */
/* U3 快进只在揭卡时出现：#fast-forward 的 display:flex 会压过 [hidden] */
html body #fast-forward[hidden] { display: none !important; }
/* U2 开封页：「自动拆包」移到右上，与「重新挑选」同一行，不再压住卡包 */
html body #tear .screen-actions { top: 16px; bottom: auto; left: auto; right: 16px; width: auto; justify-content: flex-end; }
html body #auto-open:disabled { opacity: .75; cursor: progress; }
/* U4 未收集的卡：只让卡图变灰，卡名与编号保持可读 */
html body .collection-item.empty h3 { color: var(--n-text-2); }
html body .collection-item.empty .pool-meta, html body .collection-item .pool-meta { color: var(--n-text-3); font-size: 12px; }
html body .collection-item > span { font-size: 11px; }
/* U7 加载完成前不显示收藏分母（避免 /4052 → /285 跳变） */
html body:has(#loading:not([hidden])) #collection-total { visibility: hidden; }
/* U8 顶栏按钮 44px */
html body .icon-button, html body #collection-open, html body .laijika-back { height: var(--tap); }
html body .icon-button { width: var(--tap); }
/* U9 再次开包：图标在文字前，与站内按钮一致 */
html body #again span[aria-hidden] { font-size: 18px; line-height: 1; }
@media (max-width: 1023px) {
  html body .laijika-sub { font-size: 11px; }
  html body .pack-toolbar .pack-option small, html body .pack-selector:has(>.pack-option:not([hidden])~.pack-option:not([hidden])~.pack-option:not([hidden]))>.pack-option small { font-size: 11px; }
  html body #tear .screen-actions { top: 12px; right: 12px; }
}
/* 规则弹窗里的链接与收藏筛选：对比度 ≥ 4.5、点击区域 ≥ 44px */
html body dialog .quiet a { color: #B42A0A; font-weight: 700; display: inline-flex; align-items: center; min-height: var(--tap); }
html body #collection-filter { min-height: var(--tap); }
html body .loading-progress { display: block; margin-top: 8px; font: 500 12px var(--n-cn); color: var(--n-dim); text-align: center; max-width: 300px; line-height: 1.6; }
