/* Phase 7. Materials are decorative; the 24 × 20 game geometry stays live. */
body.tts-edition #battle-screen.tts-match {
  --tts-wood:url('./assets/through-the-shadows/finish/mahogany-v1.png');
  --tts-cabinet-wood:url('./assets/through-the-shadows/finish/mahogany-v2.png');
  --tts-brass:url('./assets/through-the-shadows/finish/navy-brass-panel-v1.png');
  background:#3c2113 url('./assets/through-the-shadows/finish/tabletop-v1.png') center / cover no-repeat!important;
}
#battle-screen.tts-match .tts-match-layout {
  grid-template-columns:clamp(180px,12vw,260px) minmax(0,1fr) clamp(236px,16vw,340px);
  padding:12px 14px clamp(68px,10vh,118px);gap:10px;
}
#battle-screen.tts-match .tts-match-layout::before { background:linear-gradient(180deg,#24100518,transparent 35% 75%,#14070018);box-shadow:inset 0 0 0 4px #2b160c,inset 0 0 0 7px #a56e34,inset 0 0 0 9px #412310; }
#battle-screen.tts-match .tts-match-brand {
  background-image:linear-gradient(90deg,#170909ad,transparent 12% 83%,#1b0a09bb),var(--tts-wood);
  background-size:auto,auto 670px;background-blend-mode:normal;
  border:5px solid #714125;box-shadow:inset 0 0 0 1px #e1ab6980,inset 0 0 16px #200c08,0 5px 10px #120705b0;
}
#battle-screen.tts-match .tts-match-rail {
  border:0;border-radius:0;background:none;box-shadow:none;
  padding:clamp(136px,17vh,196px) 0 0;gap:10px;overflow:visible;
}
#battle-screen.tts-match .tts-board-space { --tts-lid-depth:clamp(136px,17vh,196px); }
#battle-screen.tts-match .tts-cabinet-well { --tts-cabinet-side:clamp(38px,3.15vw,70px);--tts-cabinet-head:clamp(22px,2.5vh,34px);--tts-cabinet-front:clamp(48px,5.4vh,70px); }
#battle-screen.tts-match .tts-cabinet-wall {
  background-color:#501912;background-image:var(--tts-cabinet-wood);
  background-size:300px 500px;background-blend-mode:normal;
  box-shadow:inset 2px 0 #c1784966,inset -2px 0 #210c0b;
}
#battle-screen.tts-match .tts-cabinet-wall-left::before {
  background:linear-gradient(90deg,#dda87733 0 6%,transparent 7% 60%,#250b09aa 82%,#140705 100%);
}
#battle-screen.tts-match .tts-cabinet-wall-right::before {
  background:linear-gradient(90deg,#180808c9,transparent 30% 86%,#d79a665c 96%,#260b08);
}
#battle-screen.tts-match .tts-cabinet-wall::after {background:none;}
#battle-screen.tts-match .tts-cabinet-wall-left {border-left:3px solid #864129;border-right:1px solid #2c0b08;}
#battle-screen.tts-match .tts-cabinet-wall-right {border-left:1px solid #210907;border-right:3px solid #87462d;}
#battle-screen.tts-match .tts-cabinet-chain {
  top:-68px;filter:drop-shadow(1px 2px 1px #230c08);
}
#battle-screen.tts-match .tts-cabinet-wall-top {
  background-image:linear-gradient(180deg,#b8644355 0 10%,transparent 15% 52%,#240b0ac9 100%),var(--tts-cabinet-wood);background-size:auto,600px 350px;
  border-top:2px solid #b6654188;border-bottom:1px solid #170908;box-shadow:inset 0 -7px 7px #1c080a99;
}
#battle-screen.tts-match .tts-cabinet-front {
  background-image:linear-gradient(180deg,#1f080ac9 0,#ac593c44 24%,transparent 42% 78%,#19070899 100%),var(--tts-cabinet-wood);
  background-size:auto,500px 360px;background-blend-mode:normal;
  border-color:#512117;border-top-color:#ba714c77;border-bottom:3px solid #623721;
  box-shadow:inset 0 1px #d9986544,inset 0 -2px #ac684855,0 4px 5px #1c0809;
}
#battle-screen.tts-match .tts-cabinet-front::before,
#battle-screen.tts-match .tts-cabinet-front::after {
  background-image:linear-gradient(90deg,#1d09096b,transparent 50%,#9f5b3433),var(--tts-cabinet-wood);
  background-size:auto,300px 500px;background-blend-mode:normal;
}
#battle-screen.tts-match .tts-match-frame {
  border-image:none;border:4px ridge #b99554;
  box-shadow:0 0 0 1px #2d140b,0 0 0 3px #6f3921,0 0 8px 8px #200909a6;
}
#battle-screen.tts-match .tts-match-lid {
  clip-path:polygon(0 0,100% 0,94% 100%,6% 100%);
  background-image:linear-gradient(180deg,#260909ba 0 6%,#bb79594f 7%,transparent 14% 78%,#280b0cb3 90%,#b3694e88 96%,#2d0b0b 100%),var(--tts-cabinet-wood);
  background-size:auto,550px 380px;background-blend-mode:normal;
}
#battle-screen.tts-match .tts-match-lid::before {
  inset:21px 9% 27px;
  clip-path:polygon(0 0,100% 0,93% 100%,7% 100%);
  background:linear-gradient(180deg,#65381225,transparent 30% 70%,#4b230d40),url('./assets/through-the-shadows/finish/lid-chart-v1.png') center / 100% 100%;
  box-shadow:inset 0 4px 11px #3d1d12,inset 0 0 0 2px #a16b48;
}
#battle-screen.tts-match .tts-match-lid::after {left:4%;right:4%;height:14px;background:linear-gradient(#a55c4277,#46151a 35%,#270d0e 76%,#be7f5a88);}
#battle-screen.tts-match .tts-lid-hinge {height:clamp(11px,1.5vh,18px);width:8%;bottom:5px;}
#battle-screen.tts-match .tts-lid-hinge-left {left:22%;}
#battle-screen.tts-match .tts-lid-hinge-right {right:22%;}
.tts-lid-lettering {
  position:absolute;z-index:3;left:40%;right:17%;top:21%;height:46%;
  display:flex;flex-direction:column;justify-content:center;align-items:center;
  font:clamp(22px,3.6vh,40px)/.94 'Black Ops One',Georgia,serif;
  color:#d99743;letter-spacing:.025em;text-align:center;
  text-shadow:0 -1px #ffe8a9,1px 1px #c4842d,0 3px #4b230d,2px 5px 3px #230e0dcc;
  transform:perspective(700px) rotateX(4deg) scaleY(.92);transform-origin:center bottom;
}
.tts-lid-lettering span:first-child { font-size:1.08em;letter-spacing:.095em; }
#battle-screen.tts-match .tts-lid-subtitle { top:70%;right:17%;width:43%;font:700 clamp(8px,.73vw,13px)/1 Georgia,serif;letter-spacing:.13em; }
#battle-screen.tts-match .tts-lid-map { left:22%;top:15%;height:63%;width:15%;border:0;background:none;opacity:.8; }
#battle-screen.tts-match .tts-lid-ghost { display:none; }
.tts-cabinet-nameplate {
  position:absolute;top:calc(100% + 13px);left:50%;transform:translateX(-50%);width:max-content;max-width:80%;
  display:flex;align-items:center;justify-content:center;gap:22px;padding:7px 24px;
  border:7px ridge #d8a94f;border-radius:7px;
  background:linear-gradient(125deg,#855521,#e4bd69 24%,#c6933d 60%,#e6c074 84%,#916024);
  color:#251608;text-align:center;font:700 clamp(14px,1.1vw,22px)/1.1 Georgia,serif;
  text-shadow:0 1px #ffe3a299;box-shadow:0 6px 7px #0e0505b8,inset 0 0 0 1px #634212;
}
.tts-cabinet-nameplate>span { font-size:1.7em;font-family:Georgia,serif; }
.tts-cabinet-nameplate small { display:block;font:700 .55em/1.5 Georgia,serif;letter-spacing:.16em; }

/* Revision 7: a calm luminous glass game board, not simulated water. */
#battle-screen.tts-match #board-plane {
  background:radial-gradient(ellipse at 48% 40%,#118ed0 0,#096cad 43%,#064d8d 72%,#032d62 100%)!important;
  box-shadow:inset 0 0 0 2px #9ff3ff,inset 0 0 48px #001e4a99,0 0 18px #42d8ff4d!important;
}
#battle-screen.tts-match #board-plane .board-surface::before {
  inset:0;opacity:1;mix-blend-mode:normal;
  background:
    radial-gradient(ellipse at 46% 35%,#8beaff26 0,transparent 54%),
    linear-gradient(132deg,#d9fbff12 0 16%,transparent 34% 72%,#70ddff0c 88% 100%),
    linear-gradient(180deg,#0a70b3,#074f91 58%,#063d78);
  background-size:100% 100%;background-position:center;
  background-repeat:no-repeat;animation:none!important;transform:none;
}
#battle-screen.tts-match #board-plane .board-surface::after {
  content:'';position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(180deg,#d8fbff0d,transparent 18% 82%,#001d4a24);
  box-shadow:inset 0 0 20px #001d4a70,inset 0 1px #d8fbff2e;
}
#battle-screen.tts-match #board-plane .tts-water-surface,
#battle-screen.tts-match #board-plane .tts-water-wakes {
  display:none!important;
}
#battle-screen.tts-match #target-grid .target-cell {
  border:0!important;border-left:1px solid #79e8ff9c!important;border-top:1px solid #79e8ff9c!important;
  box-shadow:inset 0 0 5px #1bbcf00a!important;
}
#battle-screen.tts-match #target-grid .target-cell:hover { outline:1px solid #d1faff!important;outline-offset:-2px; }
#battle-screen.tts-match #target-grid .target-cell:focus-visible { outline:2px solid #fff3b0!important;outline-offset:-3px; }
#battle-screen.tts-match #target-grid .target-cell.hit { box-shadow:inset 0 0 5px #e2662977!important; }
#battle-screen.tts-match .tts-own-panel .mini-map {
  background:radial-gradient(ellipse at 45% 35%,#1b9fd1 0,#0866a5 55%,#04376f 100%)!important;
  box-shadow:inset 0 0 20px #001b49a8,inset 0 0 0 1px #7eeeff70;
}
#battle-screen.tts-match .mini-cell.is-island { background:linear-gradient(135deg,#b9b7a9,#73776d 30% 70%,#464c45)!important;box-shadow:inset 1px 1px #d4d4bca0,inset -1px -1px #18232799; }
#battle-screen.tts-match :is(.tts-ship-wake,.tts-ship-reflection) { display:none!important; }

/* One instrument family, with crisp vector corner irons and readable live type. */
#battle-screen.tts-match :is(.tts-turn-panel,.tts-match-status-panel,.tts-enemy-panel,.tts-own-panel) {
  position:relative;box-sizing:border-box;border:12px solid transparent;border-image:var(--tts-brass) 14% / 18px / 2px stretch;
  border-radius:0;background:linear-gradient(160deg,#19364c,#061a2c 38%,#031221 70%,#102637);
  box-shadow:0 4px 7px #170703ad,inset 0 0 16px #0008;
}
#battle-screen.tts-match .tts-match-rail :is(.tts-own-panel,.tts-enemy-panel) { flex:none;padding:2px 3px 4px; }
#battle-screen.tts-match .tts-match-layout .tts-own-panel { order:1; }
#battle-screen.tts-match .tts-match-layout .tts-enemy-panel { order:2; }
#battle-screen.tts-match .tts-match-layout .tts-rail-aux { order:3; }
#battle-screen.tts-match .tts-rail-instruments { height:clamp(174px,23vh,250px); }
#battle-screen.tts-match .tts-combat-instruments { gap:10px; }
#battle-screen.tts-match .tts-turn-panel { flex:1;min-height:88px;padding:7px 3px;gap:5px; }
.tts-turn-heading { order:1;gap:8px; }
#battle-screen.tts-match .tts-turn-label { font:400 clamp(10px,.8vw,14px)/1 'Black Ops One',sans-serif;letter-spacing:.09em; }
#battle-screen.tts-match .tts-turn-number { font:700 clamp(17px,1.2vw,24px)/1 Arial,sans-serif;color:#ead39a;font-variant-numeric:tabular-nums; }
#battle-screen.tts-match .tts-turn-actor { order:0;font:400 clamp(18px,1.4vw,28px)/1.15 'Black Ops One',sans-serif;letter-spacing:.02em;color:#efca76;text-shadow:0 -1px #ffe9ad55,0 2px 2px #000; }
#battle-screen.tts-match .tts-match-layout[data-actor="cpu"] .tts-turn-actor {color:#e8ae72;}
#battle-screen.tts-match .tts-match-layout[data-paused="true"] .tts-turn-actor {color:#d9ccab;}
#battle-screen.tts-match .tts-turn-actor::after {content:'';display:block;width:66%;height:1px;margin:7px auto 0;background:linear-gradient(90deg,transparent,#d4ae626b,transparent);}
#battle-screen.tts-match .tts-turn-mode { order:2;font:600 clamp(8px,.6vw,11px)/1.2 Arial,sans-serif!important;color:#c3ced2;letter-spacing:.18em; }
#battle-screen.tts-match .tts-match-status-panel { padding:3px 4px 5px; }
#battle-screen.tts-match .tts-match-status-panel>div { border:0;border-top:1px solid #dbbb6270;padding-top:5px; }
#battle-screen.tts-match .tts-match-status-panel>div span { padding:2px 3px;font:400 11px/1 'Black Ops One',sans-serif;letter-spacing:.09em; }
#battle-screen.tts-match .tts-match-status-panel>div span+span { border-color:#dbbb6250; }
#battle-screen.tts-match .tts-match-status-panel strong { font:700 clamp(18px,1.4vw,27px)/1.15 Arial,sans-serif;letter-spacing:.02em;color:#f0dfb3;font-variant-numeric:tabular-nums; }
#battle-screen.tts-match .tts-match-status-panel span:first-child strong { color:#eadaaf; }
#battle-screen.tts-match .tts-enemy-card { height:clamp(36px,5vh,55px);border-color:#a28b4b77;border-radius:0;background:#02152288; }
#battle-screen.tts-match .tts-enemy-card b { color:#edcb85;font-family:Georgia,serif; }
#battle-screen.tts-match .tts-enemy-card small { color:#a3d9c2;font:700 8px/1 Arial,sans-serif;letter-spacing:.1em; }
#battle-screen.tts-match .tts-left-console { border:2px solid #ba934c;border-radius:3px;background:linear-gradient(130deg,#142e3f,#051623 65%);box-shadow:inset 0 0 0 2px #05121b,0 3px 6px #12060899; }
#battle-screen.tts-match .tts-placement-banner { width:min(70%,600px);top:calc(var(--tts-lid-depth) - 15px);border-color:#c4a05b;background:#051f30f2;box-shadow:0 2px 3px #13080499;padding:3px 10px;font-size:11px!important; }
#battle-screen.tts-match .tts-placement-banner span { font-size:8px!important;letter-spacing:.04em; }

@layer tts-controls {
  body.tts-edition #battle-screen.tts-match .tts-match-subtitle { font:700 clamp(10px,.85vw,16px)/1.1 Georgia,serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-command-actions .tts-plaque-button { font-size:clamp(10px,.92vw,17px)!important;padding-inline:2px!important; }
  body.tts-edition #battle-screen.tts-match .tts-command-actions #combat-feedback-open { font-size:clamp(9px,.8vw,15px)!important; }
  body.tts-edition #battle-screen.tts-match .tts-audio-controls .battle-audio-row { grid-template-columns:minmax(0,1fr) 48px!important;gap:3px 4px!important; }
  body.tts-edition #battle-screen.tts-match .tts-audio-controls .battle-audio-name { white-space:nowrap; }
  body.tts-edition #battle-screen.tts-match .tts-audio-controls .battle-audio-name :is(strong,output) { font-size:10px!important; }
  body.tts-edition #battle-screen.tts-match .tts-lid-lettering span { font:inherit!important; }
  body.tts-edition #battle-screen.tts-match .tts-lid-subtitle { font:700 clamp(8px,.73vw,13px)/1 Georgia,serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-cabinet-nameplate small { font:700 11px/1.5 Georgia,serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-cabinet-nameplate>span { font:32px/1 Georgia,serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-turn-actor { font:400 clamp(18px,1.4vw,28px)/1.15 'Black Ops One',sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-turn-label { font:400 clamp(10px,.8vw,14px)/1 'Black Ops One',sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-turn-number { font:700 clamp(17px,1.2vw,24px)/1 Arial,sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-match-status-panel>div span { font:400 11px/1 'Black Ops One',sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-match-status-panel strong { font:700 clamp(18px,1.4vw,27px)/1.15 Arial,sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-enemy-card small { font:700 9px/1 Arial,sans-serif!important; }
  body.tts-edition #battle-screen.tts-match .tts-match-rail h2 {
    font:400 clamp(11px,.9vw,18px)/1.15 'Black Ops One',sans-serif!important;
    letter-spacing:.045em!important;color:#ffe0a0!important;text-shadow:0 2px 2px #000;
    margin:0 0 7px!important;
  }
  body.tts-edition #battle-screen.tts-match .tts-own-panel h2::before,
  body.tts-edition #battle-screen.tts-match .tts-enemy-panel h2::before { content:'⚓︎';font-size:1.15em;margin-right:8px;color:#f4d38c; }
  body.tts-edition #battle-screen.tts-match .tts-match-rail .tts-plaque-button.tts-naval-action {
    --plaque-height:clamp(49px,6.9vh,76px);
    display:flex!important;align-items:center!important;justify-content:center!important;gap:12px;
    padding:9px 19px!important;text-align:left!important;white-space:nowrap!important;
    border:11px solid transparent!important;border-image:var(--tts-brass) 14% / 18px / 2px stretch!important;
    background:linear-gradient(155deg,#234559,#071e33 38%,#031428 70%,#163749)!important;
    box-shadow:0 3px 4px #1a0805aa,inset 0 0 12px #0008!important;
  }
  body.tts-edition #battle-screen.tts-match .tts-match-rail .tts-plaque-button.tts-naval-action::before { display:none!important; }
  body.tts-edition #battle-screen.tts-match .tts-naval-action .tts-action-copy { display:flex;flex-direction:column;gap:4px;text-align:left; }
  body.tts-edition #battle-screen.tts-match .tts-naval-action .tts-action-copy b { font:400 clamp(15px,1.22vw,24px)/1 'Black Ops One',sans-serif!important;letter-spacing:.025em!important; }
  body.tts-edition #battle-screen.tts-match .tts-naval-action .tts-action-copy small { font:600 clamp(6px,.5vw,9px)/1 Arial,sans-serif!important;letter-spacing:.1em!important;color:#ced6db!important;text-shadow:0 1px #000!important; }
  body.tts-edition #battle-screen.tts-match .tts-naval-action .tts-naval-icon { width:clamp(28px,2.5vw,45px);height:clamp(26px,2.4vw,42px);flex:none;color:#f2d391;filter:drop-shadow(0 2px 1px #000); }
}

/* Short screens sacrifice dressing first. */
@media(max-height:850px) {
  #battle-screen.tts-match .tts-match-layout { padding-bottom:10px; }
  .tts-cabinet-nameplate { display:none; }
  #battle-screen.tts-match .tts-match-rail { gap:7px;padding-top:108px; }
  #battle-screen.tts-match .tts-board-space { --tts-lid-depth:108px; }
  #battle-screen.tts-match .tts-rail-instruments { height:176px; }
  #battle-screen.tts-match .tts-turn-panel { min-height:78px;gap:3px;padding:4px 2px; }
  #battle-screen.tts-match .tts-enemy-card { height:36px; }
  #battle-screen.tts-match .tts-match-rail :is(.tts-own-panel,.tts-enemy-panel) { border-width:10px; }
}
@media(max-width:1279px),(max-height:719px) {
  #battle-screen.tts-match .tts-match-layout { grid-template-columns:166px minmax(0,1fr) 230px;padding:8px;gap:6px; }
  #battle-screen.tts-match .tts-board-space { --tts-lid-depth:88px; }
  #battle-screen.tts-match .tts-match-rail { padding-top:88px;gap:5px; }
  #battle-screen.tts-match .tts-cabinet-well { --tts-cabinet-side:30px;--tts-cabinet-head:18px;--tts-cabinet-front:40px; }
  #battle-screen.tts-match .tts-match-frame { border-width:4px; }
  #battle-screen.tts-match .tts-rail-instruments { height:180px; }
  .tts-lid-lettering { font-size:22px; }
  #battle-screen.tts-match .tts-match-lid::before {inset:14px 9% 20px;}
  #battle-screen.tts-match .tts-turn-actor::after {margin-top:4px;}
  #battle-screen.tts-match .tts-enemy-card { height:30px; }
  .tts-cabinet-nameplate { display:none; }
}
#battle-screen.tts-match[data-document-hidden="true"] #board-plane .board-surface::before { animation-play-state:paused; }
@media(max-height:619px) {
  #battle-screen.tts-match .tts-match-rail { overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;padding-top:78px; }
  #battle-screen.tts-match .tts-rail-instruments { height:160px; }
  #battle-screen.tts-match .tts-compact-hud .tts-hud-cell { border-color:#b29353;background:linear-gradient(135deg,#173f56,#041727);box-shadow:inset 0 0 0 1px #f6d28a55,0 2px 3px #000; }
}
@media(prefers-reduced-motion:reduce),(prefers-reduced-data:reduce) {
  #battle-screen.tts-match #board-plane .board-surface::before { animation:none!important;transform:none; }
}

/* Revision 8: polished mockup composition.  Keep every game control live while
   treating the open box and its fittings as one coherent physical object. */
#battle-screen.tts-match .tts-match-layout {
  --tts-polished-lid-depth:clamp(132px,18.6vh,182px);
  grid-template-columns:clamp(184px,15.25vw,258px) minmax(0,1fr) clamp(236px,18.4vw,312px);
  gap:clamp(6px,.65vw,11px);
  padding:clamp(6px,.65vw,11px) 10px clamp(18px,3.8vh,40px);
}

/* The left identity, controls and studio mark now sit directly on the table. */
#battle-screen.tts-match .tts-match-brand {
  gap:clamp(8px,1vh,12px);
  padding:0 3px;
  overflow:visible;
  border:0;
  border-radius:0;
  background:none;
  box-shadow:none;
}
#battle-screen.tts-match .tts-match-mark {
  position:relative;
  flex:0 0 clamp(124px,16.4vh,158px);
  width:100%;
  padding:0;
  overflow:visible;
}
#battle-screen.tts-match .tts-match-mark .tts-match-title {
  position:absolute;
  z-index:2;
  left:2%;
  top:0;
  width:78%;
  height:auto;
  max-height:none;
  object-fit:contain;
  filter:drop-shadow(1px 3px 2px #1a080899) drop-shadow(0 0 2px #f2bb5455);
}
#battle-screen.tts-match .tts-match-mark .tts-match-ghost {
  position:absolute;
  z-index:3;
  top:1%;
  right:1%;
  width:42%;
  height:auto;
  max-height:none;
  filter:drop-shadow(1px 3px 2px #1a080899);
}
#battle-screen.tts-match .tts-match-subtitle {
  position:absolute;
  z-index:4;
  left:0;
  right:0;
  bottom:0;
  margin:0;
}
#battle-screen.tts-match .tts-left-console {
  width:100%;
  box-sizing:border-box;
  border-color:#c8a45b;
  box-shadow:inset 0 0 0 2px #02090f,inset 0 8px 18px #16426633,0 4px 9px #190904a8;
}
#battle-screen.tts-match .tts-match-studio {
  flex:none;
  width:92%;
  height:auto;
  margin:clamp(28px,4.5vh,48px) auto 0;
  filter:drop-shadow(0 4px 3px #1a080877);
}
#battle-screen.tts-match .tts-match-studio img { display:block;width:100%;height:auto;object-fit:contain; }

/* A larger, shallower lid reads as a nearly top-down open case. */
#battle-screen.tts-match .tts-board-space { --tts-lid-depth:var(--tts-polished-lid-depth); }
#battle-screen.tts-match .tts-match-lid {
  clip-path:polygon(1.5% 0,98.5% 0,95% 100%,5% 100%);
}
#battle-screen.tts-match .tts-match-lid::before {
  inset:clamp(16px,1.45vw,23px) 5.8% clamp(21px,2vw,29px);
  clip-path:polygon(.5% 0,99.5% 0,96% 100%,4% 100%);
  background:linear-gradient(180deg,#65381218,transparent 26% 75%,#4b230d2e),url('./assets/through-the-shadows/finish/lid-chart-v1.png') center / cover no-repeat;
  box-shadow:inset 0 3px 9px #3d1d1288,inset 0 0 0 2px #a16b48;
}
#battle-screen.tts-match .tts-match-lid::after { left:4.5%;right:4.5%; }
#battle-screen.tts-match .tts-lid-lettering {
  left:44%;
  right:16%;
  top:20%;
  height:48%;
  transform:none;
}
#battle-screen.tts-match .tts-lid-subtitle { right:16%;width:40%;top:72%; }
#battle-screen.tts-match .tts-lid-hinge-center { display:none; }
#battle-screen.tts-match .tts-lid-hinge-left { left:20%;width:10%; }
#battle-screen.tts-match .tts-lid-hinge-right { right:20%;width:10%; }

/* Brass corner caps use one scalable vector-like treatment at every size. */
.tts-lid-corner,.tts-case-corner {
  position:absolute;
  z-index:22;
  display:block;
  width:clamp(38px,3.7vw,58px);
  height:clamp(29px,3.2vw,48px);
  pointer-events:none;
  background:
    radial-gradient(circle at 8px 8px,#251305 0 1px,#f5dc8d 1.5px 2.8px,#704513 3.2px 4.2px,transparent 4.6px),
    radial-gradient(circle at calc(100% - 8px) 8px,#251305 0 1px,#f5dc8d 1.5px 2.8px,#704513 3.2px 4.2px,transparent 4.6px),
    linear-gradient(180deg,#f4d67e,#ad7526 34%,#5c350f 60%,#dca649 79%,#4a270a) left top/100% 9px no-repeat,
    linear-gradient(90deg,#f4d67e,#ad7526 34%,#5c350f 60%,#dca649 79%,#4a270a) left top/9px 100% no-repeat;
  filter:drop-shadow(0 2px 2px #160503aa);
}
.tts-lid-corner { z-index:6;top:3px; }
.tts-lid-corner-tl { left:2.2%; }
.tts-lid-corner-tr { right:2.2%;transform:scaleX(-1); }
.tts-case-corner-tl { top:1px;left:1px; }
.tts-case-corner-tr { top:1px;right:1px;transform:scaleX(-1); }
.tts-case-corner-bl { bottom:1px;left:1px;transform:scaleY(-1); }
.tts-case-corner-br { right:1px;bottom:1px;transform:scale(-1); }
#battle-screen.tts-match .tts-cabinet-well::after { background:none;filter:none; }

/* Each support is a single continuous SVG chain with aligned end mounts. */
#battle-screen.tts-match .tts-cabinet-chain {
  top:calc(clamp(58px,7.3vh,74px) * -1);
  display:block;
  width:28px;
  height:clamp(250px,38vh,360px);
  filter:drop-shadow(1px 2px 1px #230c08) drop-shadow(0 0 2px #f2b95866);
  transform:none;
}
#battle-screen.tts-match .tts-cabinet-chain-left { left:calc(var(--tts-cabinet-side) * .5 - 14px); }
#battle-screen.tts-match .tts-cabinet-chain-right { right:calc(var(--tts-cabinet-side) * .5 - 14px); }
#battle-screen.tts-match .tts-cabinet-chain svg { display:block;width:100%;height:100%;overflow:visible; }
#battle-screen.tts-match .tts-cabinet-chain ellipse { filter:drop-shadow(.7px 1px .45px #1a0805); }
#battle-screen.tts-match .tts-cabinet-chain::before,
#battle-screen.tts-match .tts-cabinet-chain::after {
  position:absolute;
  left:50%;
  width:clamp(18px,1.55vw,24px);
  height:clamp(22px,1.9vw,29px);
  margin:0;
  transform:translateX(-50%);
}
#battle-screen.tts-match .tts-cabinet-chain::before { top:-7px; }
#battle-screen.tts-match .tts-cabinet-chain::after { bottom:-9px; }

/* The plate and two clasps are mounted directly to the lower case rail. */
#battle-screen.tts-match .tts-cabinet-front { display:block; }
#battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate {
  position:absolute;
  z-index:20;
  top:50%;
  left:50%;
  width:min(32%,292px);
  max-width:none;
  min-width:205px;
  height:clamp(30px,3.4vh,34px);
  box-sizing:border-box;
  transform:translate(-50%,-50%);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  padding:2px clamp(8px,.9vw,13px);
  border:3px ridge #d8a94f;
  border-radius:3px;
  background:linear-gradient(125deg,#855521,#efd17d 24%,#c6933d 60%,#f0d27e 84%,#7b4d1a);
  color:#251608;
  text-align:center;
  font:700 clamp(10px,.78vw,13px)/1 Georgia,serif;
  text-shadow:0 1px #ffe3a299;
  box-shadow:0 2px 4px #0e0505a8,inset 0 0 0 1px #634212;
}
#battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate>span {
  flex:none;
  display:block;
  width:clamp(13px,1.05vw,17px);
  height:clamp(13px,1.05vw,17px);
}
#battle-screen.tts-match .tts-nameplate-anchor {
  display:block;
  width:100%;
  height:100%;
  fill:none;
  stroke:#2c1808;
  stroke-width:2.15;
  stroke-linecap:round;
  stroke-linejoin:round;
  filter:drop-shadow(0 1px #ffe6a777);
}
#battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate small {
  display:block;
  margin-top:2px;
  font:700 clamp(6px,.47vw,8px)/1 Georgia,serif!important;
  letter-spacing:.13em;
}
#battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate>div { white-space:nowrap; }
#battle-screen.tts-match .tts-cabinet-front .tts-cabinet-clasp {
  position:absolute;
  z-index:21;
  top:50%;
  width:clamp(76px,7vw,106px);
  height:clamp(18px,2.35vh,27px);
  transform:translate(-50%,-50%);
}
#battle-screen.tts-match .tts-cabinet-clasp-left { left:22%; }
#battle-screen.tts-match .tts-cabinet-clasp-right { left:78%; }

/* The command bay retains its state swap, but all three deployment actions
   now share the same complete outer frame, including the disabled Deploy state. */
#battle-screen.tts-match .tts-match-rail {
  padding:var(--tts-polished-lid-depth) 0 0;
  gap:clamp(7px,.8vh,10px);
}
#battle-screen.tts-match .tts-rail-instruments { height:clamp(178px,23vh,224px); }
body.tts-edition #battle-screen.tts-match .tts-match-rail .tts-plaque-button.tts-naval-action {
  box-sizing:border-box!important;
  border:11px solid transparent!important;
  border-image:var(--tts-brass) 14% / 18px / 2px stretch!important;
}
#battle-screen.tts-match #deploy-fleet:disabled {
  opacity:.72;
  filter:saturate(.72) brightness(.82);
}

@media(max-width:1279px),(max-height:719px) {
  #battle-screen.tts-match .tts-match-layout {
    --tts-polished-lid-depth:clamp(92px,17vh,126px);
    grid-template-columns:clamp(160px,15vw,188px) minmax(0,1fr) clamp(216px,18.4vw,244px);
    padding:7px 7px 12px;
  }
  #battle-screen.tts-match .tts-match-mark { flex-basis:clamp(104px,15.5vh,128px); }
  #battle-screen.tts-match .tts-match-studio { margin-top:18px; }
  #battle-screen.tts-match .tts-cabinet-chain { height:clamp(206px,36vh,270px); }
  #battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate { min-width:190px;width:34%; }
}

@media(max-width:1040px) {
  #battle-screen.tts-match .tts-match-layout { grid-template-columns:158px minmax(0,1fr) 220px;gap:5px; }
  #battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate { min-width:176px; }
  #battle-screen.tts-match .tts-cabinet-front .tts-cabinet-nameplate>span { display:none; }
}

/* Revision 9: hardware alignment from the annotated review. */
#battle-screen.tts-match .tts-cabinet-chain::before {
  top:-31px;
  width:clamp(22px,1.5vw,27px);
  height:clamp(48px,5.2vh,57px);
  box-sizing:border-box;
  border:1px solid #482607;
  border-radius:6px 6px 10px 10px;
  background:
    radial-gradient(circle at 50% 16%,#241305 0 1px,#f5d986 1.5px 2.9px,#724612 3.3px 4.3px,transparent 4.7px),
    radial-gradient(circle at 50% 84%,#241305 0 1px,#f5d986 1.5px 2.9px,#724612 3.3px 4.3px,transparent 4.7px),
    radial-gradient(ellipse at 50% 54%,#160a03 0 15%,#f0ce73 17% 25%,#70420f 27% 39%,transparent 41%),
    linear-gradient(105deg,#4a2709,#b97f29 24%,#f1ce70 46%,#95601b 68%,#3d1f07);
  box-shadow:inset 0 1px #fff0ad88,inset 0 -3px 4px #361906aa,0 0 0 2px #42170a,0 2px 4px #170304aa;
}
#battle-screen.tts-match .tts-cabinet-chain::after {
  width:clamp(19px,1.5vw,25px);
  height:clamp(25px,2.45vw,33px);
  bottom:-10px;
}

/* The upper case elbows should read as small protectors, not broad pasted-on
   brackets.  The larger lower feet remain in place. */
#battle-screen.tts-match :is(.tts-case-corner-tl,.tts-case-corner-tr) {
  width:clamp(30px,2.25vw,39px);
  height:clamp(20px,1.65vw,28px);
  background:
    radial-gradient(circle at 7px 7px,#251305 0 1px,#f5dc8d 1.5px 2.6px,#704513 3px 3.8px,transparent 4.2px),
    linear-gradient(180deg,#f4d67e,#ad7526 38%,#5c350f 64%,#dca649 82%,#4a270a) left top/100% 7px no-repeat,
    linear-gradient(90deg,#f4d67e,#ad7526 38%,#5c350f 64%,#dca649 82%,#4a270a) left top/7px 100% no-repeat;
}

/* One shared flex stack makes Deploy, Shuffle and Rotate true siblings.  This
   removes the subtle casing mismatch caused by the former nested groups. */
#battle-screen.tts-match .tts-deployment-instruments {
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:clamp(7px,.85vh,11px);
}
#battle-screen.tts-match .tts-deployment-instruments :is(.tts-match-primary,.tts-match-secondary) {
  display:contents;
}
body.tts-edition #battle-screen.tts-match .tts-deployment-instruments .tts-plaque-button.tts-naval-action {
  flex:none;
  width:100%!important;
  margin:0!important;
  border:11px solid transparent!important;
  border-image:var(--tts-brass) 14% / 18px / 2px stretch!important;
  background:linear-gradient(155deg,#234559,#071e33 38%,#031428 70%,#163749)!important;
  box-shadow:0 3px 4px #1a0805aa,inset 0 0 0 1px #29495c,inset 0 0 12px #0008!important;
}
#battle-screen.tts-match #deploy-fleet:disabled {
  opacity:.78!important;
  filter:saturate(.76) brightness(.84)!important;
}
