/* ============================================================
   开玩！聚会小游戏 — 全局样式
   风格：街头海报 / 卡通贴纸 / 涂鸦
   ============================================================ */

:root {
  /* 配色 */
  --c-black: #171717;
  --c-cream: #FFFAF0;
  --c-paper: #F4F1E9;
  --c-purple: #8C73FF;
  --c-yellow: #FFDB4D;
  --c-pink: #FF7BAC;
  --c-green: #8FE36A;
  --c-blue: #75D6FF;
  --c-orange: #FF835F;
  --c-red: #FF5C5C;

  /* 描边与阴影 */
  --border: 3px solid var(--c-black);
  --border-thick: 4px solid var(--c-black);
  --shadow-hard: 6px 6px 0 0 var(--c-black);
  --shadow-sm: 3px 3px 0 0 var(--c-black);
  --shadow-lg: 8px 8px 0 0 var(--c-black);

  /* 尺寸 */
  --nav-h: 84px;
  --radius: 22px;
  --radius-lg: 32px;
  --radius-sm: 14px;

  /* 字体 */
  --font-base: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
    "Helvetica Neue", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --container: 1200px;
}

/* ============ 重置 ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  font-size: 16px;
  line-height: 1.6;
  color: var(--c-black);
  background-color: var(--c-paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(140, 115, 255, 0.08) 0, transparent 42%),
    radial-gradient(circle at 88% 82%, rgba(255, 219, 77, 0.10) 0, transparent 42%);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input {
  font-family: inherit;
}

[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid var(--c-purple);
  outline-offset: 3px;
  border-radius: 6px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============ 通用按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--c-black);
  background: var(--c-cream);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active {
  transform: translate(3px, 3px);
  box-shadow: 0 0 0 0 var(--c-black);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  background: var(--c-yellow);
  box-shadow: var(--shadow-hard);
  font-size: 17px;
  padding: 14px 26px;
}

.btn-ghost {
  background: var(--c-cream);
}

.btn-soft {
  background: var(--c-paper);
  color: var(--c-black);
}

.btn-random {
  background: var(--c-cream);
  font-size: 15px;
  padding: 10px 18px;
  min-height: 46px;
}

.btn-random .icon-shuffle {
  width: 20px;
  height: 20px;
  color: var(--c-black);
}

.btn-scan {
  background: var(--c-blue);
  font-size: 15px;
  padding: 10px 18px;
  min-height: 46px;
}

.btn-join {
  background: var(--c-green);
  font-size: 15px;
  padding: 10px 18px;
  min-height: 46px;
}

.btn-party {
  background: var(--c-cream);
  font-size: 17px;
  padding: 14px 24px;
  box-shadow: var(--shadow-hard);
}

.btn-stop {
  width: 100%;
  background: var(--c-black);
  color: var(--c-cream);
  font-size: 16px;
  margin-top: 18px;
}

/* ============ 顶部导航 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: var(--c-cream);
  border-bottom: var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: var(--c-yellow);
  border: var(--border);
  border-radius: 14px;
  font-size: 24px;
  font-weight: 900;
  transform: rotate(-6deg);
  box-shadow: var(--shadow-sm);
}

.brand-mark.sm {
  width: 38px;
  height: 38px;
  font-size: 20px;
  border-radius: 11px;
}

.brand-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
}

.nav-link {
  font-size: 17px;
  font-weight: 700;
  padding: 8px 4px;
  position: relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2px;
  width: 0;
  height: 3px;
  background: var(--c-purple);
  border-radius: 3px;
  transition: width 0.18s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after {
  width: 100%;
}

.nav .btn-random {
  margin-left: 8px;
}

/* ============ Hero ============ */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px 0;
}

.hero-card {
  position: relative;
  display: grid;
  grid-template-columns: 58% 42%;
  gap: 18px;
  background: var(--c-purple);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 40px 100px;
  overflow: hidden;
}

.hero-left {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 800;
  border: 2.5px solid var(--c-black);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
}

.tag-green {
  background: var(--c-green);
}

.hero-title {
  margin: 0;
  font-size: 76px;
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -1px;
  color: var(--c-black);
}

.hero-title .line-1,
.hero-title .line-2 {
  display: block;
}

.hero-title .line-2 {
  margin-top: 2px;
}

.hero-title .highlight {
  color: var(--c-yellow);
  -webkit-text-stroke: 2.5px var(--c-black);
  text-shadow: 4px 4px 0 var(--c-black);
  padding: 0 2px;
}

.hero-desc {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--c-cream);
  max-width: 460px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-people {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatars {
  display: flex;
}

.ava {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--c-cream);
  border: 2.5px solid var(--c-black);
  border-radius: 999px;
  font-size: 20px;
  box-shadow: var(--shadow-sm);
}

.ava-1 { transform: translateX(0); z-index: 4; }
.ava-2 { transform: translateX(-10px); z-index: 3; background: var(--c-yellow); }
.ava-3 { transform: translateX(-20px); z-index: 2; background: var(--c-pink); }
.ava-4 { transform: translateX(-30px); z-index: 1; background: var(--c-green); }

.hero-people-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-cream);
}

/* Hero 右侧手机 */
.hero-right {
  display: flex;
  align-items: center;
  justify-content: center;
}

.phone-stage {
  position: relative;
  width: 100%;
  max-width: 280px;
  aspect-ratio: 9 / 16;
}

.phone {
  position: absolute;
  inset: 0;
  background: var(--c-black);
  border: var(--border-thick);
  border-radius: 30px;
  box-shadow: var(--shadow-lg);
  transform: rotate(5deg);
  padding: 10px;
}

.phone-screen {
  width: 100%;
  height: 100%;
  background: var(--c-cream);
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 12px;
  gap: 10px;
  text-align: center;
}

.phone-topbar {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  font-weight: 800;
}

.phone-room {
  background: var(--c-black);
  color: var(--c-cream);
  padding: 4px 10px;
  border-radius: 999px;
}

.phone-dot {
  color: var(--c-green);
  font-size: 14px;
}

.phone-emoji {
  font-size: 52px;
  line-height: 1;
  margin-top: 6px;
}

.phone-turn {
  font-size: 14px;
  font-weight: 800;
}

.phone-prompt {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  padding: 8px 10px;
  background: var(--c-yellow);
  border: 2px solid var(--c-black);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.phone-timer {
  margin-top: auto;
  font-size: 28px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--c-purple);
}

/* Hero 贴纸 */
.sticker {
  position: absolute;
  font-weight: 900;
  background: var(--c-cream);
  border: 2.5px solid var(--c-black);
  border-radius: 10px;
  padding: 4px 10px;
  box-shadow: var(--shadow-sm);
  z-index: 5;
}

.sticker-hey {
  top: -6%;
  left: -8%;
  background: var(--c-pink);
  color: var(--c-cream);
  font-size: 16px;
  transform: rotate(-12deg);
}

.sticker-cheat {
  top: 14%;
  right: -10%;
  background: var(--c-yellow);
  font-size: 12px;
  transform: rotate(8deg);
}

.sticker-haha {
  bottom: 10%;
  left: -12%;
  background: var(--c-green);
  font-size: 12px;
  transform: rotate(-6deg);
}

.sticker-sparkle {
  bottom: -2%;
  right: 8%;
  background: transparent;
  border: none;
  box-shadow: none;
  font-size: 22px;
  color: var(--c-yellow);
  transform: rotate(15deg);
}

/* ============ 加入房间条 ============ */
.join-bar {
  position: relative;
  max-width: 880px;
  margin: -56px auto 0;
  background: var(--c-cream);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hard);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 16px;
  z-index: 2;
}

.join-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.join-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--c-red);
  border: 2px solid var(--c-black);
  flex-shrink: 0;
  animation: pulse-dot 1.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.join-text {
  display: flex;
  flex-direction: column;
}

.join-title {
  font-size: 16px;
  font-weight: 800;
}

.join-sub {
  font-size: 14px;
  color: #555;
}

.join-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.room-input {
  width: 150px;
  min-height: 46px;
  padding: 0 14px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 8px;
  text-align: center;
  color: var(--c-black);
  background: var(--c-paper);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.08s ease, transform 0.08s ease;
}

.room-input::placeholder {
  font-size: 13px;
  letter-spacing: 0;
  font-weight: 600;
  color: #999;
}

.room-input:focus {
  outline: none;
  border-color: var(--c-purple);
  box-shadow: 0 0 0 3px rgba(140, 115, 255, 0.3), var(--shadow-sm);
}

.join-error {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  color: var(--c-red);
  background: #ffe5e5;
  border: 2px solid var(--c-red);
  border-radius: 10px;
}

/* ============ 区块标题 ============ */
.section-head {
  text-align: center;
  margin-bottom: 32px;
}

.section-sticker {
  display: inline-block;
  background: var(--c-black);
  color: var(--c-yellow);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 5px 14px;
  border-radius: 6px;
  transform: rotate(-2deg);
  margin-bottom: 12px;
}

.section-title {
  margin: 0 0 8px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.5px;
}

.section-desc {
  margin: 0;
  font-size: 16px;
  color: #555;
  font-weight: 500;
}

/* ============ 游戏库 ============ */
.games {
  max-width: var(--container);
  margin: 64px auto 0;
  padding: 0 24px;
}

.filter-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.chip {
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 800;
  background: var(--c-cream);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  min-height: 44px;
}

.chip:active {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 var(--c-black);
}

.chip.is-active {
  background: var(--c-black);
  color: var(--c-yellow);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

/* 游戏卡片 */
.game-card {
  display: flex;
  flex-direction: column;
  background: var(--c-cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.game-card:hover {
  transform: translate(-3px, -3px) rotate(-0.5deg);
  box-shadow: 10px 10px 0 0 var(--c-black);
}

.game-card:active {
  transform: translate(2px, 2px);
  box-shadow: var(--shadow-sm);
}

.game-illustration {
  position: relative;
  height: 130px;
  display: grid;
  place-items: center;
  border-bottom: var(--border);
  overflow: hidden;
}

.game-illustration .game-emoji {
  font-size: 60px;
  filter: drop-shadow(2px 2px 0 var(--c-black));
}

.game-num {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--c-black);
  color: var(--c-cream);
  font-size: 11px;
  font-weight: 900;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 1px;
}

.game-cat-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--c-cream);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px;
  border: 2px solid var(--c-black);
  border-radius: 999px;
}

.game-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.game-name {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.game-intro {
  margin: 0;
  font-size: 14px;
  color: #444;
  font-weight: 500;
  line-height: 1.5;
}

.game-meta {
  display: flex;
  gap: 14px;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #555;
}

.game-meta span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.game-tag-inline {
  display: inline-block;
  background: var(--c-yellow);
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border: 2px solid var(--c-black);
  border-radius: 999px;
}

.game-card-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  font-size: 15px;
  font-weight: 800;
  background: var(--c-yellow);
  border: 2.5px solid var(--c-black);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.game-card:active .game-card-cta {
  transform: translate(2px, 2px);
  box-shadow: 0 0 0 0 var(--c-black);
}

/* 卡片插画背景色变体 */
.illu-purple { background: var(--c-purple); }
.illu-yellow { background: var(--c-yellow); }
.illu-pink   { background: var(--c-pink); }
.illu-green  { background: var(--c-green); }
.illu-blue   { background: var(--c-blue); }
.illu-orange { background: var(--c-orange); }

/* ============ 使用步骤 ============ */
.steps {
  max-width: var(--container);
  margin: 80px auto 0;
  padding: 0 24px;
}

.step-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.step-card {
  position: relative;
  background: var(--c-cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hard);
  padding: 28px 24px;
  text-align: center;
  overflow: hidden;
}

.step-card:nth-child(1) { transform: rotate(-1deg); }
.step-card:nth-child(2) { transform: rotate(0.6deg); }
.step-card:nth-child(3) { transform: rotate(-0.5deg); }

.step-emoji {
  font-size: 44px;
  filter: drop-shadow(2px 2px 0 var(--c-black));
}

.step-title {
  margin: 12px 0 6px;
  font-size: 22px;
  font-weight: 900;
}

.step-desc {
  margin: 0;
  font-size: 15px;
  color: #555;
  font-weight: 500;
}

.step-num {
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 32px;
  font-weight: 900;
  color: var(--c-paper);
  -webkit-text-stroke: 2px var(--c-black);
  text-shadow: 2px 2px 0 var(--c-black);
}

/* ============ 聚会气氛组横幅 ============ */
.party-banner-wrap {
  max-width: var(--container);
  margin: 80px auto 0;
  padding: 0 24px;
}

.party-banner {
  position: relative;
  background: var(--c-pink);
  border: var(--border-thick);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 44px 48px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  overflow: hidden;
}

.party-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-6deg);
  font-size: 90px;
  font-weight: 900;
  color: rgba(255, 255, 255, 0.25);
  white-space: nowrap;
  letter-spacing: 4px;
  pointer-events: none;
  z-index: 0;
}

.party-left {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
}

.party-sub {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--c-cream);
  background: var(--c-black);
  padding: 5px 12px;
  border-radius: 999px;
}

.party-title {
  margin: 0;
  font-size: 42px;
  font-weight: 900;
  line-height: 1.1;
  color: var(--c-black);
}

.party-right {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
}

.party-face {
  display: grid;
  place-items: center;
  width: 110px;
  height: 110px;
  background: var(--c-blue);
  border: var(--border-thick);
  border-radius: 999px;
  font-size: 56px;
  box-shadow: var(--shadow-hard);
  animation: party-bounce 2.2s ease-in-out infinite;
}

@keyframes party-bounce {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-8px) rotate(4deg); }
}

/* ============ 页脚 ============ */
.site-footer {
  margin-top: 80px;
  background: var(--c-black);
  color: var(--c-cream);
  border-top: var(--border-thick);
}

.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
}

.footer-brand .brand-mark {
  background: var(--c-yellow);
  color: var(--c-black);
}

.footer-tag {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--c-paper);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-link {
  font-size: 15px;
  font-weight: 800;
  padding: 8px 16px;
  background: var(--c-yellow);
  color: var(--c-black);
  border: 2.5px solid var(--c-cream);
  border-radius: 999px;
}

.footer-copy {
  font-size: 14px;
  font-weight: 600;
  color: #999;
}

/* ============ 弹窗通用 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(23, 23, 23, 0.62);
  backdrop-filter: blur(2px);
}

.modal-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  background: var(--c-cream);
  border: var(--border-thick);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  padding: 24px 22px;
  animation: modal-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modal-in {
  from { transform: translateY(16px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  font-size: 24px;
  font-weight: 900;
  background: var(--c-cream);
  border: var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  display: grid;
  place-items: center;
  z-index: 2;
}

.modal-close:active {
  transform: translate(2px, 2px);
  box-shadow: none;
}

.modal-title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 900;
}

.modal-sub {
  margin: 0 0 18px;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

/* ============ 扫码弹窗 ============ */
.scan-stage {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  background: var(--c-black);
  border: var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
}

.scan-video,
.scan-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-canvas { display: none; }

.scan-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--c-cream);
}

.scan-frame {
  width: 200px;
  height: 200px;
  border: 3px solid var(--c-yellow);
  border-radius: 18px;
  position: relative;
  animation: scan-pulse 1.6s ease-in-out infinite;
}

.scan-frame::before,
.scan-frame::after {
  content: "";
  position: absolute;
  background: var(--c-yellow);
}

.scan-frame::before {
  top: 50%;
  left: 8%;
  right: 8%;
  height: 2px;
  animation: scan-line 2s linear infinite;
}

@keyframes scan-line {
  0% { top: 12%; }
  50% { top: 88%; }
  100% { top: 12%; }
}

@keyframes scan-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 219, 77, 0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255, 219, 77, 0); }
}

.scan-hint {
  font-size: 14px;
  font-weight: 600;
}

.scan-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.scan-note {
  margin: 12px 0 0;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  background: var(--c-paper);
  border: 2px solid var(--c-black);
  border-radius: 10px;
}

.scan-note.is-error { color: var(--c-red); background: #ffe5e5; }
.scan-note.is-ok    { color: #1a7a3a; background: #e7f8e7; }

/* ============ 音效台 ============ */
.sound-panel {
  max-width: 620px;
}

.sound-head {
  text-align: center;
  margin-bottom: 18px;
}

.sound-sticker {
  display: inline-block;
  background: var(--c-yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 5px 12px;
  border: 2px solid var(--c-black);
  border-radius: 6px;
  transform: rotate(-2deg);
  margin-bottom: 8px;
}

.sound-title {
  margin: 0;
  font-size: 26px;
  font-weight: 900;
}

.sound-sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: #555;
  font-weight: 500;
}

.now-playing {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--c-black);
  color: var(--c-cream);
  border: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 18px;
}

.np-emoji {
  font-size: 36px;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  background: var(--c-purple);
  border: 2.5px solid var(--c-cream);
  border-radius: 14px;
  flex-shrink: 0;
}

.np-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.np-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--c-yellow);
  letter-spacing: 1px;
}

.np-name {
  font-size: 18px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.np-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 32px;
  flex-shrink: 0;
}

.np-bars span {
  width: 4px;
  height: 8px;
  background: var(--c-yellow);
  border-radius: 2px;
}

.now-playing.is-playing .np-bars span {
  animation: bar-bounce 0.6s ease-in-out infinite;
}

.now-playing.is-playing .np-bars span:nth-child(2) { animation-delay: 0.1s; }
.now-playing.is-playing .np-bars span:nth-child(3) { animation-delay: 0.2s; }
.now-playing.is-playing .np-bars span:nth-child(4) { animation-delay: 0.3s; }
.now-playing.is-playing .np-bars span:nth-child(5) { animation-delay: 0.4s; }

@keyframes bar-bounce {
  0%, 100% { height: 8px; }
  50% { height: 28px; }
}

.now-playing.is-playing .np-emoji {
  animation: emoji-pop 0.5s ease;
}

@keyframes emoji-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25) rotate(-8deg); }
  100% { transform: scale(1); }
}

.sound-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.sound-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 12px;
  background: var(--c-cream);
  border: var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 800;
  transition: transform 0.08s ease, box-shadow 0.08s ease, background 0.15s ease;
  min-height: 88px;
}

.sound-btn:active {
  transform: translate(3px, 3px);
  box-shadow: none;
}

.sound-btn .sb-emoji {
  font-size: 30px;
  line-height: 1;
}

.sound-btn .sb-name {
  font-size: 14px;
}

.sound-btn.is-woodfish {
  background: var(--c-yellow);
}

.sound-btn .sb-count {
  font-size: 12px;
  font-weight: 900;
  color: var(--c-red);
}

.sound-btn.is-woodfish .sb-emoji {
  transition: transform 0.12s ease;
}

.sound-btn.is-woodfish.knock .sb-emoji {
  animation: knock 0.2s ease;
}

@keyframes knock {
  0% { transform: scale(1) rotate(0); }
  50% { transform: scale(0.85) rotate(-10deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ============ 响应式 ============ */

/* 平板 1024px */
@media (max-width: 1024px) {
  :root { --container: 100%; }

  .hero-card {
    padding: 32px 28px 90px;
  }

  .hero-title { font-size: 60px; }

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

/* 768px */
@media (max-width: 768px) {
  .nav-inner { padding: 0 18px; gap: 10px; }
  .nav-links { display: none; }

  .hero { padding: 20px 16px 0; }

  .hero-card {
    grid-template-columns: 58% 42%;
    gap: 8px;
    padding: 24px 20px 90px;
  }

  .hero-title { font-size: 38px; letter-spacing: -0.5px; }
  .hero-title .highlight {
    -webkit-text-stroke: 1px var(--c-black);
    paint-order: stroke fill;
    text-shadow: 1.5px 1.5px 0 var(--c-black);
    padding-inline: 1px;
  }
  .hero-desc { font-size: 14px; }

  .tag { font-size: 12px; padding: 5px 11px; }

  .ava { width: 34px; height: 34px; font-size: 16px; }
  .hero-people-text { font-size: 12px; }

  .phone-stage { max-width: 180px; }
  .phone-emoji { font-size: 38px; }
  .phone-timer { font-size: 22px; }

  .sticker-hey { font-size: 13px; }
  .sticker-cheat, .sticker-haha { font-size: 10px; }

  .join-bar {
    grid-template-columns: 1fr;
    padding: 16px;
    margin-top: -50px;
  }

  .join-right {
    flex-wrap: wrap;
  }

  .room-input { width: 100%; flex: 1 1 100%; }

  .section-title { font-size: 30px; }
  .games { margin-top: 48px; padding: 0 16px; }

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

  .steps { margin-top: 56px; padding: 0 16px; }
  .step-grid { grid-template-columns: 1fr; }
  .step-card { transform: none !important; }
  .step-card:nth-child(odd) { transform: rotate(-0.6deg); }

  .party-banner-wrap { margin-top: 56px; padding: 0 16px; }
  .party-banner {
    grid-template-columns: 1fr auto;
    padding: 28px 22px;
    gap: 14px;
  }
  .party-title { font-size: 28px; }
  .party-face { width: 80px; height: 80px; font-size: 40px; }
  .party-bg { font-size: 60px; }

  .footer-inner { flex-direction: column; text-align: center; }
}

/* 430px 手机 */
@media (max-width: 430px) {
  .hero-card {
    padding: 20px 16px 84px;
    grid-template-columns: 56% 44%;
  }

  .hero-title { font-size: 33px; }
  .hero-desc { font-size: 13px; }

  .btn { min-height: 44px; padding: 10px 16px; font-size: 15px; }
  .btn-primary { padding: 12px 18px; font-size: 16px; }

  .hero-actions { gap: 8px; }
  .hero-actions .btn { flex: 1; }

  .phone-stage { max-width: 150px; }
  .phone-emoji { font-size: 30px; }
  .phone-prompt { font-size: 11px; padding: 6px 8px; }
  .phone-turn { font-size: 12px; }
  .phone-timer { font-size: 18px; }
  .phone-room { font-size: 10px; padding: 3px 7px; }

  .sticker-hey { font-size: 11px; padding: 3px 7px; }
  .sticker-cheat, .sticker-haha { font-size: 9px; padding: 3px 6px; }
  .sticker-sparkle { font-size: 16px; }

  .section-title { font-size: 26px; }
  .section-sticker { font-size: 11px; }

  .filter-bar { gap: 8px; }
  .chip { padding: 8px 16px; font-size: 14px; }

  .games { padding-inline: 12px; }
  .game-grid { gap: 12px; }
  .game-card { min-width: 0; border-width: 2.5px; }
  .game-illustration { height: 96px; border-bottom-width: 2.5px; }
  .game-illustration .game-emoji { font-size: 42px; }
  .game-num {
    top: 6px; left: 6px;
    padding: 2px 5px;
    font-size: 9px;
    letter-spacing: 0.5px;
  }
  .game-cat-tag {
    top: 6px; right: 6px;
    padding: 2px 6px;
    font-size: 9px;
    border-width: 1.5px;
  }
  .game-body { gap: 6px; padding: 10px 10px 12px; }
  .game-name { font-size: 17px; line-height: 1.2; }
  .game-intro {
    min-height: 34px;
    font-size: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }
  .game-meta {
    gap: 5px 8px;
    flex-wrap: wrap;
    font-size: 11px;
    line-height: 1.25;
  }
  .game-tag-inline { font-size: 9px; padding: 2px 6px; }
  .game-card-cta {
    padding: 8px 6px;
    font-size: 12px;
    border-width: 2px;
    border-radius: 8px;
    box-shadow: 2px 2px 0 0 var(--c-black);
  }

  .join-bar { margin-top: -44px; padding: 14px; }
  .join-title { font-size: 15px; }
  .join-sub { font-size: 12px; }
  .room-input { font-size: 18px; letter-spacing: 6px; }

  .party-title { font-size: 24px; }
  .party-sub { font-size: 13px; }

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

  .footer-tag { font-size: 13px; }
}

/* 375px 小手机 */
@media (max-width: 375px) {
  .hero-card { padding: 18px 14px 80px; }
  .hero-title { font-size: 31px; }
  .hero-desc { font-size: 12px; }
  .tag { font-size: 11px; }

  .phone-stage { max-width: 132px; }
  .phone-emoji { font-size: 26px; }

  .join-right { gap: 6px; }
  .btn-scan, .btn-join { font-size: 14px; padding: 10px 14px; }

  .games { padding-inline: 10px; }
  .game-grid { gap: 10px; }
  .game-illustration { height: 88px; }
  .game-illustration .game-emoji { font-size: 38px; }
  .game-body { padding: 9px 8px 10px; }
  .game-name { font-size: 16px; }
  .game-card-cta { font-size: 11px; }
}

/* 桌面端大屏微调 */
@media (min-width: 1440px) {
  :root { --container: 1240px; }
  .hero-title { font-size: 82px; }
}

/* 减少动画偏好 */
@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;
  }
}
