/* Glimmerdeep menus. The look is a 2000s casual game at modern fidelity:
   polished brass frames with rivets, lacquer panels with a fish-scale emboss,
   glossy gel buttons with a thick lower edge, outlined two-tone lettering,
   ribbons and inset plates. No images: everything is gradients and shadows,
   so it stays sharp at any size.

   The stage is a fixed 1280x720 design; main.js scales #ui to fit. */

:root {
  --ink: #1e0f02;
  --navy: #07173d;
  --text: #ffffff;
  --soft: #cfe8ff;
  --brass: linear-gradient(160deg, #fff8d2 0%, #f7d874 16%, #cc9226 42%, #8b5813 60%, #edc257 80%, #fff4b8 100%);
  --lacquer: linear-gradient(180deg, #1f66ae 0%, #0f3a7a 50%, #071d4a 100%);
  --scale: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0) 11.4px, rgba(255, 255, 255, 0.09) 12px, rgba(0, 10, 40, 0.2) 13px, rgba(0, 0, 0, 0) 13.7px);
  --font: "SF Pro Rounded", ui-rounded, "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --display: "Arial Rounded MT Bold", "SF Pro Rounded", ui-rounded, "Trebuchet MS", Verdana, system-ui, sans-serif;
  --outline: 0 2px 0 var(--navy), 0 -1.5px 0 var(--navy), 1.5px 0 0 var(--navy), -1.5px 0 0 var(--navy), 1.2px 1.6px 0 var(--navy), -1.2px 1.6px 0 var(--navy), 0 4px 3px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  background: #010410;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* The stage sits inside the safe area, clear of notches and the home bar. */
body {
  display: grid;
  place-items: center;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  touch-action: none;
}

#stage {
  position: relative;
  z-index: 1;
  width: 1280px;
  height: 720px;
  overflow: hidden;
  background: #030a1c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  /* A brass frame and a deep shadow: where the screen is wider or taller
     than the stage, the game sits in the scene like a cabinet. */
  box-shadow:
    0 0 0 2px #1e0f02,
    0 0 0 5px #c9922a,
    0 0 0 6.5px #fff0b0,
    0 0 0 9px #8b5813,
    0 0 0 11px #1e0f02,
    0 0 70px 22px rgba(0, 2, 12, 0.85);
}

/* The surround: the scene's own picture, blurred and darkened, behind the
   stage. It only shows where the stage leaves room (the bars beside a 16:9
   picture on a wider or taller screen). */
#surround {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 35%, #0b2a52 0%, #030a1c 70%, #010410 100%);
}

/* Two layers that cross-fade. Each is a canvas of 64 x 36 pixels holding a
   darkened copy of the scene's painting (main.js draws it), stretched over
   the window: as soft as a heavy blur, and free to show. No CSS blur (a live
   blur filter on a full-window layer is recomputed by the compositor on
   every frame), and no image made from the canvas either: reading a canvas
   back stalls the page for as long as the graphics chip takes to answer. */
#surround > canvas {
  position: absolute;
  left: -4%;
  top: -4%;
  width: 108%;
  height: 108%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.9s ease;
}

#surround > canvas.on { opacity: 1; }

/* Darker toward the screen edges, with a faint fish-scale sheen, so the
   surround stays in the background. */
#surround::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(1, 4, 16, 0) 40%, rgba(1, 4, 16, 0.5) 100%),
    var(--scale) 0 0 / 28px 14px,
    var(--scale) 14px 7px / 28px 14px;
}

#stage.playing { cursor: crosshair; }
#game { display: block; width: 100%; height: 100%; }
#readout { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

#ui {
  position: absolute;
  left: 0;
  top: 0;
  width: 1280px;
  height: 720px;
  transform-origin: 0 0;
  pointer-events: none;
}

#ui .blocks-input { pointer-events: auto; cursor: default; }
.noscript { position: fixed; inset: auto 0 2rem; text-align: center; }
h1, h2, h3, h4, p { margin: 0; }
button { font-family: inherit; }

/* ---- Lettering --------------------------------------------------------- */

/* Outlined two-tone text. The element paints the outline and shadow; the
   ::after copy (from data-text) paints the gradient face on top. */
.chunky {
  position: relative;
  display: inline-block;
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.1;
  color: var(--navy);
  -webkit-text-stroke: 0.2em var(--navy);
  text-shadow: 0 0.09em 0 var(--navy), 0 0.16em 0.1em rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

.chunky::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  top: 0;
  -webkit-text-stroke: 0;
  text-shadow: none;
  background: linear-gradient(180deg, #fff 0%, #fff6c0 28%, #ffe36a 55%, #ffae1c 58%, #ffd768 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* For names that wrap: one flat face color instead of a split gradient. */
.chunky.plain::after { background: none; color: #ffe9a0; }
.chunky.ice::after { background-image: linear-gradient(180deg, #fff 0%, #fff 40%, #e2f4ff 56%, #9fd4ff 59%, #e6f6ff 100%); }
.chunky.rose::after { background-image: linear-gradient(180deg, #fff 0%, #ffe3ee 30%, #ffb0cc 55%, #ff5a94 58%, #ffc0d8 100%); }
.chunky.steel::after { background-image: linear-gradient(180deg, #fff 0%, #e6eefc 40%, #c3d2ee 56%, #8ea4cc 59%, #dbe6fa 100%); }

/* Engraved brass nameplate, used for small labels. */
.label, h4 {
  display: inline-block;
  align-self: flex-start;
  font: 700 11.5px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255, 250, 210, 0.85);
  padding: 4px 11px 3px;
  border-radius: 5px;
  background: linear-gradient(180deg, #fff3b8 0%, #e7b94c 50%, #b07a1c 100%);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 1.5px 0 rgba(255, 255, 255, 0.75), 0 3px 4px rgba(0, 0, 0, 0.45);
  margin: 14px 0 9px;
}

h4:first-child { margin-top: 0; }

/* ---- Frames, plates, ribbons ------------------------------------------- */

.frame {
  position: relative;
  border: 7px solid transparent;
  border-radius: 20px;
  background:
    var(--scale) 0 0 / 26px 26px repeat padding-box,
    var(--scale) 13px 13px / 26px 26px repeat padding-box,
    linear-gradient(180deg, rgba(0, 6, 30, 0.6) 0, rgba(0, 6, 30, 0) 18px) padding-box,
    linear-gradient(0deg, rgba(90, 200, 255, 0.16) 0, rgba(90, 200, 255, 0) 44px) padding-box,
    var(--lacquer) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 2px var(--ink), 0 10px 24px rgba(0, 0, 0, 0.65), inset 0 0 0 1.5px rgba(70, 38, 4, 0.9);
}

/* Bevel line on the brass, and four rivets. */
.frame::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 19px;
  border: 1.2px solid rgba(255, 255, 255, 0.75);
  pointer-events: none;
}

.frame::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 20px;
  pointer-events: none;
  --rivet: radial-gradient(circle at 36% 32%, #fffbe0 0, #e6b64a 42%, #7a4a0e 68%, var(--ink) 72%, rgba(0, 0, 0, 0) 76%);
  background:
    var(--rivet) 13px 0 / 7px 7px no-repeat,
    var(--rivet) calc(100% - 13px) 0 / 7px 7px no-repeat,
    var(--rivet) 13px 100% / 7px 7px no-repeat,
    var(--rivet) calc(100% - 13px) 100% / 7px 7px no-repeat;
}

.plate {
  border-radius: 12px;
  border: 1.5px solid #010616;
  background: linear-gradient(180deg, #020a22, #0a2756);
  box-shadow: inset 0 5px 7px rgba(0, 0, 0, 0.75), 0 1.5px 0 rgba(160, 220, 255, 0.4);
}

.ribbon {
  position: relative;
  display: inline-block;
  padding: 7px 30px 9px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ff86ae 0%, #d42463 55%, #c21a54 100%);
  box-shadow: 0 0 0 2px #5a0c28, inset 0 2px 0 rgba(255, 255, 255, 0.5), inset 0 -3px 5px rgba(90, 0, 40, 0.5), 0 6px 8px rgba(0, 0, 0, 0.45);
}

.ribbon::before, .ribbon::after {
  content: "";
  position: absolute;
  top: 7px;
  width: 36px;
  height: 100%;
  z-index: -1;
  background: linear-gradient(180deg, #c21a54, #7a0c34);
}

.ribbon::before { left: -22px; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 34% 50%); }
.ribbon::after { right: -22px; clip-path: polygon(0 0, 100% 0, 66% 50%, 100% 100%, 0 100%); }
.ribbon.gold { background: linear-gradient(180deg, #ffe98a 0%, #f0a81c 55%, #d8870a 100%); box-shadow: 0 0 0 2px #5a3204, inset 0 2px 0 rgba(255, 255, 255, 0.6), inset 0 -3px 5px rgba(110, 50, 0, 0.5), 0 6px 8px rgba(0, 0, 0, 0.45); }
.ribbon.gold::before, .ribbon.gold::after { background: linear-gradient(180deg, #d8870a, #8a4a04); }

/* ---- Gel buttons ------------------------------------------------------- */

.btn {
  position: relative;
  font: 900 18px/1 var(--display);
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: var(--outline);
  padding: 12px 26px 14px;
  min-width: 150px;
  border: 4px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(180deg, #62e0ff 0%, #1ea8f0 48%, #0b74d0 52%, #1a9cea 100%) padding-box,
    var(--brass) border-box;
  /* A press never moves a control with a transform, scales or filters it:
     inside the scaled menu layer that makes some browsers (Safari) lift it
     onto a layer of its own, whose position snaps to whole pixels, and the
     control visibly jumps. A press slides the control with `top` (plain
     layout) and darkens its face with --wash (an inset shadow that covers
     it); --glow is the ring a control wears when it is chosen or has the
     keyboard. The light under the pointer is not the control's own at all:
     see .light below. */
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 2px var(--ink), 0 6px 0 2px #120801, 0 12px 16px rgba(0, 0, 0, 0.55), inset 0 -5px 8px rgba(0, 20, 90, 0.55), inset 0 0 0 1.5px rgba(0, 40, 110, 0.7), var(--glow);
  cursor: pointer;
}

/* The gloss: a bright cap over the upper half. */
.btn::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 2px;
  height: 46%;
  border-radius: 12px 12px 50% 50% / 12px 12px 90% 90%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.12));
  pointer-events: none;
}

/* Reached with the keyboard: a hard ring (no blur, cheap to paint). */
.btn:focus-visible {
  --wash: rgba(255, 255, 255, 0.17);
  --glow: 0 0 0 3px rgba(150, 240, 255, 0.95);
  outline: none;
}

/* ---- The light under the pointer ----------------------------------------

   One element (ui.js moves it) laid over whatever control the pointer is
   on: a wash over its face, a bright ring and a glow. It lives on a layer of
   its own, so lighting a control paints nothing of the menu under it.

   That matters more than it sounds. A menu is hundreds of gradients and
   shadows; on a large, dense screen it is tens of millions of pixels. When
   the light was each control's own box-shadow, moving the pointer across a
   screen of thirty boards or sixty tracks had the browser paint blurred
   shadows again on every frame (each hover faded in and out), and the game
   crawled. Two rules follow, and `make shot SHOTS=menufps` holds them:
   a menu at rest is never painted again (no endless animation of anything
   that has to be painted: only opacity and transform, which the compositor
   does alone), and nothing in a menu is painted because the pointer moved.

   The light comes on at once and goes off softly; both are its opacity. */
.light {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 60;
  pointer-events: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.17);
  box-shadow: 0 0 0 2px rgba(196, 247, 255, 0.95), 0 0 14px 4px rgba(120, 232, 255, 0.85);
  opacity: 0;
  will-change: transform, opacity;
  transition: opacity 0.12s ease;
}
.light.on { opacity: 1; transition-duration: 0.03s; }
.light.gold { background: rgba(255, 255, 255, 0.1); box-shadow: 0 0 0 2.5px #fff3a8, 0 0 14px 5px rgba(255, 236, 150, 0.9); }
html.touch .light { display: none; } /* fingers do not hover */

.btn:active {
  --wash: rgba(0, 10, 50, 0.1);
  top: 4px;
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 2px var(--ink), 0 2px 0 2px #120801, 0 4px 7px rgba(0, 0, 0, 0.5), inset 0 3px 8px rgba(0, 20, 90, 0.7), inset 0 0 0 1.5px rgba(0, 40, 110, 0.7), var(--glow);
}

.btn.primary {
  --navy: #6a2a00;
  background:
    linear-gradient(180deg, #fff08a 0%, #ffbe22 48%, #f08400 52%, #ffab1e 100%) padding-box,
    var(--brass) border-box;
}

.btn.ghost {
  --navy: #1c1846;
  font-size: 15px;
  min-width: 0;
  padding: 9px 20px 11px;
  background:
    linear-gradient(180deg, #b8b6f0 0%, #7a78cc 48%, #524fa8 52%, #7270c6 100%) padding-box,
    var(--brass) border-box;
}

.btn.danger {
  --navy: #5a0a14;
  background:
    linear-gradient(180deg, #ff9a9a 0%, #f04848 48%, #c41c28 52%, #ee4444 100%) padding-box,
    var(--brass) border-box;
}

.btn.wide { width: 100%; }

/* A small button, for rows of controls. */
.btn.small { font-size: 13px; min-width: 0; padding: 6px 11px 8px; border-width: 3px; border-radius: 12px; box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801, 0 7px 9px rgba(0, 0, 0, 0.5), inset 0 -4px 6px rgba(0, 20, 90, 0.5), var(--glow); }
.btn.small::before { left: 4px; right: 4px; border-radius: 8px 8px 50% 50% / 8px 8px 90% 90%; }
.btn.small:active { top: 3px; box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 1px 0 1.5px #120801, 0 3px 5px rgba(0, 0, 0, 0.5), inset 0 3px 6px rgba(0, 20, 90, 0.6), var(--glow); }

/* ---- Screens ----------------------------------------------------------- */

/* Screens and overlays are laid out on a canvas of 1280x720 divided by
   --zoom and then magnified by it. --zoom is 1 except on small touch screens
   (main.js sets it), where it makes every control thumb-sized. */
.screen {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(1280px / var(--zoom, 1));
  height: calc(720px / var(--zoom, 1));
  transform: scale(var(--zoom, 1));
  transform-origin: 0 0;
  display: flex;
  flex-direction: column;
  padding: 22px 36px 26px;
  background: radial-gradient(ellipse at 50% 40%, rgba(2, 10, 34, 0.35), rgba(1, 4, 18, 0.8));
  animation: screen-in 0.16s ease-out backwards;
}

@keyframes screen-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.bar { display: flex; align-items: center; gap: 40px; margin: 2px 0 20px; min-height: 52px; }
.bar .ribbon { margin-left: 18px; }
.bar .ribbon .chunky { font-size: 30px; }
.bar p { color: var(--soft); font-size: 14.5px; font-weight: 600; text-shadow: 0 2px 3px #000; margin-left: 16px; }

/* ---- Title ------------------------------------------------------------- */

/* The title painting is the star here: the Deep Bloom glows in the middle of
   the lower half, so the menu stands around it instead of on top of it. The
   logo is drawn on the game canvas (logo.js) in the room .logo-slot keeps. */
.screen.title { align-items: center; padding: 0; background: none; animation: none; }
.title-box { display: flex; flex-direction: column; align-items: center; padding-top: 44px; }
.logo-slot { width: 950px; aspect-ratio: 5.92; cursor: pointer; touch-action: none; }
.tagline { margin-top: 10px; animation: drop-in 0.5s cubic-bezier(0.2, 1.3, 0.4, 1) 0.9s backwards; }
.tagline .chunky { font-size: 19px; }

/* The one big button, with a warm light breathing behind it and a glint
   that crosses its face now and then. */
.hero { position: relative; margin-top: 18px; }
.hero::before {
  content: "";
  position: absolute;
  inset: -34px -70px -40px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 110, 0.62), rgba(255, 170, 60, 0.2) 55%, rgba(255, 150, 40, 0));
  animation: breathe 2.6s ease-in-out infinite;
  pointer-events: none;
}
.hero .btn { width: 440px; font-size: 29px; padding: 16px 20px 20px; overflow: hidden; }
.hero .btn::after {
  content: "";
  position: absolute;
  top: -30%;
  left: 0;
  width: 26%;
  height: 160%;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.55) 42%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.12) 64%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-22deg);
  translate: -170% 0;
  animation: glint 5s ease-in-out 2.2s infinite;
  pointer-events: none;
}

.side { position: absolute; top: 396px; width: 262px; display: flex; flex-direction: column; gap: 15px; }
.side.left { left: 58px; }
.side.right { right: 58px; }
.side .btn { font-size: 21px; padding: 11px 16px 14px; min-width: 0; }
/* Treasure Tide, once it is open: right under the big button. */
.under-hero { position: relative; margin-top: 15px; }
.under-hero .btn { width: 300px; font-size: 21px; padding: 10px 16px 13px; }
/* The columns lean in toward the Bloom, like the sides of a bowl. */
.side.left .btn:nth-child(2) { translate: -18px 0; }
.side.right .btn:nth-child(2) { translate: 18px 0; }

/* Buttons arrive one after another as the logo lands. Everything waits for
   the logo's first letter (.go, set from main.js) so the two stay in step. */
.title .hero .btn, .title .under-hero .btn, .title .side .btn {
  animation: btn-in 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) backwards;
  animation-delay: calc(1s + var(--i, 0) * 70ms);
}
.title:not(.go) .tagline, .title:not(.go) .btn, .title:not(.go) .progress, .title:not(.go) .hero::before { animation-play-state: paused; }
/* A press or a key during the entrance: everything is simply there. */
.title.skip .tagline, .title.skip .btn, .title.skip .progress { animation: none; }
.title.again .hero .btn, .title.again .under-hero .btn, .title.again .side .btn { animation-delay: calc(0.25s + var(--i, 0) * 45ms); }
.title.again .tagline { animation-delay: 0.2s; }
.title.again .progress { animation-delay: 0.5s; }
.title.again .hero .btn::after { animation-delay: 1.4s; }

@keyframes btn-in {
  from { opacity: 0; scale: 0.6; }
  to { opacity: 1; scale: 1; }
}

@keyframes drop-in {
  from { opacity: 0; translate: 0 -16px; scale: 0.9; }
  to { opacity: 1; translate: 0 0; scale: 1; }
}

@keyframes breathe {
  0%, 100% { opacity: 0.45; scale: 0.94; }
  50% { opacity: 1; scale: 1.05; }
}

@keyframes glint {
  0%, 70% { translate: -170% 0; }
  88%, 100% { translate: 520% 0; }
}

.progress {
  position: absolute;
  left: 50%;
  bottom: 16px;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 7px 22px 8px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  animation: fade 0.6s ease 2s backwards;
}
.progress .who { font: 900 15px var(--display); color: #ffe9a0; text-shadow: 0 2px 0 #1e0f02; padding-right: 16px; border-right: 2px solid rgba(160, 220, 255, 0.25); }
.stat { display: inline-flex; align-items: center; gap: 6px; }
.stat-icon { width: 18px; height: 20px; }
.stat b { color: #fff; font-size: 15.5px; }
.stat i { font-style: normal; opacity: 0.7; font-size: 12.5px; margin-left: -4px; }

/* ---- Voyage ------------------------------------------------------------ */

/* The three Voyages: tabs in the header bar. */
/* Ten Voyages in one row: each tab is its numeral; the open one stretches
   to show its name and stars as well. */
.tabs { display: flex; gap: 9px; margin-left: 6px; flex: 1; min-width: 0; }
.tab {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 6px 7px 8px 7px;
  font: 900 14.5px/1 var(--display);
  color: #fff;
  text-shadow: var(--outline);
  --navy: #1c2338;
  border: 3px solid transparent;
  border-radius: 14px;
  background: linear-gradient(180deg, #9aa6c4 0%, #6a7798 48%, #4a5676 52%, #66728f 100%) padding-box, var(--brass) border-box;
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801, 0 7px 0 1.5px rgba(0, 0, 0, 0.28), var(--glow);
  cursor: pointer;
}
.tab.on {
  --navy: #6a2a00;
  top: 3px;
  background: linear-gradient(180deg, #fff08a 0%, #ffbe22 48%, #f08400 52%, #ffab1e 100%) padding-box, var(--brass) border-box;
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 1px 0 1.5px #120801, 0 0 14px 2px rgba(255, 214, 90, 0.8), var(--glow);
}
.tab.on { flex: 1 1 auto; padding-right: 12px; }
.tab:not(.on) .tab-name, .tab:not(.on) .tab-stars, .tab:not(.on) > .tab-star { display: none; }
.tab.locked { cursor: default; color: #b9c2d6; }
.tab.locked .numeral { color: #5a6072; background: radial-gradient(circle at 36% 30%, #d6dbe6 0, #8a93a8 45%, #4a5266 100%); }
.tab .numeral {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 13px;
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255, 250, 210, 0.85);
  background: radial-gradient(circle at 36% 30%, #fffbe0 0, #f3cf62 45%, #b07a1c 100%);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 -2px 3px rgba(90, 50, 0, 0.5);
}
.tab .tab-name { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab .tab-stars { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; }
.tab-star { width: 15px; height: 17px; flex: none; }
/* The two charts, in front of the Voyage tabs: the same tabs, each always
   showing its name. The one in view is gold; a chart not found yet is grey. */
.charts { display: flex; gap: 7px; flex: none; }
.tab.chart, .tab.chart.on { flex: 0 0 auto; padding: 6px 13px 8px 7px; gap: 7px; }
.tab.chart .numeral { background: radial-gradient(circle at 36% 30%, #5a86c8 0, #24468a 55%, #0e2052 100%); }
.tab.chart.locked .numeral { background: radial-gradient(circle at 36% 30%, #d6dbe6 0, #8a93a8 45%, #4a5266 100%); }
.tab.chart .chart-name { white-space: nowrap; }
.chart-icon { width: 19px; height: 21px; flex: none; }
.tab-row { display: flex; gap: 8px; margin: 0 3px; flex: none; min-width: 0; }
.treasures .bar .charts { margin-left: auto; }
/* (On the map the charts stand where the heading was, close to the tabs.) */
.voyage .bar { gap: 16px; }
.voyage .bar .tabs { margin-left: 0; }
.tab-row .tabs { margin: 0; flex: 1; }
.board-pick .tab.chart { padding: 4px 9px 6px 6px; }
.board-pick .chart-icon { width: 15px; height: 17px; }
.board-pick { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.board-pick .tabs { margin: 0 3px; flex: none; }
.board-pick .tab { padding: 4px 8px 6px 6px; font-size: 12.5px; border-width: 2.5px; border-radius: 12px; gap: 6px; }
.board-pick .tab .numeral { width: 24px; height: 24px; font-size: 11px; }
html.compact .tab { padding: 8px 12px 10px 8px; font-size: 14px; }
/* (On a phone the two charts are their compass roses only: the row has no room for their names.) */
html.compact .tab.chart, html.compact .tab.chart.on { padding: 8px 8px 10px; }
html.compact .tab.chart .chart-name { display: none; }
html.compact .voyage .bar { gap: 12px; }
html.compact .voyage .tabs { gap: 6px; }
html.compact .voyage .tab:not(.on):not(.chart) { padding: 8px 5px 10px; }


.dives { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px 18px; flex: 1; min-height: 0; padding: 0 4px 6px; }
.dive { display: flex; flex-direction: column; gap: 8px; padding: 8px 9px 10px; }
/* A dive not reached yet: the same card in dull metal and grey lacquer.
   (Recolored rather than filtered: a filter would put the whole card on a
   layer of its own.) */
.dive.locked, .trial.locked, .trophy.locked {
  --lacquer: linear-gradient(180deg, #3d4a63 0%, #272f44 50%, #141a29 100%);
  --brass: linear-gradient(160deg, #c9ccd4 0%, #9aa0ad 16%, #6a707e 42%, #454a57 60%, #8d939f 80%, #c2c6ce 100%);
}
.dive.locked .chunky::after, .trial.locked .chunky::after, .trophy.locked .chunky::after { background-image: linear-gradient(180deg, #e3e8f2 0%, #aab4c8 55%, #7c879e 58%, #a9b3c7 100%); }
/* A name that wraps has a flat face (.plain: no gradient, and with it no
   clipping of the background to the letters). On a card not reached yet it
   must stay flat too, in dull silver: the gradient of the rule above, given
   to it, was painted as a box behind the name. */
.dive.locked .chunky.plain::after, .trial.locked .chunky.plain::after, .trophy.locked .chunky.plain::after { background: none; color: #c5cedf; }
.dive.locked .depth, .trial.locked, .trophy.locked { color: #8f9bb4; }
.dive-head { display: flex; gap: 8px; align-items: center; min-height: 66px; }
.dive-head .chunky { font-size: 16.5px; white-space: normal; line-height: 1.05; }
.dive .depth { font-size: 11px; font-weight: 700; color: var(--soft); margin-top: 3px; text-shadow: 0 1px 2px #000; }

.dive-art {
  flex: 1;
  min-height: 0;
  border-radius: 10px;
  border: 2px solid #010616;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 5px 10px rgba(0, 0, 0, 0.8), inset 0 0 0 1.5px rgba(255, 255, 255, 0.18), 0 1.5px 0 rgba(160, 220, 255, 0.4);
}

.pills { display: flex; flex-direction: column; gap: 9px; padding-bottom: 5px; }

/* A level row: a small gel bar with a brass coin for the number. */
.level-pill {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 9px 2px 4px;
  font: 900 12.5px/1 var(--display);
  color: #fff;
  text-align: left;
  text-shadow: var(--outline);
  border: 2.5px solid transparent;
  border-radius: 12px;
  background:
    linear-gradient(180deg, #5ad2ff 0%, #1b9ae6 48%, #0a66c2 52%, #1788dc 100%) padding-box,
    var(--brass) border-box;
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801, 0 7px 0 1.5px rgba(0, 0, 0, 0.28), inset 0 -3px 0 rgba(0, 20, 90, 0.26), var(--glow);
  cursor: pointer;
}

.level-pill::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 1px;
  height: 45%;
  border-radius: 8px 8px 50% 50% / 8px 8px 90% 90%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.1));
  pointer-events: none;
}

.level-pill:active:not(:disabled) { top: 3px; --wash: rgba(0, 10, 50, 0.1); }
.level-pill.done { background: linear-gradient(180deg, #8af0a0 0%, #2fc45c 48%, #14963c 52%, #2cb856 100%) padding-box, var(--brass) border-box; --navy: #0a3c1a; }
.level-pill.locked { background: linear-gradient(180deg, #9aa6c4 0%, #6a7798 48%, #4a5676 52%, #66728f 100%) padding-box, var(--brass) border-box; cursor: default; --navy: #1c2338; }
.level-pill .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 2px 0; }
.level-pill .best { font: 700 10.5px var(--font); color: #fff; text-shadow: 0 1px 2px rgba(0, 20, 60, 0.9); display: flex; align-items: center; }

.coin {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font: 900 12px/1 var(--display);
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255, 250, 210, 0.85);
  background: radial-gradient(circle at 36% 30%, #fffbe0 0%, #f4cf62 45%, #b07a1c 100%);
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 -2px 2px rgba(110, 60, 0, 0.5);
}

.icon { width: 15px; height: 17px; display: block; }
.portrait { display: block; flex: none; }

/* ---- Pickers (Free Dive, Duel) ------------------------------------------ */

.columns { display: grid; grid-template-columns: 1fr 392px; gap: 26px; flex: 1; min-height: 0; }
.col { display: flex; flex-direction: column; min-height: 0; }
.col.frame { padding: 12px 14px 14px; }
.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px 11px; padding: 2px 3px 6px; }

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  height: 76px;
  padding: 5px 7px;
  text-align: left;
  font: 700 11.5px/1.12 var(--font);
  color: #fff;
  text-shadow: 0 1.5px 2px rgba(0, 10, 50, 0.95);
  border: 3px solid transparent;
  border-radius: 13px;
  background:
    linear-gradient(180deg, #4fc6fa 0%, #1a8fe0 46%, #0b5db8 50%, #136fc8 100%) padding-box,
    var(--brass) border-box;
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801, 0 8px 0 1.5px rgba(0, 0, 0, 0.28), inset 0 -4px 0 rgba(0, 20, 90, 0.26), var(--glow);
  cursor: pointer;
}

.tile::before {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  top: 1px;
  height: 42%;
  border-radius: 9px 9px 46% 46% / 9px 9px 60% 60%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.06));
  pointer-events: none;
}

.tile .coin { width: 25px; height: 25px; font-size: 12.5px; }

.tile.on {
  background: linear-gradient(180deg, #fff08a 0%, #ffbe22 46%, #f08400 50%, #ffab1e 100%) padding-box, var(--brass) border-box;
  text-shadow: 0 1.5px 2px rgba(90, 30, 0, 0.95);
  /* The chosen board: gold, ringed in white and in a wider ring of gold (no
     change of size, and no blur to paint). */
  box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 1.5px var(--ink), 0 0 0 4px #fff7c4, 0 4px 0 4px #120801, 0 0 0 7.5px rgba(255, 214, 90, 0.5), inset 0 -4px 0 rgba(140, 60, 0, 0.3), var(--glow);
  z-index: 1;
}

.tile.locked { background: linear-gradient(180deg, #8e9ab8 0%, #5f6c8c 46%, #424e6c 50%, #586480 100%) padding-box, var(--brass) border-box; cursor: default; color: #d4dcee; }
.tile .icon { position: absolute; right: 7px; top: 8px; }
.best-line { margin-top: auto; padding: 9px 16px 10px; color: var(--soft); font-size: 13.5px; font-weight: 700; }
.keepers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px 2px; justify-items: center; }

.keeper {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(255, 227, 106, 0), 0 0 0 0 rgba(120, 232, 255, 0);
}

/* A ring of gold round the medallion that is chosen (two hard rings: no blur
   to paint). The blue one under the pointer is the light's. */
.keeper.on { box-shadow: 0 0 0 3px #ffe36a, 0 0 0 6px rgba(255, 227, 106, 0.42); }
.keeper.locked { cursor: default; }

.keeper-info { margin: 10px 0 10px; padding: 11px 15px 12px; min-height: 132px; font-size: 13.5px; font-weight: 600; line-height: 1.4; color: var(--soft); }
.keeper-info .chunky { font-size: 19px; }
.keeper-info .power { font: 900 13px var(--display); color: #ffe36a; text-shadow: 0 1.5px 0 #5a2c04; margin: 3px 0 5px; }
.quote { font-style: italic; color: #fff; margin-top: 5px; }

/* The board that is picked, in small: a window in a brass rim. */
.preview {
  display: block;
  width: 100%;
  height: 118px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 3px solid transparent;
  background: linear-gradient(#020a22, #020a22) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3);
}

.segment { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 2px 20px; }

.segment button {
  position: relative;
  font: 900 12px/1 var(--display);
  color: #fff;
  text-shadow: var(--outline);
  --navy: #1c2338;
  padding: 10px 2px 11px;
  border: 2.5px solid transparent;
  border-radius: 11px;
  background: linear-gradient(180deg, #9aa6c4 0%, #6a7798 48%, #4a5676 52%, #66728f 100%) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801, 0 7px 8px rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.segment button.on {
  --navy: #6a2a00;
  background: linear-gradient(180deg, #fff08a 0%, #ffbe22 48%, #f08400 52%, #ffab1e 100%) padding-box, var(--brass) border-box;
  position: relative;
  top: 3px;
  box-shadow: 0 0 0 1.5px var(--ink), 0 1px 0 1.5px #120801, 0 0 14px rgba(255, 214, 90, 0.8);
}

/* ---- Trials ------------------------------------------------------------ */

.trial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 20px; padding: 0 4px; }

.trial {
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 8px 12px 9px 9px;
  min-height: 102px;
  font: 600 13px/1.35 var(--font);
  color: var(--soft);
  cursor: pointer;
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 80px var(--wash), 0 0 0 2px var(--ink), 0 7px 0 2px rgba(0, 0, 0, 0.32), inset 0 0 0 1.5px rgba(70, 38, 4, 0.9), var(--glow);
}

.trial:active:not(:disabled) { top: 2px; }
.trial .chunky { font-size: 17px; margin-bottom: 4px; }
.trial.locked { cursor: default; }
.trial .badge { position: absolute; right: -9px; top: -12px; width: 38px; height: 43px; }

/* ---- Options ----------------------------------------------------------- */

.panel { width: 540px; margin: 0 auto; padding: 16px 22px 20px; display: flex; flex-direction: column; }
.volumes { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.slider { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 12px; font: 900 14px var(--display); text-shadow: var(--outline); text-align: left; }

/* A slider is a glass tube in a brass rim, filled with light up to the knob
   (--fill, which ui.js keeps at the slider's value), and the knob is a pearl
   in a brass collar. */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 28px;
  margin: 0;
  background: none;
  cursor: pointer;
  --fill: 50%;
  --tube:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.08) 42%, rgba(255, 255, 255, 0) 55%, rgba(0, 10, 40, 0.28) 100%) padding-box,
    linear-gradient(90deg, #9ff6ff 0%, #2fc2f4 60%, #1b8fe4 100%) 0 0 / var(--fill) 100% no-repeat padding-box,
    linear-gradient(180deg, #010618, #0b2c62) padding-box,
    var(--brass) border-box;
}

input[type="range"]::-webkit-slider-runnable-track {
  height: 16px;
  border-radius: 8px;
  border: 2.5px solid transparent;
  background: var(--tube);
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-moz-range-track {
  height: 11px;
  border-radius: 8px;
  border: 2.5px solid transparent;
  background: var(--tube);
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -8.5px;
  border-radius: 50%;
  border: 3.5px solid transparent;
  background:
    radial-gradient(circle at 34% 28%, #fff 0%, #fff 12%, #e4eefc 42%, #8a9cc4 78%, #5c6e98 100%) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(60, 30, 0, 0.55);
}

input[type="range"]::-moz-range-thumb {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 3.5px solid transparent;
  background:
    radial-gradient(circle at 34% 28%, #fff 0%, #fff 12%, #e4eefc 42%, #8a9cc4 78%, #5c6e98 100%) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(60, 30, 0, 0.55);
}

input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 4px rgba(150, 240, 255, 0.95), inset 0 0 0 1px rgba(60, 30, 0, 0.55); }

.check { display: flex; align-items: center; gap: 10px; font: 900 14px var(--display); text-shadow: var(--outline); cursor: pointer; }

/* A tick box is a well in a brass bezel; ticked, a gold gem sits in it with
   the tick cut into it. */
.check input {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 8px;
  border: 3.5px solid transparent;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0) 45%) padding-box,
    linear-gradient(180deg, #020a22, #0c2f66) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(60, 30, 0, 0.6);
  cursor: pointer;
}

.check input:checked {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M4.2 10.6l3.9 3.9 7.9-9' fill='none' stroke='%235a2c04' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M4.2 10.2l3.9 3.9 7.9-9' fill='none' stroke='%23ffffff' stroke-width='2.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 86% no-repeat padding-box,
    linear-gradient(180deg, rgba(255, 255, 255, 0.75) 0%, rgba(255, 255, 255, 0) 48%) padding-box,
    linear-gradient(180deg, #ffe98a 0%, #ffb81c 48%, #f08a0c 52%, #ffab1c 100%) padding-box,
    var(--brass) border-box;
}

.check input:focus-visible { outline: none; box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 4px rgba(150, 240, 255, 0.95), inset 0 0 0 1px rgba(60, 30, 0, 0.6); }

/* A field to type in: a deep plate in a brass rim. */
.text {
  width: 100%;
  font: 900 17px var(--display);
  color: #fff;
  text-shadow: 0 2px 0 #010616;
  padding: 9px 14px 10px;
  border-radius: 12px;
  border: 3px solid transparent;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 38%) padding-box,
    linear-gradient(180deg, #020a22, #0a2756) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(60, 30, 0, 0.6);
  caret-color: #ffe36a;
}

.text:focus { outline: none; box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 4px rgba(255, 227, 106, 0.95), inset 0 0 0 1px rgba(60, 30, 0, 0.6); }

/* The name field, and the red enamel plate that says a name was not taken. */
.namefield { display: flex; align-items: center; gap: 12px; }
.namefield .text { flex: 1; min-width: 0; }
.invalid {
  flex: none;
  font: 900 13px/1 var(--display);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  text-shadow: 0 1.5px 0 #5a0a14;
  padding: 8px 13px 7px;
  border-radius: 8px;
  border: 2.5px solid transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.45) 0%, rgba(255, 255, 255, 0) 46%) padding-box,
    linear-gradient(180deg, #ff9a9a 0%, #f04848 48%, #c41c28 52%, #ee4444 100%) padding-box,
    var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3), 0 5px 6px rgba(0, 0, 0, 0.45);
}
.invalid[hidden] { display: none; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.note { font-size: 13.5px; font-weight: 600; color: var(--soft); margin-bottom: 12px; text-shadow: 0 1px 2px #000; }
.note.gold { color: #ffe36a; font: 900 15px var(--display); text-shadow: 0 2px 0 #5a2c04; }

/* ---- Overlays ---------------------------------------------------------- */

.overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: calc(1280px / var(--zoom, 1));
  height: calc(720px / var(--zoom, 1));
  transform: scale(var(--zoom, 1));
  transform-origin: 0 0;
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at center, rgba(1, 6, 24, 0.45), rgba(1, 4, 16, 0.8));
  animation: fade 0.2s ease backwards;
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.overlay.intro { background: radial-gradient(ellipse at center, rgba(1, 6, 24, 0.15), rgba(1, 4, 16, 0.6)); }
.card { display: flex; gap: 22px; align-items: center; max-width: 690px; padding: 20px 28px 22px 22px; animation: pop-in 0.36s cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }

@keyframes pop-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.card.col { flex-direction: column; align-items: stretch; gap: 10px; width: 480px; text-align: center; padding: 0 22px 20px; }
.card.col > .ribbon { align-self: center; margin-top: -22px; margin-bottom: 4px; }
.card.col > .ribbon .chunky { font-size: 30px; }
.intro .card { cursor: pointer; }
.intro .card .chunky { font-size: 34px; margin: 6px 0 4px; }
.intro .card p { font-size: 14.5px; font-weight: 600; line-height: 1.45; margin-top: 5px; color: var(--soft); }
.intro .card strong { font: 900 14.5px var(--display); text-shadow: 0 1.5px 0 #000; }
.goal { color: #ffe36a !important; font: 900 15px var(--display) !important; text-shadow: 0 2px 0 #5a2c04; }

.hint {
  display: inline-block;
  margin-top: 10px !important;
  font: 900 14px var(--display) !important;
  color: #ffe36a !important;
  text-shadow: 0 2px 0 #5a2c04;
  animation: bounce 0.9s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.results .sub { color: var(--soft); font-size: 14px; font-weight: 600; text-shadow: 0 1px 2px #000; }
.rows { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; }
.rows .row { justify-content: space-between; align-items: center; font-size: 14px; font-weight: 700; color: var(--soft); padding: 1px 6px; }
.rows .row strong { font: 900 15.5px var(--display); color: #fff; text-shadow: 0 2px 0 #000; }
.rows .row.big { padding: 2px 6px 0; }
.rows .row.big .chunky { font-size: 44px; }
.rows .row.gold strong { color: #ffe36a; }
.flair { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; margin: 4px 0 2px; }
.flair .label { margin: 0; }
.scores { text-align: center; }
.scores .label { align-self: center; margin: 4px 0 7px; }
.scores ol { list-style: none; margin: 0; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; }

.scores li {
  display: grid;
  grid-template-columns: 1fr auto 96px;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  color: var(--soft);
  text-align: left;
  padding: 3px 10px;
  border-radius: 7px;
}

.scores li strong { text-align: right; font: 900 13.5px var(--display); color: #fff; }
.scores li.me { background: linear-gradient(180deg, #ffe36a, #f09a12); color: #4a2a06; }
.scores li.me strong { color: #4a2a06; }
.scores .who { font-size: 12px; }
.buttons { justify-content: center; margin-top: 10px; padding-bottom: 6px; }
.pause .card.col { gap: 14px; }
.howto { padding: 9px 14px 10px; font-size: 13px; font-weight: 700; line-height: 1.55; color: var(--soft); }

/* ---- Replays ----------------------------------------------------------- */

/* The list: one brass-edged row a recording, the board's painting at its
   left, what happened in the middle, what can be done with it at the right. */
.btn.corner.left { right: auto; left: 22px; }
.reps { width: 1080px; max-width: 100%; margin: 0 auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; max-height: 566px; overflow-y: auto; overscroll-behavior: contain; }
.reps > .note { margin: 14px 10px; }
.rep {
  display: flex; align-items: center; gap: 12px; padding: 4px 10px 5px 5px; flex: none;
  border: 2px solid transparent; border-radius: 14px;
  background: linear-gradient(180deg, #0a2a5e, #061a44) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), inset 0 2px 0 rgba(140, 210, 255, 0.28), 0 3px 5px rgba(0, 0, 0, 0.45);
}
.rep.kept { background: linear-gradient(180deg, #3a2c5e, #1c1444) padding-box, var(--brass) border-box; }
.rep-art { flex: none; width: 76px; height: 43px; border-radius: 9px; background-size: cover; background-position: center; box-shadow: 0 0 0 1.5px var(--ink), inset 0 0 0 1px rgba(255, 255, 255, 0.35); }
.rep-what { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.rep-what strong { font: 900 16px var(--display); color: #fff; text-shadow: 0 2px 0 var(--navy), 0 0 2px var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-what i { font: 600 12px var(--font); font-style: normal; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rep-tag { flex: none; min-width: 104px; text-align: center; font: 900 12.5px var(--display); padding: 5px 10px 6px; border-radius: 8px; color: #4a2a06; text-shadow: 0 1px 0 rgba(255, 250, 210, 0.85); background: linear-gradient(180deg, #fff3b8 0%, #e7b94c 50%, #b07a1c 100%); box-shadow: 0 0 0 1.5px var(--ink), inset 0 1.5px 0 rgba(255, 255, 255, 0.75); }
.rep-tag.lost, .rep-tag.left { color: #1c2238; text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7); background: linear-gradient(180deg, #eef3ff 0%, #b4c2dc 50%, #7a8aa8 100%); }
.rep-tag .stars .star { width: 15px; height: 17px; }
.rep-score { flex: none; width: 92px; text-align: right; font: 900 17px var(--display); color: #ffe36a; text-shadow: 0 2px 0 #5a2c04; }
.rep-keep { flex: none; width: 36px; height: 36px; padding: 0; display: grid; place-items: center; cursor: pointer; border: 2px solid transparent; border-radius: 50%; background: linear-gradient(180deg, #24406e, #0c2046) padding-box, var(--brass) border-box; box-shadow: 0 0 0 1.5px var(--ink), inset 0 3px 5px rgba(0, 0, 0, 0.6); --wash: rgba(255, 255, 255, 0); }
.rep-keep .glyph { width: 20px; height: 22px; opacity: 0.28; }
.rep-keep.on { background: linear-gradient(180deg, #7a4a0e, #3a2204) padding-box, var(--brass) border-box; }
.rep-keep.on .glyph { opacity: 1; }

/* While a recording plays: a brass card in the lower right of the HUD,
   where the Menu button is in a live match. */
.replay-bar { position: absolute; right: 14px; bottom: 12px; width: 212px; padding: 0 9px 10px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px 6px; align-items: center; border-width: 5px; border-radius: 16px; }
.replay-bar::before { inset: -4px; border-radius: 15px; }
.replay-bar::after { inset: -5px; border-radius: 16px; }
.rep-title { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; gap: 1px; margin-top: 7px; }
.rep-title .chunky { font-size: 21px; letter-spacing: 0.08em; }
.rep-title i { font: 600 11px var(--font); font-style: normal; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.replay-bar .btn.small { padding: 6px 2px 8px; font-size: 13px; }
.replay-bar .btn.small:nth-of-type(5) { grid-column: 1 / -1; }
.replay-bar .btn.small:nth-of-type(6), .replay-bar .btn.small:nth-of-type(7) { grid-column: span 2; }
.replay-bar .glyph { width: 15px; height: 17px; display: block; margin: -2px auto -3px; }
.rep-btn.on { --navy: #6a2a00; background: linear-gradient(180deg, #fff08a 0%, #ffbe22 48%, #f08400 52%, #ffab1e 100%) padding-box, var(--brass) border-box; }
.rep-track { grid-column: 1 / -1; height: 15px; border-radius: 8px; border: 2.5px solid transparent; background: linear-gradient(180deg, #010618, #0b2c62) padding-box, var(--brass) border-box; box-shadow: 0 0 0 1.5px var(--ink), 0 3px 0 1.5px rgba(0, 0, 0, 0.3); overflow: hidden; }
.rep-track i { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 45%), linear-gradient(180deg, #fff3a0 0%, #ffc02a 50%, #e88a0c 100%); }
.replay-bar.paused .rep-title .chunky { opacity: 0.55; }
.replay-over .card.col { width: 440px; }
html.touch .replay-bar { width: 232px; }
html.touch .replay-bar .btn.small { padding: 10px 2px 12px; }

.hud-menu { position: absolute; right: 48px; bottom: 22px; }
.hud-menu.btn:active { top: auto; bottom: 18px; }
.hud-menu.btn.ghost { min-width: 128px; }

.toast {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 30px) scale(0.9);
  padding: 9px 24px 10px;
  border-radius: 10px;
  font: 900 15px var(--display);
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255, 250, 210, 0.85);
  background: linear-gradient(180deg, #fff3b8 0%, #e7b94c 50%, #b07a1c 100%);
  box-shadow: 0 0 0 2px var(--ink), inset 0 2px 0 rgba(255, 255, 255, 0.75), 0 8px 14px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 1.5, 0.4, 1);
}

.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .hint, .hero::before, .hero .btn::after, .title .hero .btn, .title .under-hero .btn, .title .side .btn, .tagline, .progress { animation: none; }
  .screen, .overlay, .card { animation: none; }
}

/* ---- Stars, Treasures and the Music Box -------------------------------- */

.stars { display: inline-flex; gap: 1px; align-items: center; }
.stars .star { width: 13px; height: 15px; }
.stars.big { gap: 10px; }
.stars.big .star { width: 46px; height: 46px; }
.stars.big .star.on { background: radial-gradient(closest-side, rgba(255, 224, 110, 0.6), rgba(255, 224, 110, 0) 100%); }
.stars .star.land { animation: star-land 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) backwards; }

@keyframes star-land {
  from { transform: scale(2.6) rotate(-40deg); opacity: 0; }
  to { transform: none; opacity: 1; }
}

.star-line { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 2px 0 0; }
.star-line p { font-size: 12.5px; font-weight: 700; color: var(--soft); text-shadow: 0 1px 2px #000; }

/* 36 Treasures: six columns of six. */
.trophy-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 9px 10px; padding: 0 2px; }
.trophy { display: flex; align-items: center; gap: 6px; padding: 4px 6px 5px 4px; min-height: 84px; min-width: 0; }
.trophy > div { min-width: 0; }
.trophy .chunky { font-size: 12px; line-height: 1.05; white-space: normal; }
.trophy p { font-size: 10px; font-weight: 600; line-height: 1.22; color: var(--soft); margin-top: 2px; }
.trophy .medal { width: 44px !important; height: 44px !important; flex: none; }
.trophy { text-align: left; color: inherit; font: inherit; cursor: pointer; }
.trophy-tide { display: block; color: #ffe19a; font-size: 9px; margin-top: 3px; }
.trophy:focus-visible { outline: 3px solid #b9f8ff; outline-offset: 2px; }
.medal { flex: none; }
/* The plate keeps its place in the card from the start and is shown on its
   cue, with the fanfare (see celebrate in ui.js). */
.trophy-won { display: flex; align-items: center; gap: 12px; padding: 5px 14px 6px 8px; font-size: 12.5px; font-weight: 700; color: var(--soft); line-height: 1.35; visibility: hidden; }
.trophy-won.on { visibility: visible; animation: pop-in 0.4s cubic-bezier(0.2, 1.5, 0.4, 1) backwards; }
.trophy-won .medals { display: flex; gap: 4px; flex: none; }
.trophy-won strong { font: 900 14.5px var(--display); color: #ffe36a; text-shadow: 0 2px 0 #5a2c04; }

.tracks { width: 760px; margin: 0 auto; padding: 14px 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.track {
  display: flex; align-items: center; gap: 12px; padding: 5px 16px 7px 7px; cursor: pointer;
  border: 3px solid transparent; border-radius: 999px; color: #fff;
  font: 900 15.5px var(--display); text-shadow: 0 2px 0 var(--navy), 0 0 2px var(--navy);
  background: linear-gradient(180deg, #6fd4ff 0%, #2a9cf0 48%, #1474d0 52%, #2a92ea 100%) padding-box, var(--brass) border-box;
  position: relative;
  --wash: rgba(255, 255, 255, 0);
  --glow: 0 0 0 0 rgba(120, 232, 255, 0);
  box-shadow: inset 0 0 0 99px var(--wash), 0 4px 0 #06143a, 0 7px 0 rgba(0, 0, 0, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.6), var(--glow);
}
.track:active { top: 3px; }
.track .name { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The whole playlist on one screen: four narrower columns of fifteen. */
.tracks.many { width: 1204px; max-width: 100%; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px 10px; padding: 10px 13px 12px; }
.tracks.many .track { gap: 8px; padding: 2px 12px 4px 4px; font-size: 13px; border-width: 2px; min-width: 0; box-shadow: inset 0 0 0 99px var(--wash), 0 3px 0 #06143a, 0 5px 0 rgba(0, 0, 0, 0.28), inset 0 2px 0 rgba(255, 255, 255, 0.6), var(--glow); }
.tracks.many .track .coin { width: 20px; height: 20px; font-size: 10.5px; flex: none; }
.tracks.many .track .time { font-size: 11px; }
.tracks.many .track:active { top: 2px; }
.track .time { font: 700 12px var(--font); opacity: 0.9; }
.track.on { background: linear-gradient(180deg, #ffe98a 0%, #ffb81c 48%, #f08a0c 52%, #ffab1c 100%) padding-box, var(--brass) border-box; --navy: #5a2c04; --glow: 0 0 0 2.5px #fff7c4, 0 0 0 5px rgba(255, 214, 90, 0.45); }

.newpeg { display: flex; align-items: center; gap: 10px; padding: 5px 12px 6px 6px; margin-top: 8px !important; }
.newpeg canvas { flex: none; }
.newpeg-icon { flex: none; width: 34px; height: 38px; margin: 0 3px; }
.newpeg strong { color: #ffe36a; }
.tip { color: #bff6ff !important; }
/* What is different about this board: small brass tags in a row. */
.rules { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.rule {
  padding: 3px 10px 4px;
  font: 900 12.5px/1.1 var(--display);
  color: #4a2a06;
  text-shadow: 0 1px 0 rgba(255, 250, 210, 0.8);
  border: 2px solid transparent;
  border-radius: 9px;
  background: linear-gradient(180deg, #fff3b0 0%, #f6c84a 50%, #d99a1c 100%) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 2px 0 1.5px #120801;
}

@media (prefers-reduced-motion: reduce) {
  .stars .star.land, .track.on, .trophy-won { animation: none; }
}

/* ---- Touch ------------------------------------------------------------- */

/* The control pad in the lower right HUD panel (touch devices only). It is
   part of the 1280x720 stage, not of the magnified menus. */
.touchpad {
  position: absolute;
  right: 22px;
  bottom: 13px;
  width: 198px;
  height: 242px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 60px 1fr 50px;
  gap: 9px 8px;
  touch-action: none;
}
.touchpad.duel { height: 194px; grid-template-rows: 46px 1fr 42px; gap: 7px 8px; }
.touchpad .btn { min-width: 0; padding: 0; display: grid; place-items: center; border-width: 3px; border-radius: 15px; touch-action: none; }
.touchpad .btn.fire { grid-column: 1 / -1; font-size: 34px; letter-spacing: 0.05em; border-radius: 22px; }
.touchpad.duel .btn.fire { font-size: 28px; }
.touchpad .btn.ghost { font-size: 15px; }
.touchpad .glyph { width: 30px; height: 34px; display: block; }
.touchpad .btn.ghost .glyph { width: 26px; height: 26px; }
html .touchpad .btn.down, html.touch .touchpad .btn.down:hover { top: 4px; --wash: rgba(0, 10, 50, 0.12); box-shadow: inset 0 0 0 99px var(--wash), 0 0 0 2px var(--ink), 0 1px 0 2px #120801, 0 3px 6px rgba(0, 0, 0, 0.5), inset 0 3px 8px rgba(0, 20, 90, 0.7); }

html.touch #stage.playing { cursor: default; }
.btn.corner { position: absolute; right: 22px; top: 18px; }
.btn.corner:active { top: 22px; }

/* Small touch screens: the menus scroll instead of shrinking. */
html.compact .screen { padding: 12px 22px 14px; }
html.compact .bar { margin: 0 0 10px; gap: 18px; min-height: 46px; }
html.compact .bar p { display: none; }
html.compact .bar .ribbon .chunky { font-size: 26px; }
html.compact .btn.ghost { font-size: 16px; padding: 11px 22px 13px; }

html.compact .title-box { padding-top: 26px; }
html.compact .logo-slot { width: 620px; }
html.compact .tagline { margin-top: 4px; }
html.compact .tagline .chunky { font-size: 15.5px; }
html.compact .hero { margin-top: 12px; }
html.compact .hero .btn { width: 340px; font-size: 24px; padding: 12px 14px 15px; }
html.compact .under-hero { margin-top: 10px; }
html.compact .under-hero .btn { width: 250px; font-size: 18.5px; padding: 8px 12px 11px; }
html.compact .side { top: 268px; width: 212px; gap: 11px; }
html.compact .side.left { left: 26px; }
html.compact .side.right { right: 26px; }
html.compact .side .btn { font-size: 18.5px; padding: 10px 12px 13px; }
html.compact .progress { bottom: 8px; padding: 5px 16px 6px; font-size: 12px; gap: 13px; }
html.compact .progress .who { font-size: 13px; padding-right: 12px; }
html.compact .stat-icon { width: 15px; height: 15px; }
html.compact .stat b { font-size: 13.5px; }
html.compact .btn.corner { right: 14px; top: 12px; font-size: 13px; padding: 9px 14px 11px; }
html.compact .btn.corner:active { top: 16px; }

/* Voyage: one row of tall dive cards that slides sideways. */
html.compact .dives {
  grid-template-columns: none;
  grid-template-rows: 1fr;
  grid-auto-flow: column;
  grid-auto-columns: 236px;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  touch-action: pan-x;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  padding: 0 4px 10px;
}
html.compact .dive { scroll-snap-align: center; }
html.compact .pills { gap: 10px; }
html.compact .level-pill { padding-top: 9px; padding-bottom: 11px; font-size: 14px; }

/* Lists that scroll up and down. */
html.compact .tiles, html.compact .trial-grid, html.compact .trophy-grid, html.compact .tracks, html.compact .panel, html.compact .col.frame {
  overflow-y: auto;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}
html.compact .trial-grid, html.compact .trophy-grid { flex: 1; align-content: start; padding-bottom: 8px; }
html.compact .trial-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 12px 12px 10px 4px; }
html.compact .trophy-grid { grid-template-columns: repeat(2, 1fr); }
html.compact .tracks { width: auto; flex: 1; align-content: start; padding: 10px 12px; }
html.compact .track { padding: 9px 16px 11px 9px; font-size: 16px; }
/* (On a phone the long playlist keeps its two thumb-sized columns and scrolls.) */
html.compact .tracks.many { width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; padding: 10px 12px; }
html.compact .tracks.many .track { padding: 9px 16px 11px 9px; font-size: 16px; border-width: 3px; gap: 12px; }
html.compact .tracks.many .track .coin { width: 24px; height: 24px; font-size: 12px; }
html.compact .tracks.many .track .time { font-size: 12px; }
html.compact .panel { width: 600px; flex: 1; }
html.compact .columns { grid-template-columns: 1fr 372px; gap: 14px; }
html.compact .tiles { grid-template-columns: repeat(4, 1fr); flex: 1; align-content: start; padding: 8px 8px 10px 8px; gap: 11px 10px; }
html.compact .col.frame > .btn.wide { position: sticky; bottom: 0; flex: none; margin-top: auto; z-index: 2; }
html.compact .col.frame > .btn.wide:active { top: auto; }
html.compact .tile { height: 70px; }
html.compact .best-line { margin-top: 8px; padding: 6px 12px 7px; font-size: 12px; }
html.compact .preview { display: none; }
html.compact .keeper-info { min-height: 0; margin: 8px 0; padding: 8px 12px 9px; font-size: 12.5px; }
html.compact .col.frame { padding: 8px 12px 10px; }
html.compact .segment { margin-bottom: 12px; }
html.compact .segment button { padding: 12px 2px 13px; font-size: 13px; }
html.compact input[type="range"] { height: 36px; }
html.compact .check input { width: 34px; height: 34px; }
html.compact .card.col { gap: 8px; }

/* Landscape only. main.js adds .portrait on a touch device held upright;
   the media query covers the moment before the script has run. */
#rotate {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 40%, #0c2a5e, #010410 75%);
  color: var(--soft);
  font: 700 16px var(--font);
}
#rotate svg { width: 132px; height: 132px; margin-bottom: 8px; }
#rotate .phone { transform-origin: 60px 60px; animation: turn 2.4s ease-in-out infinite; }
#rotate .big { font: 900 25px var(--display); color: #fff; text-shadow: 0 3px 0 var(--navy); }
html.portrait #rotate { display: flex; }

@media (orientation: portrait) and (pointer: coarse) {
  #rotate { display: flex; }
}

@keyframes turn {
  0%, 20% { transform: rotate(0deg); }
  60%, 100% { transform: rotate(-90deg); }
}

@media (prefers-reduced-motion: reduce) {
  #rotate .phone { animation: none; transform: rotate(-90deg); }
}

/* ---- Treasure Tide ---------------------------------------------------------

   The cabinet is painted on a canvas that fills the stage (tidepaint.js). A
   ledger stands to its left (the Keeper, the tribute, the tide) and a tray to
   its right (the gifts, then the drop). Nothing is ever laid over the reef
   but a tooltip and the three ceremonies.

   The rules of the other menus hold here too: no control is transformed,
   filtered or repainted under the pointer (the light is the shared .light
   layer, see .tt-lit in ui.js), a press moves with `top`, chosen states are
   hard rings, and entrance animations are opacity and transform only. */
.tide-mode {
  position: absolute; inset: 0; width: 1280px; height: 720px; pointer-events: auto;
  color: #eaf4ff; font: 600 14px/1.35 var(--font);
}
.tide-mode:not(.tt-playing) { background: radial-gradient(ellipse at 50% 0%, rgba(22, 79, 139, 0.86) 0, rgba(7, 28, 59, 0.93) 62%, rgba(3, 10, 32, 0.96) 100%); }
/* (A ribbon's tails sit behind it, so every surface that carries a ribbon
   is a stacking context of its own: the tails stay in front of its paint.) */
.tide-mode, .tt-ledger, .tt-dock, .tt-welcome, .tt-setup, .tt-brief, .tt-modal-card, .tt-ceremony-card { isolation: isolate; }
/* (No more specific than a tag, so that a class can set a margin of its own.) */
:where(.tide-mode) :is(h1, h2, h3, p) { margin: 0; }
.tide-mode h1, .tide-mode h2 { font: 900 22px/1.1 var(--display); color: #fff8dc; text-shadow: var(--outline); }
.tide-mode h2.ribbon, .tide-mode h1.ribbon { --navy: #6a2a00; align-self: center; }
.tide-mode h3 { font: 900 16px/1.15 var(--display); color: #fff3c4; text-shadow: 0 1.5px 0 #06143a; }
.tide-mode :focus-visible { outline: 3px solid #b9f7e8; outline-offset: 2px; }
.tide-mode .label { margin: 0 0 5px; }
.tt-icon { display: inline-block; flex: none; background-size: 200% 200%; background-repeat: no-repeat; vertical-align: middle; }
.tt-button { min-width: 0; }
.tt-button:disabled { opacity: 0.45; cursor: default; }
.tt-button small { display: block; margin-top: 3px; font: 600 11px/1.2 var(--font); letter-spacing: 0; color: #eaf6ff; text-shadow: 0 1px 1px #06183c; }
.tt-button.on { --glow: 0 0 0 3px #fff3a8; }
.tt-muted { color: #a9c6e6; font-size: 12px; }
.tt-small { font-size: 13px; line-height: 1.4; color: #cfe2f6; }
.tt-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.tt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.tt-meter { height: 13px; border-radius: 7px; border: 1.5px solid #010616; background: #020a22; box-shadow: inset 0 3px 4px rgba(0, 0, 0, 0.8), 0 1px 0 rgba(160, 220, 255, 0.35); overflow: hidden; }
/* (The fill is the full width and slides in from the left on a layer of its
   own: a live meter is moved by the compositor and never painted again.) */
.tt-meter i { display: block; height: 100%; width: 100%; border-radius: 5px; transform: translateX(-100%); will-change: transform; background: linear-gradient(180deg, #fff6b0 0%, #ffc93a 45%, #e88a08 55%, #ffb52a 100%); }
.tt-meter.full i { background: linear-gradient(180deg, #e8ffb0 0%, #8fe85a 45%, #3fae1c 55%, #7fdc48 100%); }
.tt-meter.sea i { background: linear-gradient(180deg, #e8fdff 0%, #6fe0ff 45%, #1c9be0 55%, #58cdf8 100%); }
.tt-meter.big { height: 20px; border-radius: 10px; margin: 12px 0; }

/* The harbour. */
.tt-head { height: 92px; padding: 10px 34px 0; display: flex; align-items: center; justify-content: space-between; }
.tt-head h1.ribbon { font-size: 30px; padding: 7px 34px 10px; margin-left: 22px; }
.tt-head p { margin: 9px 0 0 4px; font-size: 15px; color: #cfe8ff; text-shadow: 0 1px 2px #020a22; }
.tt-lobby { display: grid; grid-template-columns: 470px 1fr; gap: 24px; margin: 4px 34px 0; }
.tt-welcome, .tt-setup { padding: 16px 20px; height: 596px; display: flex; flex-direction: column; }
.tt-steps { list-style: none; margin: 12px 0 6px; padding: 0; display: grid; gap: 10px; }
.tt-steps li { display: flex; gap: 12px; align-items: center; }
.tt-steps p { font-size: 13.5px; color: #d6e8fa; margin-top: 2px; }
.tt-counts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: auto 0 12px; }
.tt-counts .plate { padding: 7px 8px 8px; text-align: center; }
.tt-counts b { display: block; font: 900 21px/1.1 var(--display); color: #ffe98a; text-shadow: 0 2px 0 #06143a; }
.tt-counts span { font-size: 11.5px; color: #b9d4ee; }
.tt-setup > h2 + .tt-icon { display: block; margin: 26px auto 14px; }
.tt-setup > h3, .tt-setup > .tt-icon + h3 { text-align: center; }
.tt-boards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 12px 0 8px; }
.tt-board-tile {
  position: relative; padding: 0 0 6px; border: 4px solid transparent; border-radius: 14px; cursor: pointer; overflow: hidden;
  background: linear-gradient(180deg, #1f66ae, #0b2a66) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801; color: #fff; font: 900 12.5px/1.15 var(--display); text-shadow: 0 1.5px 0 #06143a;
}
.tt-board-tile:active { top: 3px; box-shadow: 0 0 0 1.5px var(--ink), 0 1px 0 1.5px #120801; }
.tt-board-tile canvas { display: block; width: 100%; aspect-ratio: 1; margin-bottom: 5px; }
.tt-board-tile.on { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 5px #fff3a8, 0 4px 0 5px #120801; }
.tt-about { min-height: 40px; font-size: 14px; color: #d6e8fa; }
.tt-about b { color: #ffe98a; }
.tt-levels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 14px; }
.tt-setup > .tt-button.wide { margin-top: 10px; }
.tt-setup > .tt-button.wide:first-of-type { margin-top: auto; }
.tt-records { text-align: center; margin-top: 18px; }
.tt-reef { display: grid; margin-top: 4px; }
.tt-reef-grid { display: flex; flex-wrap: wrap; gap: 5px; }
.tt-reef-grid.many { gap: 4px; }
.tt-reef-grid.many .tt-chip { width: 34px; height: 34px; border-radius: 9px; }
.tt-chip { position: relative; width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border-radius: 11px; border: 1.5px solid #010616; background: linear-gradient(180deg, #020a22, #0a2756); box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.7), 0 1.5px 0 rgba(160, 220, 255, 0.35); cursor: pointer; }
.tt-chip b { position: absolute; right: -3px; bottom: -3px; padding: 0 4px 1px; border-radius: 7px; font: 900 10px/1.3 var(--display); color: #4a2a06; background: #ffd24a; box-shadow: 0 0 0 1px var(--ink); }
.tt-chip em { position: absolute; left: -3px; bottom: -3px; padding: 0 3px 1px; border-radius: 7px; font: 900 9px/1.4 var(--display); font-style: normal; color: #06264a; background: #bfefff; box-shadow: 0 0 0 1px var(--ink); }
.tt-brief { width: 900px; margin: 14px auto 0; padding: 20px 24px; display: grid; grid-template-columns: 300px 1fr; gap: 24px; align-items: center; }
.tt-brief-board { width: 300px; height: 300px; border-radius: 16px; border: 4px solid transparent; background: var(--brass) border-box; box-shadow: 0 0 0 2px var(--ink), 0 6px 12px rgba(0, 0, 0, 0.5); }
.tt-brief-text { display: grid; gap: 10px; }
.tt-lesson { font-size: 15.5px; color: #eaf4ff; }
.tt-goal { display: flex; align-items: center; gap: 12px; padding: 8px 14px; }
.tt-goal b { display: block; font: 900 26px/1 var(--display); color: #ffe98a; text-shadow: 0 2px 0 #06143a; }
.tt-goal span { color: #b9d4ee; font-size: 13px; }
.tt-pair { display: flex; align-items: center; gap: 14px; }
.tt-pair > div { display: grid; justify-items: center; gap: 2px; font-size: 13px; color: #fff3c4; }
.tt-plus { font: 900 26px var(--display); color: #ffe08a; text-shadow: 0 2px 0 #06143a; }
.tt-law { font-size: 13.5px; color: #f1dcff; }
.tt-law strong { color: #ffb0c8; }

/* The table. */
.tt-playing [hidden] { display: none !important; }
/* (The canvas is the strip between the panels: nothing is painted, or
   composited, where a panel would hide it.) */
.tide-mode.tt-playing { background: linear-gradient(180deg, #0b2f4a 0%, #03101f 100%); }
.tt-canvas { position: absolute; left: 216px; top: 0; width: 700px; height: 720px; display: block; touch-action: none; cursor: crosshair; outline-offset: -3px; }
.tt-panel-frames { position: absolute; inset: 0; pointer-events: none; }
.tt-panel-frames > .frame { will-change: transform; }
.tt-ledger, .tt-ledger-back { position: absolute; left: 9px; top: 10px; width: 206px; height: 700px; }
.tt-ledger, .tt-dock { border: 7px solid transparent; padding: 9px 10px 10px; display: flex; flex-direction: column; }
.tt-ledger { gap: 9px; }
.tt-keeper { display: flex; align-items: center; gap: 10px; }
.tt-keeper b { display: block; font: 900 20px/1.05 var(--display); color: #fff3c4; text-shadow: var(--outline); }
.tt-keeper small { display: block; font-size: 11.5px; color: #b9d4ee; white-space: nowrap; }
.tt-medal { flex: none; width: 62px; height: 62px; border-radius: 50%; border: 4px solid transparent; background: #173b66 padding-box, var(--brass) border-box; box-shadow: 0 0 0 1.5px var(--ink), 0 3px 5px rgba(0, 0, 0, 0.5); overflow: hidden; }
.tt-medal img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tt-medal.big { width: 104px; height: 104px; margin: -62px auto 4px; border-width: 6px; }
.tt-says {
  position: relative; min-height: 66px; padding: 8px 10px 9px; border-radius: 13px; font: 700 12.5px/1.3 var(--font); color: #3b2204;
  background: linear-gradient(180deg, #fffdf0, #ffeeb8); box-shadow: 0 0 0 1.5px var(--ink), inset 0 -3px 5px rgba(190, 130, 30, 0.35), 0 3px 5px rgba(0, 0, 0, 0.4);
}
.tt-says::before { content: ""; position: absolute; left: 22px; top: -8px; width: 14px; height: 14px; background: #fffdf0; box-shadow: -1.5px -1.5px 0 var(--ink); transform: rotate(45deg); }
.tt-box { display: grid; }
.tt-box > small { margin-top: 3px; font-size: 12px; color: #b9d4ee; }
.tt-bank { display: flex; align-items: center; gap: 7px; padding: 4px 9px 5px 7px; margin-bottom: 6px; }
.tt-cash { font: 900 27px/1 var(--display); color: #ffe98a; text-shadow: 0 2px 0 #4a2a06; font-variant-numeric: tabular-nums; }
.tt-pips { display: flex; gap: 5px; }
.tt-pips i { width: 21px; height: 21px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #16264a, #050c22 70%); box-shadow: inset 0 2px 3px #000, 0 1px 0 rgba(160, 220, 255, 0.35); }
.tt-pips i.on { background: radial-gradient(circle at 34% 28%, #ffffff 0, #e4f6ff 30%, #8fc4e8 62%, #3a6fa8 100%); box-shadow: 0 0 0 1.5px #0a2040, 0 2px 3px rgba(0, 0, 0, 0.5); }
.tt-tide-now { display: flex; align-items: baseline; gap: 8px; margin-bottom: 5px; }
.tt-tide-now b { font: 900 30px/1 var(--display); color: #dffbff; text-shadow: 0 2px 0 #06143a, 0 0 0 #06143a; font-variant-numeric: tabular-nums; }
.tt-tide-now span { font: 900 13px var(--display); color: #8fe6ff; text-shadow: 0 1.5px 0 #06143a; white-space: nowrap; }
/* (Eight boons and two laws in a run; an endless one can gather them all.) */
.tt-rack { display: flex; flex-wrap: wrap; gap: 4px; align-content: flex-start; flex: 1; min-height: 0; overflow: hidden; }
.tt-rack.many { gap: 3px; }
.tt-rack.many .tt-token { width: 24px; height: 24px; border-width: 2px; font-size: 13px; }
.tt-token { position: relative; display: grid; place-items: center; flex: none; width: 31px; height: 31px; padding: 0; border: 3px solid transparent; border-radius: 50%; background: #14334c padding-box, var(--brass) border-box; box-shadow: 0 0 0 1.5px var(--ink), 0 2px 0 1.5px #120801; cursor: pointer; }
.tt-token.law { font: 900 20px var(--display); color: #fff; background: linear-gradient(180deg, #f06a8a, #a81c44) padding-box, var(--brass) border-box; text-shadow: 0 1.5px 0 #4a0a1c; }
.tt-token .tt-icon { border-radius: 50%; }
.tt-corner { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; flex: none; }
.tt-corner .tt-button { padding: 6px 2px 8px; }
.tt-corner .tt-button:last-child { grid-column: 1 / -1; }
.tt-track { display: flex; flex-wrap: wrap; gap: 3px; }
.tt-track i { width: 16px; height: 20px; border-radius: 6px; font: 900 10.5px/20px var(--display); font-style: normal; text-align: center; color: #7f9cc0; background: #06102a; box-shadow: inset 0 2px 3px #000, 0 1px 0 rgba(160, 220, 255, 0.3); }
.tt-track i.paid { color: #3b2204; background: linear-gradient(180deg, #fff0a0, #f0b02a); box-shadow: 0 0 0 1px var(--ink); }
.tt-track i.now { color: #06264a; background: linear-gradient(180deg, #e8fdff, #58cdf8); box-shadow: 0 0 0 1px var(--ink), 0 0 0 2.5px #fff3a8; }

.tt-dock, .tt-dock-back { position: absolute; right: 9px; top: 10px; width: 363px; height: 700px; }
.tt-dock > h2.ribbon { font-size: 18px; padding: 4px 22px 6px; margin-bottom: 3px; }
.tt-dock-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 7px; padding: 5px 3px 4px; overflow-y: auto; }
.tt-dock-foot { display: flex; flex-wrap: wrap; gap: 7px; justify-content: center; padding: 7px 0 5px; }
.tt-dock-foot .tt-button { flex: 1 1 auto; }
.tt-hint { font-size: 13.5px; color: #d6e8fa; text-align: center; }
.tt-drop { font-size: 24px; padding: 17px 20px 20px; margin: 4px 0 2px; }
/* The pearls on the string of a drop, and the button that lets the next go. */
.tt-string { justify-content: center; gap: 7px; }
.tt-string i { width: 24px; height: 24px; }
.tt-next { font-size: 19px; padding: 12px 16px 15px; margin: 2px 0 0; }

/* A gimmick's card. */
.tt-card {
  position: relative; display: block; flex: none; width: 100%; padding: 6px 9px 7px; border: 3px solid transparent; border-radius: 15px; text-align: left; color: #eef5ff; font: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0, rgba(255, 255, 255, 0) 30px) padding-box,
    linear-gradient(160deg, var(--wash, #27558a) 0%, #10274d 70%) padding-box, var(--brass) border-box;
  box-shadow: 0 0 0 1.5px var(--ink), 0 4px 0 1.5px #120801;
}
button.tt-card { cursor: pointer; }
button.tt-card:active { top: 3px; box-shadow: 0 0 0 1.5px var(--ink), 0 1px 0 1.5px #120801; }
.tt-card.rare { --wash: #6e3c80; }
.tt-card.boon { --wash: #5a3a9a; --accent: #d7b8ff; }
.tt-card.on { box-shadow: 0 0 0 1.5px var(--ink), 0 0 0 5px #fff3a8, 0 4px 0 5px #120801; }
.tt-card.locked { opacity: 0.6; }
.tt-card-head { display: flex; align-items: center; gap: 9px; }
.tt-card-head > div { min-width: 0; }
.tt-card-head .tt-icon { border-radius: 12px; background-color: rgba(2, 10, 34, 0.45); box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(160, 220, 255, 0.3); }
.tt-card h3 { font-size: 17px; }
.tt-role { display: block; font: 900 10px/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent, #ffdf94); }
.tt-card > p { margin-top: 6px; font-size: 13px; line-height: 1.35; }
.tt-rules { list-style: none; margin: 5px 0 0; padding: 0; display: grid; gap: 2px; font: 600 12.5px/1.27 var(--font); }
.tt-rules li.more { padding-left: 11px; background: radial-gradient(circle at 4px 8px, var(--accent, #ffdf94) 2px, rgba(0, 0, 0, 0) 2.6px) no-repeat; }
.tt-when { display: inline-block; vertical-align: 1px; margin-right: 6px; padding: 2px 7px 1px; border-radius: 6px; font: 900 9px/1.2 var(--display); font-style: normal; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; color: #3b2204; background: linear-gradient(180deg, #fff0a0, #f0b02a); box-shadow: 0 0 0 1px var(--ink); }
.tt-when.drop { color: #06264a; background: linear-gradient(180deg, #c8f2ff, #4fb8f0); }
.tt-when.end { color: #2a0e52; background: linear-gradient(180deg, #ecd6ff, #b684f0); }
.tt-when.always, .tt-when.placed { color: #0e3a12; background: linear-gradient(180deg, #d6ffc0, #6fd658); }
.tt-num { color: #ffe98a; font-weight: 900; }
.tt-word { font-weight: 900; }
.tt-supply { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 11px; color: #cfe2f6; }
.tt-supply span { display: inline-flex; align-items: center; gap: 4px; }
.tt-supply i { font-style: normal; font-weight: 900; color: #9fc0e0; }
.tt-supply em { font-style: normal; }
.tt-bead { width: 9px; height: 9px; border-radius: 50%; background: var(--bead); box-shadow: 0 0 0 1.5px #06102a; }
.tt-bead.cargo { border-radius: 2px; transform: rotate(45deg); }
.tt-supply .wants .tt-bead { background: #06102a; box-shadow: inset 0 0 0 2px var(--bead), 0 0 0 1.5px #06102a; }
.tt-dock[data-state="draft"] .tt-card .tt-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-note { margin-top: 5px; padding: 3px 8px 4px; border-radius: 8px; border: 1.5px solid #010616; background: #06173a; box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.6); color: #bfffb8; font-size: 11.5px; line-height: 1.3; }
.tt-note.duet { color: #ffe9a0; }
.tt-source { display: block; margin-top: 5px; font-size: 10.5px; color: #a4c0dc; }
.tt-card kbd { position: absolute; right: 7px; top: 6px; min-width: 19px; padding: 1px 0 2px; border-radius: 6px; font: 900 11px var(--display); text-align: center; color: #4a2a06; background: linear-gradient(180deg, #fff3b8, #d8a53a); box-shadow: 0 0 0 1px var(--ink), 0 2px 0 1px #120801; }
html.touch .tt-card kbd { display: none; }
/* A tray that would not hold its gifts at full size shows them compact
   (tideview.js tries the roomier forms first), and with four of them, tight. */
.tt-card.compact { padding: 5px 8px 6px; }
.tt-card.compact h3 { font-size: 15.5px; }
.tt-card.compact .tt-rules { font-size: 12px; gap: 1px; margin-top: 4px; }
.tt-card.compact .tt-note { display: none; }
.tt-card.tight { padding: 4px 8px 5px; }
.tt-card.tight .tt-card-head { gap: 7px; }
.tt-card.tight h3 { font-size: 14.5px; }
.tt-card.tight .tt-role { font-size: 9px; }
.tt-card.tight .tt-supply { font-size: 10.5px; margin-top: 1px; }
.tt-card.tight .tt-rules { font-size: 11.5px; line-height: 1.2; gap: 0; margin-top: 3px; }
.tt-card.tight .tt-when { font-size: 8.5px; padding: 1px 5px; margin-right: 4px; }
.tt-card.tight .tt-note { display: none; }

/* A drop as it happens, and what it came to. */
.tt-drop-now { padding: 8px 12px 10px; text-align: center; }
.tt-sum { display: block; font: 900 38px/1.05 var(--display); color: #ffe98a; text-shadow: 0 3px 0 #4a2a06; font-variant-numeric: tabular-nums; }
.tt-live { font-size: 12.5px; color: #b9d4ee; font-variant-numeric: tabular-nums; }
.tt-feed { display: grid; gap: 6px; justify-items: stretch; }
/* The changing text and receipts have their own paint surfaces. Updating a
   payout can then reuse the rasterized brass and lacquer behind the panels. */
.tt-cash, .tt-says, .tt-tide-now, .tt-tide > small, .tt-sum, .tt-feed { will-change: transform; }
.tt-live { display: block; will-change: transform; }
/* (Rows that come and go several times a second: flat colour and hard
   edges, nothing blurred to paint.) */
.tt-receipt, .tt-combo { display: flex; align-items: center; gap: 4px; padding: 3px 12px 3px 6px; border-radius: 18px; border: 1.5px solid #010616; background: #08193f; box-shadow: 0 1px 0 rgba(160, 220, 255, 0.3); }
.tt-receipt i { font: 900 15px var(--display); font-style: normal; color: #e5c485; }
.tt-receipt b { margin-left: auto; font: 900 16px var(--display); color: #ffe98a; }
.tt-combo { justify-content: space-between; padding: 5px 14px 6px; background: #4a2480; }
.tt-combo b { font: 900 15px var(--display); color: #ffd6ff; text-shadow: 0 1.5px 0 #1c0838; }
.tt-combo small { color: #e6d6f8; font-size: 11.5px; }
.tt-report { display: grid; gap: 5px; margin-top: 4px; }
.tt-report-top { display: grid; justify-items: center; padding: 6px 10px 8px; }
.tt-report-top b { font: 900 28px/1.1 var(--display); color: #ffe98a; text-shadow: 0 2px 0 #4a2a06; }
.tt-report-top small { color: #b9d4ee; font-size: 12px; }
.tt-report-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tt-report-row span:not(.tt-icon) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tt-report-row b { color: #ffe08a; font-variant-numeric: tabular-nums; }

/* The card beside a gimmick on the reef. */
.tt-tip { position: absolute; z-index: 5; width: 304px; padding: 3px 4px 6px; border-width: 5px; border-radius: 16px; pointer-events: none; }
.tt-tip::after { display: none; }
.tt-tip::before { inset: -4px; border-radius: 15px; }
.tt-tip .tt-card { border: 0; box-shadow: none; background: none; padding: 4px 5px 2px; }
.tt-tip > p { margin: 5px 5px 0; }

/* Tribute, victory, defeat: the only cards that stand on the reef. */
.tt-ceremony { position: absolute; left: 240px; top: 40px; width: 640px; height: 640px; z-index: 4; display: grid; place-items: center; border-radius: 12px; background: rgba(2, 8, 28, 0.62); }
.tt-ceremony-card { position: relative; width: 440px; padding: 18px 26px 22px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.tt-ceremony-card h2.ribbon { font-size: 24px; padding: 6px 28px 9px; }
.tt-ceremony-card p { font-size: 14.5px; color: #e2eefc; }
.tt-ceremony-card p.tt-big { font: 900 36px/1.05 var(--display); color: #ffe98a; text-shadow: 0 3px 0 #4a2a06; }
.tt-spray { position: absolute; inset: 0; pointer-events: none; }
.tt-spray .tt-icon { position: absolute; left: calc(50% - 11px); top: 30%; opacity: 0; animation: ttPrize 1100ms cubic-bezier(0.2, 0.65, 0.42, 1) backwards; }
@keyframes ttPrize {
  0% { opacity: 0; transform: scale(0.35); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(120deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .tt-dock-body > .tt-card { animation: ttDeal 0.24s backwards ease-out; }
  .tt-dock-body > .tt-card:nth-child(2) { animation-delay: 0.05s; }
  .tt-dock-body > .tt-card:nth-child(3) { animation-delay: 0.1s; }
  .tt-dock-body > .tt-card:nth-child(4) { animation-delay: 0.15s; }
  .tt-ceremony-card { animation: ttRise 0.26s backwards ease-out; }
}
/* (A gift arrives by growing into its place: nothing that would stick out of
   the tray on the way and call up a scroll bar.) */
@keyframes ttDeal { from { opacity: 0; transform: scale(0.92); } }
@keyframes ttRise { from { opacity: 0; transform: translateY(22px); } }

/* The almanac, help and the small dialogs. */
.tt-modal { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; background: rgba(1, 8, 26, 0.86); padding: 26px 40px; }
.tt-modal-card { width: 100%; max-width: 1180px; max-height: 100%; display: flex; flex-direction: column; padding: 14px 18px 16px; }
.tt-modal-card:not(:has(.tt-grid, .tt-help)) { max-width: 560px; }
.tt-modal-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex: none; padding: 0 2px 12px 22px; }
.tt-modal-head h2.ribbon { align-self: auto; font-size: 20px; }
.tt-modal-body { overflow: auto; padding: 4px 4px 6px; display: grid; gap: 12px; align-content: start; }
.tt-modal-body > p { font-size: 15px; color: #e2eefc; }
.tt-modal-body > .tt-icon { justify-self: center; }
.tt-filters { display: flex; gap: 12px; align-items: center; }
.tt-filters .tt-select { flex: 1; min-width: 0; }
.tt-select { min-height: 38px; padding: 6px 11px; border-radius: 10px; border: 1.5px solid #010616; background: #04102c; box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.7), 0 1.5px 0 rgba(160, 220, 255, 0.35); color: #f1f6ff; font: 600 14px var(--font); }
.tt-check { display: flex; align-items: center; gap: 8px; color: #e4eefc; cursor: pointer; white-space: nowrap; }
.tt-check input { width: 18px; height: 18px; accent-color: #f0b02a; }
.tt-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 2px 3px 6px; }
.tt-grid .tt-more { grid-column: 1 / -1; justify-self: center; }
.tt-tabs { display: flex; gap: 10px; }
.tt-help { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tt-help section { padding: 9px 13px 11px; }
.tt-help p { margin-top: 3px; color: #d6e8fa; font-size: 13.5px; }
html.touch .tt-button { min-height: 44px; }
html.touch .tt-corner .tt-button { min-height: 40px; }

.voyage-finale { display:flex; flex:none; align-items:center; gap:14px; margin:4px 5px 0; padding:5px 12px; border:2px solid #b99552; border-radius:14px; color:#fff0bb; background:linear-gradient(110deg,#144965,#17294d); }
.voyage-finale > svg { width:24px; height:24px; }
.voyage-finale > span { color:#cbe6e7; font-size:14px; }
.voyage-finale .btn { margin-left:auto; padding:4px 14px 6px; font-size:14px; }
