﻿:root {
  --bg: #f6fbff;
  --bg-soft: #fff9e8;
  --surface: #ffffff;
  --surface-2: #f3f6ff;
  --text: #20304a;
  --muted: #66748a;
  --primary: #4f7cff;
  --primary-dark: #345fe0;
  --secondary: #ffb703;
  --accent: #ff6b6b;
  --success: #2bb673;
  --danger: #e63946;
  --shadow: 0 16px 35px rgba(53, 86, 170, 0.16);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Trebuchet MS', 'Segoe UI', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(79, 124, 255, 0.18), transparent 25%),
    linear-gradient(180deg, #f6fbff 0%, #eef6ff 100%);
  min-height: 100vh;
}

body[data-page="home"] {
  color: #f5f7ff;
  background:
    radial-gradient(circle at top left, rgba(0, 153, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.12), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0b1220 42%, #090f1a 100%);
}

body[data-page="game"] {
  background:
    radial-gradient(circle at top left, rgba(0, 153, 255, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.1), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0b1220 42%, #090f1a 100%);
}

body[data-page="info"] {
  color: #f5f7ff;
  background:
    radial-gradient(circle at top left, rgba(0, 153, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.12), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0b1220 42%, #090f1a 100%);
}

body[data-page="community"] {
  color: #f5f7ff;
  background:
    radial-gradient(circle at 10% 10%, rgba(79, 124, 255, 0.14), transparent 22%),
    radial-gradient(circle at 92% 8%, rgba(255, 183, 3, 0.1), transparent 18%),
    linear-gradient(180deg, #060a12 0%, #0a1220 44%, #09111d 100%);
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea,
select {
  font: inherit;
}

.container {
  width: min(calc(100% - 32px), var(--container));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid rgba(79, 124, 255, 0.1);
}

body[data-page="game"] .site-header {
  background: rgba(11, 18, 32, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-page="info"] .site-header {
  background: rgba(11, 18, 32, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-page="community"] .site-header {
  background: rgba(11, 18, 32, 0.84);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body[data-page="game"] .brand,
body[data-page="game"] .nav-link {
  color: #edf2ff;
}

body[data-page="info"] .brand,
body[data-page="info"] .nav-link {
  color: #edf2ff;
}

body[data-page="community"] .brand,
body[data-page="community"] .nav-link {
  color: #edf2ff;
}

body[data-page="game"] .nav-link:hover,
body[data-page="game"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body[data-page="info"] .nav-link:hover,
body[data-page="info"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body[data-page="community"] .nav-link:hover,
body[data-page="community"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-weight: 900;
  font-size: 1.15rem;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  background: linear-gradient(135deg, var(--primary), #7a97ff);
  color: #fff;
  box-shadow: var(--shadow);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.header-account,
.site-auth-user,
.site-auth-copy {
  display: flex;
  align-items: center;
}

.header-account {
  margin-left: auto;
}

.site-auth-user {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.site-auth-copy {
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.12);
}

.site-auth-copy strong,
.site-auth-copy span {
  display: block;
  line-height: 1.15;
}

.site-auth-copy span {
  font-size: 0.78rem;
  color: var(--muted);
}

.community-name--subscriber {
  color: #ffd570;
}

.community-name--admin {
  color: #ff6b6b;
}

.community-name--member {
  color: #ffffff;
}

.nav-link,
.chip,
.badge {
  border-radius: 999px;
}

.nav-link {
  padding: 11px 16px;
  font-weight: 700;
  color: var(--muted);
  transition: 0.25s ease;
}

.nav-link:hover,
.nav-link.active {
  background: #edf3ff;
  color: var(--primary-dark);
}

.hero {
  padding: 42px 0 26px;
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.18), rgba(255, 183, 3, 0.16));
  border-radius: 36px;
  padding: 32px;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.home-shell,
.home-main-layout {
  display: grid;
  gap: 24px;
}

.home-hero-panel {
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  align-items: stretch;
}

.hero-copy {
  display: grid;
  align-content: start;
  gap: 18px;
}

.home-title-frame {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 14px 18px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  background: rgba(11, 18, 32, 0.96);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24);
}

.home-title-frame h1 {
  margin: 0;
}

.hero-panel::after {
  content: '';
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.hero h1,
.page-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.4rem);
  line-height: 1.05;
}

.hero p,
.page-subtitle,
.section-subtitle,
.empty-state p,
.form-hint {
  color: var(--muted);
  line-height: 1.7;
}

.hero-actions,
.inline-actions,
.footer-links,
.meta-list,
.filter-row,
.login-actions,
.admin-actions,
.game-cta,
.game-meta,
.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn,
button.btn,
a.btn {
  border: none;
  outline: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 16px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), #6f8fff);
  color: #fff;
  box-shadow: 0 12px 24px rgba(79, 124, 255, 0.28);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

.btn-secondary {
  background: #fff;
  color: var(--primary-dark);
  border: 2px solid rgba(79, 124, 255, 0.15);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--primary-dark);
  border: 2px dashed rgba(79, 124, 255, 0.22);
}

.btn-small {
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
}

.hero-visual {
  min-height: 280px;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
  padding: 26px;
  display: grid;
  gap: 16px;
  position: relative;
}

.hero-popular-panel {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
}

.home-hero-note {
  overflow: hidden;
}

.home-note-lines {
  position: absolute;
  inset: 0;
  opacity: 0.48;
  background:
    repeating-linear-gradient(
      180deg,
      transparent 0 24px,
      rgba(79, 124, 255, 0.1) 24px 26px
    );
  pointer-events: none;
}

.hero-bubbles {
  display: grid;
  gap: 14px;
}

.bubble {
  background: #fff;
  border-radius: 22px;
  padding: 14px 16px;
  box-shadow: 0 10px 22px rgba(47, 72, 140, 0.1);
  animation: floaty 3.6s ease-in-out infinite;
}

.bubble:nth-child(2) { animation-delay: 0.5s; }
.bubble:nth-child(3) { animation-delay: 1s; }

.bubble-large {
  padding: 18px 18px 20px;
}

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.section {
  padding: 18px 0 34px;
}

.home-main-layout {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.home-explorer,
.home-side-card,
.home-cta-card {
  background: var(--surface);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.home-explorer {
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(245, 249, 255, 0.98)),
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.12), transparent 36%);
}

.teacher-stage {
  position: relative;
  min-height: 340px;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(177, 214, 255, 0.1), transparent 34%),
    linear-gradient(180deg, #10192c 0%, #121d33 58%, #0c1525 58%, #0a1220 100%);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.classroom-window,
.classroom-chalkboard,
.classroom-desk {
  position: absolute;
}

.classroom-window {
  top: 28px;
  width: 84px;
  height: 108px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(154, 215, 255, 0.95), rgba(101, 166, 255, 0.72)),
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.55) 48% 52%, transparent 52%),
    linear-gradient(180deg, transparent 48%, rgba(255, 255, 255, 0.55) 48% 52%, transparent 52%);
  border: 6px solid rgba(237, 242, 255, 0.9);
  box-shadow: inset 0 0 0 2px rgba(34, 55, 101, 0.16);
}

.classroom-window-left {
  left: 28px;
}

.classroom-window-right {
  right: 28px;
}

.classroom-chalkboard {
  top: 34px;
  left: 50%;
  transform: translateX(-50%);
  width: min(300px, calc(100% - 250px));
  min-width: 180px;
  height: 104px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 24% 30%, rgba(255, 255, 255, 0.08), transparent 22%),
    linear-gradient(180deg, #244d33, #173122);
  border: 10px solid #8b6944;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.16);
  display: grid;
  place-items: center;
}

.classroom-chalkboard span {
  color: rgba(236, 247, 238, 0.82);
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.04em;
}

.classroom-desk {
  right: 46px;
  bottom: 94px;
  width: 110px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, #9f7648, #7d5634);
  box-shadow: 0 18px 0 -6px #69462c, 0 62px 0 -42px #69462c;
}

.teacher-stage-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 58px;
  height: 8px;
  background: linear-gradient(90deg, rgba(79, 124, 255, 0.4), rgba(255, 183, 3, 0.32), rgba(79, 124, 255, 0.4));
}

.teacher-walker {
  position: absolute;
  left: 16px;
  bottom: 72px;
  width: 118px;
  height: 162px;
  will-change: left, transform;
  animation:
    teacher-walk-across 9.5s linear infinite alternate,
    teacher-bob 0.82s ease-in-out infinite alternate;
}

.teacher-walker-illustrated {
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.34));
}

.teacher-figure-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.teacher-figure-svg .teacher-figure-body,
.teacher-figure-svg .teacher-figure-head-group {
  transform-box: fill-box;
  transform-origin: center center;
}

.teacher-figure-svg .teacher-figure-body {
  animation: teacher-svg-body 0.9s ease-in-out infinite alternate;
}

.teacher-figure-svg .teacher-figure-head-group {
  transform-origin: center bottom;
  animation: teacher-svg-head 1.4s ease-in-out infinite alternate;
}

@keyframes teacher-walk-across {
  0% {
    left: 16px;
  }
  100% {
    left: calc(100% - 148px);
  }
}

@keyframes teacher-bob {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

@keyframes teacher-svg-body {
  from { transform: translateY(0) scaleY(1); }
  to { transform: translateY(-2px) scaleY(1.01); }
}

@keyframes teacher-svg-head {
  from { transform: rotate(-0.8deg) translateY(0); }
  to { transform: rotate(0.8deg) translateY(-1px); }
}

.game-comments-card {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.game-comments-form {
  display: grid;
  gap: 14px;
}

.game-comments-profile,
.comment-login-callout,
.community-user-actions,
.community-update-head,
.community-login-actions,
.community-login-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.game-comments-profile,
.comment-login-callout {
  justify-content: space-between;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.12);
}

.game-comments-profile strong,
.comment-login-callout strong {
  display: block;
  color: #ffffff;
}

.game-comments-profile span,
.comment-login-callout p {
  color: rgba(226, 232, 245, 0.78);
}

.comment-login-callout p {
  margin: 6px 0 0;
}

.game-comments-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.game-comments-list {
  display: grid;
  gap: 14px;
}

.game-comment-item {
  display: grid;
  gap: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.12);
}

.game-comment-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
}

.game-comment-head strong {
  color: #ffffff;
}

.game-comment-head span,
.game-comment-item p,
.game-comments-empty {
  color: rgba(226, 232, 245, 0.8);
}

.game-comment-item p {
  margin: 0;
  line-height: 1.65;
}

.game-comments-empty {
  padding: 16px 0 4px;
}

.community-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.community-main-column {
  display: grid;
  gap: 24px;
  align-content: start;
}

body[data-page="community"] .page-head {
  padding: 38px 0 18px;
}

body[data-page="community"] .page-title,
body[data-page="community"] .section-title {
  color: #ffffff;
}

body[data-page="community"] .page-subtitle,
body[data-page="community"] .section-subtitle {
  color: rgba(226, 232, 245, 0.8);
}

.community-hero-card,
.community-user-card,
.community-update-card,
.community-current-profile,
.community-login-card {
  display: grid;
  gap: 14px;
  padding: 24px;
}

.community-hero-card {
  position: relative;
  overflow: hidden;
  min-height: 320px;
  border: 1px solid rgba(124, 154, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(79, 124, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(20, 30, 52, 0.98), rgba(11, 18, 32, 0.98));
  box-shadow: 0 24px 48px rgba(2, 8, 20, 0.34);
}

.community-hero-card::after {
  content: '';
  position: absolute;
  inset: auto -40px -60px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.24), transparent 68%);
  pointer-events: none;
}

.community-hero-card .chip,
.community-user-card .chip,
.community-current-profile .chip {
  width: fit-content;
  background: linear-gradient(135deg, #ffeebd, #fff4d7);
  color: #8a6500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.community-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}

.community-stat {
  padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(79, 124, 255, 0.08));
  border: 1px solid rgba(124, 154, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  color: rgba(226, 232, 245, 0.84);
}

.community-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
  color: #ffffff;
}

.community-feed {
  display: grid;
  gap: 18px;
}

.community-latest-card {
  display: grid;
  gap: 18px;
  padding: 28px;
  border-radius: 30px;
  border: 1px solid rgba(124, 154, 255, 0.16);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.16), transparent 20%),
    radial-gradient(circle at bottom left, rgba(79, 124, 255, 0.16), transparent 24%),
    linear-gradient(180deg, rgba(21, 31, 54, 0.98), rgba(10, 16, 30, 0.98));
  box-shadow: 0 24px 48px rgba(2, 8, 20, 0.32);
}

.community-latest-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.community-latest-card h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.community-latest-card p,
.community-latest-item span {
  color: rgba(226, 232, 245, 0.84);
  line-height: 1.7;
}

.community-latest-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.community-latest-item {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(124, 154, 255, 0.12);
}

.community-latest-item strong {
  color: #ffd570;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.community-update-card {
  border: 1px solid rgba(79, 124, 255, 0.12);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(79, 124, 255, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(20, 30, 52, 0.96), rgba(11, 18, 32, 0.96));
  box-shadow: 0 20px 40px rgba(2, 8, 20, 0.26);
}

.community-update-card h3,
.community-user-card h3,
.community-login-card h1 {
  margin: 0;
}

.community-update-head {
  justify-content: space-between;
}

.community-update-card p,
.community-user-card p,
.community-login-card p,
.community-update-list li,
.community-current-profile span {
  color: rgba(226, 232, 245, 0.84);
  line-height: 1.65;
}

.community-user-card,
.community-current-profile {
  border: 1px solid rgba(124, 154, 255, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(14, 20, 34, 0.98), rgba(8, 13, 24, 0.98));
  box-shadow: 0 20px 40px rgba(2, 8, 20, 0.26);
}

.community-user-card .btn-primary {
  width: 100%;
}

.community-showcase-loading,
.community-showcase-empty {
  display: grid;
  place-items: center;
  min-height: 220px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(124, 154, 255, 0.12);
  color: rgba(226, 232, 245, 0.72);
  text-align: center;
  padding: 18px;
}

.community-showcase-frame {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 248px;
}

.community-showcase-current {
  position: relative;
  min-height: 220px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(124, 154, 255, 0.14);
  box-shadow: 0 18px 34px rgba(2, 8, 20, 0.26);
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(11, 18, 32, 0.98));
  opacity: 0.82;
  transform: translateY(8px) scale(0.988);
  transition: opacity 0.42s ease, transform 0.42s ease;
}

.community-showcase-current.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.community-showcase-current img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.community-showcase-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 14px;
}

.community-showcase-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(124, 154, 255, 0.22);
  transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
}

.community-showcase-dot.active {
  width: 28px;
  background: linear-gradient(135deg, #4f7cff, #7a97ff);
}

.community-showcase-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 4px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(5, 8, 16, 0.04), rgba(5, 8, 16, 0.82) 42%, rgba(5, 8, 16, 0.95));
}

.community-showcase-overlay strong {
  color: #ffffff;
  font-size: 1.08rem;
}

.community-showcase-overlay span {
  color: rgba(226, 232, 245, 0.8);
  font-size: 0.92rem;
}

.community-update-list,
.community-feature-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}

.community-category-board {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.community-category-board-header {
  display: grid;
  gap: 10px;
}

.community-category-board-header .chip {
  width: fit-content;
  background: linear-gradient(135deg, #ffeebd, #fff4d7);
  color: #8a6500;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.community-category-board-header .section-title {
  margin: 0;
}

.community-category-board-header .section-subtitle,
.community-category-lock p,
.community-category-empty {
  margin: 0;
  color: rgba(226, 232, 245, 0.78);
  line-height: 1.6;
}

.community-category-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.community-category-button {
  width: 100%;
  min-height: 82px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 1px solid rgba(124, 154, 255, 0.14);
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(11, 18, 32, 0.98));
  color: #ffffff;
  display: grid;
  gap: 6px;
  text-align: left;
  cursor: not-allowed;
  opacity: 0.9;
}

.community-category-button small {
  color: #ffd570;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.community-login-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.community-login-side {
  display: grid;
  gap: 18px;
}

.community-login-links {
  justify-content: space-between;
}

.community-admin-list,
.subscription-admin-form {
  display: grid;
  gap: 14px;
}

.community-admin-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(124, 154, 255, 0.12);
  background:
    radial-gradient(circle at top right, rgba(79, 124, 255, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(20, 30, 52, 0.96), rgba(11, 18, 32, 0.96));
}

.community-admin-card-top,
.community-admin-flags,
.community-admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.community-admin-card-top {
  justify-content: space-between;
  align-items: flex-start;
}

.community-admin-card-top h3 {
  margin: 0 0 4px;
}

.community-admin-card-top p,
.community-admin-empty,
.subscription-admin-summary {
  margin: 0;
  color: rgba(226, 232, 245, 0.74);
  line-height: 1.6;
}

.community-admin-flag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #dbe7ff;
  font-size: 0.92rem;
  font-weight: 700;
}

.community-admin-flag.is-on {
  background: rgba(43, 182, 115, 0.14);
  border-color: rgba(43, 182, 115, 0.28);
  color: #9df0c8;
}

.community-admin-flag.is-off {
  background: rgba(255, 183, 3, 0.1);
  border-color: rgba(255, 183, 3, 0.22);
  color: #ffd570;
}

.subscription-admin-summary {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(124, 154, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.oauth-stack {
  display: grid;
  gap: 14px;
}

.community-login-divider {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px 0;
  color: rgba(226, 232, 245, 0.68);
  font-size: 0.92rem;
}

.community-login-divider::before {
  content: '';
  position: absolute;
  inset: 50% 0 auto;
  border-top: 1px solid rgba(124, 154, 255, 0.14);
}

.community-login-divider span {
  position: relative;
  padding: 0 12px;
  background: linear-gradient(180deg, rgba(20, 30, 52, 0.98), rgba(11, 18, 32, 0.98));
}

.community-email-form {
  display: grid;
  gap: 14px;
}

.oauth-button {
  width: 100%;
  justify-content: flex-start;
  min-height: 58px;
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 1rem;
}

.oauth-google,
.oauth-apple {
  border: 1px solid rgba(124, 154, 255, 0.16);
  box-shadow: 0 18px 36px rgba(2, 8, 20, 0.22);
}

.oauth-google {
  background: linear-gradient(135deg, #1c2b4b, #12203a);
  color: #ffffff;
}

.oauth-apple {
  background: linear-gradient(135deg, #111826, #0a1018);
  color: #ffffff;
}

.oauth-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 1.1rem;
  font-weight: 900;
}

.home-explorer-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
  margin-bottom: 22px;
}

.home-arrow {
  display: grid;
  place-items: center;
  width: 66px;
  min-width: 66px;
  height: 66px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(79, 124, 255, 0.14), rgba(255, 183, 3, 0.18));
  color: var(--primary-dark);
  font-size: 2rem;
  font-weight: 900;
}

.category-spotlight,
.home-summary-list,
.home-popular-list {
  display: grid;
  gap: 14px;
}

.category-spotlight {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.category-card {
  border: 0;
  border-radius: 24px;
  padding: 18px;
  text-align: left;
  background:
    linear-gradient(145deg, #ffffff, #f2f6ff),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.14), transparent 35%);
  box-shadow: 0 14px 28px rgba(53, 86, 170, 0.12);
  color: var(--text);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(53, 86, 170, 0.16);
}

.category-card strong,
.category-card span {
  display: block;
}

.category-card strong {
  margin-bottom: 8px;
  font-size: 1.02rem;
}

.category-card span {
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.94rem;
}

.home-sidebar-panels {
  display: grid;
  gap: 18px;
}

.home-side-card {
  padding: 22px;
}

.section-header.compact {
  margin-bottom: 14px;
}

.section-header.compact .section-title {
  font-size: 1.35rem;
}

.summary-row,
.popular-row {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, #f7f9ff, #edf3ff);
  border: 1px solid rgba(79, 124, 255, 0.08);
}

.summary-row {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.summary-row strong,
.popular-row strong {
  font-size: 1rem;
}

.summary-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-dark);
  font-weight: 900;
  box-shadow: inset 0 0 0 2px rgba(79, 124, 255, 0.08);
}

.popular-row {
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.popular-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(200px, 240px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.popular-image-card {
  display: grid;
  gap: 0;
  overflow: hidden;
  border-radius: 24px;
  scroll-snap-align: start;
}

.popular-image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.88), rgba(12, 18, 32, 0.96));
}

.popular-rank-overlay {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
}

.popular-empty {
  padding: 16px;
  border-radius: 20px;
}

.popular-rank {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: #fff6d8;
  color: #8a6500;
  font-weight: 900;
}

.popular-score {
  font-weight: 900;
  color: var(--primary-dark);
}

.home-cta-card {
  padding: 28px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  background:
    linear-gradient(135deg, rgba(79, 124, 255, 0.16), rgba(255, 183, 3, 0.12)),
    #ffffff;
}

body[data-page="home"] .site-header {
  background: rgba(10, 15, 27, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="home"] .nav-link {
  color: rgba(240, 244, 255, 0.74);
}

body[data-page="home"] .nav-link:hover,
body[data-page="home"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body[data-page="home"] .search-panel,
body[data-page="home"] .card,
body[data-page="home"] .info-card,
body[data-page="home"] .notice,
body[data-page="home"] .empty-state,
body[data-page="home"] .home-explorer,
body[data-page="home"] .home-side-card,
body[data-page="home"] .home-cta-card,
body[data-page="home"] .hero-panel {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body[data-page="home"] .hero-visual,
body[data-page="home"] .bubble,
body[data-page="home"] .category-card,
body[data-page="home"] .summary-row,
body[data-page="home"] .popular-row,
body[data-page="home"] .popular-image-card,
body[data-page="home"] .popular-empty {
  background: linear-gradient(180deg, rgba(22, 32, 56, 0.98), rgba(13, 20, 36, 0.98));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

body[data-page="home"] .page-subtitle,
body[data-page="home"] .section-subtitle,
body[data-page="home"] .meta-text,
body[data-page="home"] .card-description,
body[data-page="home"] .hero p,
body[data-page="home"] .category-shelf-head span {
  color: rgba(226, 232, 245, 0.74);
}

body[data-page="home"] .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-page="home"] .input,
body[data-page="home"] select.input,
body[data-page="home"] textarea.input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body[data-page="home"] .input::placeholder {
  color: rgba(230, 236, 248, 0.52);
}

body[data-page="home"] .badge {
  background: rgba(79, 124, 255, 0.16);
  color: #dfe7ff;
}

body[data-page="home"] .chip {
  background: rgba(255, 183, 3, 0.14);
  color: #ffd36b;
}

body[data-page="home"] .summary-count,
body[data-page="home"] .popular-rank {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  box-shadow: none;
}

body[data-page="home"] .popular-score {
  color: #8db0ff;
}

body[data-page="home"] .section-title,
body[data-page="home"] .card-title,
body[data-page="home"] .category-shelf-head h3 {
  color: #ffffff;
}

body[data-page="home"] .home-title-frame {
  background: rgba(11, 18, 32, 0.96);
}

body[data-page="home"] .footer {
  background: #050810;
}

body[data-page="game"] .search-panel,
body[data-page="game"] .card,
body[data-page="game"] .info-card,
body[data-page="game"] .notice,
body[data-page="game"] .empty-state,
body[data-page="game"] .game-shell {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body[data-page="game"] .page-title,
body[data-page="game"] .section-title,
body[data-page="game"] .card-title,
body[data-page="game"] .footer h3,
body[data-page="game"] .footer h4 {
  color: #ffffff;
}

body[data-page="game"] .page-subtitle,
body[data-page="game"] .section-subtitle,
body[data-page="game"] .meta-text,
body[data-page="game"] .card-description,
body[data-page="game"] .footer p,
body[data-page="game"] .footer li,
body[data-page="game"] .footer a {
  color: rgba(226, 232, 245, 0.74);
}

body[data-page="game"] .badge {
  background: rgba(79, 124, 255, 0.16);
  color: #dfe7ff;
}

body[data-page="game"] .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-page="game"] .footer {
  background: #050810;
}

body[data-page="info"] .info-card,
body[data-page="info"] .notice,
body[data-page="info"] .empty-state {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body[data-page="info"] .page-title,
body[data-page="info"] h2,
body[data-page="info"] h3,
body[data-page="info"] h4 {
  color: #ffffff;
}

body[data-page="info"] .page-subtitle,
body[data-page="info"] .meta-text,
body[data-page="info"] p,
body[data-page="info"] li,
body[data-page="info"] a {
  color: rgba(226, 232, 245, 0.78);
}

body[data-page="info"] .footer {
  background: #050810;
}

body[data-page="help"] {
  color: #f5f7ff;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.14), transparent 22%),
    radial-gradient(circle at top right, rgba(250, 204, 21, 0.14), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0b1220 42%, #090f1a 100%);
}

body[data-page="help"] .site-header {
  background: rgba(10, 15, 27, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="help"] .nav-link,
body[data-page="help"] .brand {
  color: rgba(240, 244, 255, 0.82);
}

body[data-page="help"] .nav-link:hover,
body[data-page="help"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body[data-page="help"] .page-title,
body[data-page="help"] .section-title,
body[data-page="help"] h2,
body[data-page="help"] h3,
body[data-page="help"] h4 {
  color: #ffffff;
}

body[data-page="help"] .page-subtitle,
body[data-page="help"] .section-subtitle,
body[data-page="help"] p,
body[data-page="help"] li,
body[data-page="help"] a {
  color: rgba(226, 232, 245, 0.82);
}

body[data-page="help"] .card,
body[data-page="help"] .info-card,
body[data-page="help"] .notice,
body[data-page="help"] .empty-state {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body[data-page="help"] .footer {
  background: #050810;
}

.help-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: center;
}

.help-hero-copy {
  display: grid;
  gap: 16px;
}

.help-hero-tags,
.help-bottom-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.help-tag,
.help-bottom-badges span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  background: rgba(79, 124, 255, 0.14);
  color: #f5f7ff;
  border: 1px solid rgba(79, 124, 255, 0.24);
}

.help-hero-board {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

.help-board-frame {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 26px;
  background: linear-gradient(180deg, #1d5d3f, #123624);
  border: 8px solid #b48a52;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.help-board-line {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 800;
  color: #f7fbff;
  text-align: center;
  letter-spacing: 0.02em;
}

.help-counters {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.help-counters span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd84f, #f59e0b);
  color: #1e293b;
  font-weight: 900;
}

.help-intro {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  border-radius: 28px;
}

.help-intro-step {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-radius: 22px;
  background: rgba(79, 124, 255, 0.08);
}

.help-intro-step strong {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #4f7cff, #3158d8);
  color: #ffffff;
  font-size: 1.1rem;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.help-video-panel {
  display: grid;
  gap: 18px;
}

.help-video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.help-video-card {
  display: grid;
  gap: 12px;
  padding: 22px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(18, 28, 48, 0.98), rgba(11, 18, 32, 0.98));
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.help-video-card h3 {
  margin: 0;
  font-size: 1.25rem;
  color: #ffffff;
}

.help-video-card p {
  margin: 0;
  color: rgba(226, 232, 245, 0.82);
  line-height: 1.65;
}

body[data-page="help"] .help-video-card .help-card-kicker {
  color: #8db0ff;
}

.help-mini-player {
  padding: 10px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(79, 124, 255, 0.08));
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.help-mini-screen {
  display: grid;
  gap: 14px;
  min-height: 180px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(7, 11, 20, 0.94), rgba(11, 18, 32, 0.98));
}

.help-mini-equation {
  font-size: 1.45rem;
  font-weight: 900;
  color: #ffffff;
}

.help-mini-caption {
  color: rgba(226, 232, 245, 0.82);
  line-height: 1.6;
}

.help-mini-dots,
.help-mini-groups {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.help-mini-dots span,
.help-mini-groups span {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffd84f, #f59e0b);
  box-shadow: 0 0 0 3px rgba(255, 216, 79, 0.12);
}

.help-mini-dots .plus {
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: #8db0ff;
  font-weight: 900;
  font-size: 1.15rem;
}

.help-mini-dots .fade {
  opacity: 0.25;
  animation: helpFadeOut 1.8s ease-in-out infinite alternate;
}

.help-mini-groups div {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(79, 124, 255, 0.12);
}

.help-video-steps {
  display: grid;
  gap: 8px;
}

.help-video-steps span {
  color: rgba(226, 232, 245, 0.82);
  font-size: 0.97rem;
}

.help-mini-player-add .help-mini-dots span:not(.plus),
.help-mini-player-mul .help-mini-groups span,
.help-mini-player-div .help-mini-groups span {
  animation: helpPulseDots 1.4s ease-in-out infinite;
}

.help-mini-player-add .help-mini-dots span:nth-child(2),
.help-mini-player-mul .help-mini-groups span:nth-child(2),
.help-mini-player-div .help-mini-groups span:nth-child(2) {
  animation-delay: 0.2s;
}

.help-mini-player-add .help-mini-dots span:nth-child(3),
.help-mini-player-mul .help-mini-groups span:nth-child(3),
.help-mini-player-div .help-mini-groups span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes helpPulseDots {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-3px) scale(1.06);
  }
}

@keyframes helpFadeOut {
  from {
    opacity: 0.78;
  }
  to {
    opacity: 0.16;
  }
}

.help-map {
  display: grid;
  gap: 18px;
  padding: 22px;
  border-radius: 28px;
}

.help-map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.help-map-item {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.14);
}

.help-map-item strong {
  color: #ffffff;
}

.help-map-item span {
  color: rgba(226, 232, 245, 0.82);
}

.help-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.28);
}

.help-card-add {
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.26), rgba(15, 23, 42, 0.96));
}

.help-card-subtract {
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.22), rgba(15, 23, 42, 0.96));
}

.help-card-multiply {
  background: linear-gradient(180deg, rgba(168, 85, 247, 0.22), rgba(15, 23, 42, 0.96));
}

.help-card-divide {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.22), rgba(15, 23, 42, 0.96));
}

.help-card-table {
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.22), rgba(15, 23, 42, 0.96));
}

.help-card-measure {
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.22), rgba(15, 23, 42, 0.96));
}

.help-card-geometry {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.2), rgba(15, 23, 42, 0.96));
}

.help-card-logic {
  background: linear-gradient(180deg, rgba(236, 72, 153, 0.18), rgba(15, 23, 42, 0.96));
}

.help-card-language {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.2), rgba(15, 23, 42, 0.96));
}

.help-card-quiz {
  background: linear-gradient(180deg, rgba(14, 165, 233, 0.18), rgba(15, 23, 42, 0.96));
}

.help-card-science {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.18), rgba(15, 23, 42, 0.96));
}

.help-card-memory {
  background: linear-gradient(180deg, rgba(129, 140, 248, 0.18), rgba(15, 23, 42, 0.96));
}

.help-card-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 34px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 800;
}

.help-example,
.help-mini-list {
  display: grid;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(7, 11, 20, 0.3);
}

.help-example strong,
.help-mini-list span {
  color: #ffffff;
}

.help-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
  border-radius: 28px;
}

@media (max-width: 980px) {
  .help-hero-grid,
  .help-bottom,
  .help-grid,
  .help-video-grid {
    grid-template-columns: 1fr;
  }

  .help-intro {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .help-map-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .help-intro {
    grid-template-columns: 1fr;
  }

  .help-card,
  .help-bottom,
  .help-hero-board {
    padding: 18px;
  }
}

body[data-page="admin"] {
  color: #f5f7ff;
  background:
    radial-gradient(circle at top left, rgba(0, 153, 255, 0.16), transparent 24%),
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.12), transparent 20%),
    linear-gradient(180deg, #070b14 0%, #0b1220 42%, #090f1a 100%);
}

body[data-page="admin"] .site-header {
  background: rgba(10, 15, 27, 0.88);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

body[data-page="admin"] .nav-link,
body[data-page="admin"] .brand {
  color: rgba(240, 244, 255, 0.82);
}

body[data-page="admin"] .nav-link:hover,
body[data-page="admin"] .nav-link.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

body[data-page="admin"] .admin-panel,
body[data-page="admin"] .stat-card,
body[data-page="admin"] .login-card,
body[data-page="admin"] .editor-card,
body[data-page="admin"] .notice,
body[data-page="admin"] .empty-state {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(12, 18, 32, 0.96));
  color: #f5f7ff;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.34);
}

body[data-page="admin"] .page-title,
body[data-page="admin"] h2,
body[data-page="admin"] h3,
body[data-page="admin"] h4,
body[data-page="admin"] .form-label,
body[data-page="admin"] .table th {
  color: #ffffff;
}

body[data-page="admin"] .page-subtitle,
body[data-page="admin"] .meta-text,
body[data-page="admin"] .form-hint,
body[data-page="admin"] .table td,
body[data-page="admin"] .footer p,
body[data-page="admin"] .footer li,
body[data-page="admin"] .footer a {
  color: rgba(226, 232, 245, 0.74);
}

body[data-page="admin"] .input,
body[data-page="admin"] select.input,
body[data-page="admin"] textarea.input {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

body[data-page="admin"] select.input {
  color-scheme: dark;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(245, 247, 255, 0.9) 50%),
    linear-gradient(135deg, rgba(245, 247, 255, 0.9) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 2px),
    calc(100% - 16px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 38px;
  appearance: none;
}

body[data-page="admin"] select.input option,
body[data-page="admin"] select.input optgroup {
  background: #162033;
  color: #f5f7ff;
}

body[data-page="admin"] .input::placeholder,
body[data-page="admin"] textarea.input::placeholder {
  color: rgba(230, 236, 248, 0.52);
}

body[data-page="admin"] .btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: #f5f7ff;
  border-color: rgba(255, 255, 255, 0.12);
}

body[data-page="admin"] .table-wrap {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 20px;
}

body[data-page="admin"] .footer {
  background: #050810;
}

.admin-shell {
  display: grid;
  gap: 20px;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.admin-block {
  padding: 22px;
}

.admin-config-grid,
.admin-section-grid {
  display: grid;
  gap: 20px;
}

.admin-config-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.admin-section-grid {
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  align-items: start;
}

.admin-section-grid-wide {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
}

body[data-page="admin"] .admin-panel,
body[data-page="admin"] .editor-card {
  height: 100%;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 20px;
}

.section-title {
  margin: 0 0 6px;
  font-size: clamp(1.55rem, 2.2vw, 2.2rem);
}

.search-panel,
.card,
.admin-panel,
.stat-card,
.info-card,
.game-shell,
.login-card,
.editor-card,
.notice,
.empty-state {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.search-panel {
  padding: 18px;
}

.filter-row {
  align-items: center;
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 50px;
  border: 2px solid #dfe7fb;
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea.input {
  min-height: 120px;
  resize: vertical;
}

textarea.code-input {
  min-height: 220px;
  font-family: Consolas, "Courier New", monospace;
}

.input:focus,
select.input:focus,
textarea.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 124, 255, 0.12);
  outline: none;
}

.games-grid,
.category-shelves,
.admin-grid,
.admin-community-grid,
.stats-grid,
.footer-grid,
.info-grid,
.form-grid {
  display: grid;
  gap: 18px;
}

.games-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  align-items: start;
}

.admin-community-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.category-shelves {
  gap: 28px;
  margin-bottom: 28px;
}

.category-shelf {
  display: grid;
  gap: 14px;
}

.category-shelf-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.category-shelf-head h3 {
  margin: 0;
  font-size: clamp(1.2rem, 1.8vw, 1.5rem);
}

.category-shelf-head span {
  color: var(--muted);
  font-size: 0.95rem;
}

.shelf-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 260px);
  gap: 16px;
  align-items: start;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.shelf-row::-webkit-scrollbar {
  height: 10px;
}

.shelf-row::-webkit-scrollbar-thumb {
  background: rgba(79, 124, 255, 0.28);
  border-radius: 999px;
}

.shelf-card {
  scroll-snap-align: start;
}

.section-header-secondary {
  margin-top: 10px;
}

.card {
  overflow: hidden;
  position: relative;
  align-self: start;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(53, 86, 170, 0.18);
}

body[data-page="community"] .community-hero-card,
body[data-page="community"] .community-user-card,
body[data-page="community"] .community-update-card,
body[data-page="community"] .community-current-profile,
body[data-page="community"] .community-login-card,
body[data-page="community"] .community-latest-card,
body[data-page="community"] .community-category-board {
  color: #f5f7ff;
  border-color: rgba(124, 154, 255, 0.14);
  background:
    radial-gradient(circle at top right, rgba(255, 183, 3, 0.14), transparent 28%),
    radial-gradient(circle at bottom left, rgba(79, 124, 255, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(20, 30, 52, 0.98), rgba(11, 18, 32, 0.98));
  box-shadow: 0 24px 48px rgba(2, 8, 20, 0.34);
}

body[data-page="community"] .community-user-card,
body[data-page="community"] .community-current-profile {
  background:
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(14, 20, 34, 0.98), rgba(8, 13, 24, 0.98));
}

body[data-page="community"] .community-update-card,
body[data-page="community"] .community-latest-card {
  background:
    radial-gradient(circle at top right, rgba(79, 124, 255, 0.12), transparent 20%),
    linear-gradient(180deg, rgba(20, 30, 52, 0.96), rgba(11, 18, 32, 0.96));
}

body[data-page="community"] .community-category-board {
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(2, 8, 20, 0.26);
}

.card-cover {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #dbe8ff, #fef3c7);
  overflow: hidden;
}

.card-body {
  padding: 18px;
}

.card-title {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.card-description {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.65;
  min-height: 52px;
}

.game-tile-card {
  display: block;
  border-radius: 24px;
}

.game-tile-cover {
  position: relative;
  background: linear-gradient(180deg, rgba(8, 13, 24, 0.88), rgba(12, 18, 32, 0.96));
}

.game-tile-bg,
.game-tile-fg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.game-tile-bg {
  object-fit: cover;
  object-position: center;
  filter: blur(14px) brightness(0.45);
  transform: scale(1.08);
  opacity: 0.95;
}

.game-tile-fg {
  object-fit: contain;
  object-position: center;
}

.game-tile-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: grid;
  gap: 8px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(5, 8, 16, 0.02), rgba(5, 8, 16, 0.86) 42%, rgba(5, 8, 16, 0.96));
  transform: translateY(calc(100% - 78px));
  transition: transform 0.24s ease;
  z-index: 2;
}

.game-tile-overlay-compact {
  transform: translateY(calc(100% - 88px));
}

.game-tile-card:hover .game-tile-overlay,
.game-tile-card:focus-visible .game-tile-overlay,
.game-tile-card:active .game-tile-overlay {
  transform: translateY(0);
}

.game-tile-overlay .card-title {
  margin: 0;
  font-size: 1.25rem;
  color: #ffffff;
}

.game-tile-overlay .meta-text {
  color: rgba(226, 232, 245, 0.78);
}

@media (hover: none) {
  .game-tile-overlay,
  .game-tile-overlay-compact {
    transform: translateY(0);
  }
}

.badge,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 12px;
  font-size: 0.85rem;
  font-weight: 800;
}

.badge {
  background: #eef4ff;
  color: var(--primary-dark);
}

.chip {
  background: #fff4d1;
  color: #8a6500;
}

.meta-text {
  font-size: 0.95rem;
  color: var(--muted);
}

.footer {
  margin-top: 40px;
  background: #18263f;
  color: #eef5ff;
  padding: 36px 0 46px;
}

.footer-grid {
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
}

.footer h3,
.footer h4 {
  margin-top: 0;
}

.footer p,
.footer li,
.footer a {
  color: rgba(238, 245, 255, 0.82);
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.page-head {
  padding: 36px 0 12px;
}

.game-shell {
  overflow: hidden;
  padding: 24px;
}

.game-player-wrap {
  background: #152238;
  border-radius: 26px;
  padding: 14px;
  min-height: 420px;
}

.game-player {
  width: 100%;
  min-height: 72vh;
  border: none;
  border-radius: 18px;
  background: #fff;
}

.external-launch {
  min-height: 380px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf3ff, #fff7d9);
  padding: 24px;
  text-align: center;
}

.game-start-card {
  min-height: 380px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #edf3ff, #fff7d9);
  padding: 24px;
}

.game-start-card-inner {
  width: min(680px, 100%);
  background: rgba(255, 255, 255, 0.92);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 40px rgba(53, 86, 170, 0.12);
}

.game-start-card h2 {
  margin: 12px 0 10px;
}

.game-start-form {
  margin-top: 18px;
}

.game-sidebar {
  display: grid;
  gap: 16px;
}

.game-details-card {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.12);
}

.game-detail-item {
  display: grid;
  gap: 4px;
}

.game-detail-item strong {
  color: #ffffff;
}

.game-sidebar-card {
  display: grid;
  gap: 16px;
}

.game-sidebar-popular-list {
  display: grid;
  gap: 12px;
}

.game-sidebar-popular-item {
  display: grid;
  grid-template-columns: 36px 78px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 20px;
  background: rgba(79, 124, 255, 0.08);
  border: 1px solid rgba(79, 124, 255, 0.12);
  color: inherit;
  text-decoration: none;
}

.game-sidebar-popular-item:hover {
  transform: translateY(-1px);
}

.game-sidebar-popular-rank {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(79, 124, 255, 0.16);
  color: #4f7cff;
  font-weight: 800;
}

.game-sidebar-popular-thumb {
  width: 78px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.game-sidebar-popular-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.game-sidebar-popular-copy strong,
.game-sidebar-popular-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-sidebar-popular-copy strong {
  color: inherit;
  white-space: nowrap;
}

.game-sidebar-popular-copy span {
  color: rgba(79, 124, 255, 0.82);
  font-size: 0.92rem;
  white-space: nowrap;
}

.game-sidebar-popular-empty {
  color: rgba(83, 101, 145, 0.84);
  line-height: 1.5;
}

.leaderboard-card {
  display: grid;
  gap: 18px;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(242, 246, 255, 0.96)),
    radial-gradient(circle at top left, rgba(255, 183, 3, 0.12), transparent 35%);
  border: 1px solid rgba(79, 124, 255, 0.12);
}

.leaderboard-header,
.leaderboard-inline,
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.leaderboard-header,
.leaderboard-item {
  justify-content: space-between;
}

.leaderboard-inline {
  flex-wrap: wrap;
}

.leaderboard-champion {
  padding: 28px 24px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(255, 196, 61, 0.42), transparent 34%),
    radial-gradient(circle at top right, rgba(92, 138, 255, 0.34), transparent 40%),
    linear-gradient(135deg, #ffffff 0%, #f4f7ff 55%, #eef3ff 100%);
  border: 2px solid rgba(120, 156, 255, 0.22);
  box-shadow: 0 18px 42px rgba(53, 86, 170, 0.12);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.leaderboard-champion::before {
  content: '';
  position: absolute;
  inset: -20% auto auto -10%;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 205, 96, 0.32), transparent 68%);
  pointer-events: none;
}

.leaderboard-champion::after {
  content: '';
  position: absolute;
  inset: auto -10% -24% auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(79, 124, 255, 0.22), transparent 70%);
  pointer-events: none;
}

.leaderboard-crown {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 9px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3cd, #ffe49a);
  color: #8a6500;
  font-weight: 800;
  margin-bottom: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    0 10px 24px rgba(255, 191, 36, 0.18);
}

.leaderboard-crown-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.48);
  font-size: 1rem;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.leaderboard-champion-name {
  display: block;
  font-size: clamp(2.2rem, 4.4vw, 3.3rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-top: 4px;
  text-shadow: 0 6px 24px rgba(79, 124, 255, 0.16);
}

.leaderboard-champion-score {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 900;
  color: #213252;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
  max-height: 820px;
  overflow: auto;
}

.leaderboard-table-head {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 96px;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(33, 50, 82, 0.96), rgba(55, 86, 146, 0.92));
  color: #eef4ff;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(20, 34, 63, 0.18);
}

.leaderboard-table-head span:last-child {
  text-align: right;
}

.leaderboard-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 96px;
  padding: 15px 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, #f7f9ff, #eef3ff);
  border: 1px solid rgba(79, 124, 255, 0.08);
  box-shadow: 0 8px 20px rgba(53, 86, 170, 0.06);
}

.leaderboard-item-top {
  border: 2px solid rgba(255, 183, 3, 0.42);
  background: linear-gradient(135deg, rgba(255, 244, 210, 0.9), rgba(241, 245, 255, 0.95));
}

.leaderboard-item:has(.leaderboard-rank.is-gold) {
  border: 1px solid rgba(212, 158, 18, 0.22);
  background: linear-gradient(135deg, rgba(255, 246, 214, 0.96), rgba(249, 243, 220, 0.88));
}

.leaderboard-item:has(.leaderboard-rank.is-silver) {
  border: 1px solid rgba(143, 153, 168, 0.2);
  background: linear-gradient(135deg, rgba(246, 248, 252, 0.98), rgba(233, 238, 246, 0.92));
}

.leaderboard-rank {
  min-width: 0;
  font-weight: 900;
  font-size: 1.05rem;
}

.leaderboard-name {
  flex: 1;
  font-weight: 800;
  font-size: 1.05rem;
}

.leaderboard-score {
  color: #355ff0;
  font-weight: 900;
  font-size: 1.1rem;
  text-align: right;
}

.leaderboard-empty {
  padding: 18px;
  border-radius: 18px;
  background: var(--surface-2);
}

.is-rainbow {
  background: linear-gradient(90deg, #ff4d4d 0%, #ffb703 20%, #38d66b 42%, #3bb8ff 66%, #7a5cff 84%, #ff4fd8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 220% auto;
  animation: rgb-flow 3.5s linear infinite;
}

.is-gold {
  color: #b8860b;
  text-shadow: 0 2px 12px rgba(212, 158, 18, 0.18);
}

.is-silver {
  color: #8f99a8;
  text-shadow: 0 2px 10px rgba(143, 153, 168, 0.16);
}

@keyframes rgb-flow {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.info-card,
.notice,
.empty-state,
.login-card,
.editor-card,
.admin-panel,
.stat-card {
  padding: 20px;
}

.info-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.notice {
  border-left: 8px solid var(--secondary);
}

.notice.success { border-left-color: var(--success); }
.notice.error { border-left-color: var(--danger); }

.hidden {
  display: none !important;
}

.login-card {
  max-width: 520px;
  margin: 0 auto;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-field.full {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-weight: 800;
  margin-bottom: 8px;
}

.admin-grid {
  grid-template-columns: 1.05fr 1.2fr;
  align-items: start;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card h3 {
  margin: 0 0 6px;
  font-size: 2rem;
}

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  text-align: left;
  padding: 14px 12px;
  border-bottom: 1px solid #edf1fb;
  vertical-align: top;
}

.table th {
  font-size: 0.95rem;
  color: var(--muted);
}

.cover-thumb {
  width: 84px;
  min-width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: #eef3ff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.88rem;
}

.status-pill.published {
  background: rgba(43, 182, 115, 0.14);
  color: #17734a;
}

.status-pill.draft {
  background: rgba(255, 183, 3, 0.18);
  color: #946400;
}

.loader {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid rgba(79, 124, 255, 0.2);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.empty-state {
  text-align: center;
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 12px;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 10px;
}

.skip-link:focus {
  left: 10px;
  z-index: 100;
  background: #fff;
  padding: 10px 14px;
  border-radius: 12px;
}

@media (max-width: 980px) {
  .hero-panel,
  .home-main-layout,
  .admin-community-grid,
  .admin-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .game-layout {
    display: grid;
    gap: 18px;
  }
}

@media (max-width: 720px) {
  .header-inner,
  .section-header,
  .filter-row,
  .home-explorer-head,
  .home-cta-card {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-panel,
  .game-shell,
  .login-card,
  .editor-card,
  .admin-panel,
  .info-card,
  .notice,
  .empty-state {
    padding: 18px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .nav-links {
    justify-content: center;
  }

  .category-spotlight {
    grid-template-columns: 1fr 1fr;
  }

  .game-player {
    min-height: 58vh;
  }

  .leaderboard-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .category-spotlight,
  .popular-row,
  .summary-row {
    grid-template-columns: 1fr;
  }

  .popular-strip {
    grid-auto-columns: minmax(180px, 82vw);
  }

  .popular-rank,
  .summary-count {
    width: fit-content;
  }

  .home-title-frame {
    width: 100%;
  }

  .header-account {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .site-auth-user {
    justify-content: center;
  }

  .community-stats,
  .community-hero,
  .community-login-layout,
  .community-latest-grid {
    grid-template-columns: 1fr;
  }
}


.game-player-wrap {
  background: #0f172a;
  border-radius: 28px;
  padding: 0;
  overflow: hidden;
  border: 6px solid #14213d;
  box-shadow: var(--shadow);
}

.game-player-wrap-html {
  background: #fff;
}

.game-player {
  width: 100%;
  min-height: 720px;
  border: 0;
  display: block;
  background: #fff;
}

.game-player-html {
  min-height: 720px;
}

[data-game-cover].card-cover {
  width: 100%;
  max-width: 520px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 24px;
  overflow: hidden;
  margin-bottom: 18px;
}

@media (max-width: 768px) {
  .game-player,
  .game-player-html {
    min-height: 560px;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: calc(var(--mobile-header-offset, 0px) + env(safe-area-inset-top, 0px));
  }

  .site-header {
    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    width: 100%;
  }

  .hero {
    padding: 22px 0 18px;
  }

  .header-inner {
    gap: 14px;
    padding: 14px 0;
  }

  .brand {
    gap: 10px;
    font-size: 1rem;
  }

  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.35rem;
  }

  .nav-links {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .nav-link {
    text-align: center;
    padding: 12px 14px;
  }

  .hero-panel,
  .home-hero-panel,
  .home-main-layout,
  .admin-community-grid,
  .admin-config-grid,
  .admin-section-grid,
  .admin-section-grid-wide,
  .footer-grid,
  .stats-grid,
  .community-login-layout,
  .community-latest-grid,
  .community-stats,
  .community-hero,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    gap: 18px;
    border-radius: 24px;
    padding: 22px;
  }

  .home-title-frame {
    width: 100%;
    padding: 12px 14px;
    border-radius: 22px;
  }

  .hero h1,
  .page-title {
    font-size: clamp(1.9rem, 8vw, 2.8rem);
  }

  .hero-actions,
  .game-cta,
  .login-actions,
  .admin-actions {
    flex-direction: column;
  }

  .hero-actions .btn,
  .game-cta .btn,
  .login-actions .btn,
  .admin-actions .btn,
  .community-login-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .games-grid,
  .category-spotlight,
  .popular-row,
  .summary-row,
  .community-category-buttons {
    grid-template-columns: 1fr;
  }

  .shelf-row,
  .popular-strip {
    grid-auto-columns: minmax(82vw, 82vw);
    gap: 12px;
  }

  .community-showcase-frame {
    min-height: 226px;
  }

  .community-showcase-current,
  .community-showcase-loading,
  .community-showcase-empty {
    min-height: 210px;
  }

  .community-category-board {
    padding: 20px;
  }

  .game-shell,
  .game-player-wrap,
  .login-card,
  .editor-card,
  .admin-panel,
  .info-card,
  .notice,
  .empty-state {
    border-radius: 22px;
  }

  .game-player-wrap {
    border-width: 4px;
  }

  .game-player,
  .game-player-html {
    min-height: 62svh;
  }

  [data-game-cover].card-cover {
    max-width: 100%;
    border-radius: 20px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  .leaderboard-table-head,
  .leaderboard-item {
    grid-template-columns: 70px minmax(0, 1fr) 84px;
    gap: 10px;
    padding: 12px 14px;
  }

  .leaderboard-table-head {
    font-size: 0.76rem;
  }

  .leaderboard-rank,
  .leaderboard-name,
  .leaderboard-score {
    font-size: 0.96rem;
  }
}

@media (max-width: 520px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-inner,
  .section-header,
  .filter-row,
  .home-explorer-head,
  .home-cta-card {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-links {
    grid-template-columns: 1fr 1fr;
  }

  .hero-panel,
  .game-shell,
  .login-card,
  .editor-card,
  .admin-panel,
  .info-card,
  .notice,
  .empty-state,
  .community-category-board {
    padding: 18px;
  }

  .home-note-lines,
  .hero-panel::after {
    display: none;
  }

  .shelf-row,
  .popular-strip {
    grid-auto-columns: minmax(86vw, 86vw);
  }

  .community-showcase-overlay {
    padding: 14px;
  }

  .community-showcase-overlay strong {
    font-size: 1rem;
  }

  .game-player,
  .game-player-html {
    min-height: 56svh;
  }

  .cover-thumb {
    width: 72px;
    min-width: 72px;
    height: 48px;
  }
}

/* =====================================================
   INTRO DO PORTAL + TEMA ESPACIAL
   Aplicado sem alterar a estrutura do site
===================================================== */

.portal-intro {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  contain: layout paint style;
  transform: translateZ(0);
  will-change: opacity;
}

html.portal-intro-pending .portal-intro {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: portalIntroExit 1.2s ease forwards;
  animation-delay: 5s;
}

html.portal-intro-pending body[data-page="home"] > *:not([data-portal-intro]) {
  visibility: hidden;
}

.portal-intro .portal {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background:
    radial-gradient(circle, #ffffff 0%, #ffe600 8%, #ff4b00 18%, #ff00ff 34%, #4700ff 55%, transparent 70%);
  box-shadow:
    0 0 24px #fff,
    0 0 58px #ff4b00,
    0 0 110px #ff00ff,
    0 0 180px #4700ff;
  transform: translateZ(0) scale(.08);
  will-change: transform, opacity, filter;
  animation: portalExplode 6s ease-in-out forwards;
}

.portal-intro .portal::before {
  content: "";
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  background:
    conic-gradient(
      from 0deg,
      transparent,
      #00eaff,
      transparent,
      #ff00ff,
      transparent,
      #ffe600,
      transparent,
      #ff4b00,
      transparent
    );
  filter: blur(22px);
  will-change: transform;
  animation: portalSpin 2.2s linear infinite;
}

.portal-intro .portal::after {
  content: "";
  position: absolute;
  inset: 35px;
  border-radius: 50%;
  background: #000;
  box-shadow:
    inset 0 0 35px #000,
    0 0 40px #fff,
    0 0 90px #00eaff;
  will-change: transform, opacity;
  animation: portalCore 6s ease-in-out forwards;
}

.portal-intro .wave {
  position: absolute;
  width: 90px;
  height: 90px;
  border: 3px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  will-change: transform, opacity;
  animation: portalWave 2.5s ease-out infinite;
}

.portal-intro .wave:nth-child(2) {
  animation-delay: .5s;
  border-color: rgba(0, 234, 255, 0.9);
}

.portal-intro .wave:nth-child(3) {
  animation-delay: 1s;
  border-color: rgba(255, 0, 255, 0.8);
}

.portal-intro .particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 8px white, 0 0 20px currentColor;
  will-change: transform, opacity;
  animation: portalParticle 3.5s ease-out infinite;
}

.portal-intro .text {
  position: absolute;
  bottom: 70px;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  color: white;
  font-size: clamp(1.2rem, 4vw, 2rem);
  font-weight: 900;
  letter-spacing: 4px;
  text-transform: uppercase;
  text-shadow:
    0 0 10px #fff,
    0 0 22px #00eaff,
    0 0 38px #ff00ff;
  will-change: transform, opacity;
  animation: portalText 1.5s infinite alternate;
}

.portal-intro[data-intro-preset="aurora"] .portal {
  background: radial-gradient(circle, #f6fbff 0%, #8df3ff 14%, #5f8dff 32%, #8f5bff 52%, transparent 72%);
  box-shadow:
    0 0 26px #dffbff,
    0 0 60px #4ad8ff,
    0 0 120px #7f7dff,
    0 0 190px #8f5bff;
}

.portal-intro[data-intro-preset="aurora"] .portal::before {
  background:
    conic-gradient(
      from 0deg,
      transparent,
      #8df3ff,
      transparent,
      #5f8dff,
      transparent,
      #8f5bff,
      transparent
    );
}

.portal-intro[data-intro-preset="aurora"] .text {
  text-shadow:
    0 0 10px #fff,
    0 0 24px #8df3ff,
    0 0 40px #8f5bff;
}

.portal-intro[data-intro-preset="minimal"] .portal {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, #ffffff 0%, #7ad1ff 14%, #3e5dff 42%, transparent 74%);
  box-shadow:
    0 0 20px #fff,
    0 0 46px #58b6ff,
    0 0 110px #3e5dff;
}

.portal-intro[data-intro-preset="minimal"] .portal::before {
  inset: -34px;
  filter: blur(14px);
  animation-duration: 3.4s;
}

.portal-intro[data-intro-preset="minimal"] .portal::after {
  inset: 52px;
  box-shadow:
    inset 0 0 24px #000,
    0 0 30px #c5f4ff,
    0 0 70px #58b6ff;
}

.portal-intro[data-intro-preset="minimal"] .wave:nth-child(3) {
  display: none;
}

.portal-intro[data-intro-preset="minimal"] .text {
  bottom: 82px;
  letter-spacing: 3px;
  font-size: clamp(1rem, 3.2vw, 1.65rem);
}

html.theme-space body[data-page] {
  background:
    radial-gradient(circle at 50% 18%, rgba(40, 90, 180, 0.20), transparent 30%),
    radial-gradient(circle at 80% 65%, rgba(0, 180, 255, 0.08), transparent 25%),
    radial-gradient(circle at 15% 75%, rgba(80, 70, 160, 0.12), transparent 28%),
    linear-gradient(180deg, #02030a 0%, #000000 55%, #02020a 100%) !important;
  color: #ffffff;
  overflow-x: hidden;
}

html.theme-space body[data-page]::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.95) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(180,230,255,.75) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(255,255,255,.5) 1px, transparent 1.5px);
  background-size: 120px 120px, 190px 190px, 260px 260px;
  background-position: 0 0, 40px 80px, 120px 40px;
  animation: starsMove 55s linear infinite;
  opacity: .85;
}

html.theme-space body[data-page]::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 40% 35%, rgba(0, 115, 255, .16), transparent 25%),
    radial-gradient(circle at 70% 55%, rgba(120, 220, 255, .09), transparent 24%),
    radial-gradient(circle at 35% 75%, rgba(70, 80, 170, .13), transparent 26%);
  filter: blur(25px);
  animation: nebulaFloat 14s ease-in-out infinite alternate;
}

html.theme-space body[data-page] .site-header {
  background: rgba(0, 0, 0, .72) !important;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(160, 220, 255, .14) !important;
  box-shadow: 0 10px 35px rgba(0, 0, 0, .35);
}

html.theme-space body[data-page] .brand,
html.theme-space body[data-page] .section-title,
html.theme-space body[data-page] h1,
html.theme-space body[data-page] h2,
html.theme-space body[data-page] h3 {
  color: #ffffff;
  text-shadow:
    0 0 12px rgba(130, 220, 255, .18),
    0 0 28px rgba(0, 110, 255, .12);
}

html.theme-space body[data-page] .nav-links a,
html.theme-space body[data-page] .footer a {
  color: #dceeff !important;
}

html.theme-space body[data-page] .nav-links a:hover,
html.theme-space body[data-page] .footer a:hover {
  color: #ffffff !important;
  text-shadow: 0 0 14px rgba(130, 220, 255, .8);
}

html.theme-space body[data-page] .card,
html.theme-space body[data-page] .hero-panel,
html.theme-space body[data-page] .home-side-card,
html.theme-space body[data-page] .home-cta-card,
html.theme-space body[data-page] .info-card,
html.theme-space body[data-page] .notice,
html.theme-space body[data-page] .empty-state,
html.theme-space body[data-page] .search-panel,
html.theme-space body[data-page] .game-shell,
html.theme-space body[data-page] .login-card,
html.theme-space body[data-page] .editor-card,
html.theme-space body[data-page] .admin-panel,
html.theme-space body[data-page] .stat-card,
html.theme-space body[data-page] .community-hero-card,
html.theme-space body[data-page] .community-user-card,
html.theme-space body[data-page] .community-update-card,
html.theme-space body[data-page] .community-current-profile,
html.theme-space body[data-page] .community-login-card,
html.theme-space body[data-page] .community-latest-card,
html.theme-space body[data-page] .community-category-board {
  background:
    linear-gradient(180deg, rgba(255,255,255,.075), rgba(255,255,255,.035)) !important;
  border: 1px solid rgba(160, 220, 255, .14) !important;
  box-shadow:
    0 18px 45px rgba(0, 0, 0, .45),
    0 0 22px rgba(0, 120, 255, .08) !important;
  backdrop-filter: blur(10px);
}

html.theme-space body[data-page] .card:hover,
html.theme-space body[data-page] .hero-panel:hover,
html.theme-space body[data-page] .home-side-card:hover,
html.theme-space body[data-page] .home-cta-card:hover,
html.theme-space body[data-page] .community-update-card:hover,
html.theme-space body[data-page] .community-category-board:hover {
  border-color: rgba(150, 225, 255, .35) !important;
  box-shadow:
    0 24px 55px rgba(0, 0, 0, .55),
    0 0 35px rgba(0, 150, 255, .22) !important;
}

html.theme-space body[data-page] button,
html.theme-space body[data-page] .btn,
html.theme-space body[data-page] a.btn {
  background: linear-gradient(90deg, #0b1c4d, #147cff, #9eeaff) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 0 22px rgba(0, 150, 255, .35) !important;
  font-weight: 800;
}

html.theme-space body[data-page] button:hover,
html.theme-space body[data-page] .btn:hover,
html.theme-space body[data-page] a.btn:hover {
  box-shadow: 0 0 32px rgba(120, 220, 255, .55) !important;
}

html.theme-space body[data-page] input,
html.theme-space body[data-page] textarea,
html.theme-space body[data-page] select {
  background: rgba(255, 255, 255, .07) !important;
  color: white !important;
  border: 1px solid rgba(160, 220, 255, .22) !important;
  box-shadow: 0 0 18px rgba(0, 120, 255, .08);
}

html.theme-space body[data-page] input::placeholder,
html.theme-space body[data-page] textarea::placeholder {
  color: rgba(220, 240, 255, .65) !important;
}

html.theme-space body[data-page] .chip,
html.theme-space body[data-page] .badge,
html.theme-space body[data-page] .tag,
html.theme-space body[data-page] .category,
html.theme-space body[data-page] .categoria {
  background: rgba(0, 120, 255, .12) !important;
  color: #bfeeff !important;
  border: 1px solid rgba(120, 220, 255, .22) !important;
  box-shadow: none !important;
}

html.theme-space body[data-page] .footer {
  background: rgba(0, 0, 0, .78) !important;
  border-top: 1px solid rgba(160, 220, 255, .12) !important;
  color: #b9c7e8 !important;
}

html.theme-space body[data-page="game"] .leaderboard-card,
html.theme-space body[data-page="game"] .game-start-card-inner,
html.theme-space body[data-page="game"] .game-details-card {
  color: #213252 !important;
}

html.theme-space body[data-page="game"] .leaderboard-card {
  background:
    linear-gradient(180deg, rgba(14, 18, 27, 0.98), rgba(8, 11, 18, 0.98)),
    radial-gradient(circle at top right, rgba(255, 32, 32, 0.08), transparent 28%),
    radial-gradient(circle at bottom left, rgba(255, 255, 255, 0.05), transparent 30%) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.38),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset !important;
  backdrop-filter: none;
}

html.theme-space body[data-page="game"] .leaderboard-card h3,
html.theme-space body[data-page="game"] .leaderboard-card .leaderboard-name,
html.theme-space body[data-page="game"] .leaderboard-card .leaderboard-rank,
html.theme-space body[data-page="game"] .leaderboard-card .leaderboard-empty,
html.theme-space body[data-page="game"] .leaderboard-card .meta-text,
html.theme-space body[data-page="game"] .game-start-card-inner h2,
html.theme-space body[data-page="game"] .game-start-card-inner .page-subtitle,
html.theme-space body[data-page="game"] .game-start-card-inner .form-label,
html.theme-space body[data-page="game"] .game-details-card,
html.theme-space body[data-page="game"] .game-details-card strong {
  color: #f4f7ff !important;
  text-shadow: none !important;
}

html.theme-space body[data-page="game"] .leaderboard-card .badge {
  background: linear-gradient(135deg, rgba(56, 63, 82, 0.92), rgba(25, 28, 38, 0.98)) !important;
  color: #f8fbff !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
}

html.theme-space body[data-page="game"] .leaderboard-table-head {
  background: linear-gradient(135deg, rgba(22, 24, 31, 0.92), rgba(10, 12, 18, 0.98)) !important;
  color: rgba(236, 242, 255, 0.78) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: none !important;
}

html.theme-space body[data-page="game"] .leaderboard-item {
  background:
    linear-gradient(135deg, rgba(34, 36, 42, 0.98), rgba(21, 23, 29, 0.99)) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.24) !important;
}

html.theme-space body[data-page="game"] .leaderboard-item-top {
  background:
    linear-gradient(90deg, rgba(44, 34, 12, 0.96), rgba(25, 25, 28, 0.98)) !important;
  border: 1px solid rgba(255, 210, 104, 0.34) !important;
}

html.theme-space body[data-page="game"] .leaderboard-score {
  color: #ffffff !important;
  letter-spacing: 0.02em;
}

html.theme-space body[data-page="game"] .leaderboard-rank {
  color: #ffffff !important;
  font-size: 1.55rem;
  letter-spacing: 0.04em;
}

html.theme-space body[data-page="game"] .leaderboard-name {
  text-transform: uppercase;
  font-size: 1.12rem;
  letter-spacing: 0.02em;
}

html.theme-space body[data-page="game"] .leaderboard-champion {
  background:
    linear-gradient(135deg, rgba(27, 30, 39, 0.98), rgba(13, 16, 22, 0.99)) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 20px 36px rgba(0, 0, 0, 0.28) !important;
}

html.theme-space body[data-page="game"] .leaderboard-champion::before,
html.theme-space body[data-page="game"] .leaderboard-champion::after {
  opacity: 0.45;
}

html.theme-space body[data-page="game"] .leaderboard-crown {
  background: linear-gradient(135deg, #ffea9a, #ffbf3f) !important;
  color: #5d3c00 !important;
}

html.theme-space body[data-page="game"] .leaderboard-champion-score {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
}

html.theme-space body[data-page="game"] .leaderboard-list .leaderboard-item:nth-child(2) {
  background:
    linear-gradient(90deg, rgba(86, 10, 10, 0.96), rgba(255, 20, 20, 0.96)) !important;
  border-color: rgba(255, 88, 88, 0.34) !important;
}

html.theme-space body[data-page="game"] .leaderboard-list .leaderboard-item:nth-child(2) .leaderboard-rank,
html.theme-space body[data-page="game"] .leaderboard-list .leaderboard-item:nth-child(2) .leaderboard-name,
html.theme-space body[data-page="game"] .leaderboard-list .leaderboard-item:nth-child(2) .leaderboard-score {
  color: #ffffff !important;
}

html.theme-space body[data-page="game"] .leaderboard-card .is-rainbow,
html.theme-space body[data-page="game"] .leaderboard-card .is-gold,
html.theme-space body[data-page="game"] .leaderboard-card .is-silver {
  text-shadow: none !important;
}

html.theme-space body[data-page="game"] .leaderboard-card .is-gold {
  color: #ffe27a !important;
}

html.theme-space body[data-page="game"] .leaderboard-card .is-silver {
  color: #ffffff !important;
}

html.theme-space body[data-page="game"] .game-start-card-inner {
  background:
    radial-gradient(circle at top right, rgba(117, 208, 255, 0.18), transparent 26%),
    radial-gradient(circle at bottom left, rgba(51, 112, 255, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(16, 24, 42, 0.98), rgba(9, 14, 28, 0.98)) !important;
  border: 1px solid rgba(126, 197, 255, 0.18);
  box-shadow:
    0 22px 44px rgba(2, 8, 20, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

html.theme-space body[data-page="game"] .game-start-card-inner .chip {
  background: linear-gradient(135deg, rgba(31, 83, 175, 0.92), rgba(88, 205, 255, 0.92)) !important;
  color: #eef8ff !important;
  border: 1px solid rgba(120, 220, 255, 0.24) !important;
}

html.theme-space body[data-page="game"] .game-start-card-inner input {
  background: rgba(245, 249, 255, 0.98) !important;
  color: #18304f !important;
  border: 1px solid rgba(152, 195, 255, 0.34) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 10px 24px rgba(9, 24, 53, 0.18) !important;
}

html.theme-space body[data-page="game"] .game-start-card-inner input::placeholder {
  color: rgba(60, 92, 138, 0.58) !important;
}

@keyframes portalExplode {
  0% {
    opacity: 0;
    transform: translateZ(0) scale(.08);
    filter: brightness(2.2);
  }

  20% {
    opacity: 1;
    transform: translateZ(0) scale(.42);
  }

  45% {
    transform: translateZ(0) scale(1);
    filter: brightness(1.6);
  }

  70% {
    transform: translateZ(0) scale(1.22);
    filter: brightness(1.9);
  }

  100% {
    transform: translateZ(0) scale(6.4);
    filter: brightness(2.7);
  }
}

@keyframes portalCore {
  0% {
    inset: 6px;
    opacity: 0;
  }

  25% {
    inset: 30px;
    opacity: 1;
  }

  65% {
    inset: 65px;
    opacity: 1;
  }

  100% {
    inset: 0;
    opacity: 1;
    background: #000;
    box-shadow: inset 0 0 120px #000;
  }
}

@keyframes portalSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes portalWave {
  0% {
    opacity: 1;
    transform: scale(.2);
  }

  100% {
    opacity: 0;
    transform: scale(9);
  }
}

@keyframes portalParticle {
  0% {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(.3);
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--x), var(--y), 0) scale(1.6);
  }
}

@keyframes portalText {
  from {
    opacity: .6;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 1;
    transform: translateY(-6px) scale(1.05);
  }
}

@keyframes portalIntroExit {
  to {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }
}


@keyframes starsMove {
  from {
    background-position: 0 0, 40px 80px, 120px 40px;
  }

  to {
    background-position: 900px 500px, 700px 900px, 1000px 700px;
  }
}

@keyframes nebulaFloat {
  from {
    transform: translateY(0) scale(1);
    opacity: .65;
  }

  to {
    transform: translateY(-25px) scale(1.06);
    opacity: .95;
  }
}

.portal-enter-layer {
  position: fixed;
  inset: 0;
  z-index: 999999;
  pointer-events: none;
  overflow: hidden;
  opacity: 0;
  transition: opacity .18s ease;
  will-change: opacity;
}

.portal-enter-layer.show {
  opacity: 1;
}

.portal-enter-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--x) var(--y),
      rgba(108, 235, 255, .22) 0%,
      rgba(137, 92, 255, .20) 13%,
      rgba(5, 10, 25, .70) 42%,
      rgba(0, 2, 8, .98) 100%);
}

.portal-enter-flash {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--x) var(--y),
      rgba(255, 255, 255, .65) 0%,
      rgba(99, 235, 255, .25) 9%,
      transparent 32%);
  opacity: 0;
  animation: portalEntryFlash 1.05s ease forwards;
}

.portal-enter-core {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 96px;
  height: 96px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(.08);
  opacity: 0;
  animation: portalEntryGrow 1.18s cubic-bezier(.16, .9, .12, 1) forwards;
  filter:
    drop-shadow(0 0 14px rgba(95, 235, 255, .72))
    drop-shadow(0 0 28px rgba(137, 92, 255, .48));
  will-change: transform, opacity;
}

.portal-enter-core::before {
  content: "";
  position: absolute;
  inset: -30%;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    #69f6ff,
    #318cff,
    #715cff,
    #a855f7,
    #e879f9,
    #69f6ff
  );
  animation: portalEntrySpin .68s linear infinite;
}

.portal-enter-core::after {
  content: "";
  position: absolute;
  inset: 16%;
  border-radius: 50%;
  background:
    radial-gradient(circle,
      #000 0%,
      #020617 45%,
      #08162c 64%,
      transparent 79%);
  box-shadow:
    inset 0 0 28px #000,
    0 0 22px rgba(95, 235, 255, .36),
    0 0 44px rgba(168, 85, 247, .22);
  z-index: 2;
}

.portal-enter-ring {
  position: absolute;
  inset: 3%;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .42);
  z-index: 4;
  box-shadow:
    0 0 24px rgba(105, 246, 255, .70),
    inset 0 0 25px rgba(168, 85, 247, .52);
  animation: portalEntryWobble .5s ease-in-out infinite alternate;
}

.portal-enter-wave,
.portal-enter-wave-2 {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 95px;
  height: 95px;
  border-radius: 50%;
  border: 2px solid rgba(105, 246, 255, .75);
  box-shadow: 0 0 14px rgba(105, 246, 255, .28);
  transform: translate(-50%, -50%) scale(.2);
  opacity: 0;
}

.portal-enter-wave {
  animation: portalEntryWave 1.05s ease-out forwards;
}

.portal-enter-wave-2 {
  animation: portalEntryWave2 1.18s ease-out forwards;
}

.portal-enter-particles,
.portal-enter-lines {
  position: absolute;
  inset: 0;
}

.portal-enter-particle {
  position: absolute;
  width: var(--s);
  height: var(--s);
  left: var(--sx);
  top: var(--sy);
  border-radius: 50%;
  background: radial-gradient(circle, #fff, var(--c), transparent 70%);
  box-shadow: 0 0 14px var(--c);
  opacity: 0;
  animation: portalEntryParticle var(--d) ease-in forwards;
}

.portal-enter-line {
  position: absolute;
  left: var(--lx);
  top: var(--ly);
  width: var(--len);
  height: 2px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .95), rgba(105, 246, 255, .55), transparent);
  transform-origin: left center;
  transform: rotate(var(--rot)) scaleX(.1);
  opacity: 0;
  animation: portalEntryLine .82s ease-in forwards;
}

.portal-card-active {
  transform: scale(1.03) !important;
  z-index: 99999 !important;
  box-shadow:
    0 0 0 2px rgba(95, 235, 255, .35),
    0 0 18px rgba(95, 235, 255, .28),
    0 18px 40px rgba(0, 0, 0, .45) !important;
}

body.portal-site-transitioning .site-header,
body.portal-site-transitioning main,
body.portal-site-transitioning .footer {
  transform-origin: var(--portal-entry-x) var(--portal-entry-y);
  transform: scale(.985);
  opacity: .2;
  filter: brightness(1.06);
  transition:
    transform .72s cubic-bezier(.16, .9, .12, 1),
    opacity .72s ease,
    filter .72s ease;
}

html[data-game-entry-preset="flash"] .portal-enter-core {
  animation-duration: .88s;
  filter:
    drop-shadow(0 0 12px rgba(123, 241, 255, .72))
    drop-shadow(0 0 22px rgba(75, 140, 255, .42));
}

html[data-game-entry-preset="flash"] .portal-enter-bg {
  background:
    radial-gradient(circle at var(--x) var(--y),
      rgba(140, 238, 255, .26) 0%,
      rgba(58, 118, 255, .18) 12%,
      rgba(4, 10, 28, .66) 36%,
      rgba(0, 2, 8, .98) 100%);
}

html[data-game-entry-preset="minimal"] .portal-enter-line,
html[data-game-entry-preset="minimal"] .portal-enter-wave-2 {
  display: none;
}

html[data-game-entry-preset="minimal"] .portal-enter-bg {
  background:
    radial-gradient(circle at var(--x) var(--y),
      rgba(18, 28, 50, .15) 0%,
      rgba(4, 10, 22, .68) 26%,
      rgba(0, 2, 8, .96) 100%);
}

html[data-game-entry-preset="minimal"] .portal-enter-core {
  width: 84px;
  height: 84px;
  animation-duration: .78s;
}

@media (max-width: 768px) {
  html.portal-intro-pending .portal-intro {
    animation-duration: .55s;
    animation-delay: 1.85s;
  }

  .portal-intro .portal {
    width: 180px;
    height: 180px;
    animation-duration: 2.1s;
    box-shadow:
      0 0 18px #fff,
      0 0 34px #ff4b00,
      0 0 62px #4700ff;
  }

  .portal-intro .portal::before {
    inset: -34px;
    filter: blur(10px);
    animation-duration: 3.4s;
  }

  .portal-intro .portal::after {
    inset: 38px;
    box-shadow:
      inset 0 0 20px #000,
      0 0 22px #fff,
      0 0 42px #00eaff;
  }

  .portal-intro .wave:nth-child(2),
  .portal-intro .wave:nth-child(3),
  .portal-intro .particle {
    display: none;
  }

  .portal-intro .wave {
    width: 72px;
    height: 72px;
    animation-duration: 1.4s;
  }

  .portal-intro .text {
    bottom: 52px;
    letter-spacing: 2px;
    font-size: clamp(.95rem, 4.2vw, 1.2rem);
    animation-duration: .9s;
  }

  .portal-enter-flash,
  .portal-enter-wave,
  .portal-enter-wave-2,
  .portal-enter-particles,
  .portal-enter-lines {
    display: none;
  }

  .portal-enter-core {
    width: 74px;
    height: 74px;
    animation-duration: .34s;
    filter:
      drop-shadow(0 0 8px rgba(95, 235, 255, .5))
      drop-shadow(0 0 16px rgba(137, 92, 255, .32));
  }

  .portal-enter-core::before {
    inset: -18%;
    animation-duration: .45s;
  }

  .portal-enter-core::after {
    inset: 20%;
    box-shadow:
      inset 0 0 18px #000,
      0 0 12px rgba(95, 235, 255, .24);
  }

  .portal-enter-ring {
    inset: 8%;
    border-width: 2px;
    animation: none;
  }

  body.portal-site-transitioning .site-header,
  body.portal-site-transitioning main,
  body.portal-site-transitioning .footer {
    transform: none;
    opacity: .28;
    filter: none;
    transition: opacity .24s ease;
  }

  .portal-card-active {
    transform: none !important;
    box-shadow:
      0 0 0 2px rgba(95, 235, 255, .2),
      0 0 10px rgba(95, 235, 255, .16) !important;
  }
}

@keyframes portalEntryGrow {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.08) rotate(0deg);
  }

  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.85) rotate(70deg);
  }

  48% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(2.15) rotate(200deg);
  }

  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(7.2) rotate(420deg);
  }
}

@keyframes portalEntrySpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes portalEntryWobble {
  from {
    border-radius: 44% 56% 48% 52%;
    transform: rotate(-9deg) scale(.96);
  }

  to {
    border-radius: 58% 42% 54% 46%;
    transform: rotate(9deg) scale(1.05);
  }
}

@keyframes portalEntryFlash {
  0% {
    opacity: 0;
    transform: scale(.6);
  }

  16% {
    opacity: .9;
  }

  45% {
    opacity: .35;
  }

  100% {
    opacity: 0;
    transform: scale(1.8);
  }
}

@keyframes portalEntryWave {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.2);
  }

  20% {
    opacity: .9;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(5.8);
  }
}

@keyframes portalEntryWave2 {
  0%, 18% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.2);
  }

  35% {
    opacity: .55;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(6.8);
  }
}

@keyframes portalEntryParticle {
  0% {
    opacity: 0;
    transform: translate(0, 0) scale(.65);
  }

  12% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate(
        calc(var(--tx) - var(--sx)),
        calc(var(--ty) - var(--sy))
      )
      scale(.08);
  }
}

@keyframes portalEntryLine {
  0% {
    opacity: 0;
    transform: rotate(var(--rot)) scaleX(.1);
  }

  25% {
    opacity: .9;
  }

  100% {
    opacity: 0;
    transform: rotate(var(--rot)) scaleX(1.9);
  }
}
