@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Noto+Sans+SC:wght@400;500;700;800&display=swap");

:root {
  --bg: #fff9f4;
  --bg-soft: #fff3eb;
  --bg-page-top: #fffdfb;
  --bg-page-bottom: #fff6ef;
  --bg-glow-left: rgba(255, 157, 136, 0.38);
  --bg-glow-right: rgba(74, 199, 175, 0.22);
  --card: rgba(255, 255, 255, 0.8);
  --card-strong: #fffaf4;
  --text: #402e35;
  --text-soft: #7b6670;
  --line: rgba(95, 70, 85, 0.15);
  --primary: #ff6e81;
  --primary-strong: #ef4f68;
  --secondary: #f2a26f;
  --secondary-strong: #e4864f;
  --success: #37b189;
  --warning: #d98f3c;
  --shadow: 0 24px 58px rgba(132, 90, 111, 0.18);
  --focus-ring: rgba(255, 110, 129, 0.38);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Outfit", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, var(--bg-glow-left), transparent 28%),
    radial-gradient(circle at top right, var(--bg-glow-right), transparent 24%),
    linear-gradient(180deg, var(--bg-page-top) 0%, var(--bg) 42%, var(--bg-page-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 42vw;
  height: 42vw;
  border-radius: 50%;
  filter: blur(24px);
  pointer-events: none;
  z-index: 0;
}

body::before {
  top: -18vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(255, 156, 142, 0.32), rgba(255, 156, 142, 0));
}

body::after {
  right: -14vw;
  bottom: -20vw;
  background: radial-gradient(circle, rgba(73, 198, 174, 0.22), rgba(73, 198, 174, 0));
}

body[data-page="dashboard"][data-dashboard-mood="seeking"] {
  --bg-glow-left: rgba(255, 199, 208, 0.54);
  --bg-glow-right: rgba(243, 208, 160, 0.3);
}

body[data-page="dashboard"][data-dashboard-mood="synced"] {
  --bg-page-top: #fffaf7;
  --bg-page-bottom: #fff3ee;
  --bg-glow-left: rgba(255, 170, 197, 0.58);
  --bg-glow-right: rgba(154, 232, 199, 0.38);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.page-shell {
  width: min(1080px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 128px;
  position: relative;
  z-index: 1;
}

.topbar {
  display: grid;
  gap: 18px;
  padding: 8px 0 24px;
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(12px) saturate(1.08);
  background: linear-gradient(180deg, rgba(255, 249, 244, 0.9), rgba(255, 249, 244, 0.72), rgba(255, 249, 244, 0));
}

.brand-box,
.identity-panel {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-box {
  justify-content: center;
  text-align: center;
}

.brand-box h1,
.hero-card h2,
.section-head h3 {
  margin: 0;
}

.brand-box h1 {
  font-size: clamp(2rem, 5vw, 3.35rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  max-width: 12ch;
  text-wrap: balance;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--text-soft);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-strip::-webkit-scrollbar {
  display: none;
}

.nav-strip a {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 240, 0.8));
  padding: 11px 16px;
  font-size: 0.95rem;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text-soft);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    box-shadow 180ms ease;
}

.nav-strip a:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 110, 129, 0.48);
  box-shadow:
    0 8px 18px rgba(255, 110, 129, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.nav-strip a.active {
  background: linear-gradient(135deg, rgba(255, 110, 129, 0.24), rgba(242, 162, 111, 0.3));
  color: var(--text);
  border-color: rgba(255, 110, 129, 0.54);
  box-shadow:
    0 10px 22px rgba(220, 105, 121, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.54);
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

[data-admin-only] {
  display: none !important;
}

body[data-is-admin="true"] [data-admin-only] {
  display: inline-flex !important;
}

.identity-panel {
  justify-content: center;
  flex-wrap: wrap;
}

.identity-avatar {
  width: 84px;
  height: 84px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 247, 242, 0.94), rgba(248, 238, 227, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 12px 22px rgba(120, 88, 77, 0.08);
}

.identity-avatar::before {
  content: "";
  width: 58px;
  height: 58px;
  background: url("/pixel-avatar.svg") center/contain no-repeat;
}

.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 120;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.84);
  color: var(--text);
  box-shadow: 0 18px 36px rgba(120, 88, 77, 0.12);
  backdrop-filter: blur(18px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.theme-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 157, 179, 0.28);
}

body[data-page="dashboard"] .identity-panel,
body[data-page="games"] .brand-box,
body[data-page="games"] .identity-panel,
body[data-page="rps"] .identity-panel,
body[data-page="telepathy"] .identity-panel,
body[data-page="guess-number"] .identity-panel,
body[data-page="charades"] .identity-panel,
body[data-page="shop"] .brand-box,
body[data-page="shop"] .identity-panel,
body[data-page="records"] .brand-box,
body[data-page="records"] .identity-panel,
body[data-page="profile"] .brand-box,
body[data-page="profile"] .identity-panel,
body[data-page="admin"] .brand-box,
body[data-page="admin"] .identity-panel {
  display: none;
}

body[data-page="games"] .topbar,
body[data-page="rps"] .topbar,
body[data-page="telepathy"] .topbar,
body[data-page="guess-number"] .topbar,
body[data-page="charades"] .topbar,
body[data-page="shop"] .topbar,
body[data-page="records"] .topbar,
body[data-page="profile"] .topbar,
body[data-page="admin"] .topbar {
  gap: 0;
  padding-top: 0;
}

.layout-stack {
  display: grid;
  gap: 22px;
}

.card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-xl);
  padding: 24px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), var(--card));
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(1.05);
  isolation: isolate;
  animation: float-in 420ms ease both;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 180px;
  height: 140px;
  background: radial-gradient(circle, rgba(255, 169, 147, 0.24), transparent 70%);
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0));
  pointer-events: none;
  opacity: 0.9;
}

.hero-card {
  display: grid;
  gap: 22px;
  padding: 28px 26px;
}

.hero-copy p:last-child {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.hero-copy h2 {
  font-size: clamp(1.65rem, 4vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  font-weight: 780;
  max-width: none;
  text-wrap: pretty;
}

.hero-status {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  font-size: 0.92rem;
}

.pill.subtle,
.pill.soft {
  background: linear-gradient(135deg, rgba(255, 230, 235, 0.9), rgba(248, 238, 227, 0.88));
}

.pill.connecting {
  background: rgba(255, 245, 230, 0.95);
  color: #9c6e3f;
}

.pill.online {
  background: rgba(215, 245, 232, 0.95);
  color: #3b8f70;
}

.pill.offline {
  background: rgba(250, 240, 236, 0.95);
  color: #ae7f72;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.section-head.compact {
  margin-bottom: 14px;
}

.meta-text {
  color: var(--text-soft);
  font-size: 0.9rem;
  white-space: nowrap;
}

.score-grid,
.shop-grid,
.dual-grid {
  display: grid;
  gap: 16px;
}

.score-grid {
  grid-template-columns: 1fr;
}

.compact-status-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
}

.compact-status-player {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 243, 0.9));
  display: grid;
  gap: 12px;
}

.compact-status-player.current-user {
  border-color: rgba(255, 110, 129, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 110, 129, 0.14);
}

.compact-status-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.compact-status-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 232, 238, 0.9), rgba(255, 245, 231, 0.9));
  font-size: 1.2rem;
}

.compact-status-copy {
  display: grid;
  gap: 2px;
}

.compact-status-name,
.compact-status-presence,
.compact-status-score {
  margin: 0;
}

.compact-status-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.compact-status-presence {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.85rem;
}

.compact-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #c8b4ae;
}

.compact-status-player.online .compact-status-dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(125, 200, 171, 0.16);
}

.compact-status-score {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.compact-status-score strong {
  font-size: 1.55rem;
  line-height: 1;
  letter-spacing: -0.02em;
}

.compact-status-score span {
  color: var(--text-soft);
  font-size: 0.85rem;
}

.compact-status-center {
  min-width: 116px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 249, 243, 0.9), rgba(255, 242, 234, 0.88));
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 12px 14px;
  text-align: center;
}

.compact-status-center strong,
.compact-status-center p {
  margin: 0;
}

.compact-status-center strong {
  font-size: 0.96rem;
  letter-spacing: 0.02em;
}

.compact-status-center p {
  color: var(--text-soft);
  font-size: 0.8rem;
}

.bond-board {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 0;
}

.bond-player {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 12px;
  min-height: 248px;
  padding: 18px 14px 16px;
  border-radius: 26px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 241, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    0 18px 34px rgba(217, 169, 146, 0.08);
  text-align: center;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.bond-player.current-user {
  border-color: rgba(236, 157, 179, 0.4);
  box-shadow:
    inset 0 0 0 1px rgba(236, 157, 179, 0.14),
    0 18px 34px rgba(217, 169, 146, 0.1);
}

.bond-player.offline {
  opacity: 0.88;
}

.bond-bubble {
  position: absolute;
  top: -12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(217, 169, 146, 0.14);
  animation: bubbleFloat 2.4s ease-in-out infinite;
}

.bond-bubble.ready {
  background: linear-gradient(135deg, rgba(255, 241, 202, 0.98), rgba(255, 226, 178, 0.96));
}

.bond-bubble.online {
  background: linear-gradient(135deg, rgba(227, 255, 239, 0.98), rgba(215, 245, 232, 0.96));
}

.bond-avatar-wrap {
  position: relative;
  width: 94px;
  height: 94px;
  display: grid;
  place-items: center;
}

.bond-avatar-ring,
.bond-avatar {
  position: absolute;
  border-radius: 50%;
}

.bond-avatar-ring {
  inset: 0;
  border: 2px solid rgba(200, 180, 174, 0.45);
}

.bond-avatar {
  width: 74px;
  height: 74px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 231, 236, 0.9), rgba(247, 236, 228, 0.92));
  font-size: 2rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.bond-player.online .bond-avatar-ring {
  border-color: rgba(125, 200, 171, 0.58);
  box-shadow:
    0 0 0 10px rgba(125, 200, 171, 0.08),
    0 0 28px rgba(125, 200, 171, 0.18);
  animation: ringPulse 2.6s ease-in-out infinite;
}

.bond-player.ready .bond-avatar-wrap {
  animation: avatarFloat 2.2s ease-in-out infinite;
}

.bond-player.ready .bond-avatar-ring {
  border-color: rgba(233, 180, 76, 0.72);
  box-shadow:
    0 0 0 10px rgba(233, 180, 76, 0.1),
    0 0 28px rgba(233, 180, 76, 0.24);
}

.bond-player.ready .bond-avatar-ring::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, rgba(255, 255, 255, 0), rgba(233, 180, 76, 0.95), rgba(255, 255, 255, 0));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 0);
  animation: ringSpin 2.6s linear infinite;
}

.bond-copy {
  display: grid;
  gap: 6px;
  justify-items: center;
}

.bond-name,
.bond-status,
.bond-center-note {
  margin: 0;
}

.bond-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bond-status {
  min-height: 2.8em;
  color: var(--text-soft);
  font-size: 0.92rem;
  line-height: 1.45;
}

.bond-score {
  display: grid;
  gap: 2px;
  justify-items: center;
}

.bond-score strong {
  font-size: clamp(2rem, 4vw, 2.5rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.bond-score span {
  color: var(--text-soft);
  font-size: 0.9rem;
}

.bond-action {
  margin-top: auto;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(236, 157, 179, 0.22);
  border-radius: 999px;
  background: rgba(255, 250, 246, 0.9);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.bond-action:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 157, 179, 0.42);
}

.bond-player.poked {
  animation: pokeShake 600ms ease;
}

.bond-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 248px;
  padding-top: 24px;
  align-content: center;
  overflow: visible;
}

.bond-progress {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: clamp(240px, 64vw, 480px);
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  opacity: 0.9;
}

.bond-progress-line {
  width: calc(50% - 54px);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(236, 157, 179, 0.04), rgba(236, 157, 179, 0.34), rgba(255, 255, 255, 0));
  opacity: 0.15;
  filter: blur(0.2px);
}

.bond-progress-line.left {
  transform-origin: right center;
}

.bond-progress-line.right {
  transform-origin: left center;
  transform: scaleX(-1);
}

.bond-orb {
  position: relative;
  z-index: 1;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.88), rgba(255, 237, 243, 0.54) 32%, rgba(255, 232, 196, 0.42) 60%, rgba(255, 255, 255, 0.1) 100%),
    linear-gradient(135deg, rgba(255, 234, 240, 0.92), rgba(249, 239, 228, 0.88));
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 16px 36px rgba(236, 157, 179, 0.22),
    0 0 44px rgba(236, 157, 179, 0.14);
  transition: transform 280ms ease, box-shadow 280ms ease, background 280ms ease;
  animation: orbPulse 2.8s ease-in-out infinite;
}

.bond-orb-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bond-center-note {
  position: relative;
  z-index: 1;
  color: var(--text-soft);
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.5;
}

.bond-spark {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 226, 104, 0.9), rgba(255, 152, 186, 0.9));
  opacity: 0;
}

.bond-state-idle .bond-progress-line {
  opacity: 0.08;
}

.bond-state-ready-left .bond-progress-line.left,
.bond-state-ready-right .bond-progress-line.right,
.bond-state-linked .bond-progress-line,
.bond-state-burst .bond-progress-line {
  opacity: 0.92;
  animation: beamPulse 2.2s ease-in-out infinite;
}

.bond-state-ready-left .bond-progress-line.right,
.bond-state-ready-right .bond-progress-line.left {
  opacity: 0.18;
}

.bond-state-ready-left .bond-orb {
  transform: translateX(-18px);
}

.bond-state-ready-right .bond-orb {
  transform: translateX(18px);
}

.bond-state-linked .bond-orb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.82),
    0 16px 36px rgba(125, 200, 171, 0.24),
    0 0 54px rgba(125, 200, 171, 0.18);
}

.bond-state-burst .bond-orb {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.94), rgba(255, 248, 205, 0.8) 26%, rgba(255, 182, 193, 0.5) 56%, rgba(255, 255, 255, 0.08) 100%),
    linear-gradient(135deg, rgba(255, 240, 190, 0.98), rgba(255, 224, 237, 0.92));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 40px rgba(233, 180, 76, 0.28),
    0 0 72px rgba(255, 170, 197, 0.24);
  animation: orbBurst 900ms ease-in-out infinite alternate;
}

.bond-state-burst .bond-spark {
  opacity: 1;
}

.bond-state-burst .spark-a {
  animation: sparkBurstA 1.6s ease-out infinite;
}

.bond-state-burst .spark-b {
  animation: sparkBurstB 1.6s ease-out infinite;
}

.bond-state-burst .spark-c {
  animation: sparkBurstC 1.6s ease-out infinite;
}

.bond-state-burst .spark-d {
  animation: sparkBurstD 1.6s ease-out infinite;
}

.score-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 247, 242, 0.94)),
    #fff;
}

.score-card.current-user {
  border-color: rgba(236, 157, 179, 0.42);
  box-shadow: inset 0 0 0 1px rgba(236, 157, 179, 0.18);
}

.score-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.score-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar-badge {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 157, 179, 0.26), rgba(215, 178, 143, 0.24));
  font-size: 1.1rem;
}

.score-number {
  font-size: clamp(2rem, 3vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
  font-size: 0.95rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c8b4ae;
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(125, 200, 171, 0.15);
}

.game-card {
  display: grid;
  gap: 20px;
}

.game-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.primary-button,
.choice-button,
.redeem-button {
  border: none;
  border-radius: 18px;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.primary-button {
  min-height: 50px;
  padding: 12px 18px;
  background: linear-gradient(135deg, var(--primary), #ff9d6f);
  color: #fffdf9;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.42);
  box-shadow:
    0 18px 32px rgba(255, 110, 129, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.primary-button:hover,
.choice-button:hover,
.redeem-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled,
.choice-button:disabled,
.redeem-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: none;
  border-color: var(--primary-strong);
  box-shadow:
    0 0 0 3px var(--focus-ring),
    inset 0 0 0 1px rgba(255, 255, 255, 0.82);
}

.round-summary-box {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 245, 242, 0.92), rgba(249, 241, 233, 0.9));
  border: 1px solid var(--line);
}

.round-title {
  margin: 0 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.round-summary {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.choice-button {
  display: grid;
  gap: 8px;
  justify-items: center;
  min-height: 112px;
  padding: 18px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 239, 0.92));
  border: 1px solid rgba(236, 157, 179, 0.18);
  color: var(--text);
}

.choice-button.selected {
  border-color: rgba(236, 157, 179, 0.48);
  box-shadow: inset 0 0 0 1px rgba(236, 157, 179, 0.2);
}

.choice-emoji {
  font-size: 1.5rem;
}

.hint-text {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.timeline-list {
  list-style: none;
  display: grid;
  gap: 14px;
  margin: 0;
  padding: 0;
}

.timeline-item {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.timeline-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.timeline-title {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.timeline-meta {
  color: var(--text-soft);
  font-size: 0.92rem;
}

.timeline-desc {
  color: var(--text-soft);
  line-height: 1.6;
}

.empty-card {
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(255, 251, 247, 0.96);
  border: 1px dashed rgba(215, 178, 143, 0.38);
  color: var(--text-soft);
  text-align: center;
}

.shop-card {
  display: grid;
  gap: 14px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 243, 0.94));
  border: 1px solid var(--line);
}

.shop-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.shop-card-head h3,
.admin-card-head h3 {
  margin: 2px 0 0;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.shop-emoji {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 157, 179, 0.18), rgba(215, 178, 143, 0.24));
  font-size: 1.6rem;
}

.shop-desc {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.6;
}

.shop-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 245, 240, 0.94);
  color: var(--text-soft);
  font-size: 0.9rem;
}

.profile-summary,
.gift-card-grid {
  display: grid;
  gap: 16px;
}

.profile-records-grid {
  align-items: start;
}

.profile-records-grid .card {
  min-height: 100%;
}

.profile-panel,
.gift-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 246, 241, 0.94));
}

.profile-panel-head,
.gift-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.profile-panel-avatar,
.gift-card-emoji {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 157, 179, 0.18), rgba(215, 178, 143, 0.24));
  font-size: 1.8rem;
  flex: 0 0 auto;
}

.profile-points {
  display: grid;
  gap: 2px;
}

.profile-points strong {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
}

.profile-points span,
.profile-meta-text,
.gift-card-desc,
.gift-card-meta {
  color: var(--text-soft);
}

.profile-meta-row,
.gift-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.gift-card {
  min-height: 210px;
}

.gift-card-glow {
  position: absolute;
  inset: auto -28px -42px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(236, 157, 179, 0.22), transparent 70%);
  pointer-events: none;
}

.gift-card-desc {
  margin: 0;
  line-height: 1.65;
  max-width: 26ch;
}

.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-shop-list {
  display: grid;
  gap: 12px;
}

.admin-shop-table-head {
  display: none;
}

.admin-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 248, 243, 0.94));
  border: 1px solid var(--line);
}

.admin-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-shop-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
}

.admin-form {
  display: grid;
  gap: 16px;
}

.admin-shop-row {
  gap: 12px;
  padding: 14px;
  border-radius: 18px;
}

.admin-shop-row-grid {
  display: grid;
  gap: 10px;
}

.admin-shop-cell {
  min-width: 0;
}

.admin-field-grid {
  display: grid;
  gap: 14px;
}

.field-label {
  display: grid;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.92rem;
  min-width: 0;
}

.field-label-full {
  grid-column: 1 / -1;
}

.admin-input,
.admin-textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(236, 157, 179, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.admin-input {
  min-height: 44px;
  padding: 0 14px;
}

.admin-textarea {
  min-height: 96px;
  padding: 12px 14px;
  resize: vertical;
}

.admin-input[readonly] {
  background: rgba(246, 239, 234, 0.9);
  color: var(--text-soft);
}

.admin-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-soft);
}

.admin-mobile-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.danger-button {
  border: none;
  border-radius: 18px;
  min-height: 50px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #d4817a, #c96d62);
  color: #fffdf9;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    opacity 180ms ease;
}

.danger-button:hover {
  transform: translateY(-1px);
}

.danger-button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.redeem-button {
  min-height: 48px;
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--secondary), #e8c1a0);
  color: #fffdf9;
  font-weight: 700;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  min-width: min(88vw, 360px);
  padding: 14px 18px;
  border-radius: 999px;
  background: rgba(92, 67, 60, 0.92);
  color: #fffaf5;
  box-shadow: 0 20px 36px rgba(92, 67, 60, 0.22);
  text-align: center;
  z-index: 100;
}

.toast.warning {
  background: rgba(191, 122, 77, 0.94);
}

.toast.success {
  background: rgba(78, 146, 118, 0.95);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1017;
  --bg-soft: #111925;
  --bg-page-top: #09111a;
  --bg-page-bottom: #04080e;
  --bg-glow-left: rgba(120, 88, 138, 0.16);
  --bg-glow-right: rgba(58, 108, 128, 0.12);
  --card: rgba(14, 20, 29, 0.9);
  --card-strong: #141d29;
  --text: #eef3fb;
  --text-soft: #94a6bd;
  --line: rgba(136, 154, 179, 0.18);
  --primary: #6077a4;
  --primary-strong: #7d95c1;
  --secondary: #73614f;
  --secondary-strong: #93806d;
  --success: #4abf9d;
  --warning: #d0a26f;
  --shadow: 0 28px 64px rgba(0, 0, 0, 0.52);
  --focus-ring: rgba(125, 149, 193, 0.3);
}

html[data-theme="dark"] body::before {
  background: radial-gradient(circle, rgba(100, 73, 121, 0.22), rgba(100, 73, 121, 0));
}

html[data-theme="dark"] body::after {
  background: radial-gradient(circle, rgba(52, 100, 118, 0.18), rgba(52, 100, 118, 0));
}

html[data-theme="dark"] .nav-strip a {
  background: linear-gradient(180deg, rgba(20, 28, 40, 0.9), rgba(12, 18, 28, 0.92));
  color: var(--text-soft);
  border-color: rgba(136, 154, 179, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .nav-strip a:hover {
  border-color: rgba(125, 149, 193, 0.34);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .nav-strip a.active {
  background: linear-gradient(180deg, rgba(43, 56, 79, 0.96), rgba(24, 33, 47, 0.96));
  color: var(--text);
  border-color: rgba(125, 149, 193, 0.46);
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(125, 149, 193, 0.08);
}

html[data-theme="dark"] .topbar {
  background: linear-gradient(180deg, rgba(8, 14, 22, 0.94), rgba(8, 14, 22, 0.76), rgba(8, 14, 22, 0));
}

html[data-theme="dark"] .identity-avatar {
  background: linear-gradient(135deg, rgba(24, 31, 44, 0.98), rgba(14, 20, 29, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .card {
  border-color: rgba(136, 154, 179, 0.18);
  background:
    radial-gradient(circle at top left, rgba(88, 112, 156, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(22, 29, 42, 0.96), rgba(12, 18, 27, 0.98));
  box-shadow:
    var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .card::before {
  background: radial-gradient(circle, rgba(95, 119, 165, 0.14), transparent 70%);
}

html[data-theme="dark"] .card::after {
  background: linear-gradient(90deg, rgba(136, 154, 179, 0.24), rgba(136, 154, 179, 0));
  opacity: 0.5;
}

html[data-theme="dark"] .pill {
  background: rgba(15, 22, 31, 0.82);
  border-color: rgba(136, 154, 179, 0.14);
}

html[data-theme="dark"] .pill.subtle,
html[data-theme="dark"] .pill.soft {
  background: linear-gradient(135deg, rgba(28, 38, 54, 0.96), rgba(18, 25, 36, 0.94));
}

html[data-theme="dark"] .pill.connecting {
  background: rgba(89, 72, 45, 0.38);
  color: #dec28f;
}

html[data-theme="dark"] .pill.online {
  background: rgba(40, 83, 71, 0.42);
  color: #9fe2c3;
}

html[data-theme="dark"] .pill.offline {
  background: rgba(75, 52, 59, 0.42);
  color: #dcb4bc;
}

html[data-theme="dark"] .compact-status-player.current-user,
html[data-theme="dark"] .choose-card.active,
html[data-theme="dark"] .game-chip.active,
html[data-theme="dark"] .game-hub-card.active,
html[data-theme="dark"] .choice-button.selected {
  border-color: rgba(125, 149, 193, 0.42);
  box-shadow: inset 0 0 0 1px rgba(125, 149, 193, 0.14);
}

html[data-theme="dark"] .score-card,
html[data-theme="dark"] .shop-card,
html[data-theme="dark"] .profile-panel,
html[data-theme="dark"] .gift-card,
html[data-theme="dark"] .admin-card,
html[data-theme="dark"] .compact-status-player,
html[data-theme="dark"] .compact-status-center,
html[data-theme="dark"] .choice-button,
html[data-theme="dark"] .game-chip,
html[data-theme="dark"] .game-hub-card,
html[data-theme="dark"] .timeline-item,
html[data-theme="dark"] .charades-word-card,
html[data-theme="dark"] .charades-tip-box {
  background: linear-gradient(180deg, rgba(20, 28, 40, 0.94), rgba(12, 18, 28, 0.96));
  border-color: rgba(136, 154, 179, 0.14);
}

html[data-theme="dark"] body[data-page="dashboard"][data-dashboard-mood="synced"] {
  --bg-page-top: #0e131b;
  --bg-page-bottom: #080d13;
  --bg-glow-left: rgba(102, 84, 132, 0.18);
  --bg-glow-right: rgba(73, 143, 136, 0.18);
}

html[data-theme="dark"] .bond-player {
  background: linear-gradient(180deg, rgba(20, 28, 40, 0.94), rgba(12, 18, 28, 0.96));
  border-color: rgba(136, 154, 179, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .bond-bubble {
  border-color: rgba(136, 154, 179, 0.14);
  background: rgba(15, 22, 31, 0.94);
}

html[data-theme="dark"] .bond-bubble.ready {
  background: linear-gradient(135deg, rgba(88, 74, 48, 0.94), rgba(67, 57, 38, 0.92));
  color: #ead3a2;
}

html[data-theme="dark"] .bond-bubble.online {
  background: linear-gradient(135deg, rgba(35, 74, 63, 0.94), rgba(28, 58, 50, 0.92));
  color: #b9efd5;
}

html[data-theme="dark"] .bond-avatar {
  background: linear-gradient(135deg, rgba(31, 40, 55, 0.96), rgba(18, 26, 36, 0.96));
}

html[data-theme="dark"] .bond-avatar-ring {
  border-color: rgba(136, 154, 179, 0.14);
}

html[data-theme="dark"] .bond-progress-line {
  background: linear-gradient(90deg, rgba(96, 119, 164, 0.04), rgba(96, 119, 164, 0.36), rgba(255, 255, 255, 0));
}

html[data-theme="dark"] .bond-orb {
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.18), rgba(137, 156, 191, 0.12) 32%, rgba(69, 93, 124, 0.12) 60%, rgba(255, 255, 255, 0.02) 100%),
    linear-gradient(135deg, rgba(27, 38, 55, 0.96), rgba(15, 22, 31, 0.94));
  border-color: rgba(136, 154, 179, 0.14);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 36px rgba(0, 0, 0, 0.32),
    0 0 44px rgba(96, 119, 164, 0.12);
}

html[data-theme="dark"] .bond-state-linked .bond-orb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 36px rgba(0, 0, 0, 0.3),
    0 0 54px rgba(118, 192, 162, 0.14);
}

html[data-theme="dark"] .bond-state-burst .bond-orb {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 16px 36px rgba(0, 0, 0, 0.32),
    0 0 64px rgba(233, 180, 76, 0.18);
}

html[data-theme="dark"] .bond-action {
  background: rgba(15, 22, 31, 0.88);
  border-color: rgba(136, 154, 179, 0.14);
  color: var(--text);
}

html[data-theme="dark"] .round-summary-box,
html[data-theme="dark"] .option-prompt,
html[data-theme="dark"] .number-note,
html[data-theme="dark"] .empty-card {
  background: linear-gradient(135deg, rgba(18, 26, 37, 0.96), rgba(11, 17, 25, 0.96));
  border-color: rgba(136, 154, 179, 0.14);
}

html[data-theme="dark"] .avatar-badge,
html[data-theme="dark"] .shop-emoji,
html[data-theme="dark"] .profile-panel-avatar,
html[data-theme="dark"] .gift-card-emoji,
html[data-theme="dark"] .game-hub-emoji,
html[data-theme="dark"] .choose-emoji,
html[data-theme="dark"] .compact-status-avatar {
  background: linear-gradient(135deg, rgba(55, 72, 101, 0.88), rgba(25, 35, 50, 0.92));
}

html[data-theme="dark"] .shop-badge {
  background: rgba(15, 22, 31, 0.92);
  color: var(--text-soft);
}

html[data-theme="dark"] .admin-input,
html[data-theme="dark"] .admin-textarea,
html[data-theme="dark"] .number-input {
  background: rgba(8, 13, 20, 0.9);
  border-color: rgba(136, 154, 179, 0.16);
  color: var(--text);
}

html[data-theme="dark"] .admin-input[readonly] {
  background: rgba(13, 19, 27, 0.94);
  color: var(--text-soft);
}

html[data-theme="dark"] .admin-shop-switch {
  background: rgba(8, 13, 20, 0.9);
  border-color: rgba(136, 154, 179, 0.16);
}

html[data-theme="dark"] .status-dot {
  background: #5f6e81;
}

html[data-theme="dark"] .status-dot.online {
  box-shadow: 0 0 0 6px rgba(74, 191, 157, 0.14);
}

html[data-theme="dark"] .compact-status-dot {
  background: #5f6e81;
}

html[data-theme="dark"] .compact-status-player.online .compact-status-dot {
  box-shadow: 0 0 0 4px rgba(75, 196, 159, 0.2);
}

html[data-theme="dark"] .primary-button {
  background: linear-gradient(135deg, #5f749b, #445672);
  border-color: rgba(166, 185, 219, 0.18);
  color: #f7fbff;
  box-shadow:
    0 18px 32px rgba(20, 32, 50, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .danger-button {
  background: linear-gradient(135deg, #7c4a54, #5f363e);
  box-shadow:
    0 18px 32px rgba(44, 18, 24, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .redeem-button {
  background: linear-gradient(135deg, #6b5d4d, #504538);
  box-shadow:
    0 18px 32px rgba(34, 26, 18, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .theme-toggle {
  background: rgba(14, 21, 31, 0.9);
  border-color: rgba(136, 154, 179, 0.18);
  color: var(--text);
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .theme-toggle:hover {
  border-color: rgba(125, 149, 193, 0.4);
}

html[data-theme="dark"] .toast {
  background: rgba(11, 17, 25, 0.94);
  color: #fffaf5;
  box-shadow: 0 20px 36px rgba(0, 0, 0, 0.3);
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ringPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

@keyframes ringSpin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes avatarFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

@keyframes bubbleFloat {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

@keyframes beamPulse {
  0%,
  100% {
    filter: blur(0.2px);
    opacity: 0.68;
  }

  50% {
    filter: blur(0.6px);
    opacity: 1;
  }
}

@keyframes orbPulse {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.04);
  }
}

@keyframes orbBurst {
  0% {
    transform: scale(1);
  }

  100% {
    transform: scale(1.08);
  }
}

@keyframes pokeShake {
  0%,
  100% {
    transform: translateX(0);
  }

  20% {
    transform: translateX(-5px);
  }

  40% {
    transform: translateX(5px);
  }

  60% {
    transform: translateX(-4px);
  }

  80% {
    transform: translateX(4px);
  }
}

@keyframes sparkBurstA {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    transform: translate(18px, -34px) scale(1);
    opacity: 0;
  }
}

@keyframes sparkBurstB {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    transform: translate(36px, 6px) scale(1);
    opacity: 0;
  }
}

@keyframes sparkBurstC {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    transform: translate(-34px, -20px) scale(1);
    opacity: 0;
  }
}

@keyframes sparkBurstD {
  0% {
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
  }

  25% {
    opacity: 1;
  }

  100% {
    transform: translate(-16px, 30px) scale(1);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .bond-player.poked {
    animation: none !important;
  }
}

@media (min-width: 720px) {
  .page-shell {
    width: min(1160px, calc(100% - 40px));
    padding-top: 28px;
    padding-bottom: 88px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand brand"
      "nav identity";
    align-items: center;
  }

  body[data-page="games"] .topbar,
  body[data-page="rps"] .topbar,
  body[data-page="telepathy"] .topbar,
  body[data-page="guess-number"] .topbar,
  body[data-page="charades"] .topbar,
  body[data-page="shop"] .topbar,
  body[data-page="records"] .topbar,
  body[data-page="profile"] .topbar,
  body[data-page="admin"] .topbar {
    grid-template-columns: 1fr;
    grid-template-areas: "nav";
  }

  .brand-box {
    grid-area: brand;
  }

  .hero-card {
    grid-template-columns: minmax(0, 1.3fr) auto;
    align-items: center;
  }

  .score-grid {
    grid-template-columns: 1fr;
  }

  .dual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gift-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-strip {
    grid-area: nav;
    justify-self: center;
    justify-content: center;
    position: static;
    width: fit-content;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, 0.82);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 246, 240, 0.56));
    box-shadow:
      0 12px 30px rgba(132, 90, 111, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.76);
    padding: 0;
    backdrop-filter: blur(14px) saturate(1.08);
  }

  .identity-panel {
    grid-area: identity;
    justify-self: end;
  }

  .nav-strip a {
    flex: 0 0 auto;
    min-height: auto;
    padding: 12px 18px;
  }

  .admin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-shop-list {
    grid-column: 1 / -1;
  }

  .admin-shop-table-head {
    display: grid;
    grid-template-columns: 1.2fr 1fr 1fr 0.7fr 0.7fr 0.7fr 1fr 1.2fr 0.7fr 0.9fr;
    gap: 10px;
    padding: 0 14px;
    color: var(--text-soft);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
  }

  .admin-shop-row {
    grid-template-columns: 1fr auto;
    align-items: center;
  }

  .admin-shop-row-grid {
    grid-template-columns: 1.2fr 1fr 1fr 0.7fr 0.7fr 0.7fr 1fr 1.2fr 0.7fr;
    align-items: center;
  }

  .admin-shop-row .admin-mobile-label {
    display: none;
  }

  .admin-shop-row .admin-input {
    min-height: 38px;
    border-radius: 12px;
    font-size: 0.9rem;
  }

  .admin-shop-switch {
    min-height: 38px;
    justify-content: flex-start;
    border: 1px solid rgba(236, 157, 179, 0.22);
    border-radius: 12px;
    padding: 0 12px;
    background: rgba(255, 255, 255, 0.92);
  }

  .admin-actions {
    flex-direction: column;
    width: 112px;
  }

  .admin-actions .primary-button.compact,
  .admin-actions .danger-button {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
  }

  .admin-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .card {
    padding: 26px;
  }

  .bond-board {
    grid-template-columns: minmax(0, 1fr) 132px minmax(0, 1fr);
    gap: 18px;
  }

  .bond-stage,
  .bond-player {
    min-height: 274px;
  }

  .bond-progress {
    width: clamp(320px, 52vw, 560px);
  }

  .bond-orb {
    width: 110px;
    height: 110px;
  }
}

@media (min-width: 1100px) {
  body:not([data-page="choose"]) .page-shell {
    width: min(1380px, calc(100% - 56px));
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding-top: 24px;
  }

  body:not([data-page="choose"]) .topbar {
    position: sticky;
    top: 24px;
    align-self: start;
    min-height: calc(100vh - 48px);
    padding: 24px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav"
      "identity";
    align-content: start;
    gap: 18px;
    backdrop-filter: blur(20px) saturate(1.05);
    background: linear-gradient(180deg, var(--card-strong), var(--card));
    box-shadow: var(--shadow);
  }

  body:not([data-page="choose"]) .layout-stack {
    min-width: 0;
  }

  body:not([data-page="choose"]) .brand-box {
    display: flex;
    justify-content: flex-start;
    text-align: left;
  }

  body:not([data-page="choose"]) .brand-box h1 {
    max-width: none;
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    line-height: 1.06;
    letter-spacing: -0.04em;
  }

  body:not([data-page="choose"]) .nav-strip {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    justify-self: stretch;
    gap: 10px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    overflow: visible;
  }

  body:not([data-page="choose"]) .nav-strip a {
    width: 100%;
    min-height: 52px;
    padding: 14px 16px;
    border-radius: 18px;
    justify-content: flex-start;
    box-shadow: none;
  }

  body:not([data-page="choose"]) .nav-strip a:hover {
    transform: translateX(2px);
  }

  body:not([data-page="choose"]) .nav-strip a.active {
    transform: translateX(4px);
  }

  body:not([data-page="choose"]) .identity-panel {
    margin-top: auto;
    justify-content: flex-start;
  }
}

.choose-shell {
  display: flex;
  align-items: center;
  min-height: 100vh;
}

.choose-layout {
  width: 100%;
}

.choose-hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 0.96;
  letter-spacing: -0.05em;
}

.choose-grid {
  display: grid;
  gap: 20px;
}

.choose-card {
  width: 100%;
  text-align: left;
  display: grid;
  gap: 16px;
  cursor: pointer;
}

.choose-card.active {
  border-color: rgba(236, 157, 179, 0.42);
  box-shadow: inset 0 0 0 1px rgba(236, 157, 179, 0.18);
}

.choose-card h2 {
  margin: 0;
}

.choose-card p:last-child {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.choose-emoji {
  width: 56px;
  height: 56px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 157, 179, 0.2), rgba(215, 178, 143, 0.24));
  font-size: 1.6rem;
}

.game-selector,
.game-panel,
.option-stack,
.number-form {
  display: grid;
  gap: 16px;
}

.game-selector {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.game-chip {
  border: 1px solid rgba(236, 157, 179, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 239, 0.92));
  min-height: 122px;
  padding: 16px 14px;
  display: grid;
  gap: 10px;
  justify-items: start;
  color: var(--text);
  text-align: left;
}

.game-chip.active {
  border-color: rgba(236, 157, 179, 0.46);
  box-shadow: inset 0 0 0 1px rgba(236, 157, 179, 0.18);
}

.game-chip-emoji {
  font-size: 1.4rem;
}

.game-chip-copy {
  display: grid;
  gap: 4px;
}

.game-chip-copy small {
  color: var(--text-soft);
  line-height: 1.5;
}

.option-prompt,
.number-note {
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 245, 242, 0.92), rgba(249, 241, 233, 0.9));
  border: 1px solid var(--line);
  color: var(--text);
  line-height: 1.7;
}

.game-link-card .round-summary {
  margin: 0;
}

.game-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.game-hub-card {
  display: grid;
  gap: 12px;
  padding: 20px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(236, 157, 179, 0.18);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 244, 239, 0.92));
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.game-hub-card:hover {
  transform: translateY(-1px);
  border-color: rgba(236, 157, 179, 0.38);
}

.game-hub-card.active {
  border-color: rgba(236, 157, 179, 0.48);
  box-shadow: inset 0 0 0 1px rgba(236, 157, 179, 0.18);
}

.game-hub-emoji {
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(236, 157, 179, 0.18), rgba(215, 178, 143, 0.24));
  font-size: 1.7rem;
}

.game-hub-copy {
  display: grid;
  gap: 4px;
}

.game-hub-copy strong {
  font-size: 1.08rem;
}

.game-hub-copy small,
.game-hub-arrow {
  color: var(--text-soft);
  line-height: 1.6;
}

.game-hub-arrow {
  font-size: 0.92rem;
  font-weight: 700;
}

.charades-card {
  display: grid;
  gap: 16px;
}

.charades-word-card,
.charades-tip-box {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(255, 245, 242, 0.92), rgba(249, 241, 233, 0.9));
  border: 1px solid var(--line);
}

.charades-word-card h3 {
  margin: 4px 0 0;
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: -0.03em;
}

.charades-word-card.spotlight {
  background:
    radial-gradient(circle at top right, rgba(236, 157, 179, 0.18), transparent 40%),
    linear-gradient(135deg, rgba(255, 245, 242, 0.96), rgba(249, 241, 233, 0.94));
}

.charades-meta,
.charades-tip-box p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.7;
}

.charades-tip-box {
  display: grid;
  gap: 12px;
}

.charades-input-row {
  display: flex;
  gap: 12px;
}

.charades-input {
  flex: 1 1 auto;
}

.option-grid {
  display: grid;
  gap: 12px;
}

.option-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.text-choice {
  justify-items: start;
  text-align: left;
  min-height: 74px;
}

.number-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.number-input {
  flex: 1 1 180px;
  min-height: 50px;
  padding: 0 16px;
  border-radius: 16px;
  border: 1px solid rgba(236, 157, 179, 0.22);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  font: inherit;
}

.primary-button.compact {
  min-height: 48px;
  padding: 0 18px;
}

@media (max-width: 719px) {
  .topbar {
    position: static;
    backdrop-filter: none;
    background: transparent;
  }

  .theme-toggle {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .topbar {
    padding-top: 4px;
    padding-bottom: 8px;
  }

  .brand-box h1 {
    max-width: 9ch;
  }

  .hero-card {
    padding: 24px 20px;
  }

  .hero-copy h2 {
    max-width: none;
  }

  .section-head {
    gap: 14px;
  }

  .compact-status-board {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .compact-status-player {
    padding: 12px;
    gap: 10px;
  }

  .compact-status-avatar {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .compact-status-name {
    font-size: 0.95rem;
  }

  .compact-status-score strong {
    font-size: 1.3rem;
  }

  .compact-status-center {
    grid-column: 1 / -1;
    min-width: 0;
    border-radius: 14px;
    padding: 10px 12px;
  }

  .bond-board {
    grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr);
    gap: 10px;
  }

  .bond-player,
  .bond-stage {
    min-height: 216px;
  }

  .bond-player {
    padding: 18px 10px 14px;
    gap: 10px;
  }

  .bond-bubble {
    min-height: 30px;
    padding: 0 10px;
    font-size: 0.76rem;
  }

  .bond-avatar-wrap {
    width: 74px;
    height: 74px;
  }

  .bond-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.65rem;
  }

  .bond-name {
    font-size: 1rem;
  }

  .bond-status {
    min-height: 3.3em;
    font-size: 0.82rem;
  }

  .bond-score strong {
    font-size: 1.65rem;
  }

  .bond-action {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .bond-progress {
    width: calc(100vw - 120px);
    max-width: 320px;
  }

  .bond-progress-line {
    width: calc(50% - 42px);
    height: 10px;
  }

  .bond-orb {
    width: 72px;
    height: 72px;
  }

  .bond-orb-label {
    font-size: 0.76rem;
  }

  .bond-center-note {
    font-size: 0.78rem;
  }

  .identity-panel {
    justify-content: center;
  }

  .nav-strip {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: max(16px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 90;
    width: min(calc(100% - 24px), 360px);
    padding: 8px;
    gap: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 245, 237, 0.64));
    box-shadow:
      0 24px 48px rgba(132, 90, 111, 0.16),
      inset 0 1px 0 rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(24px) saturate(1.12);
  }

  .nav-strip a {
    flex: 1 1 0;
    min-width: 0;
    min-height: 54px;
    padding: 10px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
  }

  .nav-strip a:hover {
    transform: none;
    border-color: transparent;
  }

  .nav-strip a.active {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 240, 231, 0.96));
    border-color: rgba(255, 110, 129, 0.42);
    box-shadow:
      0 14px 28px rgba(132, 90, 111, 0.2),
      0 4px 10px rgba(255, 255, 255, 0.32),
      inset 0 1px 0 rgba(255, 255, 255, 0.96);
    color: #4a3a45;
    transform: translateY(-2px) scale(1.02);
  }

  .game-selector,
  .game-hub-grid,
  .option-grid.two-col,
  .choose-grid,
  .admin-grid,
  .admin-field-grid {
    grid-template-columns: 1fr;
  }

  .charades-input-row,
  .number-controls {
    flex-direction: column;
  }

  html[data-theme="dark"] .nav-strip {
    border-color: rgba(136, 154, 179, 0.18);
    background: linear-gradient(180deg, rgba(15, 22, 31, 0.9), rgba(10, 16, 24, 0.88));
    box-shadow:
      0 24px 48px rgba(0, 0, 0, 0.42),
      inset 0 1px 0 rgba(255, 255, 255, 0.05);
  }

  html[data-theme="dark"] .nav-strip a.active {
    background: linear-gradient(180deg, rgba(44, 57, 79, 0.98), rgba(23, 31, 44, 0.96));
    border-color: rgba(125, 149, 193, 0.42);
    box-shadow:
      0 14px 28px rgba(0, 0, 0, 0.28),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--text);
  }
}

@media (min-width: 720px) {
  .choose-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
