:root {
  color-scheme: dark;
  --red: #e5092c;
  --cream: #ead7d2;
  --gold: #b49364;
  --muted: #a29898;
  --line: #ffffff12;
  font: 14px/1.6 'Chakra Petch', 'Noto Sans Thai', sans-serif;
  color: var(--cream);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100dvh; display: grid; place-items: center; background: #0d090a; padding: 42px 24px; }
button, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid #ffffff12; border-radius: 30px; background: #ffffff04; padding: 8px 17px; transition: background .18s, transform .18s, border-color .18s; }
button:hover:not(:disabled) { background: #ffffff09; border-color: #b4936460; }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: .4; cursor: default; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
.world { position: fixed; inset: 0; z-index: -1; background: linear-gradient(90deg,#13090cbb,#0b090b9c), url('assets/frontier.jpg') center/cover; }
.preview-tools { position: fixed; z-index: 4; top: 10px; left: 22px; display: flex; align-items: center; gap: 8px; color: #bfaaa2; font-size: 11px; }
.preview-tools button { background: #171012e8; padding: 4px 13px; font-size: 11px; }
#window { width: min(1120px, 94vw); background: #101012f7; border: 1px solid #593035; border-top-color: #a33443; border-radius: 20px; box-shadow: 0 30px 100px #0009; overflow: hidden; }
.window-head { height: 88px; padding: 15px 28px; display: flex; align-items: center; gap: 20px; background: linear-gradient(105deg,#37111730,transparent 60%); }
.logo { width: 99px; height: 48px; object-fit: contain; mix-blend-mode: screen; }
.heading { border-left: 1px solid #b4936428; padding-left: 20px; }
.heading small { font-size: 10px; color: var(--gold); letter-spacing: .06em; }
h1 { font-size: 24px; font-weight: 600; line-height: 1.3; }
.head-actions { margin-left: auto; display: flex; gap: 9px; align-items: center; }
.head-actions > button { font-size: 12px; }
.close { padding: 0; width: 32px; height: 32px; font-size: 22px !important; line-height: 1; }
.modes { display: flex; padding: 0 28px 14px; gap: 8px; border-bottom: 1px solid var(--line); }
.modes button { position: relative; flex: 1; text-align: left; padding: 10px 16px; background: #ffffff02; border-color: transparent; border-radius: 13px; }
.modes button strong { display: block; font-size: 13px; font-weight: 500; }
.modes button small { color: #8e8181; font-size: 10px; }
.modes button[aria-pressed=true] { background: linear-gradient(100deg,#6b192430,#36171c30); border-color: #8d39464d; }
.modes button[aria-pressed=true] strong { color: #f0d4ba; }
.modes button[aria-pressed=true]::after { content: ''; position: absolute; bottom: -15px; width: 46%; height: 2px; left: 27%; background: #ce3448; box-shadow: 0 0 12px #d71d383d; }
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 290px; padding: 22px 34px 8px; gap: 25px; }
.ceremony { min-width: 0; position: relative; border-radius: 45%; background: radial-gradient(ellipse at 50% 61%,#5c172518,transparent 67%); }
.scene-heading { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none; }
.gold { font-size: 10px; letter-spacing: .08em; color: var(--gold); }
.scene-heading h2 { font-size: 24px; line-height: 1.6; font-weight: 500; }
.scene-heading p { font-size: 11px; color: var(--muted); max-width: 380px; }
.stage { height: 304px; position: relative; display: grid; place-items: center; perspective: 1000px; isolation: isolate; }
.stage::before { content: ''; position: absolute; bottom: 18px; width: 260px; height: 18px; background: #000b; filter: blur(13px); border-radius: 50%; }
.stage::after { content: ''; position: absolute; width: 295px; height: 295px; border-radius: 50%; background: radial-gradient(ellipse,#8a24331a,transparent 69%); z-index: -1; }
.artifact { margin-top: 52px; width: 330px; height: 218px; position: relative; display: grid; place-items: center; transform-style: preserve-3d; }
.artifact { pointer-events: none; }
.artifact button { pointer-events: auto; -webkit-tap-highlight-color: transparent; }
.artifact button:disabled { opacity: 1; }
.scene-footer { min-height: 37px; display: flex; align-items: center; justify-content: center; gap: 18px; font-size: 11px; color: var(--gold); }
#skip { font-size: 11px; padding: 3px 12px; border-color: #b4936438; }
.pack-panel { border-left: 1px solid var(--line); padding: 4px 0 5px 27px; }
.pack-eyebrow { font-size: 10px; color: var(--gold); display: flex; align-items: center; gap: 8px; }
.little-seal { font-size: 18px; }
.pack-panel h2 { font-size: 24px; font-weight: 500; line-height: 1.45; margin: 9px 0; }
.muted { color: var(--muted); font-size: 11px; }
.ticket-balance { margin-top: 16px; display: flex; align-items: baseline; gap: 7px; }
.ticket-balance > span { margin-right: auto; color: var(--muted); font-size: 11px; }
.ticket-balance strong { font-size: 27px; line-height: 1; font-weight: 500; }
.ticket-balance small { color: var(--gold); }
.amount { border: 0; padding: 0; margin: 12px 0 8px; display: flex; gap: 7px; }
.amount legend { font-size: 10px; color: var(--muted); margin-bottom: 5px; }
.amount button { flex: 1; padding: 5px 12px; font-size: 12px; }
.amount button[aria-pressed=true] { background: #8c263124; border-color: #99414b88; }
.cost { display: flex; justify-content: space-between; font-size: 11px; margin: 10px 0; }
.cost span { color: var(--muted); }
.cost strong { font-weight: 500; color: #ceb493; }
.primary { width: 100%; background: var(--red); color: #fff0e9; border-color: transparent; font-weight: 600; }
.primary:hover:not(:disabled) { background: #c90a29; border-color: transparent; }
.primary span { float: right; }
.pack-note { text-align: center; font-size: 9px; color: #9d8988; margin-top: 7px; }
.text-button { border: 0; color: var(--gold); font-size: 10px; background: transparent; padding: 8px 0 0; }
.reward-shelf { margin: 10px 34px 0; padding: 15px 0 17px; border-top: 1px solid var(--line); display: flex; gap: 22px; align-items: center; }
.shelf-label { width: 100px; flex-shrink: 0; }
.shelf-label h3 { font-size: 12px; font-weight: 500; }
.shelf-label span { color: var(--muted); font-size: 10px; }
.reward-items { display: grid; grid-template-columns: repeat(6,1fr); gap: 9px; flex: 1; }
.reward-item { position: relative; min-width: 0; text-align: center; padding: 6px; border-radius: 10px; background: linear-gradient(150deg,#b4936409,transparent); }
.reward-item img { width: 37px; height: 37px; object-fit: contain; filter: drop-shadow(0 4px 6px #0007); }
.reward-item strong { display: block; font-size: 10px; font-weight: 400; white-space: nowrap; }
.reward-item small { color: #9b8581; font-size: 9px; }
.reward-item[data-tier="2"],.reward-item[data-tier="3"] { background: linear-gradient(150deg,#b4936418,transparent); }
.reward-item[data-tier="3"] small { color: #d5b278; }
.window-footer { display: flex; justify-content: space-between; gap: 10px; padding: 11px 28px; border-top: 1px solid var(--line); font-size: 9px; color: #897c7e; }
.window-footer i { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); margin-right: 6px; }
kbd { font: 9px 'Chakra Petch',sans-serif; border: 1px solid #ffffff19; border-radius: 4px; padding: 1px 4px; margin-right: 4px; }
.result { width: 100%; padding-top: 60px; text-align: center; animation: result-arrive .65s cubic-bezier(.2,.8,.2,1) both; }
.result-spark { color: var(--gold); letter-spacing: .12em; font-size: 10px; }
.result-art { width: 125px; height: 118px; object-fit: contain; filter: drop-shadow(0 12px 14px #000a); }
.result h3 { font-size: 23px; font-weight: 500; }
.result p { font-size: 11px; color: var(--gold); margin-top: 2px; }
.stamp { display: inline-block; transform: rotate(-7deg); border: 2px solid #ad8d5c; border-radius: 6px; color: #c3a273; padding: 1px 13px; font-size: 12px; margin: 12px 0 8px; animation: stamp .45s .22s both; }
.result[data-tier="3"] { background: radial-gradient(ellipse,#b4936422,transparent 65%); }
.result-batch { display: flex; align-items: center; justify-content: center; gap: 13px; min-height: 175px; padding-top: 10px; }
.batch-item { width: 87px; animation: result-arrive .5s both; animation-delay: var(--delay); }
.batch-item img { width: 58px; height: 66px; object-fit: contain; }
.batch-item strong { display: block; font-size: 10px; font-weight: 400; }
.batch-item small { font-size: 10px; color: var(--gold); }
dialog { width: min(580px,90vw); padding: 25px; border: 1px solid #733642; border-top: 2px solid #9a3547; border-radius: 19px; background: #101012; color: var(--cream); max-height: 78dvh; }
dialog::backdrop { background: #080508b8; backdrop-filter: blur(5px); }
dialog header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
dialog h2 { font-size: 20px; font-weight: 500; }
.detail-row { display: flex; align-items: center; gap: 15px; padding: 10px 0; border-top: 1px solid var(--line); }
.detail-row img { width: 40px; height: 40px; object-fit: contain; }
.detail-row strong { font-weight: 500; font-size: 13px; }
.detail-row small { display: block; color: var(--muted); font-size: 10px; }
.detail-row > b { margin-left: auto; color: var(--gold); font-weight: 500; }
.detail-note { font-size: 11px; color: var(--muted); margin-top: 15px; }
.history-entry { padding: 12px 0; border-top: 1px solid var(--line); }
.history-entry header { margin: 0 0 5px; font-size: 11px; color: var(--gold); }
.history-entry p { font-size: 12px; }
.history-entry small { font-size: 9px; color: var(--muted); }
#toast { position: fixed; z-index: 7; bottom: 18px; padding: 9px 22px; border: 1px solid #b4936440; border-radius: 30px; background: #1c1116f5; color: var(--cream); font-size: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg) translateY(-2px); } }
@keyframes reveal-object { 45% { transform: translateY(-9px) scale(1.04); filter: drop-shadow(0 0 15px #b4936460); } 100% { opacity: 0; transform: translateY(-20px) scale(.9); } }
@keyframes result-arrive { from { opacity: 0; transform: translateY(18px) scale(.93); } to { opacity: 1; transform: none; } }
@keyframes stamp { from { opacity: 0; transform: rotate(-7deg) scale(1.6); } to { opacity: 1; transform: rotate(-7deg) scale(1); } }
@keyframes wax-break { to { opacity: 0; transform: scale(1.25) translateY(23px); } }
@media (min-width:1800px) { #window { width: 1240px; } .stage { height: 357px; } .artifact { transform: scale(1.12); margin-top: 70px; } .main-layout { grid-template-columns: minmax(0,1fr) 310px; padding-top: 28px; } .pack-panel { padding-top: 12px; } .reward-shelf { padding-block: 20px; } }
@media (max-height:800px) { body { padding-block: 35px 15px; } .window-head { height: 76px; } .main-layout { padding-top: 16px; } .stage { height: 278px; } .artifact { margin-top: 60px; transform: scale(.9); } .pack-panel h2 { font-size: 22px; } .pack-panel .muted { display: none; } .reward-shelf { padding-block: 10px; } }
@media (max-width:800px) { body { padding: 50px 10px 15px; } .window-head { padding: 12px 16px; gap: 12px; } .logo { width: 70px; } .heading { padding-left: 12px; } h1 { font-size: 20px; } .head-actions > button:not(.close) { padding: 5px 9px; font-size: 10px; } .modes { padding-inline: 12px; gap: 3px; overflow-x: auto; } .modes button { flex: 0 0 120px; padding: 8px 10px; } .main-layout { padding: 18px; gap: 15px; grid-template-columns: minmax(0,1fr); } .pack-panel { border-left: 0; border-top: 1px solid var(--line); padding: 15px 0 0; } .pack-panel h2 { display: none; } .ticket-balance { margin-top: 6px; } .reward-shelf { margin-inline: 18px; align-items: start; flex-direction: column; gap: 8px; } .reward-items { width: 100%; grid-template-columns: repeat(3,1fr); } .shelf-label { width: 100%; display: flex; gap: 12px; } .window-footer span:nth-child(2) { display: none; } .scene-heading h2 { font-size: 22px; } .result-batch { gap: 4px; flex-wrap: wrap; } .batch-item { width: 72px; } }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
