/* Chess Parcel — the game screen ("the bench") and the six engines. */

.gl-bench { --n: 18px; background: var(--gl-night); color: var(--gl-on-night); clip-path: polygon(var(--n) 0, 100% 0, 100% calc(100% - var(--n)), calc(100% - var(--n)) 100%, 0 100%, 0 var(--n)); }
.gl-bench-head { display: grid; grid-template-columns: auto 1fr auto auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s5); border-bottom: 1px solid var(--gl-line-night); background: linear-gradient(90deg, hsla(var(--h), 85%, 55%, .28), transparent 60%); }
.gl-bench-thumb { width: 64px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; box-shadow: 0 0 0 1px var(--gl-line-night); }
.gl-bench-title h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem); color: #fff; margin: 0 0 4px; }
.gl-bench-title p { margin: 0; color: var(--gl-on-night-2); }
.gl-bench-title .gl-pill { margin-bottom: var(--s2); }
.gl-bench-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
.gl-bench-chips .gl-chip { color: var(--gl-ink); }
.gl-bench-tools { display: flex; gap: 4px; }
.gl-bench-tools .gl-iconbtn:hover { background: rgba(241, 236, 255, .1); }

.gl-demo-bar { display: flex; justify-content: space-between; align-items: center; gap: var(--s4); padding: var(--s3) var(--s5); background: linear-gradient(90deg, rgba(255, 122, 26, .28), rgba(123, 77, 255, .22)); border-bottom: 1px solid rgba(255, 122, 26, .45); }
.gl-demo-bar h2 { font: 700 1.05rem/1.3 var(--gl-body); margin: 0 0 2px; color: #fff; }
.gl-demo-bar p { margin: 0; font-size: .9rem; color: var(--gl-on-night); }
.gl-demo-acts { display: flex; gap: var(--s2); flex-wrap: wrap; }

.gl-bench-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; }
.gl-bench.is-wide .gl-bench-body { grid-template-columns: 1fr; }
.gl-stage {
  position: relative; display: grid; place-items: center; min-height: 440px; padding: var(--s5);
  background: linear-gradient(rgba(19, 13, 38, .55), rgba(19, 13, 38, .8)), var(--art) center / cover no-repeat;
}
.gl-stage-wait { color: var(--gl-on-night-2); }
.gl-controls { display: grid; align-content: start; gap: var(--s4); padding: var(--s5) var(--s4); border-left: 1px solid var(--gl-line-night); background: var(--gl-night-2); }
.gl-bench.is-wide .gl-controls { border-left: 0; border-top: 1px solid var(--gl-line-night); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); align-items: center; }
.gl-readout { display: grid; gap: var(--s2); margin: 0; }
.gl-readout div { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); padding: 8px 12px; background: rgba(0, 0, 0, .22); border-radius: 8px; }
.gl-readout dt { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--gl-on-night-2); }
.gl-readout dd { margin: 0; font: 700 1.05rem/1.2 var(--gl-mono); color: #fff; }
.gl-readout dd[data-tone="up"] { color: var(--gl-aqua); }
.gl-readout dd[data-tone="part"] { color: var(--gl-tang-2); }
.gl-extra { display: grid; gap: var(--s2); font-size: .9rem; color: var(--gl-on-night-2); }
.gl-extra-line { margin: 0; }
.gl-extra-line b { color: #fff; }
.gl-extra-acts { display: flex; flex-wrap: wrap; gap: var(--s2); }
.gl-extra-field { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gl-extra-field input { width: 92px; min-height: 38px; padding: 0 10px; border: 1px solid var(--gl-line-night); background: rgba(0, 0, 0, .25); color: #fff; border-radius: 8px; }
.gl-pad { display: grid; grid-template-columns: 52px 1fr 52px; gap: var(--s2); align-items: center; }
.gl-stakebtn { display: grid; place-items: center; height: 52px; border: 1px solid var(--gl-line-night); background: rgba(241, 236, 255, .08); color: #fff; border-radius: 12px; cursor: pointer; transition: background-color .15s ease-out, transform .15s var(--gl-ease); }
.gl-stakebtn:hover { background: rgba(241, 236, 255, .16); }
.gl-stakebtn:active { transform: scale(.95); }
.gl-stakebtn:disabled { opacity: .4; cursor: not-allowed; }
.gl-go {
  min-height: 64px; border: 0; cursor: pointer; font: 800 1.15rem/1 var(--gl-body); letter-spacing: .02em;
  color: var(--gl-ink); background: linear-gradient(180deg, var(--gl-tang-2), var(--gl-tang));
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  box-shadow: 0 0 24px rgba(255, 122, 26, .45);
  transition: transform .15s var(--gl-ease), filter .15s ease-out;
}
.gl-go:hover { filter: brightness(1.06); }
.gl-go:active { transform: scale(.97); }
.gl-go:disabled { cursor: progress; filter: saturate(.4) brightness(.85); }
.gl-pad-hint { margin: 0; font-size: .8rem; color: var(--gl-on-night-2); text-align: center; }

/* dossier tabs */
.gl-dossier { margin-top: var(--s5); background: var(--gl-paper); border: 1px solid var(--gl-line); border-radius: 4px 16px 16px 16px; }
.gl-dossier-tabs { display: flex; gap: 2px; padding: var(--s2) var(--s2) 0; border-bottom: 1px solid var(--gl-line); overflow-x: auto; }
.gl-dossier-tabs button { min-height: 46px; padding: 0 18px; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--gl-ink-2); border-bottom: 3px solid transparent; }
.gl-dossier-tabs button[aria-selected="true"] { color: var(--gl-violet); border-bottom-color: var(--gl-tang); }
.gl-dossier-panel { padding: var(--s5); }
.gl-dossier-panel > p { max-width: 72ch; }
.gl-steps { padding-left: 1.3em; max-width: 70ch; }
.gl-steps li { margin-bottom: var(--s2); }
.gl-inline-sym { display: inline-block; vertical-align: middle; width: 36px; height: 36px; }

/* hold & spin */
.gl-hs { width: min(100%, 680px); }
.gl-reels { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 10px; background: rgba(12, 8, 26, .72); border: 2px solid hsla(var(--h), 90%, 62%, .7); box-shadow: 0 0 28px hsla(var(--h), 90%, 60%, .4), inset 0 0 22px rgba(0, 0, 0, .6); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.gl-reel { overflow: hidden; aspect-ratio: 1 / 3; background: rgba(255, 255, 255, .04); border-radius: 8px; }
.gl-rstrip { display: flex; flex-direction: column; will-change: transform; }
.gl-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; padding: 8%; }
.gl-cell img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .45)); }
.gl-cell.is-empty { background: rgba(255, 255, 255, .03); }
.gl-cell.is-hit { background: radial-gradient(circle, rgba(255, 163, 92, .55), transparent 72%); box-shadow: inset 0 0 0 2px var(--gl-tang-2); border-radius: 8px; animation: gl-glow .9s ease-in-out 2; }
@keyframes gl-glow { 50% { transform: scale(1.06); } }
.gl-orb-v { position: absolute; left: 50%; bottom: 8%; transform: translateX(-50%); padding: 2px 8px; border-radius: 6px; background: rgba(12, 8, 26, .85); color: #fff; font: 800 clamp(.7rem, 1.8vw, 1rem)/1.3 var(--gl-mono); border: 1px solid var(--gl-tang-2); white-space: nowrap; }
.gl-cell--orb.is-new { animation: gl-orbin .4s var(--gl-ease); }
@keyframes gl-orbin { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.gl-reels.is-respin .gl-cell.is-empty { background: rgba(255, 255, 255, .1); }
.gl-hs-flag { margin: 0 0 var(--s3); padding: 8px 14px; text-align: center; font: 700 1rem/1.3 var(--gl-body); color: var(--gl-ink); background: linear-gradient(90deg, var(--gl-tang-2), var(--gl-aqua)); border-radius: 999px; }
.gl-stage.is-holding .gl-reels { border-color: var(--gl-aqua); }

/* scratch */
.gl-scratch { width: min(100%, 460px); padding: var(--s4); background: rgba(12, 8, 26, .78); border: 2px solid hsla(var(--h), 90%, 62%, .7); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.gl-scratch-title { margin: 0 0 var(--s3); text-align: center; font: 700 1.1rem/1.2 var(--gl-display); color: #fff; }
.gl-scratch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gl-sq { position: relative; aspect-ratio: 1; display: grid; place-items: center; background: #fff8ef; border-radius: 10px; overflow: hidden; }
.gl-sq img { width: 78%; height: 78%; object-fit: contain; }
.gl-sq canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.gl-sq.is-blank { background: linear-gradient(135deg, #7b5cf0, #c7b8ff 50%, #ff8a3d); }
.gl-sq.is-hit { box-shadow: inset 0 0 0 4px var(--gl-tang); background: #fff1e0; }

/* keno */
.gl-keno { width: min(100%, 620px); }
.gl-keno-board { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; padding: 10px; background: rgba(12, 8, 26, .75); border-radius: 14px; }
.gl-lamp { aspect-ratio: 1; min-height: 34px; border: 1px solid rgba(241, 236, 255, .18); border-radius: 50%; background: rgba(255, 255, 255, .06); color: var(--gl-on-night); font: 700 .9rem/1 var(--gl-mono); cursor: pointer; transition: background-color .15s ease-out, transform .15s var(--gl-ease); }
.gl-lamp:hover { background: rgba(255, 255, 255, .14); }
.gl-lamp.is-picked { background: var(--gl-violet-2); border-color: #c3b0ff; color: #fff; }
.gl-lamp.is-lit { background: hsla(var(--h), 90%, 60%, .45); box-shadow: 0 0 12px hsla(var(--h), 90%, 60%, .7); }
.gl-lamp.is-match { background: var(--gl-tang); color: var(--gl-ink); box-shadow: 0 0 16px var(--gl-tang); transform: scale(1.06); }

/* pusher */
.gl-pusher { width: min(100%, 680px); }
.gl-pusher canvas { width: 100%; height: auto; border-radius: 14px; border: 2px solid hsla(var(--h), 90%, 62%, .6); box-shadow: 0 0 26px hsla(var(--h), 90%, 60%, .3); }

/* surge */
.gl-surge { position: relative; width: min(100%, 760px); }
.gl-surge canvas { width: 100%; height: auto; border-radius: 14px; border: 1px solid var(--gl-line-night); }
.gl-surge-figure { position: absolute; top: 16px; right: 20px; margin: 0; font: 800 clamp(1.6rem, 4vw, 2.8rem)/1 var(--gl-mono); color: #fff; text-shadow: 0 0 18px hsla(var(--h), 95%, 60%, .9); }
.gl-surge-figure[data-state="bust"] { color: #a59bb8; text-shadow: none; }
.gl-surge-figure[data-state="collect"] { color: var(--gl-aqua); }

/* hi-lo */
.gl-hilo { display: grid; justify-items: center; gap: var(--s4); }
.gl-cardslot { perspective: 700px; }
.gl-card {
  display: grid; grid-template-rows: auto 1fr auto; width: 150px; aspect-ratio: 5 / 7; padding: 10px 12px; border-radius: 12px;
  background: #fffdf8; color: #1d1535; box-shadow: 0 0 0 3px hsla(var(--h), 90%, 62%, .9), 0 0 30px hsla(var(--h), 90%, 60%, .5);
  font: 800 1.4rem/1 var(--gl-display);
}
.gl-card b { display: grid; place-items: center; font-size: 3.4rem; }
.gl-card span:last-child { justify-self: end; transform: rotate(180deg); }
.gl-card--red { color: #c4123b; }
.gl-card.is-back { background: repeating-linear-gradient(45deg, #5a2fd0 0 10px, #7b4dff 10px 20px); }
.gl-card.is-turned { animation: gl-turn .28s var(--gl-ease); }
@keyframes gl-turn { from { transform: rotateY(70deg); opacity: .4; } to { transform: none; opacity: 1; } }
.gl-trail { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; min-height: 28px; }
.gl-trail li { padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); font: 600 .85rem/1.5 var(--gl-mono); }
.gl-hilo-fig { margin: 0; font: 800 2rem/1 var(--gl-mono); color: #fff; }
.gl-hilo-fig[data-state="up"] { color: var(--gl-aqua); }
.gl-hilo-fig[data-state="out"] { color: #a59bb8; }
.gl-extra-acts--calls { display: grid; grid-template-columns: 1fr 1fr; }
.gl-callbtn { display: grid; gap: 2px; min-height: 56px; border: 1px solid var(--gl-line-night); background: rgba(123, 77, 255, .35); color: #fff; font-weight: 800; border-radius: 12px; cursor: pointer; transition: background-color .15s ease-out; }
.gl-callbtn small { font: 600 .8rem/1 var(--gl-mono); color: var(--gl-on-night-2); }
.gl-callbtn:hover { background: rgba(123, 77, 255, .55); }
.gl-callbtn:disabled { opacity: .45; cursor: not-allowed; }

@media (max-width: 900px) {
  .gl-bench-body { grid-template-columns: 1fr; }
  .gl-controls { border-left: 0; border-top: 1px solid var(--gl-line-night); }
  .gl-bench-head { grid-template-columns: auto 1fr auto; }
  .gl-bench-chips { grid-column: 1 / -1; grid-row: 2; }
}
@media (max-width: 560px) {
  .gl-bench-head { padding: var(--s3); gap: var(--s3); }
  .gl-bench-thumb { width: 48px; }
  .gl-demo-bar { flex-direction: column; align-items: flex-start; padding: var(--s3); }
  .gl-stage { min-height: 320px; padding: var(--s3) var(--s2); }
  .gl-reels { gap: 3px; padding: 6px; }
  .gl-keno-board { gap: 4px; padding: 6px; }
  .gl-lamp { min-height: 0; font-size: .72rem; }
  .gl-dossier-panel { padding: var(--s4); }
}
