/* ILL Gacha - base: colours, layout, header/nav, buttons, forms, modal, toast */
:root {
  --bg: #07050f; --bg2: #0e0b1d; --panel: #120f24; --panel2: #191433; --line: #2c2554;
  --text: #f3f0ff; --muted: #a49fc6; --cyan: #2ef2ff; --pink: #ff2fb3; --red: #ff2f6d; --gold: #ffb52e; --green: #33e08a;
  --display: 'Chakra Petch', 'Segoe UI', system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.5 var(--body); overflow-x: hidden;
  background-color: var(--bg);
  background-image:
    radial-gradient(900px 500px at 85% -10%, rgba(255, 47, 179, .16), transparent 70%),
    radial-gradient(800px 500px at -10% 20%, rgba(46, 242, 255, .10), transparent 70%),
    linear-gradient(rgba(46, 242, 255, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(46, 242, 255, .035) 1px, transparent 1px);
  background-size: auto, auto, 44px 44px, 44px 44px;
  background-attachment: fixed;
}
body.no-scroll { overflow: hidden; }
a { color: var(--cyan); }
a:hover { color: #9ff9ff; }
h1, h2, h3 { font-family: var(--display); letter-spacing: .02em; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 4vw, 44px); }
h2 { font-size: 20px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.muted { color: var(--muted); }
.boot { display: grid; place-items: center; min-height: 80vh; font: 700 20px var(--display); color: var(--muted); letter-spacing: .1em; }

.demo-banner { background: repeating-linear-gradient(135deg, #2a1240 0 14px, #1d0d2e 14px 28px); color: #ffd6f3; text-align: center; font-size: 13px; padding: 6px 12px; border-bottom: 1px solid #4b1f6b; }
.demo-banner b { color: var(--pink); letter-spacing: .08em; }

/* header */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px clamp(14px, 3vw, 32px);
  background: rgba(7, 5, 15, .82); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; flex: none; }
.brand .logo { height: 40px; width: auto; }
.logo-ill { font: 700 44px var(--display); letter-spacing: -.02em; }
.logo-gacha { font: 700 25px var(--display); letter-spacing: .12em; }
.main-nav { display: flex; gap: 4px; flex: 1; justify-content: center; }
.main-nav a, .tabs a { display: flex; align-items: center; gap: 7px; color: var(--muted); text-decoration: none; font: 700 15px var(--display);
  padding: 8px 12px; border-radius: 10px; letter-spacing: .03em; }
.main-nav a:hover { color: var(--text); background: var(--panel2); }
.main-nav a.on { color: var(--text); background: linear-gradient(135deg, rgba(255, 47, 179, .25), rgba(46, 242, 255, .18)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.nav-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.top-right { display: flex; align-items: center; gap: 10px; flex: none; }
.pack-pill { font: 700 13px var(--display); padding: 5px 10px; border-radius: 99px; background: rgba(46, 242, 255, .12); color: var(--cyan); border: 1px solid rgba(46, 242, 255, .35); white-space: nowrap; }
.icon-btn { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-size: 17px; cursor: pointer; }
.icon-btn:hover { background: var(--panel2); }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font: 700 14px var(--display);
  padding: 4px 12px 4px 4px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); max-width: 190px; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .cube { flex: none; border-radius: 6px; }
.tabs { display: none; }

main { display: block; max-width: 1280px; margin: 0 auto; padding: clamp(16px, 3vw, 34px) clamp(14px, 3vw, 32px) 40px; outline: none; }
.foot { max-width: 1280px; margin: 0 auto; padding: 24px clamp(14px, 3vw, 32px) 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }
.foot p { margin: 4px 0; }

/* buttons + forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 15px var(--display); letter-spacing: .04em;
  color: var(--text); background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 18px; cursor: pointer;
  text-decoration: none; transition: transform .12s, background .2s, box-shadow .2s; min-height: 44px; }
.btn:hover:not(:disabled) { background: #241d47; color: var(--text); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--pink), #8a3dff 55%, #2bb8ff); border-color: transparent; box-shadow: 0 6px 24px rgba(255, 47, 179, .35); }
.btn.primary:hover:not(:disabled) { background: linear-gradient(135deg, #ff5cc4, #9b55ff 55%, #4cc6ff); box-shadow: 0 8px 30px rgba(255, 47, 179, .5); }
.btn.big { font-size: 20px; padding: 14px 30px; min-height: 56px; border-radius: 14px; }
.btn.small { font-size: 13px; padding: 6px 12px; min-height: 36px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: #6b1d35; color: #ffb3c6; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
input[type=text], input[type=search], select {
  font: 15px var(--body); color: var(--text); background: #0b0918; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; min-width: 0; }
input:focus, select:focus { border-color: var(--cyan); outline: none; box-shadow: 0 0 0 3px rgba(46, 242, 255, .2); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.field.wide input { width: 100%; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.check { display: flex; gap: 8px; align-items: center; margin: 8px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--pink); }
.panel { background: linear-gradient(180deg, rgba(25, 20, 51, .9), rgba(14, 11, 29, .92)); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; min-width: 0; }
.bar { height: 8px; background: #0b0918; border-radius: 99px; overflow: hidden; border: 1px solid var(--line); }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--pink)); }

/* modal + toast */
.modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(4, 2, 10, .78); backdrop-filter: blur(4px); animation: fade .2s; }
.modal-box { position: relative; width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--bg2); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6); }
.modal-x { position: absolute; top: 8px; right: 10px; width: 40px; height: 40px; border: 0; background: none; color: var(--muted); font-size: 28px; cursor: pointer; border-radius: 10px; }
.modal-x:hover { color: var(--text); background: var(--panel2); }
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 90; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .25s;
  background: #1c1638; border: 1px solid var(--line); color: var(--text); padding: 12px 18px; border-radius: 12px; font-weight: 600; max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.good { border-color: var(--green); }
#toast.bad { border-color: var(--red); }
@keyframes fade { from { opacity: 0; } }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .top { justify-content: space-between; gap: 10px; }
  .brand .logo { height: 34px; }
  .user-chip { max-width: 130px; }
  .tabs { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; justify-content: space-around; background: rgba(9, 7, 19, .96);
    border-top: 1px solid var(--line); padding: 4px 2px calc(4px + env(safe-area-inset-bottom)); backdrop-filter: blur(10px); }
  .demo-banner { font-size: 12px; padding: 5px 10px; }
  .tabs a { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 2px; flex: 1; min-width: 0; }
  .tabs a span { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .tabs a.on { color: var(--cyan); }
  .tabs .nav-ico { width: 22px; height: 22px; }
  body { padding-bottom: 66px; }
  #toast { bottom: 84px; }
}
@media (max-width: 420px) {
  .pack-pill { display: none; }
  .user-chip span { display: none; }
  .user-chip { padding: 4px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01s !important; animation-iteration-count: 1 !important; transition-duration: .01s !important; } }
