:root {
  --ink: #4A3528;
  --sky: #BDE6FF;
  --clay: #E8915A;
  --ball: #E3F24F;
  --me: #FF8FB1;
  --st: env(safe-area-inset-top, 0px);
  --sb: env(safe-area-inset-bottom, 0px);
  --sl: env(safe-area-inset-left, 0px);
  --sr: env(safe-area-inset-right, 0px);
  --fs: clamp(12px, 3.6vmin, 18px);
  --round: "Hiragino Maru Gothic ProN", "M PLUS Rounded 1c", "Kosugi Maru", "Arial Rounded MT Bold", "Yu Gothic UI", "Meiryo", sans-serif;
  --heavy: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--sky); }
body { font-family: var(--round); color: var(--ink); font-size: var(--fs); user-select: none; -webkit-user-select: none; touch-action: none; overscroll-behavior: none; }
canvas#c { position: fixed; left: 0; top: 0; display: block; touch-action: none; }
.hidden { display: none !important; }
button { font-family: var(--round); color: var(--ink); cursor: pointer; white-space: nowrap; font-weight: 800; touch-action: manipulation; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; }
#board { position: absolute; top: calc(var(--st) + 8px); left: 50%; transform: translateX(-50%); background: #2F5D3A; border: 3px solid #F5E6C8; border-radius: 12px; color: #fff; padding: 3px 10px 4px; text-align: center; box-shadow: 0 3px 0 rgba(74,53,40,0.5); font-family: var(--heavy); }
#board .row { display: flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
#board .main { font-size: clamp(20px, 6.2vmin, 30px); font-weight: 900; line-height: 1.15; }
#board .main span { min-width: 1.6em; }
#board .dash { min-width: 0.6em !important; opacity: 0.8; }
#board .sub { font-size: clamp(11px, 3.2vmin, 15px); color: #FFE14D; font-weight: 800; }
#board .lab { color: #F5E6C8; font-size: 0.85em; }
#board .ic { width: clamp(22px, 6vmin, 30px); height: clamp(22px, 6vmin, 30px); }
#board .srv { width: 9px; height: 9px; min-width: 9px !important; border-radius: 50%; background: transparent; }
#board .srv.on { background: var(--ball); box-shadow: 0 0 4px var(--ball); }
#board.pulse { animation: pulse 0.6s ease-out 2; }
@keyframes pulse { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.15); } 100% { transform: translateX(-50%) scale(1); } }
#timer { position: absolute; top: calc(var(--st) + 8px); left: 50%; transform: translateX(-50%); font-family: var(--heavy); font-weight: 900; font-size: clamp(20px, 6vmin, 30px); color: #fff; text-shadow: 0 0 3px var(--ink), 0 2px 0 var(--ink), 2px 0 0 var(--ink), -2px 0 0 var(--ink), 0 -2px 0 var(--ink); white-space: nowrap; }
#timer .lab { font-size: 0.6em; margin-right: 6px; }
#hint { position: absolute; top: calc(var(--st) + clamp(62px, 17vmin, 84px)); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 800; font-size: clamp(12px, 3.4vmin, 16px); text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink); white-space: nowrap; max-width: 94vw; overflow: hidden; }
#pauseBtn { position: absolute; top: calc(var(--st) + 10px); right: calc(var(--sr) + 10px); width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--ink); background: rgba(255,255,255,0.85); pointer-events: auto; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 0; }
#pauseBtn span { width: 5px; height: 15px; background: var(--ink); border-radius: 2px; }
#gauge { position: absolute; left: 0; top: 0; width: 44px; height: 44px; will-change: transform; }
#gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
#gauge circle { fill: none; stroke-width: 6; }
#gauge .bg { stroke: rgba(74,53,40,0.55); fill: rgba(255,255,255,0.55); }
#gauge .fg { stroke: var(--me); stroke-linecap: round; stroke-dasharray: 100.5; stroke-dashoffset: 100.5; transition: stroke-dashoffset 0.2s; }
#gauge.full .fg { filter: drop-shadow(0 0 3px #fff); }
#gaugePct { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--heavy); font-weight: 900; font-size: 11px; color: var(--ink); }
#spBtn { position: absolute; left: 0; top: 0; width: 64px; height: 64px; border-radius: 50%; border: 4px solid var(--ink); background: radial-gradient(circle at 40% 35%, #FFF6B0, #FFC61A 55%, #FF7A1A); font-size: 17px; font-weight: 900; pointer-events: auto; box-shadow: 0 0 0 4px rgba(255,255,255,0.7), 0 0 18px 6px rgba(255,200,40,0.8); animation: spGlow 0.7s ease-in-out infinite alternate; padding: 0; will-change: transform; }
#spBtn.on { background: radial-gradient(circle at 40% 35%, #fff, #9EE6FF 55%, #3F63C8); color: #fff; text-shadow: 0 1px 0 var(--ink); }
@keyframes spGlow { from { box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 0 10px 3px rgba(255,200,40,0.7); } to { box-shadow: 0 0 0 5px rgba(255,255,255,0.9), 0 0 24px 10px rgba(255,200,40,0.95); } }
#status { position: absolute; left: 0; top: 0; font-weight: 900; font-size: clamp(12px, 3.4vmin, 15px); white-space: nowrap; color: #FFE14D; text-shadow: 0 0 2px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink), 0 -1px 0 var(--ink), 0 0 10px rgba(255,220,80,0.9); will-change: transform; }
#aimOut { position: absolute; left: 0; top: 0; color: #fff; background: none; font-weight: 900; font-size: 13px; text-shadow: 0 0 2px #B00, 0 1px 0 #B00, 1px 0 0 #B00, -1px 0 0 #B00, 0 -1px 0 #B00; white-space: nowrap; will-change: transform; }

/* ---------- 演出の文字 ---------- */
#fx { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.ono { position: absolute; left: 0; top: 0; font-family: var(--heavy); font-weight: 900; white-space: nowrap; color: #FFE14D; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 #C8455E, 4px 4px 0 var(--ink); animation: ono 0.5s cubic-bezier(.2,1.6,.4,1) forwards; }
.ono.small { color: #fff; font-size: 16px; text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 var(--ink); }
.ono.nice { color: #7EF5B0; }
.ono.red { color: #FF5E5E; }
@keyframes ono { 0% { transform: translate(-50%,-50%) scale(0.2) rotate(-12deg); opacity: 1; } 35% { transform: translate(-50%,-80%) scale(1.25) rotate(-6deg); } 70% { transform: translate(-50%,-90%) scale(1) rotate(-6deg); opacity: 1; } 100% { transform: translate(-50%,-110%) scale(1) rotate(-6deg); opacity: 0; } }
.bubble { position: absolute; left: 0; top: 0; background: #fff; border: 3px solid var(--ink); border-radius: 14px; padding: 3px 9px; font-weight: 900; font-size: clamp(12px, 3.4vmin, 15px); white-space: nowrap; animation: bub 1.4s ease-out forwards; }
.bubble.owl { background: #FFF6D8; }
@keyframes bub { 0% { opacity: 0; transform: translate(-50%,-100%) scale(0.5); } 12% { opacity: 1; transform: translate(-50%,-100%) scale(1.05); } 20% { transform: translate(-50%,-100%) scale(1); } 85% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%,-110%) scale(1); } }

/* ---------- カットイン ---------- */
#cutin { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
#cutin .band { position: absolute; left: -15%; width: 130%; top: 50%; height: clamp(96px, 28vmin, 210px); transform: translateY(-50%) rotate(-9deg); background: linear-gradient(90deg, #FF5E7E, #FFC61A); border-top: 5px solid var(--ink); border-bottom: 5px solid var(--ink); display: flex; align-items: center; justify-content: center; gap: 3vmin; animation: cutIn 0.6s linear forwards; overflow: hidden; }
#cutin .lines { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,0.55) 0 4px, transparent 4px 60px); animation: lines 0.2s linear infinite; opacity: 0.8; }
@keyframes lines { from { background-position: 0 0; } to { background-position: -64px 0; } }
#cutFace { position: relative; height: 84%; width: auto; aspect-ratio: 1; }
#cutin .txt { position: relative; font-family: var(--heavy); font-weight: 900; font-size: clamp(15px, 4.7vmin, 44px); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); white-space: nowrap; }
@keyframes cutIn { 0% { transform: translate(-100%, -50%) rotate(-9deg); } 16% { transform: translate(0, -50%) rotate(-9deg); } 84% { transform: translate(0, -50%) rotate(-9deg); } 100% { transform: translate(100%, -50%) rotate(-9deg); } }

/* ---------- タイトル ---------- */
.screen { position: fixed; inset: 0; }
#title { display: flex; flex-direction: column; justify-content: space-between; align-items: center; pointer-events: none; padding: calc(var(--st) + 6px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px); }
#logo { width: min(80vw, 460px); pointer-events: none; }
#logoSvg { width: 100%; height: auto; display: block; overflow: visible; }
.dokabaki { font-family: var(--heavy); font-weight: 900; font-size: 74px; fill: #FF5E3A; stroke: var(--ink); stroke-width: 7px; paint-order: stroke fill; letter-spacing: 2px; }
.doubutsu { font-family: var(--round); font-weight: 900; font-size: 46px; fill: #fff; stroke: var(--ink); stroke-width: 7px; paint-order: stroke fill; letter-spacing: 3px; }
#panel { pointer-events: auto; width: min(94vw, 440px); background: rgba(255, 250, 240, 0.93); border: 3px solid var(--ink); border-radius: 18px; padding: clamp(6px, 2vmin, 12px); display: flex; flex-direction: column; gap: clamp(4px, 1.4vmin, 8px); box-shadow: 0 4px 0 rgba(74,53,40,0.45); }
.sel { display: flex; align-items: center; gap: 6px; }
.selLab { font-weight: 900; font-size: 0.85em; width: 3.2em; flex: none; }
.opts { display: flex; gap: 4px; flex: 1; min-width: 0; }
.opt { flex: 1; min-width: 0; border: 2px solid rgba(74,53,40,0.35); background: #fff; border-radius: 12px; padding: 3px 2px; font-size: clamp(11px, 3.3vmin, 15px); display: flex; flex-direction: column; align-items: center; gap: 1px; color: rgba(74,53,40,0.7); overflow: hidden; }
.opt canvas { width: clamp(26px, 8vmin, 42px); height: clamp(26px, 8vmin, 42px); }
.opt.on { border-color: var(--ink); background: #FFF3C4; color: #D9480F; text-shadow: 0 0 6px rgba(255,190,40,0.9), 0 0 2px #fff; }
.opt.txt { padding: clamp(6px, 1.8vmin, 10px) 2px; }
#oppDesc { font-size: clamp(11px, 3.2vmin, 14px); font-weight: 800; text-align: center; min-height: 1.3em; line-height: 1.3; }
#oppBest { font-size: clamp(10px, 3vmin, 13px); text-align: center; color: #8A5A2B; min-height: 1.2em; white-space: nowrap; overflow: hidden; }
button.big { font-size: clamp(20px, 6.4vmin, 30px); padding: clamp(6px, 1.8vmin, 12px) 10px; border-radius: 16px; border: 4px solid var(--ink); background: linear-gradient(#FFB55A, #FF7A1A); color: #fff; text-shadow: 0 2px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); box-shadow: 0 4px 0 var(--ink); letter-spacing: 4px; }
button.big:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.smallRow { display: flex; gap: 6px; justify-content: center; }
button.small { font-size: clamp(11px, 3.2vmin, 14px); padding: 4px 10px; border-radius: 10px; border: 2px solid var(--ink); background: #fff; }
button.mid { font-size: clamp(14px, 4.4vmin, 19px); padding: 7px 14px; border-radius: 12px; border: 3px solid var(--ink); background: linear-gradient(#FFB55A, #FF7A1A); color: #fff; text-shadow: 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); box-shadow: 0 3px 0 var(--ink); }
button.mid.ghost { background: #fff; color: var(--ink); text-shadow: none; }
button.mid.snap { background: linear-gradient(#9EE6FF, #3FA9F5); }

/* ---------- カード ---------- */
#howto, #vol, #pause, #result { display: flex; align-items: center; justify-content: center; background: rgba(74, 53, 40, 0.35); padding: calc(var(--st) + 8px) calc(var(--sr) + 8px) calc(var(--sb) + 8px) calc(var(--sl) + 8px); }
#result { background: rgba(74, 53, 40, 0.15); }
.card { background: #FFFAF0; border: 4px solid var(--ink); border-radius: 20px; padding: clamp(8px, 3vmin, 18px); width: min(92vw, 420px); max-height: 100%; overflow: auto; text-align: center; box-shadow: 0 5px 0 rgba(74,53,40,0.5); display: flex; flex-direction: column; gap: clamp(4px, 1.4vmin, 10px); align-items: stretch; }
.card h2 { margin: 0; font-size: clamp(18px, 6vmin, 28px); }
.step { display: flex; align-items: center; gap: 8px; text-align: left; }
.step canvas { width: clamp(64px, 20vmin, 110px); height: auto; flex: none; border-radius: 10px; border: 2px solid var(--ink); background: #E8915A; }
.step p { margin: 0; font-weight: 800; font-size: clamp(12px, 3.6vmin, 16px); line-height: 1.35; }
.foot { margin: 0; font-weight: 900; color: #D9480F; }
.close { margin: 0; font-size: 0.85em; opacity: 0.7; }
.card label { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 800; }
.card input[type=range] { flex: 1; max-width: 60%; accent-color: #FF7A1A; }
#resTitle { font-size: clamp(26px, 9vmin, 40px); }
#resTitle.win { color: #FF5E3A; }
#resBadge { font-weight: 900; color: #D9480F; font-size: clamp(14px, 4.4vmin, 20px); min-height: 0; }
#resGames { font-family: var(--heavy); font-weight: 900; font-size: clamp(22px, 7vmin, 34px); }
#resLines div, #resBest div { font-weight: 800; white-space: nowrap; font-size: clamp(12px, 3.8vmin, 16px); }
#resBest { color: #8A5A2B; }
.btnRow { display: flex; gap: 8px; justify-content: center; }
.btnRow button { flex: 1; min-width: 0; }
.new { color: #FF3B6B; margin-left: 4px; }
#skipTip { position: fixed; bottom: calc(var(--sb) + 14px); left: 50%; transform: translateX(-50%); color: #fff; font-weight: 800; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink); pointer-events: none; white-space: nowrap; }

/* 横向き */
@media (orientation: landscape) {
  #title { flex-direction: column; align-items: flex-end; justify-content: center; gap: 1vh; }
  #logo { width: min(46vw, 440px, 56vh); align-self: flex-end; margin-right: max(0px, calc((min(52vw, 420px) - min(46vw, 440px, 56vh)) / 2)); }
  #panel { width: min(52vw, 420px); }
}
@media (orientation: landscape) and (max-height: 560px) {
  .card { width: min(80vw, 520px); }
  .step canvas { width: clamp(56px, 16vmin, 90px); }
  #howto .card { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  #howto .card h2, #howto .card .foot, #howto .card .close { grid-column: 1 / -1; }
  #howto .step { flex-direction: column; text-align: center; }
}

/* ---------- ドパ演出 ---------- */
#dopa { position: absolute; top: calc(var(--st) + clamp(62px, 17vmin, 84px)); right: calc(var(--sr) + 10px); font-family: var(--heavy); font-weight: 900; color: #FFE14D; font-size: clamp(18px, 5.4vmin, 26px); white-space: nowrap; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 2px 2px 0 var(--ink); }
#dopa .lab { font-size: 0.6em; margin-right: 4px; color: #fff; }
#dopa.bump { animation: dbump 0.25s ease-out; }
@keyframes dbump { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
#combo { position: absolute; left: 0; top: 0; font-family: var(--heavy); font-weight: 900; white-space: nowrap; display: flex; align-items: baseline; gap: 3px; will-change: transform; pointer-events: none; }
#combo b { font-size: var(--cs, 30px); color: var(--cc, #FFE14D); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
#combo span { font-size: 15px; color: #fff; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
#combo.pop b { animation: cpop 0.3s cubic-bezier(.2,1.8,.4,1); }
@keyframes cpop { 0% { transform: scale(0.4) rotate(-15deg); } 60% { transform: scale(1.3) rotate(5deg); } 100% { transform: scale(1) rotate(0); } }
#feverTag { position: absolute; top: calc(var(--st) + clamp(96px, 25vmin, 124px)); left: 50%; transform: translateX(-50%); font-family: var(--heavy); font-weight: 900; font-size: clamp(22px, 7vmin, 36px); white-space: nowrap; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; animation: fever 0.4s linear infinite; }
@keyframes fever { 0% { color: #FF5E7E; transform: translateX(-50%) rotate(-4deg) scale(1); } 33% { color: #FFE14D; transform: translateX(-50%) rotate(3deg) scale(1.08); } 66% { color: #3FE0FF; transform: translateX(-50%) rotate(-2deg) scale(1); } 100% { color: #FF5E7E; transform: translateX(-50%) rotate(-4deg) scale(1); } }
#feverFrame { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s; box-shadow: inset 0 0 40px 14px #FF5EC8; animation: frame 0.6s linear infinite; }
body.fever #feverFrame { opacity: 1; }
@keyframes frame { 0% { box-shadow: inset 0 0 40px 14px #FF5EC8; } 33% { box-shadow: inset 0 0 44px 16px #FFE14D; } 66% { box-shadow: inset 0 0 40px 14px #3FE0FF; } 100% { box-shadow: inset 0 0 40px 14px #FF5EC8; } }
#flash { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; }
#flash.go { animation: flash 0.22s ease-out; }
@keyframes flash { 0% { opacity: 0.75; } 100% { opacity: 0; } }
.coin { position: fixed; left: 0; top: 0; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #FFF6B0, #FFC61A 60%, #E08A00); border: 2px solid var(--ink); pointer-events: none; transition: transform 0.55s cubic-bezier(.5,-0.4,.7,1), opacity 0.55s; z-index: 5; }
.ono.gain { color: #FFE14D; font-size: 20px; }
#resDopa { font-family: var(--heavy); font-weight: 900; font-size: clamp(18px, 6vmin, 28px); color: #D9480F; white-space: nowrap; }
#resDopa small { font-size: 0.55em; color: var(--ink); margin-left: 6px; }

/* ---------- 勝ち抜き ---------- */
#runHud { position: absolute; top: calc(var(--st) + 6px); left: calc(var(--sl) + 8px); right: calc(var(--sr) + 58px); font-family: var(--heavy); font-weight: 900; color: #fff; }
.rrow { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.rrow .nm { font-size: clamp(11px, 3.3vmin, 15px); white-space: nowrap; min-width: 3.6em; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.rrow .num { font-size: clamp(11px, 3.2vmin, 14px); white-space: nowrap; min-width: 4.2em; text-align: right; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
.bar { flex: 1; height: 14px; border: 3px solid var(--ink); border-radius: 8px; background: rgba(74,53,40,0.6); overflow: hidden; }
.bar i { display: block; height: 100%; width: 100%; background: linear-gradient(#FF8A8A, #E8323C); transition: width 0.15s; }
.bar.me i { background: linear-gradient(#9CF59C, #2FB84A); }
.exp { height: 6px; border: 2px solid var(--ink); border-radius: 4px; background: rgba(74,53,40,0.5); overflow: hidden; }
.exp i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #7EF5FF, #B79CFF); transition: width 0.2s; }
#stageTxt { margin-top: 3px; font-size: clamp(10px, 3vmin, 13px); color: #FFE14D; white-space: nowrap; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink); }
.ono.dmgn { color: #fff; font-size: 18px; text-shadow: 1px 1px 0 var(--ink), 2px 2px 0 #E8323C; }
.ono.crit { color: #FFE14D; font-size: 34px; text-shadow: 2px 2px 0 #E8323C, 4px 4px 0 var(--ink); }
.ono.hurt { color: #FF5E5E; font-size: 24px; }
#banner { position: fixed; left: 0; right: 0; top: 34%; text-align: center; pointer-events: none; font-family: var(--heavy); font-weight: 900; animation: bnr 1.8s ease-out forwards; }
#bannerBig { font-size: clamp(34px, 11vmin, 70px); color: #FFE14D; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink); white-space: nowrap; }
#bannerSub { font-size: clamp(15px, 4.8vmin, 26px); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; margin-top: 4px; }
@keyframes bnr { 0% { transform: scale(3) rotate(-8deg); opacity: 0; } 12% { transform: scale(1) rotate(-3deg); opacity: 1; } 80% { opacity: 1; } 100% { transform: scale(1.1) rotate(-3deg); opacity: 0; } }
#pick { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(20, 10, 30, 0.55); pointer-events: auto; padding: 10px; }
.pickTitle { font-family: var(--heavy); font-weight: 900; font-size: clamp(22px, 7vmin, 38px); color: #FFE14D; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; animation: cpop 0.4s cubic-bezier(.2,1.8,.4,1); }
#pickCards { display: flex; gap: clamp(6px, 2vmin, 14px); justify-content: center; }
.card3 { width: clamp(96px, 29vw, 170px); aspect-ratio: 0.68; border-radius: 12px; border: 4px solid var(--ink); background: linear-gradient(#FFF6E0, #F2D9A8); display: flex; flex-direction: column; align-items: center; padding: 6px 5px; gap: 4px; font-family: var(--round); cursor: pointer; box-shadow: 0 6px 0 rgba(0,0,0,0.4); animation: dealIn 0.35s cubic-bezier(.2,1.5,.4,1) backwards; transition: transform 0.1s; }
.card3:nth-child(2) { animation-delay: 0.06s; } .card3:nth-child(3) { animation-delay: 0.12s; }
.card3:active { transform: translateY(4px) scale(0.97); }
.card3.rare { background: linear-gradient(#EAF2FF, #B9CCFF); box-shadow: 0 0 0 3px #7E9BFF, 0 6px 0 rgba(0,0,0,0.4); }
.card3 .cn { font-weight: 900; font-size: clamp(14px, 4.4vmin, 21px); white-space: nowrap; border-bottom: 2px solid rgba(74,53,40,0.3); width: 100%; text-align: center; }
.card3 canvas { width: 88%; aspect-ratio: 1.2; border-radius: 8px; border: 2px solid var(--ink); background: #3A2A4A; }
.card3 .cl { font-size: clamp(10px, 3vmin, 13px); color: #D9480F; font-weight: 900; white-space: nowrap; }
.card3 .cd { font-size: clamp(10px, 3vmin, 13px); font-weight: 800; line-height: 1.3; text-align: center; }
@keyframes dealIn { 0% { transform: translateY(60px) rotate(-10deg) scale(0.5); opacity: 0; } 100% { transform: none; opacity: 1; } }
.pickTimer { width: min(80vw, 420px); height: 10px; border: 3px solid var(--ink); border-radius: 6px; background: rgba(0,0,0,0.4); overflow: hidden; }
.pickTimer i { display: block; height: 100%; background: linear-gradient(90deg, #FF5E3A, #FFE14D); }
.pickHint { color: #fff; font-weight: 900; font-size: clamp(12px, 3.6vmin, 16px); text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink); }
#finale { position: fixed; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 18vh; font-family: var(--heavy); font-weight: 900; }
#finTap { font-size: clamp(40px, 14vmin, 90px); color: #FFE14D; -webkit-text-stroke: 5px var(--ink); paint-order: stroke fill; text-shadow: 6px 6px 0 #E8323C; animation: fever 0.25s linear infinite; white-space: nowrap; }
#finCount { font-size: clamp(22px, 7vmin, 40px); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; }
#finStats { margin-top: 2vh; text-align: center; }
#finStats div { font-size: clamp(16px, 5vmin, 28px); color: #fff; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; white-space: nowrap; }
#finStats .big { font-size: clamp(28px, 9vmin, 58px); color: #FFE14D; text-shadow: 4px 4px 0 #E8323C; }
#finStats .rank { font-size: clamp(26px, 8.5vmin, 52px); color: #FF7AF0; text-shadow: 4px 4px 0 var(--ink); animation: cpop 0.5s cubic-bezier(.2,1.8,.4,1); }
#resLines .cards { white-space: normal; font-size: 12px; }

.exp { position: relative; height: 16px; border-width: 3px; border-radius: 8px; }
.exp i { background: linear-gradient(90deg, #6BE8FF, #B79CFF); }
.exp.pulse i { filter: brightness(1.6); }
#expTxt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; color: #fff; white-space: nowrap; text-shadow: 0 0 2px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); }
#decoyTxt { margin-top: 2px; font-size: clamp(10px, 3vmin, 13px); color: #fff; white-space: nowrap; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink); min-height: 1.2em; }
.ono.expo { color: #7EF5FF; font-size: 13px; text-shadow: 1px 1px 0 var(--ink); }
.ono.heal { color: #7EF59C; font-size: 26px; }
.ono.guard { color: #9EE6FF; font-size: 24px; }
#runHint { position: fixed; left: 50%; bottom: calc(var(--sb) + 18vh); transform: translateX(-50%); color: #fff; font-weight: 900; font-size: clamp(12px, 3.6vmin, 16px); white-space: nowrap; text-shadow: 0 0 3px var(--ink), 0 1px 0 var(--ink), 1px 0 0 var(--ink), -1px 0 0 var(--ink); pointer-events: none; background: rgba(74,53,40,0.45); padding: 4px 10px; border-radius: 10px; }

/* ---------- はみ出し対策（小さい画面・横向き） ---------- */
#bannerBig { font-size: clamp(28px, 10vw, 70px); }
#bannerSub { font-size: clamp(13px, 4.2vw, 26px); white-space: normal; padding: 0 12px; line-height: 1.3; }
#finTap { font-size: clamp(34px, 12vw, 90px); }
#finCount { font-size: clamp(18px, 6vw, 40px); }
#finStats div { font-size: clamp(14px, 4.6vw, 28px); }
#finStats .big { font-size: clamp(26px, 10vw, 58px); }
#finStats .rank { font-size: clamp(24px, 9vw, 52px); }
.pickTitle { font-size: clamp(20px, 6.5vw, 38px); }
.card3 { width: clamp(88px, min(29vw, 40vh), 170px); }
.card3 .cd { overflow: hidden; }
#resLines div { white-space: normal; }
#resGames { font-size: clamp(20px, 7vw, 34px); }
#resTitle { font-size: clamp(24px, 8vw, 40px); white-space: nowrap; }
@media (orientation: landscape) and (max-height: 500px) {
  #pick { gap: 4px; }
  .card3 { width: clamp(80px, 36vh, 150px); gap: 2px; padding: 4px; }
  .card3 canvas { width: 70%; }
  #finale { padding-top: 6vh; }
  #runHud { right: calc(var(--sr) + 58px); max-width: 60vw; }
}
.pickTitle { font-size: clamp(20px, 6vmin, 36px); }
#bannerBig { font-size: clamp(28px, min(10vw, 12vmin), 70px); }
#finTap { font-size: clamp(34px, min(12vw, 14vmin), 90px); }
#finStats .big { font-size: clamp(26px, min(10vw, 11vmin), 58px); }
#finStats .rank { font-size: clamp(24px, min(9vw, 10vmin), 52px); }

#blackout { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.6s; z-index: 20; }
#blackout.on { opacity: 1; pointer-events: auto; }
.opt.locked { color: rgba(74,53,40,0.35); background: repeating-linear-gradient(45deg, #eee, #eee 6px, #e2e2e2 6px, #e2e2e2 12px); }
#rageTxt { position: fixed; left: 0; right: 0; top: 16%; text-align: center; font-family: var(--heavy); font-weight: 900; font-size: clamp(30px, min(11vw, 12vmin), 72px); color: #FF3B3B; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink); animation: rage 0.12s linear infinite; pointer-events: none; z-index: 5; }
@keyframes rage { 0% { transform: translate(-2px, 1px) rotate(-3deg); } 50% { transform: translate(2px, -1px) rotate(2deg); } 100% { transform: translate(-2px, 1px) rotate(-3deg); } }
