/* ============================================================
   微醺局 —— 样式
   neo-brutalism 风格：米白底 / 粗黑边框 / 硬阴影
   ============================================================ */

:root {
  --bg-cream: #fffde7;
  --text-black: #000;
  --border-black: #000;
  --accent-red: #ff5252;
  --accent-blue: #448aff;
  --accent-green: #4caf50;
  --accent-yellow: #f0e634;
  --accent-purple: #9b5de5;
  --accent-orange: #ff5f1f;
  --accent-cyan: #3fa9f5;
  --accent-pink: #ff0055;
  --accent-mint: #00d084;
  --shadow-hard: 6px 6px 0px 0px #000;
  --shadow-hard-sm: 4px 4px 0px 0px #000;
  --radius-std: 8px;
}

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

body {
  background-color: var(--bg-cream);
  color: var(--text-black);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

.hidden { display: none !important; }

/* ==================== 启动页 ==================== */
.splash {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-cream);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity .5s ease-out, visibility .5s ease-out;
}
.splash.out { opacity: 0; pointer-events: none; visibility: hidden; }

/* 原版网格底纹 */
.splash-bg-grid {
  position: absolute; inset: 0; z-index: 0;
  background-image:
    linear-gradient(rgba(0,0,0,.05) 1px, transparent 0),
    linear-gradient(90deg, rgba(0,0,0,.05) 1px, transparent 0);
  background-size: 20px 20px;
}

.splash-container {
  position: relative; z-index: 10;
  display: flex; flex-direction: column; align-items: center;
}

/* 故障字效 */
.glitch-wrapper { position: relative; display: flex; justify-content: center; margin-bottom: 12px; }
.glitch-text {
  font-size: 56px; font-weight: 900; letter-spacing: 4px;
  color: #000; position: relative; z-index: 2;
  line-height: 1.1;
}
.layer-r, .layer-b { position: absolute; left: 0; top: 0; opacity: .8; mix-blend-mode: multiply; z-index: 1; }
.layer-r { color: var(--accent-red); animation: glitchText1 3s linear infinite alternate-reverse; }
.layer-b { color: var(--accent-blue); animation: glitchText2 2.5s linear infinite alternate-reverse; }

@keyframes glitchText1 {
  0% { clip-path: inset(0 0 0 0); transform: translate(-2px, 0); }
  20% { clip-path: inset(20% 0 80% 0); transform: translate(2px, 0); }
  100% { transform: translate(-2px, 0); }
}
@keyframes glitchText2 {
  0% { clip-path: inset(0 0 0 0); transform: translate(2px, 0); }
  20% { clip-path: inset(80% 0 20% 0); transform: translate(-2px, 0); }
  100% { transform: translate(2px, 0); }
}

.splash-subtitle {
  font-size: 14px; font-weight: 700; letter-spacing: 12px;
  opacity: .6; padding-left: 12px;
}

.skip-btn {
  position: absolute; right: 20px; top: 50px; z-index: 100;
  background: #fff; border: 4px solid #000; border-radius: 999px;
  box-shadow: 4px 4px 0 0 #000; color: #000;
  font-size: 13px; font-weight: 900; padding: 6px 16px;
  text-transform: uppercase; cursor: pointer;
  transition: transform .1s;
}
.skip-btn:active { box-shadow: 2px 2px 0 0 #000; transform: translate(2px, 2px); }

/* ==================== 主容器 ==================== */
.app {
  padding: 12px; max-width: 480px; margin: 0 auto;
  background: var(--bg-cream); min-height: 100vh;
}

.page { display: none; animation: pageIn .3s ease; }
.page.active { display: block; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.back-btn {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  width: 40px; height: 40px;
  background: #fff; border: 4px solid #000; border-radius: 999px;
  box-shadow: 4px 4px 0 0 #000;
  color: #000; font-size: 18px; font-weight: 900; line-height: 1;
  cursor: pointer; transition: all .1s;
}
.back-btn:active { box-shadow: 2px 2px 0 0 #000; transform: translate(2px, 2px); }

/* ==================== 首页 ==================== */
.hero { padding: 46px 0 22px; text-align: center; }
.hero-title {
  font-size: 40px; font-weight: 900; letter-spacing: 3px;
  color: #000; text-transform: uppercase; line-height: 1.1;
}
.hero-sub {
  margin-top: 8px; font-size: 12px; font-weight: 700;
  letter-spacing: 3px; opacity: .6;
}

/* 区块标题（原版 section-header：黑色方块 + 大写粗体） */
.section-title {
  display: flex; align-items: center; gap: 8px;
  margin: 26px 0 16px;
  font-size: 20px; font-weight: 900; letter-spacing: 0;
  text-transform: uppercase; color: #000;
}
.section-title::before {
  content: ''; width: 12px; height: 12px; background: #000;
  border-radius: 0; flex-shrink: 0;
}

/* ---- 工具卡（原版 tool-card-horizontal：220rpx 高，6 色轮换，硬阴影） ---- */
.grid {
  display: flex; flex-direction: column; gap: 20px; margin-bottom: 20px;
}

.tool-card {
  position: relative; height: 110px; width: 100%;
  display: flex; align-items: center;
  border: 4px solid #000; border-radius: var(--radius-std);
  box-shadow: var(--shadow-hard-sm);
  color: #000; cursor: pointer; overflow: visible;
  transition: all .1s ease;
}
.tool-card:active { box-shadow: none; transform: translate(4px, 4px); }

/* 6 色轮换（原版 nth-child(6n+1..6)） */
.tool-card:nth-child(6n+1) { background-color: var(--accent-cyan); }
.tool-card:nth-child(6n+2) { background-color: var(--accent-orange); }
.tool-card:nth-child(6n+3) { background-color: var(--accent-mint); }
.tool-card:nth-child(6n+4) { background-color: var(--accent-yellow); }
.tool-card:nth-child(6n+5) { background-color: var(--accent-purple); }
.tool-card:nth-child(6n+6) { background-color: var(--accent-pink); }

.tool-body {
  display: flex; flex-direction: column; gap: 6px;
  justify-content: center; max-width: 65%; min-width: 0;
  padding: 15px 20px; position: relative; z-index: 2;
}
.tool-chip {
  align-self: flex-start;
  background: #000 !important; color: #fff !important;
  border: none; border-radius: 4px;
  box-shadow: 2px 2px 0 0 hsla(0,0%,100%,.3);
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  padding: 3px 10px; text-transform: uppercase;
}
.tool-title { font-size: 28px; font-weight: 900; letter-spacing: -1px; line-height: 1; margin-top: 5px; }
.tool-sub {
  font-size: 13px; font-weight: 700; opacity: .9;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 右侧舞台占位（原版 stage-hero-horizontal：白底圆形硬阴影） */
.tool-stage-ph {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 80px; height: 80px; z-index: 10;
  background: #fff; border: 4px solid #000; border-radius: 50%;
  box-shadow: var(--shadow-hard-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 900; color: #000; letter-spacing: .5px;
  pointer-events: none;
}

/* ---- 入口卡 ---- */
.card-entry {
  border: 4px solid #000; border-radius: var(--radius-std);
  box-shadow: var(--shadow-hard);
  padding: 22px 20px; cursor: pointer;
  background: var(--accent-yellow);
  transition: all .1s;
}
.card-entry:active { box-shadow: 2px 2px 0 0 #000; transform: translate(4px, 4px); }

.card-entry-title { font-size: 24px; font-weight: 900; letter-spacing: -.5px; }
.card-entry-desc {
  display: inline-block; margin-top: 8px;
  background: #fff; border: 2px solid #000; border-radius: 4px;
  box-shadow: 2px 2px 0 0 #000;
  font-size: 13px; font-weight: 800; padding: 4px 10px;
}
.card-entry-btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 14px; min-width: 100px; padding: 8px 20px;
  background: #000; border-radius: 999px;
  box-shadow: var(--shadow-hard-sm);
  color: #fff; font-size: 14px; font-weight: 900; text-transform: uppercase;
}

/* ==================== 牌组页 ==================== */
.deck-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 46px 0 14px;
}
.deck-title { font-size: 26px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }
.deck-progress {
  background: #fff; border: 2px solid #000; border-radius: 4px;
  box-shadow: 2px 2px 0 0 #000;
  font-size: 13px; font-weight: 900; padding: 3px 10px;
}

.filter-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.filter-chip {
  padding: 6px 14px; border-radius: 999px; cursor: pointer;
  background: #fff; border: 3px solid #000;
  font-size: 13px; font-weight: 900; color: #000;
  box-shadow: 3px 3px 0 0 #000;
  transition: all .1s;
}
.filter-chip.on { background: #000; color: #fff; box-shadow: none; transform: translate(3px, 3px); }

.deck-stage { display: flex; flex-direction: column; align-items: center; gap: 20px; }

/* 大卡：原版 neo-brutalism 硬边 */
.bigcard {
  width: 100%; aspect-ratio: 3 / 4; max-height: 440px;
  border: 5px solid #000; border-radius: var(--radius-std);
  box-shadow: var(--shadow-hard);
  background: #fff;
  position: relative; overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.8,.3,1.2);
}
.bigcard.flip { transform: rotateY(90deg) scale(.94); }
.bigcard.pop { animation: cardPop .45s ease; }
@keyframes cardPop {
  0% { transform: scale(1); }
  45% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

.bigcard-inner {
  width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 26px 22px; text-align: center; gap: 14px;
  position: relative;
}

/* 档位标签：黑色胶囊白字 */
.bigcard-color {
  font-size: 12px; font-weight: 900; letter-spacing: 3px;
  padding: 4px 14px; border-radius: 999px;
  background: #000; color: #fff;
  text-transform: uppercase;
}
.bigcard-name {
  font-size: 34px; font-weight: 900; letter-spacing: 1px;
  line-height: 1.2; color: #000;
}
.bigcard-desc {
  font-size: 14px; line-height: 1.85; color: #000;
  max-width: 300px; font-weight: 600;
}
.bigcard-sub {
  font-size: 12.5px; font-weight: 700; color: #000;
  background: rgba(0,0,0,.07); border-radius: 6px;
  padding: 8px 14px; max-width: 300px;
}

.draw-btn {
  width: 100%; max-width: 300px; padding: 15px;
  border: 4px solid #000; border-radius: 999px;
  background: var(--accent-yellow);
  box-shadow: var(--shadow-hard-sm);
  color: #000; font-size: 16px; font-weight: 900;
  letter-spacing: 2px; text-transform: uppercase; cursor: pointer;
  transition: all .1s;
}
.draw-btn:active { box-shadow: 2px 2px 0 0 #000; transform: translate(2px, 2px); }

/* ==================== 工具舞台 ==================== */
.tool-stage {
  padding: 60px 0 40px; min-height: 76vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 20px;
}
.stage-title { font-size: 28px; font-weight: 900; letter-spacing: 2px; text-transform: uppercase; }
.stage-hint {
  font-size: 13px; font-weight: 700; text-align: center;
  line-height: 1.7; max-width: 300px; opacity: .75;
}

.big-num {
  font-size: 64px; font-weight: 900; letter-spacing: -1px;
  color: #000; transition: all .2s;
}

/* ---- 骰子 ---- */
.dice-box { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; }
.die {
  width: 74px; height: 74px;
  background: #fff; border: 4px solid #000; border-radius: 8px;
  box-shadow: var(--shadow-hard-sm);
  display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
  padding: 8px; gap: 3px;
}
.die.roll { animation: dieRoll .55s ease; }
@keyframes dieRoll {
  0% { transform: rotate(0) scale(1); }
  50% { transform: rotate(200deg) scale(1.08); }
  100% { transform: rotate(360deg) scale(1); }
}
.pip { border-radius: 50%; background: transparent; }
.pip.on { background: #000; }

/* ---- 反应类 ---- */
.arena {
  width: 100%; max-width: 300px; height: 300px; border-radius: 50%;
  border: 5px solid #000; background: #fff;
  box-shadow: var(--shadow-hard);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; transition: all .12s;
}
.arena.wait { background: var(--accent-red); }
.arena.go { background: var(--accent-green); transform: scale(1.03); }
.arena-label { font-size: 24px; font-weight: 900; letter-spacing: 1px; }

/* ---- 抖手测试 ---- */
.drunk-track {
  width: 100%; max-width: 300px; height: 130px;
  border: 4px solid #000; border-radius: 8px;
  box-shadow: var(--shadow-hard-sm);
  background: #fff; position: relative; overflow: hidden;
}
.drunk-path {
  position: absolute; top: 50%; left: 6%; width: 88%; height: 2px;
  background: rgba(0,0,0,.15); transform: translateY(-50%);
}
.drunk-cursor {
  position: absolute; top: 50%; left: 6%;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-purple); border: 3px solid #000;
  transform: translate(-50%, -50%);
  transition: left .06s linear;
}
.drunk-goal {
  position: absolute; top: 50%; left: 94%;
  width: 10px; height: 30px; border-radius: 3px;
  background: #000; transform: translate(-50%,-50%);
}

/* ---- 弹幕 ---- */
.danmu-screen {
  width: 100%; max-width: 340px; height: 210px;
  border: 4px solid #000; border-radius: 8px;
  box-shadow: var(--shadow-hard-sm);
  background: #000; position: relative; overflow: hidden;
}
.danmu-item {
  position: absolute; white-space: nowrap;
  font-size: 14px; font-weight: 900;
  animation: dmMove linear forwards;
}
@keyframes dmMove {
  from { transform: translateX(340px); }
  to { transform: translateX(-110%); }
}

/* ---- 像素鸟 ---- */
.flappy-wrap { width: 100%; max-width: 320px; }
canvas#flappy {
  width: 100%; border: 4px solid #000; border-radius: 8px;
  box-shadow: var(--shadow-hard-sm);
  display: block; background: #DDF7FF;
  touch-action: manipulation;
}

/* ---- 转酒瓶 ---- */
.bottle-wrap { position: relative; width: 270px; height: 270px; }
.bottle-svg {
  width: 100%; height: 100%;
  transition: transform 2.4s cubic-bezier(.15,.85,.2,1);
  transform-origin: 50% 50%;
}
.bottle-pick {
  margin-top: 6px; font-size: 19px; font-weight: 900; color: #000;
  min-height: 26px;
}

/* ---- 通用控件 ---- */
.inp {
  width: 100%; max-width: 300px; padding: 12px 15px;
  border: 4px solid #000; border-radius: 8px;
  background: #fff; color: #000;
  font-size: 14px; font-weight: 700; outline: none;
  box-shadow: var(--shadow-hard-sm);
}
.inp::placeholder { color: #999; font-weight: 600; }

.btn {
  padding: 12px 28px;
  border: 4px solid #000; border-radius: 999px;
  background: var(--accent-yellow);
  box-shadow: var(--shadow-hard-sm);
  color: #000; font-size: 14px; font-weight: 900;
  letter-spacing: 1px; text-transform: uppercase; cursor: pointer;
  transition: all .1s;
}
.btn:active { box-shadow: 2px 2px 0 0 #000; transform: translate(2px, 2px); }
.btn.ghost { background: #fff; }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar { width: 0; height: 0; display: none; }
body { scrollbar-width: none; }
