:root {
  color-scheme: dark;
  --bg: #07080d;
  --surface: rgba(19, 22, 32, 0.67);
  --surface-strong: rgba(27, 31, 45, 0.88);
  --border: rgba(255, 255, 255, 0.1);
  --text: #f4f6fb;
  --muted: #8c93a7;
  --violet: #9d78ff;
  --blue: #5a8fff;
  --gold: #ffc83d;
  --radius: 24px;
  font-family: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 50% -20%, #1c1835 0, #0a0c14 38%, #07080d 70%); overflow-x: hidden; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid #bca8ff; outline-offset: 3px; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; width: 38rem; height: 38rem; border-radius: 50%; filter: blur(100px); opacity: .12; pointer-events: none; z-index: -1; }
.ambient-one { background: #7f55ff; top: 15%; left: -22rem; }
.ambient-two { background: #2a79ff; right: -25rem; top: 50%; }
.glass { background: linear-gradient(145deg, rgba(255,255,255,.075), rgba(255,255,255,.018)); border: 1px solid var(--border); box-shadow: inset 0 1px rgba(255,255,255,.04), 0 24px 80px rgba(0,0,0,.24); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); }
.glass-strong { background: rgba(22,25,36,.76); border: 1px solid rgba(255,255,255,.11); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }

.site-header { position: sticky; top: 16px; z-index: 20; max-width: 1260px; height: 72px; margin: 16px auto 0; padding: 0 14px 0 22px; border-radius: 20px; display: flex; justify-content: space-between; align-items: center; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.05rem; font-weight: 700; letter-spacing: -.03em; }
.brand b { color: #b698ff; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; font-weight: 800; background: linear-gradient(145deg,#ad8bff,#6945d4); box-shadow: 0 0 24px rgba(157,120,255,.35), inset 0 1px rgba(255,255,255,.35); }
.main-nav { position: fixed; top: 30px; left: 50%; transform: translateX(-50%); z-index: 30; display: flex; align-items: center; gap: 4px; }
.nav-link { border: 0; color: #7f879a; background: transparent; padding: 11px 15px; border-radius: 12px; font-size: .88rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; }
.nav-link:hover { color: #dfe3ed; background: rgba(255,255,255,.045); }
.nav-link.active { color: white; background: rgba(157,120,255,.12); box-shadow: inset 0 0 0 1px rgba(157,120,255,.13); }
.nav-icon { font-size: .95rem; color: #a98dff; }
.wallet { justify-self: end; display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 8px 9px 8px 14px; }
.wallet div { display: grid; gap: 1px; }
.wallet-label { color: var(--muted); font-size: .67rem; font-weight: 600; }
.wallet strong { font-size: .9rem; }
.topup-button { border: 0; background: linear-gradient(145deg, #a383ff,#7651e7); color: #fff; width: 32px; height: 32px; border-radius: 10px; font-size: 1.2rem; cursor: pointer; box-shadow: 0 6px 20px rgba(126,82,235,.3); }

.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 88px 0 70px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 32px; margin-bottom: 42px; }
.section-heading h1, .case-summary h1 { font-size: clamp(2.15rem, 5vw, 4.25rem); letter-spacing: -.06em; line-height: .98; margin: 8px 0 0; }
.section-heading p { max-width: 440px; margin: 0 0 4px; color: var(--muted); line-height: 1.7; font-size: .95rem; }
.eyebrow { display: block; color: #a98dff; font-size: .72rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 800; }

.case-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, .72fr); gap: 18px; }
.case-card { border-radius: 28px; min-height: 430px; position: relative; overflow: hidden; }
.featured-case { display: grid; grid-template-columns: minmax(280px, 1.1fr) minmax(280px, .9fr); isolation: isolate; }
.featured-case::after { content: ""; position: absolute; inset: auto 0 0; height: 1px; background: linear-gradient(90deg, transparent,var(--case-accent),transparent); opacity: .7; }
.case-kicker { position: absolute; left: 24px; top: 22px; color: var(--muted); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; z-index: 2; }
.case-visual { position: relative; display: grid; place-items: center; min-height: 420px; }
.case-visual img { width: min(102%, 540px); max-height: 410px; object-fit: contain; position: relative; z-index: 1; filter: drop-shadow(0 36px 35px rgba(0,0,0,.55)); transition: transform .5s ease; }
.featured-case:hover .case-visual img { transform: translateY(-8px) scale(1.025); }
.case-halo { position: absolute; width: 64%; aspect-ratio: 1; border-radius: 50%; background: var(--case-accent); filter: blur(80px); opacity: .2; }
.case-info { padding: 76px 40px 38px 10px; display: flex; flex-direction: column; justify-content: space-between; z-index: 2; }
.case-info h2 { margin: 0 0 12px; font-size: clamp(2rem,3vw,3rem); letter-spacing: -.055em; }
.case-info p { color: var(--muted); max-width: 360px; line-height: 1.65; font-size: .9rem; }
.case-buy-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 24px; border-top: 1px solid rgba(255,255,255,.08); }
.price { font-size: 2rem; font-weight: 800; letter-spacing: -.05em; }
.price small { color: #a28bbd; font-size: 1rem; }
.button { min-height: 48px; border-radius: 14px; padding: 0 22px; border: 1px solid transparent; color: white; font-weight: 700; font-size: .85rem; cursor: pointer; transition: transform .2s ease, filter .2s ease, background .2s ease; }
.button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.button:disabled { cursor: wait; opacity: .6; transform: none; }
.button-primary { background: linear-gradient(135deg,#9d78ff,#7049dc); box-shadow: 0 12px 30px rgba(118,76,230,.25), inset 0 1px rgba(255,255,255,.28); }
.button-secondary { background: rgba(255,255,255,.055); border-color: rgba(255,255,255,.1); }
.button span { margin-left: 9px; }
.upcoming-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); border-style: dashed; }
.upcoming-glyph { width: 58px; height: 58px; border-radius: 19px; display: grid; place-items: center; margin-bottom: 12px; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); font-size: 1.65rem; color: #777f91; }
.upcoming-card h2 { color: #c3c8d3; margin: 4px 0; font-size: 1.05rem; }
.upcoming-card p { margin: 3px 0; font-size: .82rem; }
.trust-row { margin-top: 20px; padding: 0 8px; display: flex; gap: 34px; color: #6f7688; font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.trust-row i { color: #9d78ff; font-style: normal; margin-right: 8px; }

.opening-page { padding-top: 50px; }
.back-link { color: var(--muted); font-size: .82rem; display: inline-flex; gap: 10px; align-items: center; margin-bottom: 34px; }
.back-link:hover { color: white; }
.case-summary { display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 22px; margin-bottom: 30px; }
.case-summary h1 { font-size: clamp(2rem,4vw,3.3rem); }
.case-thumb { width: 112px; height: 82px; border-radius: 20px; display: grid; place-items: center; background: radial-gradient(circle, rgba(157,120,255,.22), transparent 70%); }
.case-thumb img { width: 118px; height: 100px; object-fit: contain; }
.summary-price { padding: 12px 17px; border-radius: 13px; background: rgba(157,120,255,.11); border: 1px solid rgba(157,120,255,.2); font-weight: 800; color: #c6b3ff; }
.roulette-panel { border-radius: 28px; padding: 20px; overflow: hidden; }
.reel-viewport { height: 236px; overflow: hidden; position: relative; border-radius: 19px; background: rgba(5,6,10,.66); border: 1px solid rgba(255,255,255,.065); box-shadow: inset 0 24px 70px rgba(0,0,0,.5); }
.reel-viewport::before, .reel-viewport::after { content: ""; position: absolute; inset-block: 0; width: 18%; z-index: 3; pointer-events: none; }
.reel-viewport::before { left: 0; background: linear-gradient(90deg,#090a10,transparent); }
.reel-viewport::after { right: 0; background: linear-gradient(-90deg,#090a10,transparent); }
.center-line { position: absolute; z-index: 5; left: 50%; top: 17px; bottom: 17px; width: 1px; background: linear-gradient(transparent,#b89cff 20%,#b89cff 80%,transparent); box-shadow: 0 0 12px #936bff; pointer-events: none; }
.pointer { position: absolute; left: 50%; transform: translateX(-50%); z-index: 6; width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; filter: drop-shadow(0 0 8px #9e79ff); }
.pointer-top { top: 8px; border-top: 13px solid #b89cff; }
.pointer-bottom { bottom: 8px; border-bottom: 13px solid #b89cff; }
.reel { display: flex; gap: 12px; padding: 21px 0; width: max-content; will-change: transform; }
.reel-card { flex: 0 0 168px; height: 192px; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: end; padding: 14px 10px; overflow: hidden; border-radius: 16px; background: linear-gradient(170deg, color-mix(in srgb,var(--rarity) 12%,#12151e), rgba(12,14,21,.86)); border: 1px solid color-mix(in srgb,var(--rarity) 32%,transparent); box-shadow: inset 0 -50px 60px color-mix(in srgb,var(--rarity) 7%,transparent); }
.reel-card::before { content: ""; position: absolute; inset: auto 14% 0; height: 2px; background: var(--rarity); box-shadow: 0 0 18px var(--rarity); }
.reel-card .item-art { height: 104px; }
.reel-card > span { font-size: .75rem; font-weight: 700; margin-top: 9px; text-align: center; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.reel-card > i { color: var(--rarity); font-size: .62rem; font-style: normal; text-transform: uppercase; margin-top: 4px; letter-spacing: .08em; }
.roulette-controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 22px 4px 3px; }
.open-button { justify-self: end; min-width: 220px; position: relative; overflow: hidden; }
.open-button.is-loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid rgba(255,255,255,.35); border-top-color: white; border-radius: 50%; left: 18px; top: 13px; animation: spin .7s linear infinite; }
.speed-toggle { display: flex; align-items: center; gap: 11px; cursor: pointer; min-width: 200px; }
.speed-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.speed-toggle > span:last-child { display: grid; gap: 2px; }
.speed-toggle b { font-size: .75rem; }
.speed-toggle small { color: var(--muted); font-size: .64rem; }
.switch { width: 42px; height: 24px; border-radius: 20px; background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.1); position: relative; transition: .2s; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; top: 3px; left: 4px; background: #7d8496; transition: .2s; }
.speed-toggle input:checked + .switch { background: rgba(157,120,255,.3); border-color: rgba(157,120,255,.55); }
.speed-toggle input:checked + .switch::after { left: 21px; background: #b89cff; box-shadow: 0 0 10px #9d78ff; }
.roulette-controls .button-secondary { justify-self: start; }
.roulette-controls .button-secondary span { color: #8fe7b2; font-size: .65rem; }

.contents-section { margin-top: 62px; }
.contents-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 20px; }
.contents-heading h2 { margin: 6px 0 0; font-size: clamp(1.5rem,3vw,2.15rem); letter-spacing: -.04em; }
.contents-heading > span { color: var(--muted); font-size: .75rem; }
.items-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.item-card { --rarity: white; min-height: 230px; border-radius: 20px; padding: 16px; position: relative; overflow: hidden; transition: transform .25s ease, border-color .25s; }
.item-card:hover { transform: translateY(-4px); border-color: color-mix(in srgb,var(--rarity) 45%,transparent); }
.item-card::after { content: ""; position: absolute; width: 130px; height: 90px; border-radius: 50%; background: var(--rarity); filter: blur(60px); opacity: .13; left: 50%; top: 42px; transform: translateX(-50%); }
.chance-dot { width: 6px; height: 6px; display: block; border-radius: 50%; background: var(--rarity); box-shadow: 0 0 9px var(--rarity); }
.item-art { height: 130px; display: grid; place-items: center; position: relative; z-index: 1; }
.item-art img { grid-area: 1/1; max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 15px 18px rgba(0,0,0,.35)); }
.fallback-art { grid-area: 1/1; min-width: 68px; height: 68px; border-radius: 21px; display: grid; place-items: center; color: var(--rarity); font-size: 1.55rem; font-weight: 800; letter-spacing: -.08em; background: linear-gradient(145deg,color-mix(in srgb,var(--rarity) 16%,#161923),rgba(255,255,255,.02)); border: 1px solid color-mix(in srgb,var(--rarity) 26%,transparent); box-shadow: 0 16px 38px color-mix(in srgb,var(--rarity) 12%,transparent); }
.item-meta { position: relative; z-index: 2; }
.item-meta span { color: var(--rarity); font-size: .62rem; text-transform: uppercase; letter-spacing: .11em; }
.item-meta h3 { font-size: .83rem; margin: 5px 0 0; }

.win-dialog { width: min(480px,calc(100% - 28px)); padding: 0; border: 0; background: transparent; color: var(--text); overflow: visible; }
.win-dialog::backdrop { background: rgba(2,3,7,.76); backdrop-filter: blur(10px); }
.win-card { --rarity: #9d78ff; border-radius: 30px; padding: 34px; text-align: center; position: relative; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,.6), 0 0 70px color-mix(in srgb,var(--rarity) 16%,transparent); animation: modal-in .35s cubic-bezier(.2,.8,.2,1); }
.win-card::before { content: ""; position: absolute; width: 220px; height: 220px; top: 55px; left: 50%; transform: translateX(-50%); border-radius: 50%; background: var(--rarity); filter: blur(100px); opacity: .18; }
.modal-close { position: absolute; right: 16px; top: 16px; z-index: 3; width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; background: rgba(255,255,255,.05); color: #a3a9b7; font-size: 1.2rem; cursor: pointer; }
.win-item-art { height: 180px; display: grid; place-items: center; position: relative; }
.win-item-art .item-art { height: 150px; width: 180px; }
.win-item-art .fallback-art { width: 104px; height: 104px; font-size: 2.15rem; border-radius: 30px; }
.rarity-chip { display: inline-block; color: var(--rarity); border: 1px solid color-mix(in srgb,var(--rarity) 28%,transparent); background: color-mix(in srgb,var(--rarity) 9%,transparent); padding: 6px 10px; border-radius: 20px; font-size: .65rem; letter-spacing: .12em; text-transform: uppercase; }
.win-card h2 { margin: 12px 0 8px; font-size: 2rem; letter-spacing: -.05em; }
.win-card p { color: var(--muted); font-size: .85rem; line-height: 1.6; margin: 0 auto 24px; max-width: 340px; }
.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: relative; z-index: 2; }
.modal-actions .button[hidden] + .button { grid-column: 1 / -1; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translate(-50%,24px); padding: 12px 18px; border: 1px solid rgba(255,255,255,.12); border-radius: 13px; background: rgba(25,29,41,.92); box-shadow: 0 15px 40px rgba(0,0,0,.35); color: #e8ebf2; font-size: .8rem; opacity: 0; pointer-events: none; transition: .25s; backdrop-filter: blur(16px); }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }

@media (max-width: 900px) {
  .site-header { margin-inline: 14px; }
  .main-nav { top: auto; bottom: 14px; border-radius: 18px; padding: 6px; background: rgba(17,20,29,.92); border: 1px solid rgba(255,255,255,.11); box-shadow: 0 16px 40px rgba(0,0,0,.45); backdrop-filter: blur(20px); }
  .nav-link { flex-direction: column; gap: 2px; padding: 8px 13px; font-size: .62rem; }
  .nav-icon { font-size: 1rem; }
  .case-grid { grid-template-columns: 1fr; }
  .upcoming-card { min-height: 180px; }
  .items-grid { grid-template-columns: repeat(3,1fr); }
}

@media (max-width: 680px) {
  .site-header { top: 8px; height: 62px; margin-top: 8px; padding-left: 14px; border-radius: 17px; }
  .brand { font-size: .92rem; }
  .brand-mark { width: 31px; height: 31px; }
  .wallet { padding-left: 10px; gap: 8px; }
  .wallet-label { display: none; }
  .topup-button { width: 30px; height: 30px; }
  .page { width: min(100% - 24px,1180px); padding-top: 58px; padding-bottom: 100px; }
  .section-heading { display: block; margin-bottom: 26px; }
  .section-heading h1 { font-size: 2.55rem; }
  .section-heading p { margin-top: 17px; font-size: .85rem; }
  .featured-case { display: flex; flex-direction: column; }
  .case-visual { min-height: 310px; }
  .case-visual img { width: 105%; max-height: 310px; margin-top: 20px; }
  .case-info { padding: 10px 22px 24px; gap: 28px; }
  .case-info h2 { font-size: 2.1rem; }
  .case-info p { font-size: .83rem; }
  .case-buy-row { padding-top: 18px; }
  .button { padding-inline: 16px; }
  .trust-row { gap: 14px; overflow-x: auto; white-space: nowrap; padding-bottom: 5px; }
  .case-summary { grid-template-columns: 74px 1fr auto; gap: 12px; }
  .case-thumb { width: 74px; height: 65px; }
  .case-thumb img { width: 86px; height: 76px; }
  .case-summary h1 { font-size: 1.75rem; }
  .case-summary .eyebrow { font-size: .58rem; }
  .summary-price { font-size: .8rem; padding: 9px 10px; }
  .roulette-panel { padding: 10px; border-radius: 22px; }
  .reel-viewport { height: 194px; }
  .reel { padding-block: 15px; gap: 9px; }
  .reel-card { flex-basis: 132px; height: 164px; }
  .reel-card .item-art { height: 87px; }
  .roulette-controls { display: flex; flex-direction: column; padding: 16px 4px 5px; }
  .roulette-controls .button, .open-button { width: 100%; justify-self: auto; }
  .speed-toggle { order: 3; width: 100%; min-width: 0; justify-content: center; padding: 6px 0; }
  .contents-section { margin-top: 46px; }
  .items-grid { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .item-card { min-height: 200px; padding: 13px; }
  .item-art { height: 112px; }
  .modal-actions { grid-template-columns: 1fr; }
  .modal-actions .button[hidden] + .button { grid-column: auto; }
}

@media (max-width: 460px) {
  .case-summary { grid-template-columns: 74px minmax(0,1fr); align-items: center; }
  .case-summary > div:nth-child(2) { min-width: 0; }
  .case-summary h1 { overflow-wrap: anywhere; }
  .summary-price { grid-column: 2; justify-self: start; margin-top: -4px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
