/* The research stage follows the game's event strip and bottom-center opening control. */
.bar-inner { height: clamp(54px, 6.5svh, 76px); }
.topbar { background: #0b1012; border-bottom-color: #35403e; }
.main-nav { gap: 12px; }
.nav-item:first-child { padding-left: 0; }
.nav-item:first-child::after { left: 0; right: clamp(13px,1.7vw,29px); }
.stage {
  position: relative; isolation: isolate; overflow: hidden;
  display: flex; flex: 1; flex-direction: column; background: #121719;
}
.scene, .scene-shade { position: absolute; inset: 0; pointer-events: none; }
.scene { z-index: -3; }
.scene img, .scene video {
  position: absolute; inset: 0; display: block; width: 100%; height: 100%;
  object-fit: cover; object-position: var(--face,50%) var(--height,35%);
}
.scene video { opacity: 0; transition: opacity .24s; }
.scene video.ready { opacity: 1; }
.scene-shade {
  z-index: -2;
  background: linear-gradient(90deg,#0b1114f2 0%,#0c1215e0 15%,#0c1115b8 25%,#0b11155c 38%,#0b11150f 56%,transparent 70%),
    linear-gradient(180deg,#060a10aa 0%,#060a1010 18%,transparent 34%),
    linear-gradient(0deg,#070b10dc 0%,#090c1050 15%,transparent 44%);
}
.pool-switch {
  position: relative; z-index: 1; display: flex; align-items: center;
  gap: clamp(8px,1vw,18px); padding-top: clamp(14px,2.6svh,31px);
}
.pool-switch .collection { margin-left: auto; flex-shrink: 0; }
#op-home-enter { flex: none; min-height: 44px; padding: 0 14px; white-space: nowrap; color: #d4f0df; border-color: #83ae98; }
.pool-switch .pool-list { min-width: 0; }
.pool-list { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); width: min(83%,996px); }
.pool-card {
  position: relative; display: flex; align-items: center; gap: clamp(5px,.7vw,12px);
  min-width: 0; min-height: clamp(47px,5.8svh,64px); padding: 5px clamp(5px,.8vw,13px);
  text-align: left; border: 1px solid #c3d9d01e; background: #0d1115b0; color: #cbd2d0;
  transition: color .16s, background .16s; backdrop-filter: blur(8px);
}
.pool-card + .pool-card { border-left-color: transparent; }
.pool-card img { flex: none; width: clamp(26px,2.75vw,46px); height: clamp(31px,3vw,47px); object-fit: cover; border: 1px solid #e4f0e524; filter: saturate(.68) brightness(.86); }
.pool-card[aria-pressed="true"] { color: #eefff5; background: #223f36da; border-color: #86dcb874; }
.pool-card[aria-pressed="true"]::after {
  content: ""; position: absolute; bottom: -1px; left: -1px; right: -1px; height: 2px; background: #86e6b9;
}
.pool-card:hover { background: #26332fe0; color: #fff; }
.pool-card[aria-pressed="true"] img, .pool-card:hover img { filter: none; }
.card-copy { min-width: 0; }
.card-copy b, .card-copy small { display: block; line-height: 1.35; white-space: nowrap; }
.card-copy b { font-size: clamp(12px,1.07vw,17px); font-weight: 700; }
.card-copy small { margin-top: 1px; font-size: clamp(10px,.76vw,12px); color: #b2bebb; }
.pool-card[aria-pressed="true"] .card-copy small { color: #a6d3be; }
.card-earned { --size: 12px; position: absolute; top: 2px; right: 2px; color: #b1ffd4; }
.collection { display: flex; align-items: center; gap: 7px; white-space: nowrap; color: #d2ddd7; font-size: 12px; text-shadow: 0 1px 6px #000; }
.collection .ic { --size: 15px; color: #b4ccbf; }
.collection b { color: #f1f6ef; font: 600 14px var(--mono); }
.stage-inner {
  position: relative; flex: 1; display: flex; align-items: center;
  min-height: 435px; padding-top: clamp(22px,4svh,62px); padding-bottom: clamp(140px,19svh,245px);
}
.hero-copy { width: max-content; max-width: 47%; }
.hero-kicker { display: flex; align-items: center; gap: 12px; color: #e6eae6; font-size: clamp(12px,.93vw,15px); font-weight: 600; }
.tier { display: inline-flex; align-items: center; gap: 8px; color: #ffa499; }
.tier i { width: 9px; height: 9px; transform: rotate(45deg); background: #fa8374; border: 1px solid #ffa99a; box-shadow: inset 0 0 0 2px #533a39; }
.kicker-line { width: 23px; height: 1px; background: #9ba7a3a0; }
.mid-dot { color: #96a29e; margin: 0 .25em; }
.hero-copy h1 { margin: clamp(10px,1.7svh,24px) 0; width: clamp(260px,29vw,530px); height: clamp(102px,11.5vw,214px); }
.title-art { display: block; width: 100%; height: 100%; object-fit: contain; object-position: left center; filter: drop-shadow(0 3px 14px #03070a54); }
.hero-line { margin: 0; color: #e5e9e4; font-size: clamp(13px,1.05vw,17px); line-height: 1.75; text-shadow: 0 1px 6px #0008; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(12px,2.1svh,25px); }
.detail-link { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 5px 15px; font-size: 13px; color: #e4e9e4; background: #10171993; border: 1px solid #a3b0a77c; }
.detail-link .ic { --size: 14px; }
.detail-link:hover, .secondary:hover, .quiet:hover { color: white; border-color: #bbd1c5; background: #283734; }
.primary, .secondary, .quiet { position: relative; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; line-height: 1.25; }
.primary { color: #2c2518; background: linear-gradient(110deg,#ffe6a7,#e9c47d); border: 1px solid #ffe6aa; }
.primary:hover { background: #ffe5a1; }
.primary:active, .secondary:active, .quiet:active { transform: translateY(1px); }
.secondary, .quiet { color: #e8efeb; background: #131c1edb; border: 1px solid #65726f; }
.hero-actions { position: absolute; left: 50%; bottom: clamp(27px,5.6svh,82px); transform: translateX(-50%); }
.draw-unit { display: flex; flex-direction: column; align-items: center; gap: 9px; }
.button-price { display: inline-flex; align-items: center; gap: 7px; color: #f1ead5; font-size: 12px; text-shadow: 0 1px 5px black; }
.button-price .ic { --size: 20px; color: #f0cd86; }
.button-price #cost { font: 600 19px/1 var(--mono); }
.draw-button {
  width: clamp(210px,17.8vw,325px); min-height: clamp(48px,5.4svh,66px);
  color: #ffe4a1; font-size: clamp(17px,1.45vw,26px); letter-spacing: .06em;
  background: linear-gradient(100deg,#393025e0,#302a22d6); border: 1px solid #d9b66b;
  box-shadow: inset 0 -2px #efcd78, 0 4px 25px #05060842; backdrop-filter: blur(5px);
}
.draw-button:hover { color: #fff2d0; background: linear-gradient(100deg,#63513bea,#514231e8); }
.progress-panel { position: absolute; right: var(--pad); bottom: clamp(24px,4.1svh,63px); width: clamp(148px,12vw,202px); padding: 10px 12px; background: #0a1113b8; border-left: 2px solid #9ebbac; backdrop-filter: blur(7px); }
.progress-heading, .progress-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.progress-heading > span { display: flex; align-items: center; gap: 6px; color: #dce6df; font-size: 11px; }
.progress-heading .ic { --size: 13px; color: #bbd2c7; }
.progress-heading strong { font: 600 18px/1 var(--mono); }
.progress-heading em { font-size: 12px; font-weight: 400; font-style: normal; color: #aab6b2; }
.progress-segments { display: grid; grid-template-columns: repeat(8,1fr); gap: 3px; margin: 7px 0 5px; }
.progress-segments b { height: 3px; background: #8da29c55; }
.progress-segments b.on { background: var(--mint); }
.progress-foot { font: 10px/1.45 var(--mono), "Microsoft YaHei", sans-serif; color: #b8c7bf; }
.page-footer { min-height: 40px; }
#media-note { color: #e4c68d; font-size: 11px; }

/* The reward preview and the eight corresponding inventory tiles. */
#dialog[data-view="details"] { width: min(992px,calc(100vw - 38px)); }
.loot-inspector { isolation: isolate; position: relative; height: clamp(192px,32svh,345px); overflow: hidden; background: #141a1c; border: 1px solid #44504e; margin-bottom: 12px; }
.loot-inspector::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg,#101719ed,#11181bd1 17%,#171e2180 34%,transparent 50%); pointer-events: none; }
.inspect-haze { position: absolute; width: 100%; height: 100%; object-fit: cover; filter: blur(22px) brightness(.62); transform: scale(1.1); }
.inspect-art { position: absolute; right: 0; top: 0; width: 70%; height: 100%; display: grid; grid-template: minmax(0,1fr) / minmax(0,1fr); place-items: center; }
#inspect-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; min-width: 0; min-height: 0; object-fit: contain;
  mask-image: linear-gradient(90deg,transparent,#000 4%,#000 97%,transparent), linear-gradient(0deg,transparent,#000 5%,#000 95%,transparent); mask-composite: intersect; }
.inspect-caption { z-index: 1; position: absolute; bottom: 17%; left: 3.6%; max-width: 36%; text-shadow: 0 2px 8px #090d0fc0; }
.inspect-caption small { font-size: 12px; color: var(--tint); }
.inspect-caption h3 { font-size: clamp(19px,2.2vw,32px); line-height: 1.4; margin: 6px 0 0; overflow-wrap: anywhere; }
.inspect-caption h3 > span { display: inline-block; }
.prize-grid { grid-template-columns: repeat(8,minmax(0,1fr)); gap: clamp(4px,.6vw,9px); }
.prize-card { display: flex; flex-direction: column; align-items: stretch; text-align: left; }
.prize-thumb { position: relative; display: block; width: 100%; aspect-ratio: 1.29; background: #292521; }
.prize-thumb > img { display: block; width: 100%; height: 100%; object-fit: contain; }
.prize-card > b { margin: 6px 6px 0; line-height: 1.3; font-size: 12px; }
.prize-card > small { margin: 3px 6px 0; font-size: 10px; }
.prize-card[aria-pressed="true"] { outline: 2px solid #c5ebd6; outline-offset: -2px; }
.prize-card:hover { background: #29332f; }
.award-state { top: 3px; right: 3px; }
.reward-show { grid-template-columns: minmax(0,1.3fr) minmax(0,1fr); }
.reward-show .award-art { height: clamp(152px,25svh,260px); background: #171e20; }
.award-art img { object-fit: contain; object-position: center; }
.reward-copy .reward-type, .jackpot-visual small { display: inline-flex; align-items: center; gap: 9px; }
.result-thumb { width: 37px; height: 37px; object-fit: contain; border: 1px solid #eaca806a; }
.jackpot-visual .result-thumb { border-color: #e18c787d; }
.jackpot-visual { min-height: clamp(181px,29svh,300px); }
.jackpot-visual > img { width: auto; min-width: 52%; max-width: 83%; object-fit: cover; object-position: center; mask-image: linear-gradient(90deg,transparent,#000 24%); }
.bonus-tags span { display: inline-flex; align-items: center; gap: 6px; padding: 2px 7px 2px 2px; }
.bonus-tags img, .log-thumb { width: 25px; height: 25px; object-fit: contain; background: #302923; }
.log-thumb { width: 24px; height: 24px; flex: none; }

/* Cinematics preserve their native frame, including on portrait screens. */
#theater { position: fixed; inset: 0; margin: 0; padding: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; overflow: hidden; border: 0; background: #06090b; }
#theater[open] { animation: none; }
#theater::backdrop { background: #050709; }
.theater-surface { position: relative; width: 100%; height: 100%; overflow: hidden; }
#film-still, #film-video { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain; background: #06090b; }
#film-video { opacity: 0; }
#film-video.ready { opacity: 1; }
#theater[data-phase="reward"] #film-still { inset: 12% 5%; width: 90%; height: 76%; }
.film-vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg,#0407098a,transparent 16%,transparent 72%,#040709c4); }
.film-topline, .film-commands, .film-caption { position: absolute; }
.film-topline { top: max(17px,env(safe-area-inset-top)); left: var(--pad); right: var(--pad); display: flex; align-items: center; justify-content: space-between; color: #edf2ea; font-size: 13px; text-shadow: 0 1px 5px #000; }
.film-topline > span { padding-left: 10px; border-left: 2px solid var(--mint); }
.film-control { min-height: 39px; padding: 5px 14px; color: #f3f4ed; background: #111819bb; border: 1px solid #d5e1d373; backdrop-filter: blur(7px); font-size: 13px; }
.film-control:hover { color: #fff1c9; border-color: #eddaa6; }
#film-sound { display: grid; place-items: center; min-width: 39px; padding: 5px; }
.film-caption { display: flex; align-items: center; gap: 12px; bottom: max(28px,5svh); left: var(--pad); max-width: 57%; text-shadow: 0 2px 8px #000a; }
#film-item { width: 56px; height: 56px; object-fit: contain; border: 1px solid #dabc77; }
.film-caption small { font-size: 12px; color: #e1d2b3; }
.film-caption h2 { font-size: clamp(22px,2.35vw,40px); margin: 3px 0 0; line-height: 1.35; }
.film-commands { right: var(--pad); bottom: max(28px,5svh); display: flex; gap: 8px; }
.film-trace { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #dce3d829; }
.film-trace i { display: block; width: 100%; height: 100%; background: #d5bf8d; transform: scaleX(0); transform-origin: left; transition: transform .21s linear; }

@media (max-width: 1100px) {
  :root { --pad: clamp(18px,3.5vw,38px); }
  .pool-list { width: 100%; }
  .collection { display: none; }
}
@media (min-width: 721px) and (max-width: 950px) {
  .progress-panel { width: 123px; padding: 7px 9px; }
}
@media (max-width: 950px) {
  .pool-switch { flex-wrap: wrap; gap: 5px; }
  #op-home-enter { margin-left: auto; font-size: 13px; }
}
@media (max-width: 720px) {
  :root { --pad: clamp(14px,4.4vw,26px); }
  .bar-inner { height: 51px; }
  .main-nav { gap: 3px; }
  .nav-item { padding: 0 7px; font-size: 12px; }
  .nav-item:first-child::after { right: 7px; }
  .top-tools { gap: 5px; }
  .icon-btn { width: 32px; height: 35px; }
  .wallet { gap: 5px; font-size: 11px; }
  .wallet .ic { --size: 17px; }
  .wallet b { font-size: 20px; }
  .separator { height: 14px; }
  .pool-switch { padding-top: 9px; }
  .pool-list { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 2px; }
  .pool-card { min-height: 36px; padding: 3px 6px; gap: 6px; }
  .pool-card img { width: 26px; height: 28px; }
  .card-copy b { font-size: 11px; }
  .card-copy small { font-size: 9px; line-height: 1.2; }
  .scene { height: 71%; }
  .scene-shade { background: linear-gradient(0deg,#101719 0%,#101719 28%,#101719ed 35%,#10171972 46%,transparent 63%),linear-gradient(180deg,#0b10157a,transparent 26%); }
  .stage-inner { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 13px; min-height: 0; padding-top: clamp(145px,25svh,285px); padding-bottom: 20px; }
  .hero-copy { width: 100%; max-width: none; }
  .hero-kicker { font-size: 11px; gap: 8px; }
  .kicker-line { width: 18px; }
  .hero-copy h1 { width: clamp(220px,58vw,334px); height: clamp(76px,20.5vw,115px); margin: 6px 0; }
  .hero-line { font-size: 12px; line-height: 1.6; }
  .detail-actions { margin-top: 8px; gap: 6px; }
  .detail-link { font-size: 12px; min-height: 33px; padding: 5px 10px; }
  .progress-panel { position: static; order: 2; display: grid; grid-template-columns: auto minmax(28px,1fr) auto; align-items: center; gap: 10px; width: 100%; padding: 7px 0; backdrop-filter: none; background: none; border: solid #96aa9e33; border-width: 1px 0; }
  .progress-heading { gap: 6px; }
  .progress-heading > span, .progress-foot { font-size: 10px; }
  .progress-heading strong { font-size: 14px; }
  .progress-heading em { font-size: 10px; }
  .progress-segments { margin: 0; gap: 2px; }
  .progress-foot { gap: 7px; }
  .hero-actions { position: static; transform: none; order: 3; display: flex; gap: 9px; align-items: flex-end; }
  .draw-unit { flex: 1; min-width: 0; gap: 5px; }
  .draw-button { width: 100%; min-height: 45px; font-size: 16px; }
  .button-price { font-size: 11px; }
  .button-price #cost { font-size: 15px; }
  .button-price .ic { --size: 16px; }
  .page-footer { min-height: 34px; }
  dialog, #dialog[data-view="details"] { width: calc(100vw - 20px); max-height: 94dvh; }
  .dialog-heading, .dialog-content { padding: 14px; }
  .dialog-heading h2 { font-size: 21px; }
  .dialog-actions { padding: 11px 14px 14px; gap: 6px; }
  .dialog-actions button { padding: 0 12px; }
  .loot-inspector { height: clamp(159px,24svh,237px); }
  .inspect-caption { bottom: 9px; left: 10px; max-width: 76%; }
  .inspect-caption h3 { font-size: 17px; margin: 2px 0 0; }
  .inspect-caption small { font-size: 10px; }
  .loot-inspector::after { background: linear-gradient(0deg,#0e151bd6,transparent 42%); }
  .inspect-art { width: 100%; }
  .prize-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 5px; }
  .prize-thumb { aspect-ratio: 1.65; }
  .prize-card { padding-bottom: 6px; }
  .prize-card > b, .prize-card > small { margin-left: 4px; margin-right: 2px; }
  .prize-card > b { font-size: 11px; }
  .cost-strip { grid-template-columns: repeat(4,minmax(0,1fr)); }
  .reward-show { gap: 10px; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); }
  .reward-copy h3 { font-size: 17px; }
  .reward-show .award-art { height: 148px; }
  .jackpot-visual { padding: 15px; }
  .film-topline { top: max(12px,env(safe-area-inset-top)); }
  .film-caption { max-width: calc(100% - 2 * var(--pad)); bottom: 85px; }
  .film-commands { left: var(--pad); right: auto; bottom: max(23px,env(safe-area-inset-bottom)); }
  .page-footer:has(#media-note:not([hidden])) { flex-wrap: wrap; padding-block: 6px; }
  #media-note { order: 3; width: 100%; }
}
@media (max-width: 430px) {
  .wallet span { display: none; }
  .top-tools { gap: 3px; }
  .history-stats > div { padding: 8px; }
  .history-round summary { flex-wrap: wrap; gap: 5px; }
  .history-round summary > small { font-size: 10px; }
}
@media (max-height: 520px) and (min-width: 721px) {
  .stage-inner { min-height: 285px; padding-top: 10px; padding-bottom: 88px; }
  .hero-copy h1 { height: 70px; margin-block: 5px; }
  .detail-actions { margin-top: 5px; }
  .hero-actions { bottom: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
