:root {
  --ink: #f7f6ff;
  --muted: #a8a6b8;
  --panel: #161827;
  --line: rgba(255, 255, 255, 0.1);
  --purple: #9d81ff;
  --background: #0a0b13;
}

* { box-sizing: border-box; }
html { background: var(--background); }
body { margin: 0; background: var(--background); color: var(--ink); font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button { color: inherit; font: inherit; }
img { display: block; max-width: 100%; }

.portal-home { position: relative; isolation: isolate; min-height: 100vh; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(circle at 18% 22%, rgba(65, 211, 255, 0.09), transparent 26rem), radial-gradient(circle at 78% 10%, rgba(148, 84, 255, 0.16), transparent 34rem), #090a12; }
.portal-home::before { content: ""; position: absolute; z-index: -2; inset: 74px 0 0; opacity: 0.22; background-image: linear-gradient(rgba(159, 137, 255, 0.18) 1px, transparent 1px), linear-gradient(90deg, rgba(159, 137, 255, 0.18) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(to bottom, black, transparent 78%); transform: perspective(700px) rotateX(58deg) scale(1.35) translateY(18%); transform-origin: top; }
.portal-home::after { content: "PLAY"; position: absolute; z-index: -1; top: 88px; right: -30px; color: rgba(255, 255, 255, 0.018); font-size: clamp(180px, 27vw, 430px); font-weight: 1000; line-height: 0.8; letter-spacing: -0.09em; pointer-events: none; }
.simple-header { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(20px, 5vw, 72px); border-bottom: 1px solid rgba(255, 255, 255, 0.08); background: rgba(9, 10, 18, 0.72); backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-mark { position: relative; width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 13px 6px 13px 6px; background: linear-gradient(145deg, #c4a8ff, #6841de 70%); color: white; font-weight: 950; box-shadow: 0 0 26px rgba(127, 85, 255, 0.42); transform: rotate(-3deg); }
.brand-mark::after { content: ""; position: absolute; inset: 4px; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 9px 4px 9px 4px; }
.brand > span:last-child { display: grid; line-height: 1.05; }
.brand strong { font-size: 14px; letter-spacing: 0.09em; }
.brand small { margin-top: 5px; color: var(--muted); font-size: 10px; letter-spacing: 0.12em; }
.header-meta { display: flex; align-items: center; gap: 24px; }
.header-meta > span { display: inline-flex; align-items: center; gap: 7px; color: #8f8da0; font-size: 11px; letter-spacing: 0.08em; }
.header-meta i { width: 7px; height: 7px; border-radius: 50%; background: #7fff8f; box-shadow: 0 0 12px #59ff71; }
.quiet-link { padding: 9px 0; color: #8d8b9d; font-size: 13px; }
.quiet-link:hover { color: white; }
.language-switcher { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 9px; background: rgba(255, 255, 255, 0.045); }
.language-switcher button { min-width: 38px; height: 28px; padding: 0 8px; border: 0; border-radius: 6px; background: transparent; color: #858394; font-size: 10px; font-weight: 850; letter-spacing: 0.04em; cursor: pointer; transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease; }
.language-switcher button:hover { color: white; }
.language-switcher button.active { background: linear-gradient(135deg, rgba(158, 128, 255, 0.95), rgba(102, 74, 214, 0.95)); color: white; box-shadow: 0 4px 15px rgba(104, 65, 222, 0.3); }

.game-library { position: relative; width: min(1240px, calc(100% - 40px)); flex: 1; margin: 0 auto; padding: clamp(60px, 8vw, 104px) 0 90px; }
.game-library::before { content: ""; position: absolute; top: 36px; left: -48px; width: 92px; height: 3px; background: linear-gradient(90deg, transparent, #9f7dff); box-shadow: 0 0 18px #8d68ff; }
.library-heading { margin-bottom: 34px; }
.heading-kicker { display: flex; align-items: center; gap: 12px; }
.heading-kicker > span:last-child { padding: 4px 7px; border: 1px solid rgba(98, 222, 255, 0.28); border-radius: 4px; background: rgba(61, 192, 232, 0.07); color: #73def8; font-size: 9px; font-weight: 900; letter-spacing: 0.16em; transform: skewX(-8deg); }
.eyebrow { color: #b49fff; font-size: 11px; font-weight: 850; letter-spacing: 0.16em; text-transform: uppercase; }
.library-heading h1 { width: auto; max-width: 760px; margin: 11px 0 10px; background: linear-gradient(98deg, #fff 22%, #d5c9ff 68%, #7fe9ff); background-clip: text; color: transparent; font-size: clamp(40px, 6vw, 70px); line-height: 1; letter-spacing: -0.055em; text-shadow: 0 0 46px rgba(157, 129, 255, 0.1); }
.library-heading p { margin: 0; color: var(--muted); font-size: 16px; }

.simple-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 350px)); gap: 22px; }
.simple-game-card { position: relative; min-width: 0; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 5px 24px 5px 24px; background: linear-gradient(145deg, rgba(31, 33, 52, 0.96), rgba(17, 18, 31, 0.96)); box-shadow: inset 0 1px rgba(255, 255, 255, 0.04); transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease; }
.simple-game-card::after { content: ""; position: absolute; inset: 0; border: 1px solid transparent; border-radius: inherit; pointer-events: none; transition: border-color 180ms ease; }
.simple-game-card:hover { transform: translateY(-6px) scale(1.01); border-color: rgba(137, 222, 255, 0.48); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42), 0 0 36px rgba(108, 83, 245, 0.18); }
.simple-game-card:hover::after { border-color: rgba(180, 159, 255, 0.18); }
.game-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #272a42; }
.game-art > img:first-child { width: 100%; height: 100%; object-fit: cover; transition: transform 360ms ease; }
.simple-game-card:hover .game-art > img:first-child { transform: scale(1.035); }
.game-art-shade { position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(transparent, rgba(6, 7, 14, 0.35)); }
.game-art-overlay { position: absolute; inset: auto 3% 0; width: 94%; height: 91%; object-fit: contain !important; object-position: center bottom !important; }
.card-status { position: absolute; z-index: 2; top: 13px; left: 13px; padding: 5px 8px; border: 1px solid rgba(116, 255, 151, 0.32); border-radius: 4px; background: rgba(7, 18, 14, 0.72); color: #90ffa6; font-size: 9px; font-weight: 900; letter-spacing: 0.14em; backdrop-filter: blur(8px); }
.card-play-icon { position: absolute; z-index: 2; top: calc(50% - 32px); left: calc(50% - 30px); width: 60px; height: 60px; display: grid; place-items: center; padding-left: 4px; border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 50%; background: rgba(89, 55, 200, 0.68); color: white; font-size: 20px; opacity: 0; box-shadow: 0 0 34px rgba(130, 97, 255, 0.7); backdrop-filter: blur(8px); transform: scale(0.78); transition: opacity 180ms ease, transform 180ms ease; }
.simple-game-card:hover .card-play-icon { opacity: 1; transform: scale(1); }
.simple-game-info { min-height: 86px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 17px 18px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.simple-game-info > span { min-width: 0; display: grid; gap: 5px; }
.simple-game-info strong { overflow: hidden; font-size: 18px; text-overflow: ellipsis; white-space: nowrap; }
.simple-game-info small { color: #858497; font-size: 12px; }
.simple-game-info b { flex: 0 0 auto; color: #93e7ff; font-size: 13px; }
.empty-state { min-height: 180px; display: grid; place-items: center; border: 1px dashed var(--line); border-radius: 20px; color: var(--muted); }
.simple-footer { padding: 24px; border-top: 1px solid rgba(255, 255, 255, 0.07); background: rgba(8, 9, 16, 0.62); color: #686779; font-size: 12px; text-align: center; }

.play-page { height: 100vh; display: grid; grid-template-rows: 64px minmax(0, 1fr); overflow: hidden; background: #080911; }
.play-header { z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 18px; padding: 10px clamp(14px, 3vw, 28px); border-bottom: 1px solid var(--line); background: #11121d; }
.play-header strong { font-size: 14px; }
.back-link { justify-self: start; color: #aaa9ba; font-size: 13px; }
.back-link:hover { color: white; }
.play-actions { justify-self: end; display: flex; align-items: center; gap: 10px; }
.play-actions > button { min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: #1b1d2c; cursor: pointer; }
.play-actions > button:hover { border-color: rgba(180, 159, 255, 0.5); }
.fullscreen-label { margin-left: 6px; }
.game-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 50% 35%, #222640, #080911 64%); }
.game-stage iframe { width: min(100%, 500px); height: 100%; border: 0; background: #050607; }
.game-stage:fullscreen iframe { width: min(100%, 580px); }

.legal-page { width: min(760px, calc(100% - 40px)); margin: 0 auto; padding: 60px 0 100px; }
.legal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 70px; }
.legal-page .back-link { display: block; }
.legal-page h1 { margin: 8px 0 16px; font-size: clamp(42px, 7vw, 70px); line-height: 1.03; letter-spacing: -0.055em; }
.legal-lead { color: #c5c4ce; font-size: 19px; line-height: 1.7; }
.legal-page section { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.legal-page h2 { font-size: 22px; }
.legal-page p { color: #aaa9b8; line-height: 1.8; }

:focus-visible { outline: 3px solid rgba(180, 159, 255, 0.86); outline-offset: 3px; }
@media (max-width: 620px) {
  .simple-header { min-height: 66px; padding: 10px 14px; }
  .brand-mark { width: 38px; height: 38px; }
  .header-meta > span { display: none; }
  .header-meta { gap: 10px; }
  .quiet-link { display: none; }
  .game-library { width: calc(100% - 28px); padding: 48px 0 64px; }
  .library-heading { margin-bottom: 26px; }
  .library-heading h1 { max-width: 330px; font-size: clamp(40px, 12vw, 46px); }
  .simple-game-grid { grid-template-columns: 1fr; }
  .portal-home::after { top: 120px; right: -18px; font-size: 170px; }
  .play-page { grid-template-rows: 58px minmax(0, 1fr); }
  .play-header { grid-template-columns: 1fr auto; }
  .play-header > strong { display: none; }
  .play-actions { gap: 7px; }
  .play-actions > button { width: 38px; overflow: hidden; padding: 0 10px; }
  .fullscreen-label { display: none; }
  .play-header .language-switcher button { min-width: 34px; padding: 0 6px; }
  .game-stage iframe { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
