/* yx 游戏厅 —— 暗色霓虹风，手机优先，零依赖 */
:root {
  --bg: #08090f;
  --bg-2: #10121c;
  --card: #151827;
  --line: #262b40;
  --text: #eef1fb;
  --muted: #98a0bd;
  --faint: #6b7392;
  --brand: #7c5cff;
  --brand-2: #12c2b0;
  --hot: #ff5c8a;
  --warn: #ffb648;
  --ok: #39d98a;
  --radius: 18px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 50% -12%, rgba(124, 92, 255, .28), transparent 68%),
    radial-gradient(700px 380px at 100% 0%, rgba(18, 194, 176, .16), transparent 62%),
    var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100%;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 8px; }

.wrap { width: min(980px, 100% - 32px); margin: 0 auto; }

/* ---------- 顶栏 ---------- */
.top {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 0;
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, rgba(8, 9, 15, .92), rgba(8, 9, 15, .66));
  backdrop-filter: blur(10px);
}
.mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff;
}
.top b { font-size: 15px; letter-spacing: .3px; }
.top .right { margin-left: auto; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.top .right a { color: var(--muted); }
.top .right a:hover { color: var(--text); }

/* ---------- 大厅 ---------- */
.hero { padding: 20px 0 8px; }
.hero h1 {
  margin: 0 0 8px; font-size: clamp(28px, 6vw, 40px); line-height: 1.2; letter-spacing: -.6px;
  background: linear-gradient(120deg, #fff 20%, #b9a8ff 60%, #7ff0e2 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin: 0; color: var(--muted); font-size: 14.5px; max-width: 46em; }
.hero .tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.tag {
  font-size: 12px; color: var(--muted); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03); border-radius: 999px; padding: 4px 11px;
}

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 14px; }
.chip {
  border: 1px solid var(--line); background: rgba(255, 255, 255, .03);
  color: var(--muted); font: inherit; font-size: 13.5px;
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: rgba(124, 92, 255, .5); }
.chip.on { background: linear-gradient(135deg, var(--brand), #5a3ee0); border-color: transparent; color: #fff; }
.chip .n { opacity: .7; font-size: 11.5px; margin-left: 4px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding-bottom: 40px; }

.game {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02));
  border: 1px solid var(--line);
  color: inherit; overflow: hidden;
  transition: transform .16s ease, border-color .16s ease;
}
.game::after {
  content: ""; position: absolute; inset: -40% -30% auto auto; width: 180px; height: 180px;
  background: var(--glow, rgba(124, 92, 255, .5)); filter: blur(48px); opacity: .5; pointer-events: none;
}
.game:hover { transform: translateY(-3px); border-color: rgba(124, 92, 255, .55); text-decoration: none; }
.game .ico { font-size: 30px; line-height: 1; }
.game h3 { margin: 0; font-size: 17px; letter-spacing: -.2px; }
.game .short { margin: 0; color: var(--muted); font-size: 13.5px; min-height: 2.4em; }
.game .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--faint); margin-top: auto; }
.game .meta span { border: 1px solid var(--line); border-radius: 7px; padding: 1px 7px; }
.game .play {
  margin-top: 10px; align-self: flex-start;
  font-size: 13px; font-weight: 600; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-radius: 10px; padding: 7px 15px;
}

/* ---------- 游戏页 ---------- */
.stage {
  margin: 10px 0 0;
  background: linear-gradient(165deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015));
  border: 1px solid var(--line); border-radius: 22px;
  padding: 22px; min-height: 420px;
  display: flex; flex-direction: column; gap: 16px;
}
.stage-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stage-head h2 { margin: 0; font-size: 19px; letter-spacing: -.2px; }
.stage-head .sub { color: var(--muted); font-size: 13px; }
.stage-head .sp { margin-left: auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 48px; padding: 0 20px; border-radius: 14px;
  border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  color: var(--text); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: transform .1s, filter .15s, border-color .15s;
}
.btn:active { transform: scale(.97); }
.btn:hover { border-color: rgba(124, 92, 255, .6); }
.btn.primary { background: linear-gradient(135deg, var(--brand), #5a3ee0); border-color: transparent; }
.btn.accent { background: linear-gradient(135deg, var(--brand-2), #0a9e8f); border-color: transparent; }
.btn.ghost { background: transparent; }
.btn.danger { background: linear-gradient(135deg, #ff5c8a, #c81e5b); border-color: transparent; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }

.field-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.field-row label { font-size: 13px; color: var(--muted); }
select, input[type=number], input[type=text] {
  font: inherit; font-size: 15px; color: var(--text);
  background: rgba(255, 255, 255, .06); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; outline: none; min-height: 46px;
}

/* 骰子 */
.dice-table { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.player {
  background: rgba(255, 255, 255, .04); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; text-align: center;
}
.player .pname { font-size: 13.5px; color: var(--muted); }
.dice { display: flex; gap: 8px; justify-content: center; margin: 10px 0 6px; }
.die {
  width: 46px; height: 46px; border-radius: 12px;
  background: linear-gradient(160deg, #fff, #d9dcf0); color: #12141f;
  font-size: 24px; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .9);
}
.die.rolling { animation: shake .12s infinite; }
@keyframes shake {
  0% { transform: rotate(-8deg) translateY(-2px); }
  50% { transform: rotate(9deg) translateY(2px); }
  100% { transform: rotate(-6deg); }
}
.player .score { font-size: 22px; font-weight: 800; margin-top: 4px; }
.player.win { border-color: rgba(57, 217, 138, .7); box-shadow: 0 0 0 1px rgba(57, 217, 138, .35) inset; }
.player.lose { border-color: rgba(255, 92, 138, .7); }

/* 数字炸弹 */
.bomb-num { font-size: clamp(44px, 14vw, 76px); font-weight: 900; letter-spacing: -2px; text-align: center; }
.range-hint { text-align: center; color: var(--muted); font-size: 14px; }
.num-pad { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.num-pad button {
  min-height: 46px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .05); color: var(--text);
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.num-pad button:hover { border-color: rgba(124, 92, 255, .6); }
.num-pad button.used { opacity: .28; pointer-events: none; text-decoration: line-through; }

/* 卡片（真心话/大冒险、你演我猜） */
.card-face {
  border-radius: 20px; padding: 26px 22px; min-height: 190px;
  display: grid; place-items: center; text-align: center;
  background: linear-gradient(150deg, rgba(124, 92, 255, .22), rgba(18, 194, 176, .12));
  border: 1px solid rgba(124, 92, 255, .35);
  font-size: clamp(18px, 3.6vw, 24px); font-weight: 650; line-height: 1.55; letter-spacing: -.2px;
}
.card-face.small { font-size: clamp(15px, 2.6vw, 18px); font-weight: 550; }
.card-meta { text-align: center; color: var(--muted); font-size: 13px; }

/* 转盘 */
.wheel-wrap { position: relative; display: grid; place-items: center; padding: 8px 0; }
.wheel {
  width: min(320px, 76vw); aspect-ratio: 1; border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, .1);
  transition: transform 4.2s cubic-bezier(.16, .84, .16, 1);
  position: relative;
}
.wheel-label {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; color: #0b0d14; font-weight: 700; pointer-events: none;
}
.pointer {
  position: absolute; top: -6px; width: 0; height: 0;
  border-left: 12px solid transparent; border-right: 12px solid transparent;
  border-top: 20px solid var(--warn); filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .6));
  z-index: 2;
}
.wheel-result {
  text-align: center; font-size: clamp(22px, 5vw, 30px); font-weight: 800;
  min-height: 1.6em;
}

/* 计时器 */
.timer {
  text-align: center; font-size: clamp(40px, 12vw, 64px); font-weight: 900;
  font-variant-numeric: tabular-nums; letter-spacing: -2px;
}
.timer.hot { color: var(--hot); }

/* 通用 */
.hint { color: var(--muted); font-size: 13px; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.row-split { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }

.foot { color: var(--faint); font-size: 12.5px; text-align: center; padding: 30px 0 40px; }
.foot a { color: var(--faint); }

@media (max-width: 520px) {
  .wrap { width: calc(100% - 24px); }
  .stage { padding: 16px; min-height: 380px; border-radius: 18px; }
  .btn { min-height: 46px; font-size: 14.5px; padding: 0 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .game { padding: 14px; }
  .game h3 { font-size: 15px; }
  .game .short { font-size: 12.5px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
