/* Panjat Pinang Matematika: tata letak khusus (panel kiri | dua tiang | panel kanan) */
.pp .arena { grid-template-columns: 1fr minmax(170px, .78fr) 1fr; }
.pp .team { gap: clamp(4px, 1vh, 12px); }
.pp .team h2 { font-size: clamp(14px, 2vw, 24px); }

.pp .qbox {
  flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 10px;
  background: #fff; border: 4px solid var(--line); border-radius: 22px; padding: clamp(3px, 1vh, 12px) 8px;
  font-family: var(--font); font-weight: 800; color: var(--ink); line-height: 1.1; text-align: center;
}
.pp .team.a .qbox { border-color: var(--team-a); } .pp .team.b .qbox { border-color: var(--team-b); }
.pp .q { font-size: clamp(22px, 3.6vw, 56px); }
.pp .ans {
  min-width: 2.2em; padding: 0 .3em; border-radius: 14px; background: var(--sky-50); border: 3px dashed var(--muted);
  font-size: clamp(22px, 3.6vw, 56px); color: var(--ink);
  line-height: 1; height: 1.25em; display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
}
.pp .ans.blank { color: var(--muted); }
.pp .ans.shake { animation: pp-shake .35s; }
@keyframes pp-shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.keypad { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 1fr); gap: clamp(4px, 1vw, 12px); min-height: 0; }
.key {
  border: 0; border-radius: 18px; font-family: var(--font); font-weight: 800; font-size: clamp(20px, 3.4vw, 46px);
  color: #fff; cursor: pointer; min-height: 0; padding: 0; display: grid; place-items: center;
  box-shadow: 0 5px 0 rgba(0,0,0,.2); transition: transform .08s ease, filter .12s ease;
}
.team.a .key { background: var(--team-a); } .team.b .key { background: var(--team-b); }
.key.del { background: var(--muted) !important; }
.key.ok { background: var(--ok) !important; }
.key svg { width: 46%; max-width: 34px; height: auto; }
.key:active { transform: translateY(3px) scale(.97); box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.key:focus-visible { outline: 4px solid var(--amber); outline-offset: 2px; }
.team.locked .key, .team.bot .key { filter: grayscale(.6) brightness(.9); pointer-events: none; }

/* tiang */
.poles {
  display: flex; gap: 6%; justify-content: center; padding: 6px 4% 0;
  background: linear-gradient(180deg, #bae6fd, #e0f2fe 55%, #bbf7d0);
  border-left: 3px solid #fff; border-right: 3px solid #fff; min-height: 0;
}
.lane { --ch: clamp(52px, 11vh, 96px); flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; min-height: 0; position: relative; --p: 0; }
.lane .prize { flex: none; height: clamp(30px, 8vh, 56px); width: auto; z-index: 2; margin-bottom: -6px; }
.lane .track { flex: 1; position: relative; width: 100%; min-height: 0; border-bottom: 8px solid #16a34a; }
.lane .pole {
  position: absolute; left: 50%; width: clamp(14px, 2.2vw, 26px); top: 0; bottom: 0; transform: translateX(-50%);
  background: repeating-linear-gradient(180deg, #a16207 0 22px, #854d0e 22px 26px); border-radius: 8px 8px 0 0;
  box-shadow: inset -5px 0 0 rgba(0,0,0,.14), inset 4px 0 0 rgba(255,255,255,.18);
}
.lane.a .pole { border-top: 5px solid var(--team-a); } .lane.b .pole { border-top: 5px solid var(--team-b); }
.lane .marks i {
  position: absolute; left: 50%; width: clamp(24px, 3.4vw, 40px); height: 3px; margin-left: calc(clamp(24px, 3.4vw, 40px) / -2);
  bottom: calc(var(--f) * (100% - var(--ch)) + var(--ch) * .5); background: rgba(255,255,255,.7); border-radius: 2px;
}
.climber {
  position: absolute; left: 50%; width: var(--ch); margin-left: calc(var(--ch) * -.62); z-index: 3;
  bottom: calc(var(--p) * (100% - var(--ch))); transition: bottom .55s cubic-bezier(.3, 1.3, .5, 1);
}
.climber img { display: block; width: 100%; height: auto; transform-origin: 62% 50%; }
.climber.up img { animation: pp-up .5s; }
.climber.down img { animation: pp-down .6s; }
.climber.stay img { animation: pp-shake .35s; }
@keyframes pp-up { 40% { transform: scale(1.12) rotate(-4deg); } }
@keyframes pp-down { 30% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } }
.lane.won .prize { animation: pp-win .6s ease-in-out 3; }
@keyframes pp-win { 50% { transform: scale(1.35) rotate(-8deg); } }

@media (max-width: 700px) and (orientation: portrait) {
  .pp .arena { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, .8fr) minmax(0, 1.2fr); }
  .pp .poles { grid-column: 1 / -1; grid-row: 1; border: 0; border-bottom: 3px solid #fff; gap: 20%; }
  .pp .team.a { grid-column: 1; grid-row: 2; border-bottom: 0; border-right: 3px solid #fff; }
  .pp .team.b { grid-column: 2; grid-row: 2; }
  .pp .q, .pp .ans { font-size: clamp(18px, 6vw, 30px); }
}
@media (max-height: 520px) {
  .pp .team h2 { font-size: 13px; }
  .pp .qbox { border-width: 3px; border-radius: 14px; padding: 2px 6px; }
  .pp .q, .pp .ans { font-size: clamp(17px, 8vh, 34px); }
  .pp .ans { border-width: 2px; border-radius: 10px; }
  .key { font-size: clamp(16px, 8vh, 30px); border-radius: 12px; box-shadow: 0 3px 0 rgba(0,0,0,.2); }
  .lane { --ch: clamp(40px, 15vh, 70px); }
}
@media (prefers-reduced-motion: reduce) { .climber { transition: none; } .climber img, .lane.won .prize { animation: none; } }
