.pit-stack-page { max-width: 1160px; margin: 0 auto; padding: 26px 22px 50px; }
.pit-stack-heading { display: flex; justify-content: space-between; gap: 20px; align-items: end; margin-bottom: 20px; }
.pit-stack-heading a { color: #a6b1bd; text-decoration: none; font-size: 12px; }
.pit-stack-eyebrow { margin: 14px 0 6px; font-size: 10px; font-weight: 800; letter-spacing: .19em; color: #acbbc5; }
.pit-stack-heading h1 { font: 40px/1.05 "Russo One", sans-serif; margin: 0; }
.pit-stack-heading h1 { font-size: clamp(36px,5vw,64px); letter-spacing: -.035em; }
.pit-stack-heading h1 em { color: #ef5358; font-style: normal; }
.pit-stack-lede { color: #99a9b9; font-size: 13px; margin: 12px 0 0; }
.pit-stack-heading .pit-stack-admin { border: 1px solid #36414d; padding: 10px 14px; border-radius: 8px; background: #121b24; white-space: nowrap; }
.pit-stack-page > .arcade-game-nav { margin-bottom: 24px; }
.pit-stack-heading h1 span { font: 13px "Manrope", sans-serif; color: #9daeb9; margin-left: 10px; white-space: nowrap; }
.pit-stack-private { margin: 0; font-size: 12px; text-align: right; color: #efd2a2; line-height: 1.8; }
.pit-stack-private span { color: #8996a3; font-size: 11px; }
.tetris-machine { position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: 54px minmax(0,1fr); height: min(900px,calc(100svh - 164px)); min-height: 530px; padding: 0 20px 14px; border: 1px solid #343b46; border-top: 3px solid #e44545; border-radius: 10px; background: #11151c; overflow: hidden; box-shadow: 0 22px 60px #0006; }
.tetris-scenery { position: absolute; inset: 0; z-index: -2; pointer-events: none; background: #172b3d; }
.tetris-scenery > div { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s ease; }
.tetris-scenery > div.is-visible { opacity: 1; }
.tetris-scenery img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; pointer-events: none; user-select: none; }
.tetris-machine::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: -1; background: linear-gradient(#080e18b3,transparent 35%,#080e1866),linear-gradient(90deg,#070c1844,transparent 30%,transparent 70%,#070c1844); }
.tetris-toolbar { background: #0b111cdd; margin: 0 -20px; padding: 0 20px; }
.tetris-board { border-color: #8d9aa9; box-shadow: 0 0 0 4px #0a101bed,0 16px 45px #0009; }
.tetris-telemetry { padding: 10px 0; }
.tetris-stat { box-shadow: 0 5px 15px #0003; }
.tetris-circuit, .tetris-pace { background: #0a111eeb; border: 1px solid #455263; border-radius: 4px; padding: 10px; }
.tetris-circuit > span, .tetris-pace > span { display: block; font-size: 7px; color: #9cabbc; letter-spacing: .08em; text-transform: uppercase; }
.tetris-circuit strong, .tetris-pace strong { display: block; font: 10px/1.5 "Manrope",sans-serif; font-weight: 800; color: var(--venue-accent,#72d9df); margin-top: 5px; }
.tetris-route { height: 2px; background: #344252; margin-top: 9px; }
.tetris-route i { display: block; height: 100%; background: var(--venue-accent); transition: width .3s; }
.tetris-pace > div { display: flex; gap: 3px; margin-top: 8px; }
.tetris-pace i { height: 4px; flex: 1; background: #344252; }
.tetris-pace i.is-lit { background: #e8877c; }
.tetris-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 1px solid #282f39; }
.tetris-wordmark { display: flex; align-items: center; gap: 5px; font: 16px "Russo One",sans-serif; letter-spacing: .04em; white-space: nowrap; }
.tetris-wordmark::before { content: ""; width: 16px; height: 16px; margin-right: 5px; background: conic-gradient(#e6eaf0 25%,transparent 0 50%,#e6eaf0 0 75%,transparent 0) 0 0 / 8px 8px; }
.tetris-wordmark b { color: #f35e5e; font-weight: inherit; }
.tetris-wordmark small { color: #9caab8; font: 9px "Manrope",sans-serif; margin-left: 12px; letter-spacing: .15em; }
.tetris-toolbar-actions { display: flex; gap: 6px; }
.tetris-control-icon { display: none; width: 20px; height: 20px; flex: none; }
.tetris-audio-control { position: relative; display: flex; align-items: center; }
.tetris-toolbar #tetris-sound { display: flex; align-items: center; justify-content: center; align-self: stretch; width: 32px; padding: 5px; color: #b7d5d1; }
.tetris-speaker-slash, .is-muted .tetris-speaker-waves { display: none; }
.is-muted .tetris-speaker-slash { display: block; }
.tetris-toolbar #tetris-sound.is-muted { color: #8b9aa9; }
.tetris-volume { position: absolute; right: 0; top: calc(100% + 8px); z-index: 10; width: 154px; padding: 12px; border: 1px solid #4a5a6b; border-radius: 6px; background: #101925; box-shadow: 0 8px 20px #0007; font-size: 10px; color: #cedae4; opacity: 0; visibility: hidden; pointer-events: none; }
.tetris-volume input { display: block; width: 100%; margin: 10px 0 0; accent-color: #e96769; touch-action: pan-x; }
.tetris-audio-control:focus-within .tetris-volume { opacity: 1; visibility: visible; pointer-events: auto; }
@media (hover:hover) { .tetris-audio-control:hover .tetris-volume { opacity: 1; visibility: visible; pointer-events: auto; } }
.tetris-machine button { font-family: inherit; touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; cursor: pointer; }
.tetris-toolbar button { background: #101923e8; border: 1px solid #64717b; border-radius: 5px; color: #dce5ec; padding: 7px 10px; font-size: 11px; }
.tetris-toolbar button:disabled { opacity: .4; cursor: default; }
.tetris-machine button:focus-visible { outline: 2px solid #5de2d3; outline-offset: 3px; }
.tetris-deck { min-height: 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 16px; padding: 16px 0; }
.tetris-board { position: relative; flex-shrink: 0; width: 220px; height: 440px; background: #07090f; border: 2px solid #77818e; box-shadow: 0 0 0 3px #0a0e14,0 0 0 4px #303844; overflow: hidden; }
#tetris-canvas { display: block; width: 100%; height: 100%; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; outline: none; }
.tetris-board { overflow: visible; }
#tetris-feedback { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tetris-track-lights { position: absolute; inset: 0; pointer-events: none; opacity: 0; }
.tetris-track-lights > div { position: absolute; top: calc(50% - 31px); left: -10px; width: 7px; padding: 4px 1px; display: grid; gap: 6px; background: #080d14; border-radius: 3px; box-shadow: 0 0 0 1px #58606d; }
.tetris-track-lights > div + div { left: auto; right: -10px; }
.tetris-track-lights i { width: 5px; height: 5px; display: block; border-radius: 50%; background: #613035; }
.tetris-track-lights.is-celebrating { opacity: 1; }
.tetris-track-lights::before { content: ''; position: absolute; inset: -2px; border: 1px solid #f4d396; opacity: 0; pointer-events: none; }
.tetris-track-lights.is-celebrating::before { animation: tetris-pole-frame 850ms ease-out both; }
@keyframes tetris-pole-frame { 0% { opacity: 0; } 16% { opacity: .85; box-shadow: 0 0 12px #e9bc6640,inset 0 0 8px #e9bc6624; } 100% { opacity: 0; box-shadow: none; } }
.is-celebrating i { animation: tetris-race-light 780ms ease-out both; }
.is-celebrating i:nth-child(2) { animation-delay: 45ms; }
.is-celebrating i:nth-child(3) { animation-delay: 90ms; }
.is-celebrating i:nth-child(4) { animation-delay: 135ms; }
.is-celebrating i:nth-child(5) { animation-delay: 180ms; }
.tetris-track-lights.is-paused i { animation-play-state: paused; }
.tetris-track-lights.is-paused::before { animation-play-state: paused; }
@keyframes tetris-race-light { 0%{background:#613035;box-shadow:none} 18%,65%{background:#ff7770;box-shadow:0 0 5px #ee5458,0 0 10px #ee545866} 100%{background:#613035;box-shadow:none} }
.tetris-telemetry { width: 108px; flex-shrink: 0; align-self: stretch; display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.tetris-stat { background: #090d14; border: 1px solid #303946; border-radius: 4px; padding: 10px; }
.tetris-stat > span { display: block; font: 8px "Manrope",sans-serif; text-transform: uppercase; color: #a4b2bf; letter-spacing: .1em; margin-bottom: 4px; }
.tetris-stat strong { display: block; color: #f2f5fa; font: 25px/1.1 "Barlow Condensed",monospace; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tetris-stat-score { position: relative; border-top: 2px solid #e44545; }
.tetris-stat-score strong { color: #fff; font-size: min(28px,calc(140px / var(--score-chars,1))); white-space: nowrap; }
.tetris-next { padding-bottom: 2px; }
#tetris-next { display: block; width: 100%; height: auto; }
.tetris-session-label { color: #9ca9b9; font-size: 9px; line-height: 1.6; letter-spacing: .18em; margin: 0; text-align: center; }
.tetris-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 10px; text-align: center; background: #080c14f5; }
.tetris-overlay[hidden] { display: none; }
.tetris-start-lights { display: flex; gap: 6px; padding: 8px; border: 1px solid #394650; background: #101923; }
.tetris-start-lights i { width: 12px; height: 12px; background: #d63c37; border: 2px solid #f36f56; border-radius: 50%; box-shadow: 0 0 9px #ed443e5c; }
.tetris-overlay h2 { color: #f2f5fa; font: clamp(19px,3vw,32px)/1.15 "Russo One",sans-serif; margin: 12px 0; }
.tetris-overlay p:not(.pit-stack-eyebrow) { color: #acbac7; font-size: 11px; line-height: 1.8; margin: 0 0 17px; }
.tetris-overlay .pit-stack-eyebrow { font-size: 8px; letter-spacing: .12em; }
.tetris-help-touch { display:none; }
@media(pointer:coarse) {
  .tetris-help-keyboard { display:none; }
  .tetris-help-touch { display:inline; }
}
#tetris-start { border: 1px solid #ec6969; background: #a52e34; color: #fff; border-radius: 5px; padding: 12px 15px; font-size: 12px; font-weight: 800; box-shadow: 0 3px #551b21; }
#tetris-start span { margin-left: 8px; }
.tetris-line-message { position: absolute; top: -18px; left: -3px; right: -3px; pointer-events: none; text-align: center; opacity: 0; white-space: nowrap; color: #f6dfb7; text-shadow: 1px 1px #07090f; font: 8px "Russo One",sans-serif; }
.tetris-line-message.is-visible { animation: tetris-callout 900ms ease-out both; }
@keyframes tetris-callout { 0%{opacity:0;transform:translateY(4px)} 15%,65%{opacity:1} 100%{opacity:0;transform:translateY(-7px)} }
.tetris-machine, .tetris-machine * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.tetris-machine { touch-action: pan-y pinch-zoom; }
.tetris-machine.is-fullscreen { touch-action: none; overscroll-behavior: none; }
.tetris-launch { display: none; }
html:has(body.tetris-fullscreen), body.tetris-fullscreen { overflow: hidden !important; overscroll-behavior: none; }
body.tetris-fullscreen > :not(#tetris-machine) { visibility: hidden !important; }
.tetris-machine.is-fullscreen { position: fixed; inset: var(--tetris-viewport-top,0px) auto auto var(--tetris-viewport-left,0px); z-index: 1000000; width: var(--tetris-viewport-width,100%); height: var(--tetris-viewport-height,100dvh); max-width: none; max-height: none; min-width: 0; min-height: 0; margin: 0; box-sizing: border-box; border-radius: 0; border: 0; padding: env(safe-area-inset-top,0px) max(14px,env(safe-area-inset-right,0px)) max(10px,env(safe-area-inset-bottom,0px)) max(14px,env(safe-area-inset-left,0px)); }
.tetris-machine:fullscreen { width: 100%; height: 100%; }
.tetris-machine.is-fullscreen .tetris-toolbar { margin-inline: 0; padding-inline: 0; }
@media (max-width:600px) {
  .pit-stack-page { padding: 18px 12px 35px; }
  .pit-stack-heading { display: block; }
  .pit-stack-heading .pit-stack-admin { display: inline-block; margin-top: 12px; font-size: 10px; }
  .pit-stack-lede { font-size: 11px; }
  .tetris-toolbar { margin: 0 -10px; padding: 0 10px; }
  .tetris-circuit, .tetris-pace { padding: 7px; }
  .tetris-circuit strong, .tetris-pace strong { font-size: 8px; }
  .tetris-circuit strong { font-size: 7px; }
  .pit-stack-heading h1 { font-size: 30px; }
  .pit-stack-private { font-size: 10px; text-align: left; margin-top: 10px; }
  .tetris-machine { padding: 0 10px 10px; border-radius: 10px; height: 650px; min-height: 490px; max-height: 90svh; grid-template-rows: 49px minmax(0,1fr); }
  .tetris-wordmark { font-size: 12px; }
  .tetris-wordmark small { display: none; }
  .tetris-toolbar button { font-size: 10px; padding: 7px 8px; }
  .tetris-deck { gap: 12px; padding-bottom: 12px; }
  .tetris-telemetry { width: 78px; gap: 8px; }
  .tetris-stat { padding: 8px; }
  .tetris-stat strong { font-size: 23px; }
  .tetris-stat-score strong { font-size: min(23px,calc(96px / var(--score-chars,1))); }
  .tetris-stat > span { font-size: 7px; letter-spacing: .05em; }
  .tetris-session-label { font-size: 7px; }
  .tetris-overlay h2 { font-size: 23px; }
}
@media (max-width:360px) {
  .tetris-toolbar { gap: 6px; }
  .tetris-wordmark { font-size: 11px; gap: 3px; }
  .tetris-wordmark::before { display: none; }
  .tetris-toolbar-actions { gap: 4px; }
  .tetris-toolbar button { font-size: 9px; padding: 7px 6px; }
  .tetris-overlay h2 { font-size: 20px; margin: 8px 0; }
  .tetris-overlay p:not(.pit-stack-eyebrow) { font-size: 9px; line-height: 1.5; margin-bottom: 10px; }
  .tetris-overlay .pit-stack-eyebrow { font-size: 6px; letter-spacing: .08em; margin-top: 8px; }
  .tetris-start-lights { gap: 4px; padding: 6px; }
  .tetris-start-lights i { width: 9px; height: 9px; }
  #tetris-start { font-size: 10px; padding: 10px 12px; }
}
@media (max-width:600px), (pointer:coarse) and (max-width:1000px) {
  .tetris-machine:not(.is-fullscreen) { height: clamp(280px,75vw,380px); min-height: 0; max-height: none; padding: 0; grid-template-rows: minmax(0,1fr); }
  .tetris-machine:not(.is-fullscreen) :is(.tetris-toolbar,.tetris-deck) { display: none; }
  .tetris-machine:not(.is-fullscreen) .tetris-launch { display: flex; position: relative; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: 24px 18px; text-align: center; background: linear-gradient(180deg,#0b111c8c,#0b111ce8); }
  .tetris-launch .pit-stack-eyebrow { margin: 0 0 12px; font-size: 8px; }
  .tetris-launch h2 { margin: 0; color: #f3f5f7; font: 30px/1.1 "Russo One",sans-serif; letter-spacing: -.03em; }
  .tetris-launch h2 em { color: #ef5358; font-style: normal; }
  .tetris-launch > p:not(.pit-stack-eyebrow) { margin: 14px 0 22px; color: #c1cad6; font-size: 12px; line-height: 1.7; }
  #tetris-launch-start { display: inline-flex; align-items: center; justify-content: space-between; gap: 28px; min-width: 172px; min-height: 48px; padding: 12px 20px; border: 1px solid #f16761; border-radius: 8px; background: #dc423e; color: #fff; font-size: 13px; font-weight: 750; box-shadow: 0 6px 20px #0003; }
  #tetris-launch-start:disabled { opacity: .6; }
}
@media (max-width:600px) {
  .tetris-machine { grid-template-rows: auto minmax(0,1fr); }
  .tetris-machine .tetris-toolbar { display: grid; grid-template-columns: minmax(0,1fr); gap: 6px; padding: 8px 10px; min-width: 0; }
  .tetris-wordmark { justify-content: center; }
  .tetris-toolbar-actions { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr) 40px; gap: 6px; min-width: 0; }
  .tetris-toolbar button, .tetris-toolbar #tetris-sound { width: 100%; min-width: 0; min-height: 40px; padding: 6px; }
  .tetris-toolbar .tetris-audio-control { min-width: 0; }
  .tetris-machine.is-fullscreen { max-height: none; min-height: 0; grid-template-rows: auto minmax(0,1fr); }
}
@media (max-height:520px) and (orientation:landscape) {
  .tetris-machine.is-fullscreen { grid-template-rows: 38px minmax(0,1fr); }
  .is-fullscreen .tetris-session-label { display: none; }
  .is-fullscreen .tetris-telemetry { gap: 4px; width: 85px; }
  .is-fullscreen .tetris-stat { padding: 3px 8px; }
  .is-fullscreen .tetris-stat strong { font-size: 18px; }
  .is-fullscreen .tetris-next { display: none; }
  .is-fullscreen .tetris-circuit, .is-fullscreen .tetris-pace { display: none; }
  .is-fullscreen .tetris-overlay h2 { font-size: 16px; margin: 4px 0; }
  .is-fullscreen .tetris-overlay p:not(.pit-stack-eyebrow) { display: none; }
  .is-fullscreen .tetris-start-lights { padding: 4px; }
  .is-fullscreen #tetris-start { padding: 7px; }
  .is-fullscreen .tetris-overlay .pit-stack-eyebrow { margin: 5px 0 0; }
}
/* One compact pit-wall header on phones, in portrait and landscape. */
@media (max-width:600px), (pointer:coarse) and (max-width:1000px) {
  .tetris-machine.is-fullscreen { grid-template-rows: 56px minmax(0,1fr); }
  .is-fullscreen .tetris-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; padding: 0; background: transparent; border-bottom: 1px solid #ffffff18; }
  .is-fullscreen .tetris-wordmark { justify-content: flex-start; gap: 4px; font-size: 13px; letter-spacing: .015em; }
  .is-fullscreen .tetris-wordmark::before { display: block; width: 12px; height: 12px; margin-right: 4px; background-size: 6px 6px; opacity: .75; }
  .is-fullscreen .tetris-wordmark small { display: none; }
  .is-fullscreen .tetris-toolbar-actions { display: flex; flex: none; gap: 6px; }
  .is-fullscreen .tetris-toolbar button, .is-fullscreen .tetris-toolbar #tetris-sound { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 1px solid #ffffff16; border-radius: 10px; background: #101923b3; color: #dce5ee; box-shadow: none; }
  .is-fullscreen .tetris-control-label { display: none; }
  .is-fullscreen .tetris-control-icon { display: block; }
  .is-fullscreen #tetris-pause .tetris-resume-icon { display: none; }
  .is-fullscreen #tetris-pause[aria-pressed="true"] .tetris-resume-icon { display: block; }
  .is-fullscreen #tetris-pause[aria-pressed="true"] .tetris-pause-icon { display: none; }
  .is-fullscreen #tetris-pause[aria-pressed="true"] { color: #ffaca6; border-color: #ef696540; background: #6d303044; }
  .is-fullscreen .tetris-audio-control { order: 2; }
  .is-fullscreen #tetris-fullscreen { order: 3; }
  .is-fullscreen .tetris-toolbar #tetris-sound svg { width: 19px; height: 19px; }
}
@media (prefers-reduced-motion:reduce) { .tetris-line-message.is-visible { animation: none; opacity: 1; } }
@media (prefers-reduced-motion:reduce) { .tetris-scenery > div, .tetris-route i { transition: none; } }
@media (prefers-reduced-motion:reduce) { .tetris-track-lights.is-celebrating i { animation: none; background: #db7773; box-shadow: none; } }
@media (prefers-reduced-motion:reduce) { .tetris-track-lights.is-celebrating::before { animation: none; opacity: .35; box-shadow: none; } }
.tetris-save-line { display:flex; align-items:center; flex-wrap:wrap; gap:12px; color:#b2c0ce; font-size:12px; }
.tetris-save-line:has(p:empty):has(button[hidden]) { display:none; }
.tetris-save-line button { border:1px solid #475463; border-radius:6px; padding:8px 12px; color:#edf2f7; background:#1a252f; }
