/* Partner Arcade: the game table shared by every game page
   (board plate + scene on the left, your play on the right, phone dock). Load after shared.css. */
.table {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: clamp(16px, 2vw, 28px); align-items: start;
  max-width: 1320px; margin: 0 auto; padding: clamp(8px, 2vh, 24px) var(--gutter) 0;
}
.controls { display: flex; flex-direction: column; gap: 22px; animation: rise .8s var(--ease) .15s backwards; }
.board { display: flex; flex-direction: column; gap: 22px; min-width: 0; animation: rise .8s var(--ease) backwards; }

/* ---------- controls ---------- */
.ctl { display: flex; flex-direction: column; gap: 12px; }
.ctl__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ctl__head span:last-child { font: 500 13px/1 var(--sans); color: var(--t3); font-variant-numeric: tabular-nums; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.err { margin: 0; padding: 12px 14px; border-radius: 13px; background: var(--error-fill); box-shadow: inset 0 0 0 1px var(--error-line); font: 400 14px/1.45 var(--sans); color: var(--error-text); }
.err[hidden] { display: none; }
.err button { margin-left: 4px; padding: 0; border: 0; background: none; color: var(--cream); font: 600 14px/1 var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.payout { display: grid; grid-template-columns: 1fr 1fr; padding: 16px 18px; gap: 12px; }
.payout .label { margin-bottom: 10px; }
.payout b { font: 700 18px/1 var(--sans); font-variant-numeric: tabular-nums; }
.payout div + div { padding-left: 14px; border-left: 1px solid var(--hair); }
.mainkey .keycap__face { height: 68px; font-size: 18px; }
.mainkey.is-busy .keycap__face { --kc-ink: rgba(11, 11, 11, .55); }
.hint { margin: -8px 0 0; text-align: center; font: 400 13px/1.4 var(--sans); color: var(--t3); }
.session { display: grid; grid-template-columns: repeat(3, 1fr); padding-top: 18px; box-shadow: inset 0 1px 0 rgba(0, 0, 0, .7), inset 0 2px 0 rgba(255, 255, 255, .035); }
.session div { display: flex; flex-direction: column; gap: 8px; }
.session div + div { padding-left: 14px; border-left: 1px solid var(--hair); }
.session b { font: 700 16px/1 var(--sans); font-variant-numeric: tabular-nums; }
.note { margin: 0; font: 400 13.5px/1.55 var(--sans); color: var(--t2); }

/* ---------- board header + history ---------- */
.board__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.board__title { margin: 0; font: 850 clamp(26px, 2.4vw, 34px)/1 var(--display); text-transform: uppercase; font-stretch: 110%; font-variation-settings: 'wdth' 110; letter-spacing: -.005em; }
.hist { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; min-height: 34px; }
.hist li {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 11px; border-radius: 11px;
  background: linear-gradient(195deg, var(--well-hi), var(--well-lo)); box-shadow: var(--sh-well);
  font: 600 13px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--t3);
  animation: chip .45s var(--spring);
}
.hist li.win { color: var(--cream); box-shadow: var(--sh-well), inset 0 0 0 1px rgba(242, 240, 236, .16); }
.hist li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: rgba(229, 140, 125, .7); }
.hist li.win::before { background: var(--cream); box-shadow: 0 0 6px rgba(242, 240, 236, .8); }
.hist__empty { font: 400 13px/34px var(--sans); color: var(--t3); }
@keyframes chip { from { opacity: 0; transform: translateX(-10px) scale(.9); } }

/* ---------- scene: the object on the left, the result on the right ---------- */
.scene {
  --glow: 236, 230, 218; --fx: .25;
  position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center;
  min-height: clamp(260px, 34vh, 340px); border-radius: 20px;
  background: radial-gradient(120% 100% at 80% 0%, #151516, #0b0b0c 70%); box-shadow: var(--sh-well);
}
.scene.is-win { --fx: 1; }
.scene__rays {
  position: absolute; left: 30%; top: 52%; width: 120%; aspect-ratio: 1; translate: -50% -50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(var(--glow), .1) 0deg 2.5deg, rgba(var(--glow), 0) 2.5deg 14deg);
  -webkit-mask: radial-gradient(closest-side, #000 12%, transparent 66%); mask: radial-gradient(closest-side, #000 12%, transparent 66%);
  opacity: calc(var(--fx) * .7); transition: opacity .8s var(--ease); animation: spin 60s linear infinite;
}
.scene__halo {
  position: absolute; left: 30%; top: 52%; width: 70%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(var(--glow), .16), rgba(var(--glow), 0)); opacity: calc(.4 + var(--fx) * .6); transition: opacity .8s var(--ease);
}
.scene .sparks { left: 30%; top: 50%; }
.scene__obj { position: relative; height: 100%; min-height: 220px; display: grid; place-items: center; perspective: 900px; perspective-origin: 50% 30%; }
.scene__out { position: relative; padding: 28px clamp(20px, 3vw, 40px) 28px 0; text-align: right; }
.scene__out .label { margin-bottom: 14px; }
.num {
  display: block; font: 850 clamp(64px, 8.4vw, 132px)/.86 var(--display); font-stretch: 88%; font-variation-settings: 'wdth' 88;
  letter-spacing: -.04em; font-variant-numeric: tabular-nums; color: var(--t3); transition: color .3s, text-shadow .5s;
}
.num.is-spin { color: var(--t2); filter: blur(.6px); }
.num.is-win { color: var(--cream); text-shadow: 0 0 40px rgba(242, 240, 236, .28); }
.num.is-lose { color: rgba(242, 240, 236, .62); }
.num.is-pop { animation: pop .5s var(--spring); }
@keyframes pop { 40% { transform: scale(1.06); } }
.status { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; min-height: 22px; font: 500 15px/1.4 var(--sans); color: var(--t2); }
.status b { color: var(--cream); font-weight: 700; font-variant-numeric: tabular-nums; }
.status .led { display: none; }
.status.is-win .led, .status.is-lose .led { display: block; }

.foot { max-width: 1320px; margin: 0 auto; padding: clamp(56px, 8vh, 96px) var(--gutter) 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 12px 32px; font: 400 13px/1.55 var(--sans); color: var(--t4); }
.foot p { margin: 0; max-width: 72ch; }

/* phones: a fixed clay dock keeps the main key under the thumb */
.dock { display: none; }
@media (max-width: 960px) {
  .table { grid-template-columns: 1fr; max-width: 720px; }
  .board { order: -1; }
  body { padding-bottom: 96px; }
  .dock {
    position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 14px;
    padding: 12px 12px 12px 18px; border-radius: 22px;
    background: linear-gradient(195deg, #222224, #19191b 55%, #141416); box-shadow: var(--clay-edge), -14px 22px 40px rgba(0, 0, 0, .7);
  }
  .dock__info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
  .dock__info b { font: 700 16px/1 var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .dock .keycap__face { min-width: 120px; }
}
@media (max-width: 620px) {
  .scene { grid-template-columns: 1fr; }
  .scene__obj { min-height: 180px; }
  .scene__out { padding: 0 20px 24px; text-align: center; }
  .scene__rays, .scene__halo, .scene .sparks { left: 50%; top: 32%; }
  .hist li:nth-child(n+5) { display: none; }
}
