/* Pour and Compare (js/arcade/pourcompare.js, and its 3D picture js/arcade-3d/pourcompare3d.js). Every class starts with .pc- */

.pc-wrap { position: relative; display: grid; gap: 8px; width: min(100%, 600px); margin: 0 auto; padding-bottom: 14px; }

/* ---------- HUD: the question she is on, the stars she can win, the score ---------- */
.pc-hud { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px 12px; font: 700 14px var(--font-ui); color: var(--muted); }
.pc-hud b { color: var(--ink); font-size: 19px; }
.pc-stars { display: inline-flex; gap: 3px; }
.pc-star {
  --f: 0%; width: 24px; height: 24px;
  clip-path: polygon(50% 2%, 62% 36%, 98% 37%, 69% 59%, 80% 94%, 50% 73%, 20% 94%, 31% 59%, 2% 37%, 38% 36%);
  background: linear-gradient(90deg, var(--sun) var(--f), var(--tile-shadow) var(--f));
}
.pc-star.pc-half { --f: 50%; }
.pc-star.pc-full { --f: 100%; animation: pc-pop 0.45s; }
@keyframes pc-pop { 0% { transform: scale(0.6); } 60% { transform: scale(1.25); } 100% { transform: none; } }

/* ---------- the question ---------- */
.pc-q { margin: 0; min-height: 62px; display: grid; place-items: center; padding: 8px 14px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow-soft); text-align: center; font: 700 17px/1.25 var(--font-read); color: var(--grape-d); text-wrap: balance; }

/* ---------- the containers: a 3D picture she can turn, or the flat drawing ---------- */
.pc-stage { position: relative; border-radius: var(--radius); background: color-mix(in srgb, var(--sun) 12%, white); box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--sun) 50%, white), var(--shadow-soft); }
.pc-view { position: relative; height: clamp(190px, 37vh, 340px); height: clamp(190px, 37dvh, 340px); overflow: hidden; border-radius: var(--radius); }
.pc-gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; outline-offset: -4px; }
.pc-gl.is-held { cursor: grabbing; }
.pc-tags { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pc-tag { position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform; font: 700 15px/1.2 var(--font-read); color: var(--ink); text-shadow: 0 0 3px var(--card), 0 0 3px var(--card), 0 0 3px var(--card); }
.pc-tag-mark, .pc-frac { display: inline-grid; justify-items: center; font: 800 13px/1.05 var(--font-ui); }
.pc-tag-mark i, .pc-frac i { font-style: normal; padding: 0 3px; }
.pc-tag-mark i + i, .pc-frac i + i { border-top: 2px solid currentColor; }
.pc-flat { position: absolute; inset: 0; display: grid; place-items: center; padding: 6px; }
.pc-3d .pc-flat { display: none; }
.pc-flat-svg { display: block; width: 100%; height: 100%; }
.pc-flat-glass { fill: color-mix(in srgb, var(--grape) 7%, transparent); stroke: var(--grape-d); stroke-width: 2.5; stroke-linejoin: round; }
.pc-flat-glass ellipse { fill: none; stroke-width: 1.5; opacity: 0.6; }
.pc-flat-water { fill: var(--sky-d); }
.pc-flat-top { fill: color-mix(in srgb, var(--sky) 65%, white); stroke: color-mix(in srgb, var(--sky) 65%, white); stroke-width: 3; }
.pc-flat-stream { fill: none; stroke: var(--sky); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.pc-flat-line { stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; opacity: 0.75; }
.pc-flat-mark text { font: 800 16px var(--font-ui); fill: var(--ink); text-anchor: middle; dominant-baseline: central; }
.pc-flat-mark line { stroke: var(--ink); stroke-width: 2; }
.pc-flat-name { font: 700 19px var(--font-read); fill: var(--ink); text-anchor: middle; }
.pc-stage.pc-right { box-shadow: inset 0 0 0 4px var(--green-d), var(--shadow-soft); background: color-mix(in srgb, var(--green) 20%, white); }

.pc-turns { position: absolute; right: 8px; top: 8px; display: none; }
.pc-3d .pc-turns { display: block; }
.pc-turn { min-height: 44px; padding: 6px 14px; border: 0; border-radius: 22px; background: var(--card); box-shadow: 0 3px 0 var(--tile-shadow); font: 700 15px var(--font-ui); color: var(--ink); touch-action: manipulation; cursor: pointer; }
.pc-turn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--tile-shadow); }

.pc-msg { min-height: 64px; margin: 0; display: grid; place-items: center; text-align: center; font: 700 16px/1.3 var(--font-read); color: var(--ink); text-wrap: balance; }

/* ---------- her guess: two to four choices ---------- */
.pc-choices { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 8px; }
.pc-choice { min-height: 60px; padding: 6px 4px; display: grid; place-items: center; font-size: 26px; touch-action: manipulation; }
.pc-choice .pc-frac { font-size: 22px; }
.pc-choice.pc-off { opacity: 0.35; }
.pc-choice.pc-picked { box-shadow: 0 5px 0 var(--c-d), 0 0 0 4px var(--sun); }
.pc-choice.pc-out { opacity: 0.35; }
.pc-choice.pc-yes { --c: var(--green); --c-d: var(--green-d); opacity: 1; }

/* ---------- Pour, and the count of pours ---------- */
.pc-act { margin-top: 4px; display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; }
.pc-count { display: grid; justify-items: center; min-width: 76px; padding: 4px 10px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow-soft); font: 700 13px/1.1 var(--font-ui); color: var(--muted); }
.pc-count b { font: 900 28px/1 var(--font-ui); color: var(--grape-d); }
.pc-pour { min-height: 58px; font-size: 24px; color: var(--ink); touch-action: manipulation; }
.pc-pour.pc-off { opacity: 0.4; }
.pc-pour.pc-go { animation: pc-go 1.2s ease-in-out infinite; }
@keyframes pc-go { 50% { box-shadow: 0 5px 0 var(--c-d), 0 0 0 5px color-mix(in srgb, var(--sky) 45%, transparent); } }

.pc-no { animation: pc-no 0.32s; }
@keyframes pc-no { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* iPad: more room */
@media (min-width: 700px) {
  .pc-wrap { gap: 12px; }
  .pc-q { font-size: 23px; min-height: 76px; }
  .pc-view { height: clamp(300px, 38vh, 440px); }
  .pc-msg { font-size: 19px; }
  .pc-tag { font-size: 18px; }
  .pc-tag-mark { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .pc-star.pc-full, .pc-no, .pc-pour.pc-go { animation: none; }
}
