/* ==========================================================================
   The Nest — "observation deck" theme for the unlisted /portalnew preview.
   Loaded only on /portalnew and scoped to html[data-portal-theme="deck"], so
   the live /portal is unaffected. Reuses the portal's markup hooks, data and
   actions; this file only changes presentation.
   ========================================================================== */
@font-face { font-family: "Archivo Deck"; src: url("/portal/assets/fonts/Archivo-Variable.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/portal/assets/fonts/InstrumentSerif-Regular.woff2") format("woff2"); font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/portal/assets/fonts/InstrumentSerif-Italic.woff2") format("woff2"); font-style: italic; font-display: swap; }

@property --deck-count { syntax: "<integer>"; inherits: false; initial-value: 0; }

html[data-portal-theme="deck"] {
  --bone: #ece6d6;
  --mute: rgba(236, 230, 214, 0.7);
  --amber: #f2a93b;
  --amber-hot: #ffc66e;
  --teal: #5be3b8;
  --red: #f0563f;
  --ice: #9fd4ff;
  --glass: rgba(8, 13, 11, 0.6);
  --glass-hi: rgba(14, 21, 18, 0.66);
  --hair: rgba(236, 230, 214, 0.1);
  --display: "Archivo Deck", "IBM Plex Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --rail: 96px;
  --top: 76px;
  background: #040706;
}
html[data-portal-theme="deck"] body { background: #040706; color: var(--bone); }
html[data-portal-theme="deck"] body::before,
html[data-portal-theme="deck"] body::after,
html[data-portal-theme="deck"] .app-shell::before,
html[data-portal-theme="deck"] .app-shell::after { display: none !important; }

.deck-shell {
  color: var(--bone);
  display: grid;
  font-family: var(--display);
  grid-template-columns: var(--rail) minmax(0, 1fr);
  grid-template-rows: var(--top) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}
.deck-shell *, .deck-shell *::before, .deck-shell *::after { box-sizing: border-box; }
.deck-shell [hidden] { display: none !important; }
.deck-shell :focus-visible { outline: 2px solid var(--amber-hot); outline-offset: 3px; }
.deck-sr, .deck-page-head.is-visually-hidden {
  clip-path: inset(50%); height: 1px; overflow: hidden; position: absolute; white-space: nowrap; width: 1px;
}

/* ---------- scene ---------- */
.deck-scene { inset: 0; overflow: hidden; pointer-events: none; position: fixed; z-index: 0; }
.deck-bg { position: absolute; inset: -4%; background-position: 46% 78%; background-repeat: no-repeat; background-size: cover; }
.deck-scene-jungle .deck-bg {
  background-image: url("/portal/assets/raptor-racing/jungle-panorama.webp");
  filter: brightness(0.5) saturate(0.78) contrast(1.12) hue-rotate(-6deg);
  animation: deck-kenburns 48s ease-in-out infinite alternate;
  transform-origin: 58% 70%;
}
.deck-scene-lab .deck-bg {
  background-image: url("/portal/assets/the-nest-containment-corridor.webp");
  background-position: center;
  filter: brightness(0.26) saturate(0.6) blur(3px);
  transform: scale(1.05);
}
@keyframes deck-kenburns { from { transform: scale(1.04); } to { transform: scale(1.13) translate3d(-1.6%, -0.8%, 0); } }
.deck-grade { position: absolute; inset: 0; }
.deck-scene-jungle .deck-grade {
  background:
    radial-gradient(ellipse 60% 55% at 42% 58%, rgba(255, 196, 110, 0.1), transparent 70%),
    linear-gradient(180deg, rgba(4, 7, 6, 0.86) 0%, rgba(4, 7, 6, 0.18) 24%, rgba(4, 7, 6, 0) 46%, rgba(4, 7, 6, 0.55) 78%, rgba(4, 7, 6, 0.96) 100%),
    linear-gradient(90deg, rgba(4, 7, 6, 0.95) 0%, rgba(4, 7, 6, 0.4) 18%, rgba(4, 7, 6, 0) 42%, rgba(4, 7, 6, 0.3) 66%, rgba(4, 7, 6, 0.9) 100%);
}
.deck-scene-lab .deck-grade { background: radial-gradient(ellipse 70% 60% at 50% 40%, rgba(8, 24, 20, 0.2), rgba(4, 7, 6, 0.94) 78%); }
.deck-rays {
  position: absolute; inset: -20% -10%;
  background: repeating-linear-gradient(104deg, rgba(255, 214, 150, 0) 0 60px, rgba(255, 214, 150, 0.05) 60px 90px, rgba(255, 214, 150, 0) 90px 170px);
  -webkit-mask-image: radial-gradient(ellipse 45% 60% at 42% 18%, #000, transparent 75%);
  mask-image: radial-gradient(ellipse 45% 60% at 42% 18%, #000, transparent 75%);
  mix-blend-mode: screen;
  animation: deck-rays 9s ease-in-out infinite alternate;
}
@keyframes deck-rays { from { opacity: 0.55; transform: translateX(-12px); } to { opacity: 1; transform: translateX(16px); } }
.deck-fog { position: absolute; left: -20%; width: 140%; filter: blur(30px); mix-blend-mode: screen; }
.deck-fog-far { top: 50%; height: 30vh; background: radial-gradient(ellipse 30% 50% at 30% 50%, rgba(170, 200, 180, 0.2), transparent 70%), radial-gradient(ellipse 25% 45% at 72% 60%, rgba(170, 200, 180, 0.16), transparent 70%); animation: deck-drift 34s ease-in-out infinite alternate; }
.deck-fog-near { top: 68%; height: 28vh; background: radial-gradient(ellipse 30% 42% at 44% 46%, rgba(190, 215, 200, 0.24), transparent 70%), radial-gradient(ellipse 22% 36% at 70% 50%, rgba(190, 215, 200, 0.16), transparent 70%); animation: deck-drift 26s ease-in-out infinite alternate-reverse; }
@keyframes deck-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
.deck-spores i {
  position: absolute; bottom: -10px; left: calc(20% + var(--i) * 5.4%);
  width: 3px; height: 3px; border-radius: 50%;
  background: rgba(255, 226, 170, 0.75); box-shadow: 0 0 8px rgba(255, 200, 120, 0.8);
  opacity: 0;
  animation: deck-spore calc(12s + var(--i) * 1.1s) linear calc(var(--i) * -1.7s) infinite;
}
@keyframes deck-spore { 0% { opacity: 0; transform: translate3d(0, 0, 0); } 12% { opacity: 0.85; } 80% { opacity: 0.45; } 100% { opacity: 0; transform: translate3d(calc((var(--i) - 5) * 9px), -90vh, 0); } }
.deck-scanlines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 3px); }
.deck-vignette { position: absolute; inset: 0; box-shadow: inset 0 0 220px 60px rgba(0, 0, 0, 0.75); }
.deck-grain {
  position: absolute; inset: -50%; opacity: 0.08;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: deck-grain 1.2s steps(6) infinite;
}
@keyframes deck-grain { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(3%, 2%); } }

/* ---------- glass ---------- */
.deck-card,
.deck-rail,
.deck-shell .portal-notification-popover {
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass));
  border: 1px solid var(--hair);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.deck-card { border-radius: 20px; padding: 20px 22px; position: relative; }
.deck-card::before {
  content: ""; position: absolute; inset: -1px; pointer-events: none; border-radius: inherit;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(242, 169, 59, 0.55), rgba(242, 169, 59, 0) 28%, rgba(242, 169, 59, 0) 72%, rgba(91, 227, 184, 0.35)) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}
.deck-card h2 {
  align-items: center; display: flex; justify-content: space-between; gap: 12px;
  font: 600 15px/1 var(--display); font-stretch: 110%; letter-spacing: 0.02em; margin: 0;
}
.deck-card h2 > span { color: var(--mute); font: 500 12px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; }
.deck-muted { color: var(--mute); font-size: 13px; margin: 8px 0 0; }
.deck-rise { animation: deck-rise 1s cubic-bezier(0.16, 0.84, 0.24, 1) both; }
@keyframes deck-rise { from { opacity: 0; transform: translateY(18px); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }

/* ---------- rail ---------- */
.deck-rail {
  align-items: center; border-width: 0 1px 0 0; border-radius: 0;
  background: linear-gradient(180deg, rgba(6, 10, 9, 0.88), rgba(6, 10, 9, 0.74));
  display: flex; flex-direction: column; gap: 4px;
  grid-column: 1; grid-row: 1 / 3;
  height: 100vh; padding: 18px 0 14px; position: sticky; top: 0; z-index: 30;
}
.deck-logo img {
  border: 1px solid rgba(242, 169, 59, 0.45); border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(242, 169, 59, 0.06), 0 0 30px rgba(242, 169, 59, 0.18);
  display: block; height: 52px; margin-bottom: 14px; width: 52px;
}
.deck-rail-list { align-items: center; display: flex; flex: 1; flex-direction: column; gap: 2px; min-height: 0; overflow-y: auto; scrollbar-width: none; width: 100%; }
.deck-rail-item {
  align-items: center; background: none; border: 0; border-radius: 12px; color: rgba(236, 230, 214, 0.64); cursor: pointer;
  display: flex; flex: none; flex-direction: column; font: 500 12px/1.1 var(--display); gap: 6px;
  padding: 10px 2px 9px; position: relative; text-align: center; text-decoration: none; transition: color 0.2s, background 0.2s; width: 78px;
}
.deck-rail-item svg { fill: none; height: 22px; stroke: currentColor; stroke-width: 1.6; width: 22px; }
.deck-rail-item:hover { background: rgba(255, 255, 255, 0.04); color: var(--bone); }
.deck-rail-item.is-active { background: linear-gradient(180deg, rgba(242, 169, 59, 0.16), rgba(242, 169, 59, 0.04)); color: #fff; }
.deck-rail-item.is-active::before { background: var(--amber); border-radius: 3px; box-shadow: 0 0 14px var(--amber); content: ""; left: -9px; position: absolute; top: 14px; bottom: 14px; width: 3px; }
.deck-rail-item.is-active svg { color: var(--amber-hot); filter: drop-shadow(0 0 8px rgba(242, 169, 59, 0.6)); }
.deck-rail-item.is-staff { color: rgba(240, 198, 117, 0.75); }
.deck-rail-sep { background: var(--hair); flex: none; height: 1px; margin: 8px 0; width: 36px; }
.deck-rail-util { margin-top: 8px; }

/* ---------- top bar ---------- */
.deck-top {
  align-items: center; background: linear-gradient(180deg, rgba(4, 7, 6, 0.9), rgba(4, 7, 6, 0));
  display: flex; gap: 14px; grid-column: 2; grid-row: 1; min-width: 0;
  padding: 0 28px 0 40px; position: sticky; top: 0; z-index: 25;
}
.deck-crumbs { align-items: center; color: var(--mute); display: flex; flex: none; font: 500 12px/1 var(--mono); gap: 10px; letter-spacing: 0.16em; text-transform: uppercase; white-space: nowrap; }
.deck-crumbs b { color: var(--bone); font-weight: 600; }
.deck-crumbs i { background: var(--amber); height: 4px; transform: rotate(45deg); width: 4px; }
.deck-shell .deck-notice {
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  align-items: center; background: rgba(32, 22, 8, 0.66); border: 1px solid rgba(242, 169, 59, 0.38); border-radius: 999px;
  color: #f6dfb4; display: flex; font-size: 13px; gap: 12px; margin: 0 auto; max-width: min(560px, 40vw); min-height: 42px;
  min-width: 0; overflow: hidden; padding: 4px 16px 4px 4px; position: relative;
}
.deck-shell .deck-notice::before {
  align-self: stretch; animation: deck-haz 1s linear infinite; background: repeating-linear-gradient(-45deg, var(--amber) 0 7px, #1c1406 7px 14px);
  background-size: 20px 20px; border-radius: 999px 0 0 999px; content: ""; flex: none; height: auto; inset: auto; opacity: 1; position: static; width: 34px;
}
@keyframes deck-haz { to { background-position: 20px 0; } }
.deck-shell .deck-notice * { min-width: 0; }
.deck-shell .deck-notice small { color: var(--amber-hot); font: 600 11px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.deck-shell .deck-notice p, .deck-shell .deck-notice strong, .deck-shell .deck-notice span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-top-tools { align-items: center; display: flex; flex: none; gap: 10px; margin-left: auto; }
.deck-chip {
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  align-items: center; background: rgba(8, 13, 11, 0.58); border: 1px solid var(--hair); border-radius: 999px; color: var(--bone);
  display: inline-flex; font: 500 14px/1 var(--mono); gap: 9px; height: 42px; padding: 0 14px; white-space: nowrap;
}
.deck-chip small { color: var(--mute); font: 500 12px/1 var(--display); }
.deck-chip b { font-weight: 500; }
.deck-online i { animation: deck-ping 2s infinite; background: var(--teal); border-radius: 50%; height: 8px; width: 8px; }
.deck-online:not(.server-online) i { animation: none; background: #8a948c; }
.deck-telemetry { font-size: 12px; gap: 8px; }
.deck-telemetry > span:first-child { background: var(--teal); border-radius: 50%; height: 7px; width: 7px; }
.deck-telemetry.stale > span:first-child { background: var(--amber); }
.deck-telemetry.unavailable > span:first-child { background: #8a948c; }
@keyframes deck-ping { 0% { box-shadow: 0 0 0 0 rgba(91, 227, 184, 0.55); } 80%, 100% { box-shadow: 0 0 0 12px rgba(91, 227, 184, 0); } }
.deck-coin { background: radial-gradient(circle at 35% 30%, #ffe2a0, #e39a2a 55%, #8a5410); border-radius: 50%; box-shadow: 0 0 10px rgba(242, 169, 59, 0.55); height: 18px; width: 18px; }
.deck-egg { background: radial-gradient(circle at 40% 30%, #c9f5e3, #4fbf94 60%, #1d5a45); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; height: 18px; width: 14px; }
.deck-shell .deck-icon-button {
  align-items: center; background: rgba(8, 13, 11, 0.58); border: 1px solid var(--hair); border-radius: 50%; color: var(--bone);
  display: grid; height: 42px; min-height: 42px; place-items: center; position: relative; width: 42px;
}
.deck-shell .deck-icon-button svg { height: 19px; width: 19px; }
.deck-shell .portal-notification-popover { border-radius: 16px; right: 0; top: calc(100% + 10px); z-index: 60; }
.deck-avatar { background: conic-gradient(var(--amber) 0 64%, rgba(255, 255, 255, 0.12) 64% 100%); border: 0; border-radius: 50%; cursor: pointer; height: 42px; padding: 2px; width: 42px; }
.deck-avatar .account-avatar { border-radius: 50%; display: grid; height: 100%; overflow: hidden; place-items: center; position: relative; width: 100%; background: #18221d; color: var(--amber-hot); font: 700 15px/1 var(--display); }
.deck-avatar .account-avatar img { height: 100%; inset: 0; object-fit: cover; position: absolute; width: 100%; }

/* ---------- main ---------- */
.deck-main { grid-column: 2; grid-row: 2; min-width: 0; padding: 4px 28px 32px 40px; position: relative; z-index: 10; }
.deck-page-head { margin: 8px 0 20px; }
.deck-page-head h1 { font: 800 34px/1 var(--display); font-stretch: 120%; letter-spacing: 0.01em; margin: 0; }
.deck-page-head p { color: var(--mute); font-size: 15px; margin: 8px 0 0; }
.deck-shell .portal-toast { border-radius: 14px; }

/* ---------- Live ---------- */
.deck-overview {
  display: grid;
  gap: 18px 24px;
  grid-template-areas: "onboard onboard" "controls controls" "identity vitals" "stage actions" "prime wallet";
  grid-template-columns: minmax(0, 1fr) 360px;
  grid-template-rows: auto auto auto minmax(340px, 1fr) auto;
  min-height: calc(100vh - var(--top) - 40px);
}
.deck-onboarding { grid-area: onboard; }
.deck-controls { grid-area: controls; }
.deck-controls:empty { display: none; }
.deck-hero { display: contents; }
.deck-identity { align-self: start; grid-area: identity; padding: 18px 0 0 6px; position: relative; z-index: 3; }
.deck-vitals { grid-area: vitals; z-index: 3; }
.deck-actions { grid-area: actions; align-self: start; z-index: 3; }
.deck-wallet { grid-area: wallet; align-self: end; z-index: 3; }
.deck-prime { grid-area: prime; align-self: end; z-index: 3; }
.deck-identity, .deck-vitals, .deck-actions, .deck-wallet, .deck-prime { animation: deck-rise 1s cubic-bezier(0.16, 0.84, 0.24, 1) both; }
.deck-vitals { animation-delay: 0.35s; }
.deck-actions { animation-delay: 0.5s; }
.deck-wallet { animation-delay: 0.65s; }
.deck-prime { animation-delay: 0.8s; }

.deck-kicker { align-items: center; color: rgba(214, 247, 235, 0.86); display: flex; flex-wrap: wrap; font: 500 12px/1 var(--mono); gap: 14px; letter-spacing: 0.2em; text-transform: uppercase; }
.deck-kicker .console-uid { display: none; }
.deck-shell .deck-kicker .player-presence {
  align-items: center; background: rgba(60, 12, 8, 0.38); border: 1px solid rgba(240, 86, 63, 0.48); border-radius: 999px;
  color: #ffb3a6; display: inline-flex; font: inherit; gap: 8px; letter-spacing: inherit; padding: 6px 10px;
}
.deck-shell .deck-kicker .player-presence::before { animation: deck-blink 1.4s steps(2) infinite; background: var(--red); border-radius: 50%; content: ""; height: 7px; width: 7px; }
.deck-shell .deck-kicker .player-presence:not(.online) { background: rgba(255, 255, 255, 0.05); border-color: var(--hair); color: var(--mute); }
.deck-shell .deck-kicker .player-presence:not(.online)::before { animation: none; background: #8a948c; }
@keyframes deck-blink { 50% { opacity: 0.15; } }
.deck-shell .deck-identity .dino-name { bottom: auto; display: grid; gap: 4px; left: auto; margin-top: 20px; position: static; }
.deck-shell .deck-identity .dino-name::before { content: none; }
.deck-shell .deck-identity .dino-name span { color: var(--amber-hot); font: italic 400 clamp(28px, 2.6vw, 40px)/1 var(--serif); letter-spacing: 0.01em; text-transform: none; }
.deck-shell .deck-identity .dino-name strong {
  animation: deck-name 1.6s 0.25s cubic-bezier(0.16, 0.84, 0.24, 1) both;
  color: var(--bone); font: 850 clamp(64px, 7.2vw, 116px)/0.86 var(--display); font-stretch: 125%; letter-spacing: -0.01em;
  overflow-wrap: anywhere; text-shadow: 0 10px 50px rgba(0, 0, 0, 0.6); text-transform: uppercase;
}
@keyframes deck-name { from { filter: blur(10px); letter-spacing: 0.24em; opacity: 0; } to { filter: blur(0); letter-spacing: -0.01em; opacity: 1; } }
.deck-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.deck-tag {
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  align-items: center; background: rgba(8, 13, 11, 0.52); border: 1px solid var(--hair); border-radius: 999px; color: var(--bone);
  display: inline-flex; font-size: 13px; gap: 7px; height: 32px; padding: 0 12px;
}
.deck-tag svg { color: var(--amber); height: 14px; width: 14px; }

.deck-stage { --model-h: clamp(620px, 104vh, 1080px); grid-area: stage; min-height: 340px; position: relative; z-index: 1; }
.deck-shell .deck-stage .live-dino-model-stage.deck-model {
  animation: deck-arrive 1.6s 0.15s cubic-bezier(0.16, 0.84, 0.24, 1) both;
  bottom: auto; height: var(--model-h); inset: auto; left: 50%; pointer-events: none; position: absolute; right: auto;
  top: 50%; transform: translate(-50%, -48%); width: calc(var(--model-h) * 1.75); z-index: 1;
}
.deck-shell .deck-stage .deck-model canvas {
  animation: deck-breathe 4.4s ease-in-out infinite; display: block; filter: saturate(0.72) brightness(0.84) contrast(1.08) drop-shadow(0 26px 34px rgba(0, 0, 0, 0.55));
  height: 100%; transform-origin: 50% 66%; width: 100%;
}
@keyframes deck-arrive { from { filter: blur(14px); opacity: 0; } to { filter: blur(0); opacity: 1; } }
@keyframes deck-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.004, 1.012); } }
.deck-contact {
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.72), transparent 70%); border-radius: 50%; filter: blur(6px);
  height: 46px; left: 50%; position: absolute; top: calc(50% + var(--model-h) * 0.16); transform: translateX(-50%); width: min(420px, 44%); z-index: 0;
}
.deck-scan {
  -webkit-mask-image: radial-gradient(ellipse 34% 40% at 50% 52%, #000 40%, transparent 72%);
  mask-image: radial-gradient(ellipse 34% 40% at 50% 52%, #000 40%, transparent 72%);
  animation: deck-scan 6.5s cubic-bezier(0.6, 0, 0.4, 1) 2.2s infinite;
  background: linear-gradient(180deg, transparent 0 44%, rgba(91, 227, 184, 0) 46%, rgba(91, 227, 184, 0.32) 50%, rgba(91, 227, 184, 0) 54%, transparent 56% 100%) 0 0 / 100% 300% no-repeat;
  inset: 0; mix-blend-mode: screen; pointer-events: none; position: absolute; z-index: 2;
}
@keyframes deck-scan { 0% { background-position: 0 100%; opacity: 0; } 8% { opacity: 1; } 55% { background-position: 0 0; opacity: 1; } 62%, 100% { background-position: 0 0; opacity: 0; } }
.deck-reticle { animation: deck-fade 1s 1.4s both, deck-lock 3.2s 2.4s ease-in-out infinite; inset: 8% 16% 4% 16%; pointer-events: none; position: absolute; z-index: 2; }
.deck-reticle i { border: 1.5px solid rgba(91, 227, 184, 0.6); height: 26px; position: absolute; width: 26px; }
.deck-reticle i:nth-child(1) { border-bottom: 0; border-right: 0; left: 0; top: 0; }
.deck-reticle i:nth-child(2) { border-bottom: 0; border-left: 0; right: 0; top: 0; }
.deck-reticle i:nth-child(3) { border-right: 0; border-top: 0; bottom: 0; left: 0; }
.deck-reticle i:nth-child(4) { border-left: 0; border-top: 0; bottom: 0; right: 0; }
@keyframes deck-lock { 0%, 100% { inset: 8% 16% 4% 16%; } 50% { inset: 9.5% 17% 5.5% 17%; } }
@keyframes deck-fade { from { opacity: 0; } to { opacity: 1; } }
.deck-empty { color: var(--mute); font-size: 16px; left: 50%; position: absolute; text-align: center; top: 46%; transform: translate(-50%, -50%); z-index: 3; }
.deck-callout { align-items: center; animation: deck-fade 0.8s 2.2s both; bottom: 10%; color: rgba(214, 247, 235, 0.92); display: flex; font: 500 12px/1.35 var(--mono); gap: 10px; letter-spacing: 0.08em; position: absolute; right: 6%; text-transform: uppercase; z-index: 3; }
.deck-callout b { color: #fff; display: block; font-weight: 600; }
.deck-callout small { color: rgba(214, 247, 235, 0.66); }
.deck-ping { animation: deck-ping 2.2s infinite; background: var(--teal); border-radius: 50%; height: 7px; width: 7px; }

/* vitals */
.deck-growth { align-items: center; display: flex; gap: 18px; margin: 16px 0 12px; }
.deck-gauge { flex: none; height: 118px; position: relative; width: 118px; }
.deck-gauge svg { height: 118px; transform: rotate(-90deg); width: 118px; }
.deck-gauge .track { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 7; }
.deck-gauge .ticks { fill: none; stroke: rgba(236, 230, 214, 0.28); stroke-dasharray: 1.2 5.3; stroke-width: 5; }
.deck-gauge .fill {
  animation: deck-gauge 2s 0.6s cubic-bezier(0.16, 0.84, 0.24, 1) forwards; fill: none; filter: drop-shadow(0 0 6px rgba(242, 169, 59, 0.6));
  stroke: url(#deckGaugeGrad); stroke-dasharray: 326.7; stroke-dashoffset: 326.7; stroke-linecap: round; stroke-width: 7;
}
@keyframes deck-gauge { to { stroke-dashoffset: var(--off); } }
.deck-gauge-value { display: grid; inset: 0; place-content: center; position: absolute; text-align: center; }
.deck-gauge-value b { font: 700 30px/1 var(--display); font-stretch: 112%; }
.deck-gauge-value small { color: var(--mute); font: 500 11px/1 var(--mono); letter-spacing: 0.16em; margin-top: 6px; text-transform: uppercase; }
.deck-growth-copy { display: grid; gap: 6px; min-width: 0; }
.deck-growth-copy strong { font: 700 18px/1.2 var(--display); font-stretch: 110%; }
.deck-growth-copy small { color: var(--mute); font-size: 13px; line-height: 1.45; }
.deck-pulse { align-items: center; color: var(--teal); display: flex; font: 500 12px/1 var(--mono); gap: 8px; margin-top: 4px; white-space: nowrap; }
.deck-pulse svg { flex: none; height: 24px; width: 96px; }
.deck-pulse path { animation: deck-ecg 2.1s linear infinite; fill: none; filter: drop-shadow(0 0 4px rgba(91, 227, 184, 0.9)); stroke: var(--teal); stroke-dasharray: 60 260; stroke-dashoffset: 320; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.deck-pulse path.base { animation: none; filter: none; stroke: rgba(91, 227, 184, 0.22); stroke-dasharray: none; }
.deck-pulse.is-idle { color: var(--mute); }
.deck-pulse.is-idle path:not(.base) { animation: none; opacity: 0; }
@keyframes deck-ecg { to { stroke-dashoffset: 0; } }
.deck-metrics { display: grid; gap: 4px; }
.deck-shell .deck-metric {
  align-items: center; background: none; border: 0; display: grid; gap: 12px; grid-template-columns: 78px 1fr 46px;
  min-height: 30px; padding: 0;
}
.deck-shell .deck-metric > span { color: var(--mute); font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.deck-shell .deck-metric > strong { color: var(--bone); font: 600 14px/1 var(--mono); text-align: right; }
.deck-shell .deck-metric .metric-line { background: rgba(255, 255, 255, 0.07); border: 0; border-radius: 6px; height: 6px; margin: 0; overflow: hidden; position: relative; }
.deck-shell .deck-metric .metric-line > span {
  animation: deck-bar 1.6s 0.9s cubic-bezier(0.16, 0.84, 0.24, 1) both; background-image: none; border-radius: 6px; box-shadow: none; display: block; height: 100%;
  transform-origin: left; transition: width 0.6s ease;
}
@keyframes deck-bar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.deck-shell .deck-metric.health .metric-line > span { background: linear-gradient(90deg, #2fae86, #5be3b8); }
.deck-shell .deck-metric.stamina .metric-line > span { background: linear-gradient(90deg, #9aa97a, #d6e2b0); }
.deck-shell .deck-metric.hunger .metric-line > span { background: linear-gradient(90deg, #d07c1e, #f2a93b); }
.deck-shell .deck-metric.thirst .metric-line > span { background: linear-gradient(90deg, #3b8fb0, #6fd0ef); }
.deck-shell .deck-vitals .status-note { background: rgba(242, 169, 59, 0.08); border: 1px solid rgba(242, 169, 59, 0.3); border-radius: 12px; color: #f6dfb4; font-size: 13px; line-height: 1.45; margin: 12px 0 0; padding: 10px 12px; }
.deck-live-label.is-live { color: var(--teal) !important; }

/* actions */
.deck-primary {
  align-items: center; background: linear-gradient(180deg, #ffc469, #f0a131 55%, #d9861a); border: 0; border-radius: 14px;
  box-shadow: 0 14px 34px -10px rgba(242, 169, 59, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.55); color: #1b1205; cursor: pointer;
  display: flex; font: 700 15px/1 var(--display); font-stretch: 112%; gap: 14px; height: 58px; letter-spacing: 0.04em; margin-top: 16px;
  overflow: hidden; padding: 0 18px; position: relative; text-transform: uppercase; transition: transform 0.2s, box-shadow 0.2s; width: 100%;
}
.deck-primary:not(:disabled):hover { box-shadow: 0 18px 40px -10px rgba(242, 169, 59, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.55); transform: translateY(-1px); }
.deck-primary::after { animation: deck-sheen 5.5s 3s ease-in-out infinite; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent); bottom: 0; content: ""; left: -80px; position: absolute; top: 0; transform: skewX(-18deg); width: 60px; }
@keyframes deck-sheen { 0%, 70% { left: -80px; } 100% { left: 120%; } }
.deck-primary svg { height: 22px; width: 22px; }
.deck-primary small { font: 600 12px/1 var(--mono); letter-spacing: 0.06em; margin-left: auto; opacity: 0.72; text-transform: none; }
.deck-primary:disabled { background: linear-gradient(180deg, rgba(242, 169, 59, 0.35), rgba(217, 134, 26, 0.25)); box-shadow: none; color: rgba(27, 18, 5, 0.75); cursor: not-allowed; }
.deck-primary:disabled::after { display: none; }
.deck-checks { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; margin: 10px 2px 0; padding: 0; }
.deck-checks li { align-items: center; color: var(--mute); display: inline-flex; font: 500 12px/1 var(--mono); gap: 6px; }
.deck-checks li::before { border-radius: 50%; content: ""; height: 14px; width: 14px; }
.deck-checks li.is-ok::before { background: rgba(91, 227, 184, 0.16) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235be3b8' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'><path d='M6 12l4 4 8-9'/></svg>") center / 9px no-repeat; border: 1px solid rgba(91, 227, 184, 0.5); }
.deck-checks li.is-blocked { color: #ffb3a6; }
.deck-checks li.is-blocked::before { background: rgba(240, 86, 63, 0.14) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f0563f' stroke-width='3.2' stroke-linecap='round'><path d='M7 7l10 10M17 7 7 17'/></svg>") center / 8px no-repeat; border: 1px solid rgba(240, 86, 63, 0.5); }
.deck-blockers { color: var(--mute); font-size: 12.5px; line-height: 1.45; margin: 8px 2px 0; }
.deck-shell .deck-parking { border-radius: 14px; margin-top: 12px; }
.deck-select { display: grid; gap: 6px; margin-top: 14px; }
.deck-select span { color: var(--mute); font: 500 12px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; }
.deck-select select { background: rgba(8, 13, 11, 0.7); border: 1px solid rgba(236, 230, 214, 0.18); border-radius: 10px; color: var(--bone); font: 500 14px var(--display); min-height: 42px; padding: 0 10px; }
.deck-action-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-top: 14px; }
.deck-ghost {
  align-items: center; background: rgba(255, 255, 255, 0.03); border: 1px solid rgba(236, 230, 214, 0.16); border-radius: 12px; color: var(--bone);
  cursor: pointer; display: flex; gap: 10px; min-height: 52px; padding: 8px 12px; text-align: left; transition: border-color 0.2s, background 0.2s;
}
.deck-ghost:not(:disabled):hover { background: rgba(242, 169, 59, 0.06); border-color: rgba(242, 169, 59, 0.6); }
.deck-ghost svg { flex: none; height: 18px; width: 18px; }
.deck-ghost span { display: grid; font: 600 13px/1.2 var(--display); gap: 3px; letter-spacing: 0.04em; text-transform: uppercase; }
.deck-ghost small { color: var(--mute); font: 500 11px/1.2 var(--mono); letter-spacing: 0.02em; text-transform: none; }
.deck-ghost:disabled { cursor: not-allowed; opacity: 0.5; }
.deck-danger { border-color: rgba(240, 86, 63, 0.38); color: #ffb3a6; }
.deck-danger:not(:disabled):hover { background: rgba(240, 86, 63, 0.08); border-color: rgba(240, 86, 63, 0.75); }

/* wallet */
.deck-link { align-items: center; background: none; border: 0; color: var(--mute); cursor: pointer; display: inline-flex; font: 500 12px/1 var(--mono); gap: 2px; letter-spacing: 0.12em; text-transform: uppercase; }
.deck-link:hover { color: var(--amber-hot); }
.deck-link svg { height: 14px; width: 14px; }
.deck-balance { align-items: baseline; display: flex; gap: 10px; margin: 14px 0 4px; }
.deck-balance b { -webkit-background-clip: text; background: linear-gradient(180deg, #fff2d4, #f2b250); background-clip: text; color: transparent; font: 800 34px/1 var(--display); font-stretch: 112%; letter-spacing: -0.01em; }
.deck-balance small { color: var(--mute); font: 500 13px/1 var(--mono); text-transform: uppercase; }
.deck-reward {
  align-items: center; background: linear-gradient(90deg, rgba(242, 169, 59, 0.16), rgba(242, 169, 59, 0.04)); border: 1px solid rgba(242, 169, 59, 0.35); border-radius: 12px;
  display: flex; font-size: 14px; justify-content: space-between; margin: 12px 0 10px; min-height: 48px; padding: 6px 6px 6px 14px;
}
.deck-reward > span { display: grid; gap: 3px; }
.deck-reward small { color: var(--mute); font: 500 12px/1 var(--mono); }
.deck-reward button { animation: deck-glow 2.4s ease-in-out infinite; background: var(--amber); border: 0; border-radius: 9px; box-shadow: 0 0 18px rgba(242, 169, 59, 0.45); color: #1b1205; cursor: pointer; font: 700 12px/1 var(--display); height: 36px; letter-spacing: 0.08em; padding: 0 16px; text-transform: uppercase; }
.deck-reward button:disabled { animation: none; background: rgba(255, 255, 255, 0.08); box-shadow: none; color: var(--mute); cursor: not-allowed; }
.deck-reward.is-cooling { background: rgba(255, 255, 255, 0.03); border-color: var(--hair); }
@keyframes deck-glow { 50% { box-shadow: 0 0 30px rgba(242, 169, 59, 0.8); } }
.deck-ledger-row { align-items: center; border-top: 1px solid rgba(236, 230, 214, 0.07); display: grid; font-size: 13px; gap: 10px; grid-template-columns: max-content minmax(0, 1fr) auto; min-height: 32px; }
.deck-ledger-row time { color: var(--mute); font: 500 12px/1 var(--mono); }
.deck-ledger-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-ledger-row b { font: 600 13px/1 var(--mono); }
.deck-ledger-row .is-credit { color: var(--teal); }
.deck-ledger-row .is-debit { color: #ff8f7c; }

/* prime */
.deck-prime { align-items: center; display: grid; gap: 24px; grid-template-columns: 190px minmax(0, 1fr); padding: 18px 24px; }
.deck-prime-head b { display: block; font: 800 30px/1 var(--display); font-stretch: 118%; }
.deck-prime-head b em { color: var(--mute); font: italic 400 24px/1 var(--serif); }
.deck-prime-head p { color: var(--mute); font-size: 12.5px; line-height: 1.4; margin: 8px 0 0; }
.deck-track { align-items: start; display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; list-style: none; margin: 0; padding: 0; position: relative; }
.deck-track::before { background: rgba(255, 255, 255, 0.08); content: ""; height: 2px; left: 5%; position: absolute; right: 5%; top: 18px; }
.deck-track::after {
  animation: deck-track 1.8s 1.2s cubic-bezier(0.16, 0.84, 0.24, 1) both; background: linear-gradient(90deg, var(--teal), rgba(91, 227, 184, 0.4));
  box-shadow: 0 0 12px rgba(91, 227, 184, 0.7); content: ""; height: 2px; left: 5%; position: absolute; top: 18px; width: calc(var(--fill) * 0.9);
}
@keyframes deck-track { from { width: 0; } }
.deck-node { align-items: center; color: var(--mute); display: flex; flex-direction: column; font: 500 12px/1.15 var(--display); gap: 9px; position: relative; text-align: center; z-index: 1; }
.deck-gem { background: #0d1512; border: 1px solid rgba(236, 230, 214, 0.18); border-radius: 9px; display: grid; height: 38px; place-items: center; transform: rotate(45deg); width: 38px; }
.deck-gem svg { color: rgba(236, 230, 214, 0.7); height: 17px; transform: rotate(-45deg); width: 17px; }
.deck-node.is-done { color: var(--bone); }
.deck-node.is-done .deck-gem { animation: deck-pop 0.6s both; background: linear-gradient(135deg, rgba(91, 227, 184, 0.35), rgba(91, 227, 184, 0.08)); border-color: rgba(91, 227, 184, 0.75); box-shadow: 0 0 18px rgba(91, 227, 184, 0.35); }
.deck-node.is-done .deck-gem svg { color: #c9fbe9; }
.deck-node.is-next .deck-gem { animation: deck-next 2s 2.5s infinite; border-color: rgba(242, 169, 59, 0.75); }
.deck-node.is-next .deck-gem svg { color: var(--amber-hot); }
.deck-node small { color: var(--amber-hot); font: 600 11px/1 var(--mono); }
.deck-node-label { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; max-width: 92px; overflow: hidden; }
@keyframes deck-pop { from { opacity: 0; transform: rotate(45deg) scale(0.4); } to { opacity: 1; transform: rotate(45deg) scale(1); } }
@keyframes deck-next { 0% { box-shadow: 0 0 0 0 rgba(242, 169, 59, 0.5); } 80%, 100% { box-shadow: 0 0 0 12px rgba(242, 169, 59, 0); } }

/* ---------- Live Map ---------- */
.deck-shell .deck-map .map-layout {
  align-items: start; display: grid; gap: 16px 22px;
  grid-template-areas: "map roster" "map wx" "map forecast" "legend legend" "attr attr" "explorer explorer";
  grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto auto 1fr auto auto auto;
}
.deck-shell .deck-map .map-surface { display: contents; }
.deck-shell .deck-map #liveMapCanvas.group-map {
  border: 1px solid rgba(159, 212, 255, 0.16); border-radius: 22px; box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
  grid-area: 1 / 1 / 4 / 2; height: max(540px, calc(100vh - var(--top) - 150px)); background: #0b2651;
}
.deck-shell .deck-map .map-toolbar {
  align-items: flex-start; align-self: start; background: none; border: 0; display: flex; flex-wrap: wrap; gap: 8px;
  grid-area: 1 / 1 / 2 / 2; margin: 14px 14px 0 64px; padding: 0; pointer-events: none; position: relative; z-index: 1000;
}
.deck-shell .deck-map .map-toolbar > * { pointer-events: auto; }
.deck-shell .deck-map .map-toolbar-heading { pointer-events: none; }
.deck-shell .deck-map .map-toolbar-heading strong, .deck-shell .deck-map .map-toolbar-heading span { display: none; }
.deck-shell .deck-map .weather-game-clock,
.deck-shell .deck-map .map-toolbar .tool-button,
.deck-shell .deck-map .map-layer-toggle {
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  align-items: center; background: rgba(6, 12, 10, 0.74); border: 1px solid var(--hair); border-radius: 999px; color: var(--bone);
  display: inline-flex; font: 500 12px/1 var(--display); gap: 8px; min-height: 36px; padding: 0 13px;
}
.deck-shell .deck-map .weather-game-clock { font-family: var(--mono); letter-spacing: 0.06em; }
.deck-shell .deck-map .map-layer-controls { display: flex; flex-wrap: wrap; gap: 6px; }
.deck-shell .deck-map .map-layer-toggle:has(input:checked) { background: rgba(242, 169, 59, 0.16); border-color: rgba(242, 169, 59, 0.5); color: #fff; }
.deck-shell .deck-map .map-layer-toggle:has(input:disabled) { opacity: 0.5; }
.deck-shell .deck-map .map-calibration-panel, .deck-shell .deck-map .map-demo-notice { grid-area: 1 / 1 / 2 / 2; margin: 64px 14px 0; position: relative; z-index: 1000; }
.deck-shell .deck-map .map-roster,
.deck-shell .deck-map .map-weather-observatory,
.deck-shell .deck-map .map-weather-forecast,
.deck-shell .deck-map .weather-explorer {
  -webkit-backdrop-filter: blur(22px) saturate(140%); backdrop-filter: blur(22px) saturate(140%);
  background: linear-gradient(160deg, var(--glass-hi), var(--glass)); border: 1px solid var(--hair); border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.7); color: var(--bone);
}
.deck-shell .deck-map .map-roster { grid-area: roster; max-height: none; padding: 18px 20px; }
.deck-shell .deck-map .map-weather-observatory { display: grid; grid-area: wx; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
.deck-shell .deck-map .map-weather-observatory > * { border: 0; border-top: 1px solid var(--hair); padding: 14px 18px; }
.deck-shell .deck-map .map-weather-observatory > :first-child { border-top: 0; }
.deck-shell .deck-map .map-weather-observatory[data-weather-state="unavailable"] > :not(.map-weather-primary) { display: none; }
.deck-shell .deck-map .map-weather-forecast { display: grid; gap: 8px; grid-area: forecast; grid-template-columns: minmax(0, 1fr); padding: 16px 18px; }
.deck-shell .deck-map .regional-weather-legend { background: none; border: 0; grid-area: legend; padding: 0 4px; }
.deck-shell .deck-map .map-heatmap-legend { grid-area: legend; justify-self: end; }
.deck-shell .deck-map .map-attribution { color: var(--mute); font-size: 12px; grid-area: attr; margin: 0 4px; }
.deck-shell .deck-map .weather-explorer { grid-area: explorer; margin: 0; }
.deck-shell .deck-map .map-roster .eyebrow, .deck-shell .deck-map .map-weather-observatory .eyebrow { color: var(--amber); font: 600 11px/1 var(--mono); letter-spacing: 0.18em; }

/* ---------- other pages keep their content inside the deck frame ---------- */
.deck-shell:not(.deck-page-overview):not(.deck-page-map) #portalPageContent { animation: deck-rise 0.8s cubic-bezier(0.16, 0.84, 0.24, 1) both; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .deck-overview { grid-template-columns: minmax(0, 1fr) 320px; }
  .deck-top-tools .deck-telemetry { display: none; }
  .deck-shell .deck-map .map-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}
@media (max-width: 1080px) {
  .deck-crumbs { display: none; }
  .deck-overview {
    grid-template-areas: "onboard" "controls" "identity" "stage" "vitals" "actions" "wallet" "prime";
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0;
  }
  .deck-stage { --model-h: clamp(420px, 80vw, 760px); min-height: 360px; }
  .deck-prime { grid-template-columns: minmax(0, 1fr); }
  .deck-shell .deck-map .map-layout { grid-template-areas: "map" "roster" "wx" "forecast" "legend" "attr" "explorer"; grid-template-columns: minmax(0, 1fr); }
  .deck-shell .deck-map #liveMapCanvas.group-map { grid-area: map; height: min(100vw, 620px); }
  .deck-shell .deck-map .map-toolbar, .deck-shell .deck-map .map-calibration-panel, .deck-shell .deck-map .map-demo-notice { grid-area: map; }
}
@media (max-width: 760px) {
  html[data-portal-theme="deck"] { --rail: 0px; --top: 64px; }
  .deck-shell { grid-template-columns: minmax(0, 1fr); }
  .deck-rail {
    border-top: 1px solid var(--hair); border-width: 1px 0 0; bottom: 0; flex-direction: row; height: auto; left: 0; padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
    position: fixed; right: 0; top: auto;
  }
  .deck-logo, .deck-rail-util { display: none; }
  .deck-rail .deck-classic-link { display: flex; flex: none; margin-top: 0; }
  .deck-rail-list { flex-direction: row; overflow-x: auto; }
  .deck-rail-item { width: 70px; }
  .deck-rail-item.is-active::before { bottom: auto; height: 3px; left: 16px; right: 16px; top: -7px; width: auto; }
  .deck-top { grid-column: 1; padding: 0 12px; }
  .deck-shell .deck-notice { display: none; }
  .deck-top-tools { gap: 6px; }
  .deck-top-tools .deck-chip:not(.deck-online) { display: none; }
  .deck-main { grid-column: 1; padding: 0 14px 110px; }
  .deck-shell .deck-identity .dino-name strong { font-size: clamp(44px, 14vw, 72px); }
  .deck-action-row { grid-template-columns: 1fr; }
  .deck-track { grid-auto-columns: 74px; overflow-x: auto; padding-bottom: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .deck-shell *, .deck-shell *::before, .deck-shell *::after { animation-delay: 0s !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- polish ---------- */
.deck-shell .deck-metric > * { grid-area: auto !important; grid-column: auto !important; grid-row: auto !important; }
.deck-shell .deck-notice { max-width: min(620px, 42vw); padding-right: 18px; }
.deck-shell .deck-notice .portal-announcement-icon,
.deck-shell .deck-notice .portal-announcement-copy > small { display: none; }
.deck-shell .deck-notice .portal-announcement-copy { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-shell .deck-notice .portal-announcement-copy > span { font-size: 13px; }
.deck-stage { --model-h: clamp(520px, 78vh, 860px); }
.deck-shell .deck-stage .live-dino-model-stage.deck-model { transform: translate(-50%, -54%); }
.deck-contact { top: calc(46% + var(--model-h) * 0.16); }
.deck-card { padding: 18px 20px; }
.deck-growth { margin: 12px 0 8px; }
.deck-gauge, .deck-gauge svg { height: 104px; width: 104px; }
.deck-gauge-value b { font-size: 26px; }
.deck-shell .deck-metric { min-height: 27px; }
.deck-primary { height: 54px; margin-top: 14px; }
.deck-action-row { margin-top: 12px; }
.deck-ghost { min-height: 48px; }
.deck-reward { margin: 10px 0 6px; }
.deck-balance { margin: 10px 0 2px; }
.deck-overview { gap: 16px 24px; }

/* Independent columns: the right-hand stack no longer shares row heights with the stage. */
.deck-overview {
  grid-template-areas: "identity vitals" "identity actions" "stage actions" "stage wallet" "prime wallet";
  grid-template-rows: auto auto minmax(140px, 1fr) auto auto;
  min-height: calc(100vh - var(--top) - 36px);
}
.deck-overview:has(> .deck-onboarding) {
  grid-template-areas: "onboard onboard" "identity vitals" "identity actions" "stage actions" "stage wallet" "prime wallet";
  grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto;
}
.deck-overview:has(> .deck-controls:not(:empty)) {
  grid-template-areas: "controls controls" "identity vitals" "identity actions" "stage actions" "stage wallet" "prime wallet";
  grid-template-rows: auto auto auto minmax(140px, 1fr) auto auto;
}
.deck-overview:has(> .deck-onboarding):has(> .deck-controls:not(:empty)) {
  grid-template-areas: "onboard onboard" "controls controls" "identity vitals" "identity actions" "stage actions" "stage wallet" "prime wallet";
  grid-template-rows: auto auto auto auto minmax(140px, 1fr) auto auto;
}
.deck-stage { min-height: 300px; }
.deck-actions { align-self: center; }
.deck-contact { top: calc(46% + var(--model-h) * 0.105); width: min(360px, 40%); }
@media (max-width: 1080px) {
  .deck-overview, .deck-overview:has(> .deck-onboarding), .deck-overview:has(> .deck-controls:not(:empty)), .deck-overview:has(> .deck-onboarding):has(> .deck-controls:not(:empty)) {
    grid-template-areas: "onboard" "controls" "identity" "stage" "vitals" "actions" "wallet" "prime";
    grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0;
  }
}

/* Map controls float as a dock along the bottom of the map. */
.deck-shell .deck-map .map-toolbar {
  align-self: end !important; background: none !important; border: 0 !important; box-shadow: none !important;
  display: flex !important; flex-wrap: wrap; gap: 6px; grid-template-columns: none !important; justify-content: center;
  margin: 0 16px 16px !important; min-height: 0 !important; padding: 0 !important;
}
.deck-shell .deck-map .map-toolbar::before, .deck-shell .deck-map .map-toolbar::after { content: none !important; display: none !important; }
.deck-shell .deck-map .map-toolbar-heading { background: none !important; border: 0 !important; display: flex !important; flex: none; padding: 0 !important; }
.deck-shell .deck-map .map-layer-controls { background: none !important; border: 0 !important; justify-content: center; padding: 0 !important; }
.deck-shell .deck-map .map-toolbar .tool-button,
.deck-shell .deck-map .map-layer-toggle,
.deck-shell .deck-map .weather-game-clock { font-size: 12px; min-height: 34px; padding: 0 12px; }
.deck-shell .deck-map .map-layer-toggle input { accent-color: var(--amber); }
.deck-page-map .deck-page-head { margin-bottom: 14px; }
.deck-page-map .deck-page-head h1 { font-size: 28px; }
.deck-shell .deck-map .map-toolbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; grid-area: 1 / 1 / 4 / 2 !important; }
@media (max-width: 1080px) { .deck-shell .deck-map .map-toolbar { grid-area: map !important; } }
.deck-shell .deck-map { --map-h: max(540px, calc(100vh - var(--top) - 150px)); }
.deck-shell .deck-map .map-layout { grid-template-rows: auto auto auto auto auto auto !important; min-height: 0 !important; }
.deck-shell .deck-map #liveMapCanvas.group-map { height: var(--map-h); }
.deck-shell .deck-map .map-toolbar { align-self: start !important; margin-top: calc(var(--map-h) - 16px) !important; transform: translateY(-100%); }
.deck-main { overflow-x: clip; }
@media (max-width: 1080px) {
  .deck-shell .deck-map { --map-h: min(100vw, 620px); }
  .deck-stage { overflow: hidden; }
}
.deck-shell .deck-map .map-layout { grid-template-rows: auto auto 1fr auto auto auto !important; }
.deck-shell .deck-map .map-weather-forecast { align-self: start; }
@media (max-width: 1080px) {
  .deck-stage { --model-h: clamp(300px, 88vw, 560px); min-height: calc(var(--model-h) * 0.62); }
}
