:root {
  --pink: #ff8cb9;
  --purple: #be78ff;
  --text: #faf0f7;
  --muted: #c4a8bd;
  --bg: #08040b;
  --rim: rgba(255, 255, 255, 0.16);
  --ease: cubic-bezier(0.22, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font-family: Inter, "Segoe UI", system-ui, sans-serif; animation: pageIn 0.7s var(--ease) both; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- moving background: soft silk ribbons ---------- */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: var(--bg); }
.bg i { position: absolute; width: 130vmax; height: 26vmax; left: 50%; top: 50%; margin: -13vmax 0 0 -65vmax; border-radius: 50%; filter: blur(70px); opacity: 0.4; will-change: transform; }
.bg i:nth-child(1) { background: linear-gradient(90deg, transparent, #6c2fb8 45%, #4a22a0 60%, transparent); animation: sway1 28s ease-in-out infinite alternate; }
.bg i:nth-child(2) { background: linear-gradient(90deg, transparent, #a03a78 40%, #b8508f 65%, transparent); animation: sway2 34s ease-in-out infinite alternate; }
.bg i:nth-child(3) { background: linear-gradient(90deg, transparent, #3a1f86 50%, transparent); animation: sway3 40s ease-in-out infinite alternate; }
.bg i:nth-child(4) { background: linear-gradient(90deg, transparent, #c57aa8 50%, transparent); opacity: 0.2; animation: sway4 31s ease-in-out infinite alternate; }
.bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 20%, rgba(8, 4, 11, 0.92) 100%); }

@keyframes sway1 { from { transform: translate(-8%, -30%) rotate(-28deg) scaleY(1); } to { transform: translate(8%, 10%) rotate(-8deg) scaleY(1.25); } }
@keyframes sway2 { from { transform: translate(6%, 25%) rotate(24deg) scaleY(0.9); } to { transform: translate(-10%, -15%) rotate(42deg) scaleY(1.3); } }
@keyframes sway3 { from { transform: translate(-12%, 30%) rotate(-52deg) scaleY(1); } to { transform: translate(10%, -25%) rotate(-30deg) scaleY(1.2); } }
@keyframes sway4 { from { transform: translate(10%, -20%) rotate(12deg) scaleY(1); } to { transform: translate(-6%, 18%) rotate(-6deg) scaleY(1.4); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes pageIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { to { background-position: 200% center; } }

/* ---------- glass (shared) ---------- */
.glass, .side, .tile, .list, .detail, .bar, .search, .btn, .pill, .chip {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--rim);
  backdrop-filter: blur(20px) saturate(120%);
  -webkit-backdrop-filter: blur(20px) saturate(120%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 -1px 0 rgba(255, 255, 255, 0.04), 0 12px 40px rgba(0, 0, 0, 0.35);
}

/* ---------- app frame: sidebar + content ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 26px; padding: 24px; max-width: 1440px; margin: 0 auto; }

.side {
  position: sticky; top: 24px; height: calc(100vh - 48px);
  display: flex; flex-direction: column; padding: 20px 14px; border-radius: 28px;
  animation: slideIn 0.7s var(--ease) both;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 10px 22px; }
.brand img { width: 46px; height: 46px; transition: transform 0.6s var(--ease); filter: drop-shadow(0 4px 16px rgba(190, 90, 170, 0.4)); }
.brand:hover img { transform: rotate(12deg) scale(1.08); }
.brand b { font-size: 20px; letter-spacing: -0.03em; line-height: 1; display: block; }
.brand small { font-size: 12px; color: var(--muted); letter-spacing: 0.25em; text-transform: uppercase; }

.side nav { display: flex; flex-direction: column; gap: 4px; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 16px; font-weight: 600; font-size: 14.5px; color: var(--muted); transition: color 0.25s, background 0.25s, transform 0.3s var(--ease); position: relative; }
.nav-i svg { width: 19px; height: 19px; flex-shrink: 0; }
.nav-i:hover { color: var(--text); transform: translateX(3px); }
.nav-i.active { color: var(--text); background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2); }
.nav-i.active::before { content: ""; position: absolute; left: -14px; top: 22%; bottom: 22%; width: 4px; border-radius: 4px; background: linear-gradient(var(--pink), var(--purple)); box-shadow: 0 0 14px var(--pink); }
.side-foot { margin-top: auto; padding: 0 4px; display: grid; gap: 10px; }
.side-foot .btn { width: 100%; }

.main { min-width: 0; animation: fadeUp 0.8s var(--ease) both; }

/* ---------- buttons, pills, bar ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 700; font-size: 14.5px; cursor: pointer; color: var(--text); transition: transform 0.3s var(--ease), box-shadow 0.3s, filter 0.3s; }
.btn:hover { transform: translateY(-3px); filter: brightness(1.15); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: linear-gradient(135deg, rgba(214, 120, 170, 0.92), rgba(150, 100, 220, 0.92)); color: #1a0a17; border-color: rgba(255, 255, 255, 0.3); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 10px 30px rgba(190, 90, 150, 0.28); }
.btn.primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 14px 40px rgba(190, 90, 150, 0.4); }
.btns { display: flex; gap: 12px; flex-wrap: wrap; }
.pill { display: inline-block; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; letter-spacing: 0.02em; }

/* ---------- home ---------- */
.intro { padding: 34px 6px 30px; }
.intro > * { animation: fadeUp 0.9s var(--ease) both; }
.intro > *:nth-child(2) { animation-delay: 0.08s; }
.intro > *:nth-child(3) { animation-delay: 0.16s; }
.intro > *:nth-child(4) { animation-delay: 0.24s; }
.intro > *:nth-child(5) { animation-delay: 0.32s; }
.intro > *:nth-child(6) { animation-delay: 0.4s; }
.wordmark { width: min(520px, 100%); display: block; margin: 0 0 26px -8px; animation: floaty 7s ease-in-out infinite; filter: drop-shadow(0 10px 34px rgba(120, 50, 150, 0.4)); }
.tag { color: var(--muted); font-size: 17px; margin-bottom: 26px; }
.bar { display: flex; align-items: center; gap: 12px; width: min(660px, 100%); padding: 9px 9px 9px 18px; border-radius: 999px; margin-bottom: 18px; background: linear-gradient(100deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.03) 60%, rgba(190, 90, 170, 0.16) 100%); }
.bar img { width: 26px; height: 26px; flex-shrink: 0; object-fit: contain; }
.bar code { flex: 1; min-width: 0; text-align: left; font-family: Consolas, monospace; font-size: 13.5px; color: #f3e3fb; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar code b { color: var(--pink); }
.bar .btn { padding: 10px 20px; flex-shrink: 0; }

.bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.tile { padding: 24px; border-radius: 26px; animation: fadeUp 0.9s var(--ease) both; transition: transform 0.4s var(--ease), border-color 0.3s; }
.tile:nth-child(1) { grid-column: span 4; animation-delay: 0.35s; }
.tile:nth-child(2) { grid-column: span 2; animation-delay: 0.45s; }
.tile:nth-child(3) { grid-column: span 3; animation-delay: 0.55s; }
.tile:nth-child(4) { grid-column: span 3; animation-delay: 0.65s; }
.tile:hover { transform: translateY(-5px); border-color: rgba(255, 140, 185, 0.45); }
.tile h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--pink); margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: 13.5px; box-shadow: none; }
.chip svg { width: 14px; height: 14px; color: var(--pink); flex-shrink: 0; }
.big { font-size: 64px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; background: linear-gradient(90deg, var(--pink), var(--purple), #6ea8ff, var(--pink)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s linear infinite; margin-bottom: 12px; }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 14px; }
.steps li { counter-increment: s; padding-left: 40px; position: relative; color: var(--muted); font-size: 14px; line-height: 1.45; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #1a0a17; background: linear-gradient(135deg, var(--pink), var(--purple)); }
.steps b { color: var(--text); display: block; }
.t-games { display: flex; align-items: center; gap: 18px; }
.gthumb { width: 130px; aspect-ratio: 4 / 3; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #3a1a45, #1c0d26); display: grid; place-items: center; font-size: 34px; flex-shrink: 0; }
.gthumb img, .gimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.t-games h3 { margin-bottom: 6px; }
.t-games .name { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 4px; }

/* ---------- ratings ---------- */
.rate { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vote { display: inline-flex; align-items: center; gap: 6px; }
.vote svg { width: 15px; height: 15px; }
.pct { color: var(--text); font-weight: 700; }

/* ---------- games: list + detail ---------- */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 30px 6px 22px; animation: fadeUp 0.8s var(--ease) both; }
.head h1 { font-size: clamp(34px, 5vw, 54px); letter-spacing: -0.04em; line-height: 1; }
.head p { margin-top: 8px; font-size: 14px; }
.search { width: min(380px, 100%); padding: 14px 18px 14px 48px; border-radius: 16px; color: var(--text); font-size: 14.5px; outline: none; transition: border-color 0.25s, box-shadow 0.25s; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%23c4a8bd' stroke-width='2'><circle cx='8' cy='8' r='6'/><path d='M13 13l4 4'/></svg>"); background-repeat: no-repeat; background-position: 17px center; }
.search:focus { border-color: var(--pink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 4px rgba(255, 140, 185, 0.16), 0 12px 40px rgba(0, 0, 0, 0.35); }

.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.list { border-radius: 26px; padding: 10px; display: grid; gap: 6px; animation: fadeUp 0.8s var(--ease) 0.1s both; max-height: calc(100vh - 220px); overflow-y: auto; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 18px; cursor: pointer; border: 1px solid transparent; transition: background 0.25s, transform 0.3s var(--ease), border-color 0.25s; animation: fadeUp 0.6s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.row:hover { background: rgba(255, 255, 255, 0.06); transform: translateX(4px); }
.row.on { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 140, 185, 0.4); }
.row .gimg { width: 72px; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #3a1a45, #1c0d26); display: grid; place-items: center; font-size: 22px; flex-shrink: 0; }
.row b { display: block; font-size: 14.5px; margin-bottom: 5px; }
.row .rate { font-size: 12px; gap: 10px; }
.empty { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }

.detail { border-radius: 28px; overflow: hidden; animation: fadeUp 0.8s var(--ease) 0.2s both; }
.detail.swap > * { animation: fadeUp 0.5s var(--ease) both; }
.banner { aspect-ratio: 16 / 7; background: linear-gradient(135deg, rgba(190, 120, 255, 0.35), rgba(255, 140, 185, 0.25)); display: grid; place-items: center; font-size: 60px; position: relative; overflow: hidden; }
.banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(10, 5, 14, 0.75)); }
.d-body { padding: 24px 28px 28px; }
.d-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.d-top h2 { font-size: 26px; letter-spacing: -0.03em; margin-bottom: 14px; }
.d-rate { text-align: right; }
.d-rate small { display: block; text-transform: uppercase; letter-spacing: 0.14em; font-size: 11px; color: var(--pink); margin-bottom: 6px; }
.d-rate .rate { justify-content: flex-end; font-size: 14px; }
.d-note { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.d-body h4 { margin: 24px 0 12px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--pink); }
.feat { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.feat div { display: flex; align-items: center; gap: 10px; padding: 8px 0; font-size: 14.5px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); opacity: 0; animation: slideIn 0.5s var(--ease) both; animation-delay: calc(var(--k, 0) * 30ms + 150ms); }
.feat svg { width: 15px; height: 15px; color: var(--pink); flex-shrink: 0; }

/* ---------- donate ---------- */
.center-tile { max-width: 560px; margin: 8vh auto 0; text-align: center; padding: 40px 30px; }
.center-tile:hover { transform: none; }
.center-tile h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.04em; margin-bottom: 14px; }
.center-tile p { color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.grad { background: linear-gradient(90deg, var(--pink), var(--purple), #6ea8ff, var(--pink)); background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 7s linear infinite; }

footer { text-align: center; color: var(--muted); font-size: 13px; padding: 34px 0 20px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 10px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .tile:nth-child(n) { grid-column: span 6; }
  .split { grid-template-columns: 1fr; }
  .list { max-height: none; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; padding: 14px 14px 100px; gap: 0; }
  .side { position: fixed; z-index: 30; left: 12px; right: 12px; bottom: 12px; top: auto; height: auto; flex-direction: row; padding: 8px; border-radius: 24px; animation: none; }
  .brand, .side-foot { display: none; }
  .side nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav-i { flex-direction: column; gap: 4px; font-size: 11.5px; padding: 8px 14px; }
  .nav-i.active::before { display: none; }
  .nav-i:hover { transform: none; }
  .big { font-size: 52px; }
  .t-games { flex-direction: column; align-items: flex-start; }
  .bg i { filter: blur(60px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
}

/* ---------- vote box ---------- */
.rate-box { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 14px 16px; border-radius: 18px; background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(255, 255, 255, 0.1); margin-bottom: 4px; }
.rate-box > b { font-size: 13px; margin-right: 4px; }
.key-in { flex: 1; min-width: 210px; padding: 11px 16px; border-radius: 999px; border: 1px solid var(--rim); background: rgba(8, 4, 11, 0.45); color: var(--text); font-family: Consolas, monospace; font-size: 13px; outline: none; transition: border-color 0.25s, box-shadow 0.25s; }
.key-in:focus { border-color: var(--pink); box-shadow: 0 0 0 4px rgba(255, 140, 185, 0.16); }
.vbtn { padding: 10px 18px; font-size: 13.5px; }
.vbtn svg { width: 15px; height: 15px; }
.vmsg { flex-basis: 100%; font-size: 12.5px; color: var(--muted); min-height: 1em; }

.vbtn.mine { border-color: var(--pink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 0 0 3px rgba(255, 140, 185, 0.18); }

/* ---------- admin key manager ---------- */
.ktable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ktable th { text-align: left; padding: 12px 14px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--pink); }
.ktable td { padding: 11px 14px; border-top: 1px solid rgba(255, 255, 255, 0.07); vertical-align: middle; }
.ktable .mono { font-family: Consolas, monospace; font-size: 13.5px; white-space: nowrap; }
.ktable .acts { white-space: nowrap; display: flex; gap: 8px; }
.ktable .empty { text-align: center; color: var(--muted); padding: 26px; }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; background: rgba(255, 255, 255, 0.08); margin-right: 6px; }
.badge.ok { color: #9be8b4; background: rgba(120, 220, 160, 0.14); }
.badge.old { color: #ff9aa5; background: rgba(255, 110, 120, 0.14); }
.btn.danger { color: #ff9aa5; }
.key-big { font-family: Consolas, monospace; font-size: 22px; letter-spacing: 0.04em; padding: 14px 16px; margin: 6px 0 14px; border-radius: 14px; background: rgba(10, 5, 12, 0.5); border: 1px solid var(--rim); word-break: break-all; }
#notice .btn { margin-right: 12px; }
