:root {
  --bg: #090a0e;
  --panel: rgba(20, 22, 30, .78);
  --panel-solid: #14161e;
  --text: #f7f7fb;
  --muted: #a9abb8;
  --line: rgba(255,255,255,.09);
  --radius: 22px;
  --shadow: 0 22px 70px rgba(0,0,0,.38);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(circle at 20% -10%, rgba(151, 69, 255, .16), transparent 30rem),
    radial-gradient(circle at 90% 10%, rgba(0, 210, 255, .11), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-width: 320px;
}
.noise { position: fixed; inset: 0; opacity: .032; pointer-events: none; z-index: 20; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E"); }
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero__content { width: min(1500px, calc(100% - 32px)); margin: 0 auto; padding: 86px 0 58px; position: relative; z-index: 2; }
.hero__glow { position: absolute; width: 34rem; height: 34rem; filter: blur(75px); opacity: .22; border-radius: 50%; }
.hero__glow--one { background: #ff3b6b; left: -15rem; top: -18rem; }
.hero__glow--two { background: #5c38ff; right: -12rem; top: -17rem; }
.eyebrow { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 8px 13px; color: #d7d8e2; background: rgba(255,255,255,.04); font: 700 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .07em; text-transform: uppercase; }
h1 { margin: 22px 0 12px; font-size: clamp(46px, 8vw, 104px); line-height: .93; letter-spacing: -.065em; max-width: 1100px; }
h1 span { background: linear-gradient(100deg, #ff516f, #ffb13b 43%, #ae67ff 88%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__subtitle { max-width: 860px; color: #d4d5de; font-size: clamp(17px, 2vw, 23px); line-height: 1.5; margin: 24px 0 8px; }
.hero__mystery { color: #777a89; font-size: 13px; margin-top: 12px; }
.hero__controls { display: flex; gap: 12px; align-items: end; margin-top: 34px; flex-wrap: wrap; }
.search { display: grid; gap: 8px; flex: 1 1 360px; color: #9699a8; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.search input { width: 100%; border: 1px solid var(--line); background: rgba(10,11,15,.72); color: white; border-radius: 15px; padding: 16px 18px; outline: none; font: inherit; box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.search input:focus { border-color: rgba(175,117,255,.7); box-shadow: 0 0 0 4px rgba(151,69,255,.12); }
.random-button { border: 0; border-radius: 15px; padding: 16px 21px; color: #0a0b0e; background: linear-gradient(120deg, #f3f3f5, #bdbdc6); font-weight: 900; font-size: 14px; cursor: pointer; min-height: 53px; transition: .2s ease; }
.random-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.stats { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.stat { padding: 8px 11px; border-radius: 10px; background: rgba(255,255,255,.045); border: 1px solid var(--line); color: #aeb0bb; font-size: 12px; }
.stat b { color: white; }
.tier-nav { position: sticky; top: 0; z-index: 15; background: rgba(9,10,14,.84); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); display: flex; gap: 8px; padding: 10px max(16px, calc((100vw - 1500px)/2)); overflow-x: auto; scrollbar-width: none; }
.tier-nav::-webkit-scrollbar { display:none; }
.tier-nav a { flex: 0 0 auto; text-decoration: none; color: #c5c7d1; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; font-weight: 900; }
.tiers { width: min(1500px, calc(100% - 32px)); margin: 30px auto 80px; display: grid; gap: 30px; }
.tier { --tier-color: #999; --tier-soft: rgba(153,153,153,.14); border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--tier-soft), rgba(16,18,25,.93) 26%); overflow: hidden; box-shadow: var(--shadow); scroll-margin-top: 74px; }
.tier-ass { --tier-color: #ff2d55; --tier-soft: rgba(255,45,85,.18); }
.tier-a { --tier-color: #ff9838; --tier-soft: rgba(255,152,56,.16); }
.tier-b { --tier-color: #f2cf36; --tier-soft: rgba(242,207,54,.13); }
.tier-c { --tier-color: #61d078; --tier-soft: rgba(97,208,120,.12); }
.tier-offtop { --tier-color: #58bfff; --tier-soft: rgba(88,191,255,.13); }
.tier-coop { --tier-color: #8270ff; --tier-soft: rgba(130,112,255,.14); }
.tier-old { --tier-color: #d56eff; --tier-soft: rgba(213,110,255,.14); }
.tier-f { --tier-color: #6d707a; --tier-soft: rgba(109,112,122,.16); }
.tier__header { display: grid; grid-template-columns: 145px 1fr; border-bottom: 1px solid var(--line); min-height: 145px; }
.tier__badge { display: grid; place-items: center; background: var(--tier-color); color: #08090c; font-size: clamp(42px, 6vw, 72px); line-height: 1; font-weight: 1000; letter-spacing: -.07em; text-shadow: 0 1px rgba(255,255,255,.2); padding: 8px; white-space: nowrap; }
.tier__badge--compact { font-size: clamp(30px, 4.2vw, 50px); letter-spacing: -.045em; }
.tier__intro { padding: 25px 28px; display: flex; flex-direction: column; justify-content: center; }
.tier__intro h2 { margin: 0 0 8px; font-size: clamp(25px, 3vw, 40px); line-height: 1.05; letter-spacing: -.035em; }
.tier__intro p { margin: 0; color: #b5b7c3; line-height: 1.5; max-width: 900px; }
.games { padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, minmax(245px, 1fr)); gap: 15px; }
.game { min-width: 0; border-radius: 16px; background: #151720; border: 1px solid rgba(255,255,255,.085); overflow: hidden; position: relative; transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease; }
.game:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--tier-color) 55%, white 10%); box-shadow: 0 18px 38px rgba(0,0,0,.32); }
.game__image { display: block; width: 100%; aspect-ratio: 460 / 215; object-fit: cover; background: #20232e; }
.game__fallback { width: 100%; aspect-ratio: 460 / 215; display: none; align-items: flex-end; padding: 16px; position: relative; overflow: hidden; background: linear-gradient(135deg, var(--fallback-a), var(--fallback-b)); }
.game__fallback::before { content: attr(data-initials); position: absolute; right: -3px; top: -19px; color: rgba(255,255,255,.14); font-size: 95px; font-weight: 1000; letter-spacing: -.08em; }
.game__fallback span { position: relative; z-index: 2; font-weight: 900; font-size: 17px; line-height: 1.05; text-shadow: 0 2px 14px rgba(0,0,0,.35); }
.game__body { padding: 14px 15px 16px; }
.game__title { margin: 0; font-size: 16px; line-height: 1.25; letter-spacing: -.015em; }
.game__note { color: #aeb0bc; font-size: 12.5px; line-height: 1.45; margin: 9px 0 0; }
.divider { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; color: #999ca9; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; padding: 12px 2px; }
.divider::before, .divider::after { content: ''; height: 1px; background: var(--line); flex: 1; }
.hidden { display: none !important; }
.empty-search { border: 1px dashed var(--line); border-radius: 18px; padding: 42px 20px; text-align: center; color: #9b9eaa; }
.random-dialog { width: min(620px, calc(100% - 24px)); color: white; border: 1px solid rgba(255,255,255,.16); border-radius: 23px; background: #11131a; padding: 0; box-shadow: 0 40px 130px rgba(0,0,0,.8); }
.random-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.random-dialog__close { position: absolute; right: 11px; top: 9px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: white; background: rgba(0,0,0,.35); cursor:pointer; font-size: 24px; z-index: 4; }
.random-dialog__label { padding: 20px 24px 0; color: #979aa8; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }
.random-result img, .random-result .game__fallback { display: flex; width: 100%; aspect-ratio: 460/215; object-fit: cover; margin-top: 15px; }
.random-result__body { padding: 23px 24px 27px; }
.random-result__tier { color: var(--random-color, #fff); font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.random-result h3 { margin: 7px 0 0; font-size: clamp(28px, 6vw, 52px); line-height: .98; letter-spacing: -.05em; }
.random-result p { color: #b8bac5; line-height: 1.5; }
footer { border-top: 1px solid var(--line); padding: 38px 16px 60px; text-align: center; color: #858895; }
.footer__tiny { font-size: 11px; color: #565966; }
@media (max-width: 680px) {
  .hero__content { padding-top: 55px; }
  .tier__header { grid-template-columns: 92px 1fr; min-height: 115px; }
  .tier__intro { padding: 20px 18px; }
  .tier__badge { font-size: 38px; }
  .tier__badge--compact { font-size: 27px; }
  .games { padding: 14px; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .game__body { padding: 11px 11px 13px; }
  .game__title { font-size: 13px; }
  .game__note { font-size: 11px; }
}
@media (max-width: 420px) {
  .games { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
