:root {
  color-scheme: dark;
  --bg: #101b2a;
  --panel: #263a4e;
  --edge: #536b82;
  --text: #f5f8fb;
  --dim: #c4d0de;
  --accent: #bfe9ff;
  --gold: #ffcf51;
  --display: 'Roboto Condensed','Arial Narrow',Arial,sans-serif;
  --latin: 'Barlow Condensed',Impact,sans-serif;
  --mono: ui-monospace,SFMono-Regular,Consolas,monospace;
}
* { box-sizing: border-box }
[hidden] { display: none !important }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.4 Arial,sans-serif; -webkit-font-smoothing: antialiased }
button,input,select { font: inherit }
button { color: inherit; cursor: pointer; touch-action: manipulation }
button:disabled { opacity: .55; cursor: default }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px }
h1,h2,h3,p { margin: 0 }
.icon { width: 20px; height: 20px; display: inline-block; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round }
.event-shell {
  --rail: clamp(112px,13.6vw,202px);
  --gutter: clamp(18px,3.5vw,68px);
  --pad-y: clamp(14px,3.5vh,42px);
  position: relative; isolation: isolate; min-height: 100vh; min-height: 100svh;
  display: grid; grid-template-columns: minmax(0,1fr) var(--rail); grid-template-rows: auto auto 1fr; gap: 0 clamp(12px,1.6vw,28px);
  padding: max(var(--pad-y),env(safe-area-inset-top)) max(var(--gutter),env(safe-area-inset-right)) max(var(--pad-y),env(safe-area-inset-bottom)) max(var(--gutter),env(safe-area-inset-left));
  background: linear-gradient(0deg,#0b1626e8 0%,#172d4a37 25%,transparent 55%,#101e36a8 100%),
    linear-gradient(96deg,#0c1c37c7 2%,#192d4b30 36%,#172d4a25 56%,#162b46c2 88%),
    url('./assets/birthday/valley.webp') center / cover no-repeat;
}
.event-shell::before,.event-shell::after { content: ''; position: absolute; pointer-events: none; z-index: -2 }
.event-shell::before { top: 0; left: 0; width: clamp(200px,26vw,460px); height: clamp(95px,22vh,230px); clip-path: polygon(0 0,100% 0,0 100%); background: radial-gradient(#b9872c80 .8px,transparent 1px) 0 0/4px 4px,linear-gradient(125deg,#ffe390,#efb337 65%,#ffc74a) }
.event-shell::after { inset: 0; clip-path: polygon(100% 5%,100% 100%,67% 100%); background: #14263e60 }
.event-header { grid-area: 1 / 1 / 2 / -1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; position: relative; z-index: 1; pointer-events: none }
.event-header button,.wallet { pointer-events: auto }
.event-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 clamp(12px,1.6vw,24px); max-width: 63%; }
.event-title h1 { font: italic 800 clamp(50px,6.1vw,100px)/.91 var(--latin); white-space: nowrap; letter-spacing: -.025em; color: #fff; text-shadow: 1px 2px 0 #223247,0 2px 10px #11243acc }
.brand { padding: 0; border: 0; background: transparent; display: inline-flex; align-items: center; gap: 4px; color: #f7faff; font: italic 800 clamp(16px,1.55vw,25px) var(--latin); text-shadow: 0 1px 5px #17293c }
.brand .icon { width: 1.05em; height: 1.05em }
.event-links { width: 100%; display: flex; gap: 12px; margin-top: 7px }
.event-links button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: #111e31bb; padding: 4px 7px; color: white; font: 700 clamp(13px,1vw,17px) var(--display) }
.event-links .icon { width: 15px; height: 15px }
#chances { text-decoration: underline; text-underline-offset: 3px }
.hud,.wallet,.currency,.icon-btn { display: flex; align-items: center }
.hud { gap: 6px; padding: 2px 4px 2px 10px; color: #fff; background: linear-gradient(100deg,#111d32a6,#0e192dcf); border-top: 1px solid #d7edff50 }
.wallet { gap: clamp(10px,1.4vw,24px); padding-right: 6px }
.currency { gap: 5px; font: 700 clamp(18px,2vw,30px)/1 var(--latin) }
.currency .icon { width: 24px; height: 22px; color: #ffe4a1 }.currency + .currency .icon { color: #e5edf7 }
.currency small { font: 700 12px var(--display); align-self: end; color: var(--dim) }
.icon-btn { width: 38px; height: 36px; justify-content: center; border: 0; background: transparent; color: var(--text) }
.icon-btn:hover,.event-links button:hover { background: #3e5970 }
#error { grid-area: 2 / 1 / 3 / -1; z-index: 2; margin-top: 8px }
.event-nav { grid-area: 3 / 2; z-index: 1; align-self: start; display: grid; gap: 7px; margin-top: clamp(8px,4vh,46px) }
.navbtn { position: relative; isolation: isolate; overflow: hidden; height: clamp(54px,8.2vh,90px); width: 100%; border: 1px solid #c5dced66; background-color: #203751; text-align: right; display: flex; align-items: flex-end; justify-content: flex-end; padding: 5px 8px; font: 700 clamp(15px,1.5vw,23px)/1 var(--display); text-shadow: 0 2px 3px #08182b }
.navbtn::before { content: ''; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(0deg,#0b172de3,transparent 65%),var(--card-art),linear-gradient(128deg,var(--card-color) 40%,#d5e6ff66 40.5%,var(--card-color) 41%,#163050 85%); background-size: auto,auto 106%,auto; background-position: center,left 8% center,center; background-repeat: no-repeat }
#roulette-tab { --card-art: url('./assets/birthday/portrait.webp'); --card-color: #718db6 }
#catalog-tab { --card-art: url('./assets/airdrop.webp'); --card-color: #896994 }
#inventory-tab { --card-art: url('./assets/pack.webp'); --card-color: #43777c }
.navbtn .icon { display: none }
.navbtn.active,.navbtn:hover { border-color: var(--gold) }
.navbtn.active::after { content: ''; pointer-events: none; position: absolute; inset: 0; border: 2px solid var(--gold); background: linear-gradient(0deg,#ffbc4d4a,transparent 45%) }
.navbtn span { position: relative; z-index: 1 }
#roulette { grid-area: 3 / 1; min-width: 0; display: grid; grid-template-rows: minmax(160px,1fr) auto }
.hero-portrait { position: absolute; z-index: -1; pointer-events: none; inset: 1.5% auto 0 43%; width: min(51vw,83vh); transform: translateX(-50%); background: url('./assets/birthday/character.webp') center bottom/contain no-repeat }
.prize-board { align-self: stretch; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(2px,2vw,32px) }
.prize-bank { --tile: clamp(88px,min(9.5vw,19vh),170px); display: grid; grid-template-columns: repeat(4,calc(var(--tile)/2)); grid-auto-rows: calc(var(--tile)/2) }
.reward-tile { position: relative; display: grid; place-items: center; padding: 0; border: 0; margin: 1px; background: #b7c9d677; clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%); isolation: isolate }
.reward-tile::before { content: ''; position: absolute; inset: 1px; z-index: -1; clip-path: inherit; background: linear-gradient(45deg,transparent 25%,var(--tint) 25% 28.5%,transparent 28.5%),linear-gradient(140deg,#374659e8,#192a40ef) }
.reward-tile:nth-child(1) { grid-area: 1 / 2 / span 2 / span 2 }
.reward-tile:nth-child(2) { grid-area: 2 / 1 / span 2 / span 2 }
.reward-tile:nth-child(3) { grid-area: 2 / 3 / span 2 / span 2 }
.reward-tile:nth-child(4) { grid-area: 3 / 2 / span 2 / span 2 }
.reward-tile img { width: 62%; height: 62%; object-fit: contain; filter: drop-shadow(0 3px 2px #071526a8) }
.reward-tile small { position: absolute; bottom: 12%; color: white; background: #19283ad6; padding: 0 3px; font: 700 clamp(9px,.85vw,13px) var(--display) }
.reward-tile.spent img { opacity: .5; filter: grayscale(.8) }
.reward-tile:is(:hover,:focus-visible,.selected) { background: var(--gold) }
.reward-tile:is(:hover,:focus-visible,.selected)::before { inset: 4px; background: linear-gradient(137deg,#635336ee,#343a4aee) }
.common { --tint:#9ac4fc; --well:#57718e; --deep:#304359 }
.rare { --tint:#71c5ff; --well:#387da4; --deep:#284d69 }
.epic { --tint:#e88cf5; --well:#84629f; --deep:#4a395d }
.legendary { --tint:#ffbc63; --well:#9a7648; --deep:#574735 }
.draw-footer { z-index: 1; display: flex; justify-content: space-between; align-items: end; gap: 10px }
.draw-progress { width: clamp(146px,18vw,265px); padding: 8px 13px; background: linear-gradient(100deg,#112137e8,#172b41bb); border-left: 3px solid var(--gold); box-shadow: inset 0 1px #d6edff4d; font: 700 14px/1.12 var(--display) }
.draw-progress strong { font: 700 clamp(27px,2.6vw,41px)/1.1 var(--latin) }.draw-progress small { color: var(--dim); font-size: 13px }
.draw-progress progress { display: block; width: 100%; height: 4px; border: 0; accent-color: var(--gold); border-radius: 0; background: #566779 }
progress::-webkit-progress-bar { background: #566779 }progress::-webkit-progress-value { background: var(--gold) }progress::-moz-progress-bar { background: var(--gold) }
.controls { width: clamp(300px,32vw,500px); max-width: 100%; text-shadow: 0 1px 4px #051527 }
.draw-options { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 2px 7px; margin-bottom: 4px; font: 700 13px var(--display) }
#skip-option { display: inline-flex; align-items: center; min-height: 26px; padding: 2px 7px; background: #132336c9; cursor: pointer }
#skip-animation { accent-color: var(--gold); width: 17px; height: 17px; margin: 0 6px 0 0; padding: 0 }
#open-coupon { font-size: 12px }
.actions { display: flex; gap: 8px }
.draw { display: flex; flex: 1; flex-direction: column; overflow: hidden; padding: 0; border: 0; border-bottom: 3px solid #688ad0; text-align: center }
.draw .cost { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; min-height: 20px; background: #192738; color: white; font: 700 13px var(--display) }.cost .icon { width: 17px; height: 14px }
.draw strong { width: 100%; padding: 7px 5px; font: 700 clamp(17px,1.7vw,28px)/1.1 var(--display) }
.button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 8px 15px; border: 1px solid var(--edge); font: 700 17px var(--display) }
.actions .button { width: 100% }
.primary { background: linear-gradient(110deg,#ffda55,#ffbf31); color: #271e10 }
.secondary { background: linear-gradient(110deg,#f2f2ec,#cbd5df); color: #202c3b }
.draw:hover:enabled,.button:hover:enabled { filter: brightness(1.1) }
#machine-status { display: block; margin-top: 4px; font: 700 12px/1.2 var(--display); text-align: right }
.content-panel { position: relative; grid-area: 3 / 1; min-width: 0; align-self: start; margin-top: clamp(12px,3vh,30px); padding: clamp(12px,2vw,30px); background: #152639eb; border-top: 2px solid var(--gold); }
.section-head,.section-head h2,.dialog-head,.statline { display: flex; align-items: center }
.prize-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 4px; flex-wrap: wrap }.prize-meta b { font: 700 13px var(--display); color: #eff8ff }
.section-head { justify-content: space-between; gap: 12px; margin-bottom: 14px }
.section-head h2 { gap: 10px; font: 700 25px/1.2 var(--display); text-transform: uppercase; letter-spacing: .3px }
.section-head .icon { color: var(--accent); width: 23px; height: 23px }
.count { color: var(--dim); font: 14px var(--display) }
.grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr)); gap: 10px }
.prize { color: var(--text); position: relative; padding: 0; display: flex; flex-direction: column; min-width: 0; text-align: left; border: 1px solid #adc9db; border-bottom: 3px solid var(--tint); background: var(--deep); overflow: hidden; border-radius: 3px 12px 3px 3px }
.prize:hover { border-color: var(--tint); filter: brightness(1.12) }.prize:focus-visible { outline: 0; box-shadow: inset 0 0 0 3px white }
.art { position: relative; display: grid; place-items: center; width: 100%; height: clamp(87px,8vw,121px); background: radial-gradient(ellipse at center bottom, var(--well), var(--deep) 78%) }
.art::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(127deg,transparent 48%,#ffedd710 48% 59%,transparent 59% 62%,#fff3da12 62% 63%,transparent 63%) }
.art img { position: absolute; inset: 0; margin: auto; width: 81%; height: 83%; object-fit: contain; filter: drop-shadow(0 5px 4px #05101a85) }
.prize-text { width: 100%; flex: 1; padding: 8px 10px 10px; background: #213951ee }
.rarity { display: block; font: 700 11px/1.2 var(--display); letter-spacing: .9px; text-transform: uppercase; color: var(--tint) }
.prize-name { display: block; margin-top: 4px; font: 700 clamp(15px,1.18vw,20px)/1.13 var(--display); overflow-wrap: anywhere }
.out { position: absolute; right: 5px; top: 5px; padding: 2px 5px; background: #253b52ee; font: 700 12px var(--display) }
.disabled-prize img { opacity: .46; filter: grayscale(.8) }
.panel,.inv-summary span { color: var(--text); background: var(--panel); border: 1px solid var(--edge) }
.empty { padding: 40px 20px; text-align: center; color: var(--dim) }.empty .icon { display: block; width: 32px; height: 32px; margin: 0 auto 9px; color: var(--accent) }.empty .button { margin: 15px auto 0 }
.inv-summary { display: flex; gap: 10px; flex-wrap: wrap }.inv-summary span { padding: 8px 13px }
.inv-box { margin-top: 12px; padding: 15px 18px }.inv-box h3 { font: 700 21px var(--display) }
.group-list { padding: 0; margin: 0; list-style: none }.group-list li { display: flex; align-items: center; gap: 10px; padding: 6px 0 }.group-list img,.sector-prize img { width: 44px; height: 40px; object-fit: contain }.group-list b { margin-left: auto; color: var(--accent) }
.history { border-bottom: 1px solid var(--edge) }.history summary { cursor: pointer; padding: 10px 0; font-weight: bold }.history small { color: var(--dim); margin-left: 8px; font-size: 12px }.history ol { margin: 0 0 12px }
dialog { padding: 0; width: min(530px,calc(100% - 26px)); max-height: 90vh; max-height: 90dvh; overflow: auto; color: var(--text); background: linear-gradient(145deg,#365872,#1f3950 62%); border: 1px solid #afcfe1; border-top: 3px solid var(--accent); box-shadow: 0 18px 80px #152a3ed9 }
dialog:modal { margin: auto }dialog::backdrop { background: #152e43c7; backdrop-filter: blur(5px) }body:has(dialog[open]) { overflow: hidden }
.dialog-head { position: sticky; z-index: 4; top: 0; justify-content: space-between; padding: 8px 16px; background: #28485e; border-bottom: 1px solid var(--edge) }
.dialog-head h2 { font: 700 24px var(--display); text-transform: uppercase }
#dialog-body { padding: 17px 18px 20px }#dialog-body p { margin-bottom: 12px; color: #ebf5fc }#dialog-body .button { width: 100%; margin-top: 14px }
dialog:has(.result-grid) {
  width: min(858px,calc(100% - 22px));
  border-color: #637e9d; border-top: 2px solid var(--gold);
  background: radial-gradient(ellipse at 50% 0%,#3c6185,#192e49 55%,#101c2e 100%);
}
dialog:has(.result-slot:only-child) { width: min(460px,calc(100% - 22px)) }
dialog:has(.result-grid) .dialog-head {
  padding: 8px 14px;
  border-bottom: 1px solid #a0bfe15c;
  background: linear-gradient(112deg,#deaf4770 0 5px,transparent 6px 16px,#8fbfff14 17px 21px,transparent 22px),#172a42;
}
dialog:has(.result-grid) .dialog-head h2 {
  font: italic 700 clamp(26px,4.4vw,39px)/1.04 var(--display);
  color: #fff4cd; text-shadow: 0 2px 9px #0e1b31;
}
dialog:has(.result-grid) #dialog-body { padding: 12px 14px 0 }
#dialog-body .result-summary {
  margin-bottom: 9px; font: 700 16px var(--display); color: #e1effa; text-align: center;
}
.result-grid {
  display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: clamp(5px,1vw,10px);
  margin: 0; padding: 0; list-style: none;
}
.result-slot {
  min-width: 0; position: relative; isolation: isolate;
  background: linear-gradient(140deg,#1d324d,#111f33);
  border: 1px solid #7ea8ce38;
}
.result-slot::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(135deg,transparent 48%,#718fb560 49% 51%,transparent 52%),linear-gradient(45deg,transparent 48%,#718fb560 49% 51%,transparent 52%);
  background-size: 26px 26px; background-position: center; background-repeat: no-repeat;
}
.result-card {
  overflow: hidden; min-height: 100%;
  border: 1px solid var(--well); border-bottom: 3px solid var(--tint);
  background: var(--deep); text-align: center;
}
.result-card .art { height: clamp(61px,12vw,114px); overflow: hidden }
.result-card .art img { height: 81%; width: 82% }
.result-card:not(.common) .art {
  background: radial-gradient(ellipse at 50% 83%,var(--well),var(--deep) 76%);
}
.result-card:not(.common) .art::before {
  background: repeating-conic-gradient(from 18deg,var(--tint) 0deg 9deg,transparent 14deg 49deg);
  mask-image: radial-gradient(ellipse,#000 5%,transparent 70%);
  opacity: .23;
}
.result-card:not(.common) .art::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at 50% 55%,#fff2d755,transparent 59%),linear-gradient(128deg,transparent 32%,var(--tint) 48%,#fff9 50%,transparent 62%);
  mix-blend-mode: screen;
}
.result-card.legendary .art::before { opacity: .49 }
.result-name { padding: 4px 4px 6px }
.result-name .rarity { font-size: clamp(8px,1.25vw,11px); letter-spacing: .3px }
.result-name strong { display: block; margin-top: 2px; font: 700 clamp(12px,1.8vw,17px)/1.06 var(--display); overflow-wrap: anywhere }
.result-slot:only-child { grid-column: 1/-1; width: min(100%,270px); justify-self: center }
.result-slot:only-child .art { height: min(32svh,190px) }
.result-slot:only-child .result-name strong { font-size: 22px }
.result-actions {
  position: sticky; bottom: 0; z-index: 2;
  display: grid; justify-items: center; margin: 0 -14px; padding: 10px 14px;
  background: linear-gradient(0deg,#14233a 82%,#14233ad9);
}
#dialog-body #collect { width: min(100%,230px); min-height: 44px; margin: 0; border-color: #ffe7a8 }
.revealing .result-card {
  animation: result-reveal .31s cubic-bezier(.18,.79,.29,1) var(--reveal-delay) both;
}
.revealing .result-card:not(.common) .art::before {
  animation: result-rays .72s ease-out var(--reveal-delay) both;
}
.revealing .result-card:not(.common) .art::after {
  animation: result-glint .58s ease-out var(--reveal-delay) both;
}
.revealing .result-card.legendary .art::before { animation-duration: .9s }
@keyframes result-reveal {
  from { visibility: hidden; opacity: 0; transform: translateY(6px) scale(.86) }
  1% { visibility: visible }
  55% { opacity: 1; transform: scale(1.025) }
  to { visibility: visible; opacity: 1; transform: none }
}
@keyframes result-rays {
  from { opacity: .12; transform: scale(.6) rotate(-26deg) }
  33% { opacity: .85 }
  to { transform: none }
}
@keyframes result-glint {
  from { opacity: 0; transform: translateX(-68%) }
  38% { opacity: .52 }
  to { opacity: 0; transform: translateX(62%) }
}
dialog:has(.opening-scene) {
  width: min(820px,calc(100% - 24px)); overflow: hidden; border-top-color: var(--gold);
}
dialog:has(.opening-scene) .dialog-head {
  position: absolute; inset: 0 0 auto; background: linear-gradient(#101e36e6,transparent);
  border: 0; padding: 13px clamp(12px,3vw,27px) 24px; pointer-events: none;
}
dialog:has(.opening-scene) .dialog-head h2 { font-size: clamp(19px,3.2vw,30px); text-shadow: 0 2px 5px #0f1f37 }
dialog:has(.opening-scene) #close-dialog { display: none }
dialog:has(.opening-scene) #dialog-body { padding: 0 }
.opening-scene {
  --opening-time: 2.35s;
  --land-at: calc(var(--opening-time) * .42);
  --open-at: calc(var(--opening-time) * .65);
  position: relative; isolation: isolate; overflow: hidden;
  height: min(79svh,510px);
  background: linear-gradient(180deg,#273d6955,transparent 53%,#101a2f9c),
    url('./assets/birthday/valley.webp') center 63% / cover no-repeat;
  animation: opening-scene var(--opening-time) linear both;
}
.opening-horizon {
  position: absolute; inset: 0; z-index: -1;
  background: radial-gradient(ellipse at 50% 70%,#a1d5ff15,#1325465c 60%,#101b32);
}
.opening-horizon::after {
  content: ''; position: absolute; left: 50%; bottom: 14%;
  width: min(60%,48svh,260px); height: 8%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse,#122341b8,transparent 69%);
}
.opening-load {
  position: absolute; left: 50%; bottom: 17%;
  width: min(62%,42svh,230px); aspect-ratio: 1.3;
  animation: opening-land var(--opening-time) both;
}
.opening-parachute {
  position: absolute; width: 138%; height: 112%; left: -19%; bottom: 82%;
  background: url('./assets/birthday/parachute.webp') center bottom / contain no-repeat;
  transform-origin: 50% 100%;
  animation: opening-canopy var(--opening-time) both;
}
.opening-crate { position: absolute; inset: -21% 0 0; background-position: center bottom; background-size: contain; background-repeat: no-repeat }
.closed-crate {
  background-image: url('./assets/airdrop.webp');
  animation: opening-cover 1ms step-start var(--open-at) forwards;
}
.open-crate {
  inset-block-start: -58%; opacity: 0;
  background-image: url('./assets/birthday/open-crate.webp');
  animation: opening-lid 1ms step-start var(--open-at) forwards;
}
.opening-shockwave {
  position: absolute; left: 50%; bottom: 16%; width: min(46%,245px);
  height: 6%; border-radius: 50%; border: 2px solid #cdeaff; background: #accbfb67;
  animation: opening-impact .61s ease-out var(--land-at) both;
}
.opening-light {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 55%,#ffecaeaa,transparent 48%),conic-gradient(from -54deg at 50% 70%,#ffdc8510 0deg,#ffe5ac75 38deg,#fcd78810 59deg,#ffe7b073 79deg,#ffdc8500 108deg,transparent 108deg);
  animation: opening-glow var(--opening-time) both;
}
.opening-sparks { position: absolute; inset: 0; pointer-events: none }
.opening-sparks i {
  position: absolute; left: 50%; bottom: 30%; width: 10px; aspect-ratio: 1;
  background: #fff2bd; box-shadow: 0 0 13px 3px #ffc566a0;
  clip-path: polygon(50% 0,65% 35%,100% 50%,65% 65%,50% 100%,35% 65%,0 50%,35% 35%);
  animation: opening-spark var(--opening-time) ease-out both;
}
.opening-sparks i:nth-child(1) { --spark-x: -92; --spark-y: -3 }
.opening-sparks i:nth-child(2) { --spark-x: -57; --spark-y: -8; width: 7px }
.opening-sparks i:nth-child(3) { --spark-x: -22; --spark-y: -11 }
.opening-sparks i:nth-child(4) { --spark-x: 30; --spark-y: -9; width: 7px }
.opening-sparks i:nth-child(5) { --spark-x: 77; --spark-y: -6 }
.opening-sparks i:nth-child(6) { --spark-x: 102; --spark-y: -3; width: 8px }
#dialog-body #skip-opening {
  position: absolute; right: 12px; bottom: 12px; width: auto; min-height: 44px; margin: 0;
  background: #14253ee8; color: #f6f9ff;
}
@keyframes opening-scene {
  0% { opacity: .35 }
  9%,86% { opacity: 1 }
  100% { opacity: .72 }
}
@keyframes opening-land {
  0% { transform: translate(-90%,-220%) rotate(-13deg) scale(.8) }
  23% { transform: translate(-42%,-45%) rotate(7deg) scale(.93) }
  42% { transform: translate(-50%,5%) rotate(-3deg) scale(1,.93) }
  49% { transform: translate(-50%,-6%) rotate(2deg) }
  57% { transform: translateX(-50%) }
  62% { transform: translate(-50%,2%) scale(1,.98) }
  69%,100% { transform: translateX(-50%) }
}
@keyframes opening-canopy {
  0%,40% { opacity: 1; transform: none }
  51% { opacity: .6; transform: translate(27%,20%) rotate(22deg) scale(.8,.65) }
  64%,100% { opacity: 0; transform: translate(76%,60%) rotate(49deg) scale(.55,.25) }
}
@keyframes opening-cover { to { opacity: 0 } }
@keyframes opening-lid { to { opacity: 1 } }
@keyframes opening-impact {
  from { opacity: 0; transform: translateX(-50%) scale(.35) }
  10% { opacity: .88 }
  to { opacity: 0; transform: translateX(-50%) scale(1.85) }
}
@keyframes opening-glow {
  0%,64% { opacity: 0 }
  73% { opacity: .86 }
  92%,100% { opacity: .36 }
}
@keyframes opening-spark {
  0%,64% { opacity: 0; transform: scale(.4) }
  70% { opacity: 1 }
  90% { opacity: .75 }
  100% { opacity: 0; transform: translate(calc(var(--spark-x) * min(2px,.43vw)),calc(var(--spark-y) * min(23px,4svh))) rotate(90deg) scale(.6) }
}
.big-art { height: 165px; border-bottom: 2px solid var(--tint); margin-bottom: 12px }.detail-name { font: 700 26px var(--display); margin: 2px 0 9px }.statline { justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--edge) }.statline span,.note,.settings-meta { color: var(--dim) }
.sector-prize { display: flex; align-items: center; gap: 12px; width: 100%; margin: 5px 0; padding: 5px 10px; color: white; background: var(--deep); border: 1px solid var(--well); border-left: 3px solid var(--tint); text-align: left }
.rules { padding-left: 20px; margin: 0 }.rules li { margin-bottom: 10px }.error { background: #422c35; color: #ffdbce; border-left: 3px solid #efa482; padding: 10px 4% }
.edit-row { background: #29465c; border: 1px solid var(--edge); margin: 7px 0 }.edit-row summary { padding: 9px 11px; font-weight: bold; cursor: pointer; overflow-wrap: anywhere }.edit-row small { float: right; color: var(--dim); font: 13px var(--mono); margin: 4px 0 0 5px }
.edit-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 3px 11px 11px }.edit-fields label { display: flex; flex-direction: column; gap: 4px; color: #e2f0f7; font-size: 14px }.wide { grid-column: 1/-1 }
input,select { width: 100%; min-width: 0; padding: 8px; color: var(--text); background: #193047; border: 1px solid var(--edge); font-size: 16px }.note,.settings-meta { font-size: 14px }.settings-meta { display: block; margin-top: 6px }
.textbtn { padding: 8px 0; background: transparent; border: 0; color: var(--accent); font-weight: 700; text-align: left }.remove,.form-error { color: #ffc5ac !important }.settings-footer { display: flex; flex-wrap: wrap; gap: 15px; margin-top: 12px; border-top: 1px solid var(--edge) }
@media (orientation:portrait) {
  .event-shell { --gutter: clamp(12px,3.5vw,34px); --pad-y: clamp(12px,2.2svh,28px); grid-template-columns: minmax(0,1fr); grid-template-rows: auto auto minmax(0,1fr) auto }
  .event-nav { grid-area: 4 / 1; display: flex; gap: 4px; margin-top: 12px }
  .navbtn { flex: 1; height: 44px; align-items: center; justify-content: center; gap: 5px; padding: 5px; background: #162940e8; text-align: center; font-size: 16px }
  .navbtn::before { display: none }.navbtn .icon { display: block; width: 17px; height: 17px }
  .hero-portrait { left: 49%; top: 13%; bottom: 14%; width: 72%; background-position: center 30% }
  .prize-board { padding: 0; align-items: center }
  .prize-bank { --tile: min(14.5vw,116px) }
  .event-shell:has(#roulette[hidden]) { grid-template-rows: auto auto auto 1fr }
  .event-shell:has(#roulette[hidden]) .event-nav { grid-area: 3 / 1 }
  .content-panel { grid-area: 4 / 1; margin-top: 14px }
  .hero-portrait { mask-image: linear-gradient(#000 95%,transparent); -webkit-mask-image: linear-gradient(#000 95%,transparent) }
}
@media (orientation:portrait) and (max-width:600px) {
  .event-shell { --gutter: 12px; --pad-y: 12px }
  .event-header { gap: 2px }.event-title { max-width: none; flex: 1 }.event-title h1 { font-size: clamp(38px,10.7vw,60px) }.event-title .brand { padding: 0; border: 0; background: transparent; display: none }
  .event-links { margin-top: 6px; gap: 4px }.event-links button { padding: 5px; font-size: 12px }
  .hud { gap: 1px; padding: 2px 3px }.wallet { gap: 6px; padding-right: 1px }.currency { gap: 2px; font-size: 19px }.currency .icon { width: 17px; height: 15px }.currency small { font-size: 10px }.icon-btn { width: 30px; height: 32px }.icon-btn .icon { width: 17px }
  #roulette { grid-template-rows: minmax(218px,1fr) auto }
  .hero-portrait { left: 48%; width: 88%; top: 17%; bottom: 22%; background-position: center top }
  .prize-board { align-items: end; padding-bottom: min(5vh,48px) }
  .prize-bank { --tile: clamp(52px,16vw,90px) }
  .draw-footer { flex-direction: column; align-items: stretch; gap: 5px }
  .draw-progress { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1px 8px; width: 100%; padding: 4px 8px; font-size: 12px }.draw-progress strong { font-size: 18px }.draw-progress progress { grid-column: 1/-1; height: 2px }
  .controls { width: 100% }.draw-options { margin-bottom: 2px }.draw .cost { min-height: 18px }#machine-status { margin-top: 3px }
  .event-nav { margin-top: 7px }.navbtn { height: 38px }
  .grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px }.section-head h2 { font-size: 20px }.art { height: 83px }
  .result-grid { grid-template-columns: repeat(2,minmax(0,1fr)) }
  .result-slot:not(:only-child) .result-card { display: grid; grid-template-columns: minmax(0,44%) minmax(0,1fr); align-items: center }
  .result-slot:not(:only-child) .art { height: 100%; min-height: 49px }
  .result-slot:not(:only-child) .result-name { text-align: left }
}
@media (orientation:portrait) and (max-width:420px) {
  .event-header { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 4px }
  .event-title { display: contents }.event-title h1 { align-self: center }
  .event-links { grid-area: 2 / 1 / 3 / -1; margin-top: 0 }
  .hud { grid-area: 1 / 2; align-self: start }
}
@media (orientation:landscape) and (max-height:550px) {
  .event-shell { --gutter: clamp(9px,2.3vw,22px); --pad-y: 8px; --rail: clamp(78px,12vw,130px); column-gap: 10px }
  .event-title h1 { font-size: clamp(37px,6.5vw,58px) }.event-links { margin-top: 2px; gap: 5px }.event-links button { padding: 3px 6px; font-size: 12px }
  .hud { padding: 0 3px 0 7px; gap: 2px }.currency { font-size: 20px }.currency .icon { width: 19px; height: 17px }.icon-btn { width: 32px; height: 32px }
  .event-nav { margin-top: 3px; gap: 4px }.navbtn { height: clamp(36px,12.5svh,66px); font-size: clamp(12px,1.8vw,17px); padding: 3px 5px }
  #roulette { grid-template-rows: minmax(90px,1fr) auto }.prize-bank { --tile: clamp(48px,min(9vw,18vh),98px) }
  .draw-progress { padding: 5px 8px; font-size: 12px; width: 135px }.draw-progress strong { font-size: 24px }
  .controls { width: clamp(236px,35vw,370px) }.draw-options { margin-bottom: 1px; font-size: 12px }#skip-option { min-height: 22px }.draw .cost { min-height: 15px; font-size: 11px }.draw strong { padding: 6px 4px; font-size: 17px }#machine-status { font-size: 10px }
}
@media (orientation:landscape) and (max-height:550px) {
  dialog:has(.result-grid) .dialog-head { padding-block: 2px }
  dialog:has(.result-grid) .dialog-head h2 { font-size: 24px }
  dialog:has(.result-grid) #dialog-body { padding-top: 6px }
  #dialog-body .result-summary { margin-bottom: 4px; font-size: 14px }
  .result-card .art { height: clamp(39px,17svh,92px) }
  .result-actions { padding-block: 6px }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important }
  .revealing .result-card,.revealing .result-card .art::before,.revealing .result-card .art::after { animation: none !important }
}
