/**
 * 摇一摇竞速 · 共享视觉系统
 *
 * 大屏(screen) 和 手机端(play) 都引这一份，保证两边观感一致。
 * 只放「令牌 + 基础样式 + 通用组件」，各自的布局留在 screen.css / play.css。
 *
 * 唯一的运行时常量是 --accent：由服务端主题配置驱动，JS 用 setProperty 改写。
 */

:root {
  /* ---- 紫金主色 ---- */
  --p1: #7b6bf0;          /* 紫·亮 */
  --p2: #6c5ce7;          /* 紫·主 */
  --p3: #4e3fc0;          /* 紫·深 */
  --gold: #ffc93c;        /* 金·主 */
  --gold-l: #ffda69;      /* 金·亮 */
  --gold-d: #f2a33c;      /* 金·暗 */
  --hot: #e8342a;         /* 按钮红字 */

  /* ---- 文字 ---- */
  --text: #ffffff;
  --dim: rgba(255, 255, 255, 0.74);
  --faint: rgba(255, 255, 255, 0.42);

  /* ---- 面板 ---- */
  --panel: rgba(255, 255, 255, 0.14);
  --panel-deep: rgba(43, 27, 107, 0.42);
  --line: rgba(255, 255, 255, 0.28);
  --ink: #2b1b6b;         /* 深紫，用于描边字和阴影 */

  /* ---- 语义色（被 JS 覆盖）---- */
  --accent: #ffc93c;

  /* ---- 尺寸 ---- */
  --top-h: 92px;
  --footer-h: 44px;
  --radius: 20px;

  /* ---- 阴影 ---- */
  --sh-1: 0 6px 18px rgba(28, 16, 76, 0.26);
  --sh-2: 0 14px 40px rgba(28, 16, 76, 0.36);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB",
               "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 紫渐变底 —— 刻意不用整套网络字体，展会现场可能断网。
   参考图的底色几乎是平的，渐变只做一点点明暗，避免大屏上出现明显色块。 */
body {
  background: linear-gradient(160deg, #7a6cf2 0%, var(--p2) 55%, #5b4ad8 100%);
  background-attachment: fixed;
  user-select: none;
}

/* 涂鸦纹理层：白色线稿平铺，压到很淡。
   大屏的结算页要自己盖住赛道，所以它也铺一层同样的纹理 —— 用同一个
   规则渲染，两页背景才不会在切换时「跳」一下。 */
body::before,
.doodle-layer::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("/doodles.svg");
  background-repeat: repeat;
  background-size: 420px 420px;
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
body::before { position: fixed; }
.doodle-layer::before { z-index: -1; }

/* ============================================================
   通用组件
   ============================================================ */

/* ---- 黄色胶囊按钮（参考图里的「开始」）---- */
.btn-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 54px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 8px;
  text-indent: 8px;              /* 抵消字距造成的右侧空隙 */
  color: var(--hot);
  cursor: pointer;
  background: linear-gradient(180deg, var(--gold-l) 0%, var(--gold) 52%, var(--gold-d) 100%);
  /* 白描边 + 立体下沿 */
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -4px 0 rgba(201, 130, 12, 0.5),
    0 6px 0 #cf8b14,
    0 14px 30px rgba(28, 16, 76, 0.34);
  text-shadow:
    -2px -2px 0 #fff, 2px -2px 0 #fff,
    -2px 2px 0 #fff, 2px 2px 0 #fff;
  transition: transform 0.14s, box-shadow 0.14s, filter 0.14s;
}
.btn-capsule:hover { filter: brightness(1.06); }
.btn-capsule:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 2px 0 rgba(255, 255, 255, 0.85),
    inset 0 -3px 0 rgba(201, 130, 12, 0.5),
    0 2px 0 #cf8b14,
    0 6px 16px rgba(28, 16, 76, 0.3);
}
.btn-capsule.small { padding: 10px 30px; font-size: 19px; letter-spacing: 4px; text-indent: 4px; }

/* ---- 圆形头像 ---- */
.avatar-circle {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(180deg, #e2e6ef 0%, #b9c1d1 100%);
  border: 4px solid rgba(255, 255, 255, 0.92);
  /* 深紫外环 —— 参考图里头像都有一圈深色描边，浅底上也立得住 */
  box-shadow: 0 0 0 3px rgba(43, 27, 107, 0.45), var(--sh-1);
  font-size: 42px;
  line-height: 1;
  flex: none;
}
/* 微信授权后头像是真实图片，铺满这个圆。emoji 模式下不会命中这条规则。
   （.avatar-circle 自己有 overflow:hidden，所以裁成圆形不需要 img 再动手脚） */
.avatar-circle > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 未加入时的灰色人形剪影 */
.avatar-circle.empty::before {
  content: "";
  position: absolute;
  inset: 0;
  background-repeat: no-repeat;
  background-position: center 58%;
  background-size: 62%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%238e97ab' d='M12 12.5a5.25 5.25 0 1 0 0-10.5 5.25 5.25 0 0 0 0 10.5Zm0 2.1c-4.7 0-8.5 2.4-8.5 5.4v3.5h17v-3.5c0-3-3.8-5.4-8.5-5.4Z'/%3E%3C/svg%3E");
}

/* ---- 玻璃面板 ---- */
.glass {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
}

/* ---- 底部页脚条 ---- */
.footer-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  height: var(--footer-h);
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.82);
  background: rgba(38, 24, 96, 0.55);
}

/* ---- 小工具 ---- */
.hidden { display: none !important; }
