/* Pulled Chai styles */
html, body { overflow-x: hidden; }
#game { display: block; }
.pc-stage {
  position: relative; width: 100%; max-width: 560px; margin: 0 auto;
  height: calc(100svh - 50px); min-height: 500px; max-height: 900px;
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  outline: none;
}
.pc-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

/* HUD */
.pc-hud {
  position: absolute; left: 0; right: 0; top: 0; z-index: 2; padding: 8px 12px 6px;
  background: color-mix(in srgb, var(--paper) 97%, transparent); border-bottom: 2px solid var(--ink);
  font-variant-numeric: tabular-nums;
}
.pc-stage[data-mode="title"] .pc-hud > *, .pc-stage[data-mode="result"] .pc-hud > * { visibility: hidden; }
.pc-hud-main { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 8px; }
.pc-stat { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.pc-stat small, .pc-combo small { font: 600 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.pc-stat b { font: 700 20px var(--mono); }
.pc-stat.low b { color: var(--bad); }
.pc-stat[hidden] { display: flex; visibility: hidden; }
.pc-froth { align-items: center; }
.pc-froth b { font: 800 30px var(--display); color: var(--game); }
.pc-pull { align-items: flex-end; text-align: right; }
.pc-hud-sub { display: flex; align-items: center; gap: 8px; margin-top: 4px; font: 600 12px var(--body); flex-wrap: wrap; }
.pc-combo { display: flex; align-items: center; gap: 6px; flex: 1 1 120px; min-width: 0; }
.pc-bar { flex: 1; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; border: 1px solid var(--ink); min-width: 40px; }
.pc-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent-2), var(--game)); transition: width .15s; }
.pc-hud-sub .chip { padding: 4px 10px; font-size: 12px; }

/* chaiwala speech and hints */
.pc-say {
  position: absolute; z-index: 3; left: 12px; top: 40%; transform: translateY(8px); margin: 0; max-width: min(55%, 260px);
  padding: 8px 14px; border-radius: 14px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink);
  font: 700 15px var(--body); box-shadow: 3px 3px 0 var(--ink); opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; text-align: left;
}
.pc-say.on { opacity: 1; transform: none; }
.pc-stage:not([data-mode="play"]) .pc-say { display: none; }
.pc-hint {
  position: absolute; z-index: 3; left: 16px; right: 16px; bottom: 18%; margin: 0; text-align: center;
  font: 700 15px var(--body); color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.7); opacity: 0; transition: opacity .3s; pointer-events: none;
}
.pc-hint.on { opacity: 1; animation: pc-pulse 1.6s ease-in-out infinite; }
.pc-stage:not([data-mode="play"]) .pc-hint { display: none; }
@keyframes pc-pulse { 50% { opacity: .6; } }

/* title and result cards */
.pc-screen {
  position: absolute; inset: 0; z-index: 4; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 35%, transparent); overflow-y: auto; touch-action: pan-y;
}
.pc-screen[hidden] { display: none; }
.pc-card {
  width: 100%; max-width: 400px; margin: auto; padding: 20px; border: 2px solid var(--ink); border-radius: var(--radius);
  background: var(--paper); box-shadow: 5px 5px 0 var(--ink);
}
.pc-card h1 { font-size: 40px; margin: 0 0 4px; color: var(--game); }
.pc-lead { margin: 0 0 12px; font-weight: 600; }
.pc-today { padding: 10px 12px; border: 1.5px dashed var(--line); border-radius: 12px; margin-bottom: 10px; }
.pc-today small, .pc-result > small, .pc-board small { font: 600 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pc-today h2 { font-size: 20px; margin: 2px 0 4px; }
.pc-today ul { margin: 0; padding-left: 18px; font-size: 14px; }
.pc-best { margin: 6px 0; }
.pc-actions { margin: 12px 0 8px; }
.pc-actions .btn { flex: 1 1 auto; }
.pc-toggles { margin-bottom: 6px; }
.pc-small { font-size: 13px; margin: 6px 0 0; }
.pc-big { font: 800 48px/1 var(--display); color: var(--game); margin: 4px 0 6px; }
.pc-quote { margin: 0 0 12px; font-weight: 600; font-style: italic; }
.pc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pc-stats div { padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; }
.pc-stats small { font: 600 11px var(--body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.pc-stats b { font: 700 18px var(--mono); }
.pc-rank { margin: 12px 0 0; font-weight: 700; }
.pc-board { margin-top: 8px; }
.pc-board .board-list { margin: 6px 0; }

@media (max-width: 380px) {
  .pc-stat b { font-size: 17px; }
  .pc-froth b { font-size: 26px; }
  .pc-card { padding: 16px; }
  .pc-card h1 { font-size: 34px; }
  .pc-big { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) { .pc-hint.on { animation: none; } }
