* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
:root {
  --theme: #FF8A3D; --ink: #5A3412; --cream: #FBEFD9;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
html, body { margin: 0; height: 100%; overflow: hidden; background: #F3D9B4; color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
  user-select: none; -webkit-user-select: none; touch-action: none; }

.bg { position: fixed; inset: -24px; z-index: 0;
  background: url(images/gen/gptimg_1795577016_look.png) center / cover no-repeat;
  filter: blur(6px) saturate(1.1); }
.bg::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(rgba(255, 240, 220, .35), rgba(255, 228, 196, .55)); }

.game { position: relative; z-index: 1; height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 10px; padding: 10px 12px 12px; }

.hud { display: flex; gap: 8px; }
.chip { flex: 1; min-height: 58px; padding: 4px 8px; border-radius: 16px; color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(#C98447, #A8642C); border: 3px solid #7A4519;
  box-shadow: 0 3px 0 #6B3B14, 0 6px 12px rgba(90, 50, 20, .25); }
.chip.score { flex: 1.3; }
.chip .lbl { font-size: 12px; opacity: .92; display: flex; align-items: center; gap: 2px; }
.chip .mp-icon { font-size: 13px; width: 13px; height: 13px; color: #FFE27A; }
.chip b { font-size: 22px; line-height: 1.1; color: #FFE27A; text-shadow: 0 2px 0 #7A4519; }
.chip.next canvas { width: 34px; height: 34px; }

.board { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 22px;
  background: linear-gradient(#FFF6E6, #F5DFBC); border: 8px solid #B8743A;
  box-shadow: inset 0 0 0 2px #E2B07A, 0 6px 0 #7A4519, 0 10px 24px rgba(90, 50, 20, .3);
  transition: border-color .3s; }
.board::after { content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: 14px;
  box-shadow: inset 0 0 calc(44px * var(--danger, 0)) calc(14px * var(--danger, 0)) rgba(255, 50, 30, calc(.85 * var(--danger, 0))); }
.board.danger { border-color: #C9502E; }
.board.danger::after { animation: pulse .55s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .5; } to { opacity: 1; } }
#cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.overlay { position: fixed; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(60, 30, 10, .45); }
.hide { display: none !important; }
.panel { width: 100%; max-width: 360px; max-height: 100%; overflow: auto; text-align: center;
  padding: 20px 16px; border-radius: 24px; background: var(--cream); border: 4px solid #B8743A;
  box-shadow: 0 6px 0 #7A4519, 0 16px 40px rgba(0, 0, 0, .3); }
.panel h2 { margin: 0 0 6px; font-size: 24px; color: #8A4F22; }
.tip { margin: 4px 0 12px; font-size: 14px; line-height: 1.5; color: #9A7350; }
.route { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 0; margin: 6px 0 12px; }
.route .step { width: 50px; display: flex; flex-direction: column; align-items: center; }
.route canvas { width: 44px; height: 44px; }
.route .name { margin-top: 2px; font-size: 11px; color: #7A4A22; }
.route .arrow { width: 12px; margin-top: -14px; font-size: 18px; font-weight: 700; color: #E08A3D; }
.btn { display: block; width: 100%; height: 52px; border: none; border-radius: 26px; color: #fff;
  font-size: 18px; font-weight: 700; background: linear-gradient(#FFA25E, var(--theme));
  box-shadow: 0 4px 0 #C9601F; }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #C9601F; }
.best-line { margin: 12px 0 0; font-size: 13px; color: #9A7350; }
.final { margin: 8px 0 4px; font-size: 16px; color: #8A4F22; }
.final b { display: block; font-size: 40px; color: var(--theme); }
.newbest { margin: 0; font-weight: 700; color: #E0452B; }
