/* The tabletop is a locked 16:9 composition. Smaller windows crop the artwork;
   a separate reachable control rail preserves every essential action. */
.tts-edition { background: #080e15; }
.tts-edition #mode-screen, .tts-edition #gps-start-controls,
.tts-edition .gps-cinematic-sweep { display: none !important; }
.tts-edition .gps-fleet-footprint { display: none !important; }
#tts-shell { position: fixed; inset: 0; z-index: 60; overflow: hidden; color: #f5ebd5; font-family: Georgia, 'Times New Roman', serif; isolation: isolate; }
#tts-shell:focus { outline: none; }
#tts-shell[hidden], #tts-shell [hidden], .tts-dialog [hidden] { display: none !important; }
#tts-shell button, .tts-dialog button { cursor: pointer; font: inherit; touch-action: manipulation; }
#tts-shell button:focus-visible, .tts-dialog button:focus-visible, .tts-dialog input:focus-visible { outline: 3px solid #fff4b0; outline-offset: 4px; }
#tts-shell button:disabled, .tts-dialog button:disabled { cursor: wait; opacity: .65; }
.tts-stage { position: absolute; left: 50%; top: 50%; width: max(1280px, min(100vw, 177.7778svh)); height: max(720px, min(100svh, 56.25vw)); transform: translate(-50%, -50%); }
.tts-world, .tts-tabletop, .tts-home-actions, .tts-film, .tts-film video, #tts-terminal { position: absolute; inset: 0; width: 100%; height: 100%; }
.tts-world { transform-origin: 69.5% 74.5%; }
.tts-tabletop, .tts-film video, #tts-terminal { object-fit: fill; }
/* Restore the untouched original box artwork as a separate, noninteractive layer. */
.tts-home-hardware,.tts-home-hardware img { position:absolute;inset:0;width:100%;height:100%;object-fit:fill;pointer-events:none; }
.tts-hardware-upper { mask:url('./assets/through-the-shadows/home-hardware/frame-mask-v1.svg?v=20260919') 0 0 / 100% 100% no-repeat; }
.tts-hardware-lower { transform:translateY(.75%);mask:url('./assets/through-the-shadows/home-hardware/lower-frame-mask-v1.svg') 0 0 / 100% 100% no-repeat; }
.tts-gallery-cleanup { position: absolute; inset: 0; width: 100%; height: 100%; background: #a56d36; pointer-events: none; mask: url('./assets/through-the-shadows/gallery-cleanup-mask.svg') 0 0 / 100% 100% no-repeat; }
.tts-gallery-cleanup img { width: 100%; height: 100%; object-fit: fill; }
#tts-shell:not([data-view="home"]) #tts-world > .tts-tablet-loop { visibility: hidden; }
/* Match the inset screen in the updated 24 × 20 board composition. */
.tts-tablet-loop { position: absolute; left: 59.2995%; top: 63.1016%; width: 21.4498%; height: 20.6417%; transform-origin: 0 0; transform: matrix(1, .0701, -.087, 1, 0, 0); overflow: hidden; pointer-events: none; opacity: 0; }
.tts-tablet-loop[data-ready="true"] { opacity: 1; }
#tts-tablet-video { display: block; width: 100%; height: 100%; object-fit: fill; transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .tts-tablet-loop[data-ready="true"] { opacity: 0; } }
.tts-edition .match-page-v2 [data-enemy-type="DREADNOUGHT"] .enemy-formation-silhouette { position: relative; background-image: none; mix-blend-mode: normal; }
.tts-edition .match-page-v2 [data-enemy-type="DREADNOUGHT"] .enemy-formation-silhouette::before { content: ""; position: absolute; left: 50%; top: 50%; width: 40%; aspect-ratio: 2 / 5; background: url('./assets/ships/die-cast/Die_Cast_Dreadnought_192x480.png?v=tts-cgh-20260914') center / contain no-repeat; transform: translate(-50%, -50%) rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .tts-edition .formation-dreadnought.is-burning .formation-sprite-art { filter: sepia(.35) brightness(1.2) drop-shadow(0 0 3px #ef761c); } }
.tts-hotspot { position: absolute; padding: 0; border: 0; background: transparent; color: #fff0b4; border-radius: 12px; }
.tts-hotspot:hover { box-shadow: inset 0 0 28px #fff3b32b, 0 0 14px #ffe28b42; }
.tts-solo { left: 69.2%; top: 9.2%; width: 30%; height: 12%; }
.tts-pvp { left: 69.2%; top: 26%; width: 30%; height: 12%; }
.tts-inspect { left: 69.2%; top: 44.2%; width: 30%; height: 12%; }
.tts-achievements { left: 83%; top: 62.7%; width: 16.2%; height: 10.7%; }
.tts-menu { left: 83.3%; top: 80.7%; width: 16.1%; height: 10.2%; }
.tts-tablet { left: 57.6%; top: 59.2%; width: 23.4%; height: 30%; transform: rotate(4deg); border-radius: 24px; }
.tts-tablet span { position: absolute; left: 12%; right: 12%; bottom: 12%; padding: 12px 4px; background: #071728ee; border: 1px solid #e3be6a; border-radius: 4px; font: bold clamp(16px, 1.6vw, 28px) Georgia, serif; opacity: 0; transition: opacity .16s; }
.tts-tablet:hover span, .tts-tablet:focus-visible span { opacity: 1; }
.tts-home-audio { position: absolute; top: 12px; left: 12px; display: flex; gap: 5px; }
.tts-home-audio button { background: #06192ee8; color: #f9df91; border: 1px solid #9b773d; border-radius: 5px; padding: 8px 12px; font: 14px system-ui, sans-serif !important; }
.tts-home-audio button:last-child { font-size: 19px !important; padding: 3px 10px; }
.tts-compact-actions { display: none; }
#tts-shell:not([data-view="home"]) .tts-home-actions { visibility: hidden; }
#tts-shell:not([data-view="home"]) .tts-home-audio, #tts-shell:not([data-view="home"]) .tts-compact-actions { display: none; }
.tts-modes { position: absolute; inset: 0; display: grid; place-items: start center; padding: 16px 0; box-sizing: border-box; overflow-y: auto; background: #031327d6; }
.tts-mode-shell { width: min(900px, 92vw); height: min(940px, calc(100svh - 32px)); min-height: 590px; box-sizing: border-box; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; padding: 8px 0; }
.tts-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tts-heading > div { text-align: center; }
.tts-heading p, .tts-fleet-header p { margin: 0 0 4px; color: #eac467; text-transform: uppercase; letter-spacing: .13em; font: 12px system-ui, sans-serif; }
.tts-heading h2 { margin: 0; font-size: clamp(20px, 2.35vw, 32px); font-weight: 800; text-transform: uppercase; text-shadow: 0 2px 0 #000; }
.tts-heading button, .tts-mode-footer button, .tts-fleet button:not(.tts-splash), .tts-film-controls button, .tts-compact-actions button, .tts-dialog button { border: 1px solid #c29d52; border-radius: 6px; background: linear-gradient(#12314b, #061528); color: #ffe5a3; box-shadow: inset 0 0 0 2px #152d43, 0 3px 8px #0005; padding: 9px 17px; font-weight: bold; font-size: 16px; }
.tts-heading button:hover, .tts-mode-footer button:hover, .tts-fleet button:not(.tts-splash):hover, .tts-film-controls button:hover, .tts-dialog button:hover { background: #1e4561; }
.tts-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); justify-items: center; gap: 16px 26px; }
.tts-mode-card { position: relative; height: 100%; max-width: 100%; aspect-ratio: .695; border: 0; padding: 0; background: #04172a; color: #f5e6c7; border-radius: 14px; box-shadow: 0 7px 18px #0008; transition: box-shadow .15s, filter .15s; overflow: hidden; }
.tts-mode-card > img { width: 100%; height: 100%; object-fit: fill; display: block; }
.tts-mode-card[aria-pressed="true"] { outline: 3px solid #ffd875; outline-offset: 3px; box-shadow: 0 0 23px #eec05c66; }
.tts-mode-card[aria-pressed="false"] { filter: brightness(.85); }
.tts-mode-card:hover { filter: brightness(1.07); }
.tts-card-copy { position: absolute; left: 9%; right: 9%; top: 51%; bottom: 11%; background: linear-gradient(#082038, #041a30); display: flex; flex-direction: column; justify-content: center; padding: 3px; text-align: center; gap: 5px; }
.tts-card-copy strong { text-transform: uppercase; font-size: clamp(14px, 1.7svh, 18px); line-height: 1.08; }
.tts-card-copy small { font: 14px/1.18 system-ui, sans-serif; color: #f2e4cb; }
.tts-card-status { position: absolute; bottom: 4%; left: 9%; right: 9%; background: #071b2c; color: #edcc75; font: 11px/1.2 system-ui, sans-serif; text-transform: uppercase; }
.tts-mode-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; min-height: 100px; }
.tts-mode-footer h3 { font-size: 22px; margin: 0 0 5px; color: #ffdb86; }
.tts-mode-footer p { font: 16px/1.4 system-ui, sans-serif; margin: 0; }
.tts-mode-footer small { display: block; font: 14px/1.3 system-ui, sans-serif; margin-top: 7px; color: #e6c574; }
.tts-mode-footer button { min-width: 132px; padding: 14px 24px; font-size: 25px; text-transform: uppercase; }
.tts-fleet { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; background: #06132255; }
.tts-fleet-tablet { width: min(1500px, 96vw); height: min(920px, 94svh); display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; gap: 10px; background: #06101b; border: 10px solid #10151b; border-radius: 28px; box-shadow: 0 0 0 2px #797d80, 0 25px 80px #000b; padding: 16px; }
.tts-fleet-tablet { position: relative; transform-origin: 0 0; }
.tts-gallery-preview { position: absolute; inset: -1px; border-radius: 18px; background: #02070d; overflow: hidden; pointer-events: none; z-index: 2; }
.tts-gallery-preview .tts-tablet-loop { left: 3%; top: 14%; width: 94%; height: 72%; transform: none; visibility: visible; }
.tts-fleet-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; }
.tts-fleet-header > div { grid-column: 2; text-align: center; }
.tts-fleet-header > button:first-child { grid-column: 1; justify-self: start; }
.tts-fleet-header > button:last-child { grid-column: 3; justify-self: end; }
.tts-fleet-header h2 { margin: 0; color: #e8f4ff; font-size: clamp(20px, 2.1vw, 30px); }
.tts-fleet-header p { color: #9bbed3; }
.tts-fleet-header p span { margin-left: 12px; }
.tts-fleet-tabs { display: flex; justify-content: center; gap: 8px; }
.tts-fleet-tabs button { flex: 1; max-width: 225px; font-size: 15px !important; }
.tts-fleet-tabs button[aria-pressed="true"] { color: #fff6d6 !important; border-color: #ffe196 !important; background: #22445a !important; }
.tts-fleet-tabs small { display: block; font: 12px/1.25 system-ui, sans-serif; color: #b5c9d3; margin-top: 2px; }
.tts-blueprint-area { min-height: 0; position: relative; display: grid; place-items: center; background: #07365e; overflow: hidden; container-type: size; }
.tts-blueprint-sheet { position: relative; width: 100%; height: 100cqh; min-height: 0; box-sizing: border-box; padding: 16px 24px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 30%); grid-template-rows: auto minmax(0, 1fr) auto; gap: 10px 24px; background: #07365e; color: #e4f2fc; }
.tts-schematic-heading { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #b5d8ed80; padding-bottom: 8px; }
.tts-schematic-heading p { margin: 0 0 3px; font: 12px/1.2 system-ui, sans-serif; letter-spacing: .15em; text-transform: uppercase; }
.tts-schematic-heading h3 { margin: 0; font-size: clamp(20px, 2.2vw, 32px); line-height: 1; }
.tts-schematic-heading > span { font: 12px/1.4 system-ui, sans-serif; text-transform: uppercase; text-align: right; letter-spacing: .12em; }
.tts-schematic-drawing { grid-column: 1; grid-row: 2; min-height: 0; display: grid; place-items: center; overflow: hidden; }
#tts-blueprint { display: block; width: 100%; height: 100%; object-fit: contain; min-height: 0; }
.tts-schematic-notes { grid-column: 1; grid-row: 3; align-self: end; border-top: 1px solid #b5d8ed80; padding-top: 8px; }
.tts-schematic-notes h3 { font-size: clamp(14px, 1.3vw, 20px); margin: 0 0 6px; }
.tts-schematic-notes p { font: clamp(13px, 1.12vw, 17px)/1.4 system-ui, sans-serif; margin: 0 0 6px; }
.tts-schematic-notes small { font: 12px/1.3 system-ui, sans-serif; color: #bbd6e6; }
.tts-scale-panel { grid-column: 2; grid-row: 2 / 4; align-self: end; height: clamp(150px, 25cqh, 210px); margin: 0; padding: 9px; box-sizing: border-box; display: grid; grid-template-columns: 50% minmax(0, 1fr); gap: 12px; align-items: center; background: #092e50; border: 1px solid #96b9d0; color: #ecf5fc; min-height: 0; }
.tts-scale-panel > img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.tts-scale-panel figcaption { min-width: 0; font: 12px/1.35 system-ui, sans-serif; }
.tts-scale-panel h3 { margin: 0 0 8px; font-size: clamp(14px, 1.3vw, 19px); line-height: 1.1; color: #e6f2fb; }
.tts-scale-panel strong { display: block; font-size: 13px; margin-bottom: 3px; }
.tts-scale-panel span { display: block; }
.tts-scale-panel small { display: block; margin-top: 8px; font: 11px/1.3 system-ui, sans-serif; color: #c2d9e9; }
@media (max-width: 650px) {
  .tts-blueprint-sheet { padding: 10px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(100px, 1fr) auto 155px; gap: 8px; }
  .tts-schematic-heading { grid-column: 1; }
  .tts-schematic-heading p { font-size: 10px; }
  .tts-schematic-heading > span { font-size: 10px; }
  .tts-schematic-drawing { grid-column: 1; }
  .tts-schematic-notes { padding: 7px 0 0; }
  .tts-schematic-notes h3 { display: none; }
  .tts-schematic-notes p { margin: 0; font-size: 11px; line-height: 1.4; }
  .tts-schematic-notes small { font-size: 10px; }
  .tts-scale-panel { grid-column: 1; grid-row: 4; height: 155px; grid-template-columns: 115px minmax(0, 1fr); padding: 6px; gap: 14px; }
}
.tts-splash { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; background: #09111a; }
.tts-splash img { width: 100%; height: 100%; object-fit: contain; }
.tts-fleet-footer { display: flex; align-items: center; gap: 14px; }
.tts-fleet-footer p { flex: 1; font: 14px/1.35 system-ui, sans-serif; color: #cadce7; margin: 0; }
.tts-fleet-footer button { white-space: nowrap; }
.tts-film { z-index: 4; pointer-events: none; }
.tts-film-controls { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; z-index: 6; white-space: nowrap; }
.tts-dialog { width: min(610px, calc(100vw - 32px)); max-height: 88svh; box-sizing: border-box; overflow: auto; padding: 24px; background: #081c2d; color: #f5e6c7; border: 2px solid #ae8b49; border-radius: 12px; box-shadow: 0 30px 100px #000c; font: 16px/1.45 system-ui, sans-serif; }
.tts-dialog::backdrop { background: #020914ba; }
.tts-dialog > header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.tts-dialog h2 { color: #ffdb86; font: bold 25px/1.2 Georgia, serif; margin: 0; }
.tts-dialog > header button { padding: 2px 13px; font-size: 28px; }
.tts-dialog p { margin: 0 0 18px; }
.tts-fire-options { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tts-fire-options button { min-height: 130px; text-align: left; }
.tts-fire-options strong { font-size: 21px; display: block; margin-bottom: 8px; }
.tts-fire-options span { display: block; font: 16px/1.4 system-ui, sans-serif; color: #dce5e9; }
.tts-dialog .tts-back { margin-top: 18px; }
.tts-audio-row { display: grid; grid-template-columns: 100px 1fr 55px; align-items: center; gap: 12px; margin: 20px 0; }
.tts-audio-row input { width: 100%; accent-color: #e4b755; }
.tts-menu-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.tts-menu-links a { color: #edce88; padding: 9px 0; font-size: 14px; }
.tts-dialog dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.tts-dialog dt { color: #a9c2d3; }
.tts-dialog dd { margin: 0; text-align: right; }
.tts-dialog.is-art {
  --art-nav-size: clamp(44px, 6vw, 110px);
  width: min(1500px, calc(100vw - var(--art-nav-size) - var(--art-nav-size) - 40px));
  overflow: visible;
}
.tts-dialog.is-art img { display: block; width: 100%; max-height: 72svh; object-fit: contain; }
.tts-dialog:not(.is-art) > .tts-art-nav { display: none; }
.tts-dialog > .tts-art-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: var(--art-nav-size);
  height: var(--art-nav-size);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: #f9d77f;
  filter: drop-shadow(0 3px 4px #000b);
}
.tts-dialog > .tts-art-prev { right: calc(100% + 12px); }
.tts-dialog > .tts-art-next { left: calc(100% + 12px); }
.tts-dialog > .tts-art-nav svg { width: 100%; height: auto; fill: #081c2d99; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.tts-dialog > .tts-art-nav:hover { background: transparent; color: #fff0ad; }
.tts-dialog > .tts-art-nav:active { filter: brightness(.85); }
@media (max-width: 1279px), (max-height: 719px) {
  .tts-home-actions { visibility: hidden; }
  .tts-compact-actions { position: absolute; bottom: 12px; left: 12px; right: 12px; display: flex; justify-content: center; flex-wrap: wrap; gap: 7px; padding: 8px; border: 1px solid #b88b4b; border-radius: 8px; background: #061728f2; }
  .tts-compact-actions button { font-size: 14px; padding: 9px 13px; }
  .tts-mode-shell { min-height: 560px; }
  .tts-mode-grid { gap: 12px 18px; }
  .tts-fleet { padding: 12px; }
  .tts-fleet-tablet { padding: 10px; gap: 8px; }
}
@media (max-width: 650px) {
  .tts-mode-shell { width: 96vw; height: auto; min-height: 0; gap: 16px; grid-template-rows: auto auto auto; }
  .tts-heading { gap: 8px; }
  .tts-heading button { padding: 8px 10px; font-size: 14px; }
  .tts-heading h2 { font-size: 20px; }
  .tts-mode-grid { gap: 12px 10px; grid-template-rows: auto auto; }
  .tts-mode-card { width: 100%; height: auto; align-self: center; }
  .tts-card-copy small { display: none; }
  .tts-card-copy strong { font-size: 14px; }
  .tts-card-status { font-size: 10px; }
  .tts-mode-footer { gap: 12px; }
  .tts-mode-footer button { min-width: 80px; padding: 12px; font-size: 20px; }
  .tts-fleet-tablet { height: 95svh; padding: 9px; border-width: 6px; border-radius: 18px; }
  .tts-fleet-header { grid-template-columns: 1fr 1fr; gap: 5px; }
  .tts-fleet-header > div { grid-column: 1 / -1; grid-row: 1; }
  .tts-fleet-header > button:first-child { grid-column: 1; grid-row: 2; }
  .tts-fleet-header > button:last-child { grid-column: 2; grid-row: 2; }
  .tts-fleet-header button { padding: 8px !important; font-size: 14px !important; }
  .tts-fleet-header h2 { font-size: 18px; }
  .tts-fleet-tabs { flex-wrap: wrap; gap: 5px; }
  .tts-fleet-tabs button { flex: 1 1 28%; padding: 7px !important; }
  .tts-fleet-footer { flex-wrap: wrap; gap: 6px; }
  .tts-fleet-footer p { flex-basis: 100%; order: -1; }
  .tts-fire-options { grid-template-columns: 1fr; }
  .tts-fire-options button { min-height: 100px; }
  .tts-film-controls { gap: 5px; }
  .tts-film-controls button { padding: 9px; font-size: 14px; }
}
@media (hover: none) { .tts-tablet span { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #tts-shell *, .tts-dialog * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
