/* HG_HAMBURG_DEPTH_WORLD_V14 — colorful spatial Hamburg instead of a flat red tunnel. */
/* HG_HAMBURG_TUNNEL_VISUAL_V15 — Hamburg-specific ImageGen corridor for the live Three.js stage. */
/* HG_MOBILE_WEBGL_LITE_V19 */
:root {
  --hgd-sea: #63d7dd;
  --hgd-sea-deep: #0b3646;
  --hgd-amber: #f1b25a;
  --hgd-violet: #9c72e7;
  --hgd-paper: #f4efe4;
}

body.hg-portal-page {
  background:
    radial-gradient(circle at 22% 9%, rgba(83, 211, 218, .22), transparent 34%),
    radial-gradient(circle at 85% 28%, rgba(165, 111, 232, .2), transparent 30%),
    #0b202b;
}

.hg-portal { background: linear-gradient(180deg, rgba(7, 24, 32, .72), #0b202a 42%, #102631); }
.hg-portal-hero { isolation: isolate; background: #0a202a; }
.hg-depth-world { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: #0a202a; }
.hg-depth-world-fallback,
.hg-depth-world canvas,
.hg-depth-world-wash { position: absolute; inset: 0; width: 100%; height: 100%; }
.hg-depth-world-fallback {
  background:
    linear-gradient(90deg, rgba(5,20,27,.58) 0 27%, rgba(5,20,27,.18) 51%, rgba(5,20,27,0)),
    url("/assets/visuals/hamburg-depth-tunnel-v15.webp") center / cover no-repeat;
  filter: saturate(1.05) brightness(1.03);
  transform: scale(1.015);
}
.hg-depth-world canvas { z-index: 1; display: block; }
.hg-depth-world-wash {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(5,20,27,.38) 0 23%, rgba(5,20,27,.16) 39%, rgba(5,20,27,0) 69%, rgba(5,20,27,.08)),
    linear-gradient(180deg, rgba(5,20,27,0), transparent 72%, rgba(5,20,27,.24));
}
.hg-depth-route {
  position: absolute;
  right: clamp(18px, 3vw, 52px);
  bottom: 16px;
  z-index: 3;
  display: grid;
  grid-template-columns: auto minmax(60px, 15vw) auto;
  align-items: center;
  gap: 10px;
  color: rgba(244,239,228,.7);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .13em;
}
.hg-depth-route i { height: 1px; background: linear-gradient(90deg, var(--hgd-sea), var(--hgd-amber), var(--hgd-violet)); box-shadow: 0 0 12px rgba(99,215,221,.5); }
.hg-depth-route small { font: inherit; color: rgba(244,239,228,.46); }
.hg-portal-hero-copy,
.hg-portal-game-column { position: relative; z-index: 5; }
.hg-portal-hero h1 span:last-child { color: #ff3154; text-shadow: 0 0 28px rgba(227,6,47,.25); }
.hg-portal-hero-lead { color: rgba(244,239,228,.88); }
.hg-portal-badges span:nth-child(2) { border-color: rgba(99,215,221,.52); background: rgba(7,38,49,.66); }
.hg-portal-badges span:nth-child(3) { border-color: rgba(241,178,90,.52); background: rgba(47,30,12,.62); }

.hg-meshy-lab {
  position: relative;
  grid-column: span 2;
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(300px, 1.12fr) minmax(260px, .88fr);
  overflow: hidden;
  border: 1px solid rgba(99,215,221,.34);
  color: var(--hgd-paper);
  background:
    radial-gradient(circle at 22% 32%, rgba(76,214,224,.22), transparent 34%),
    radial-gradient(circle at 63% 70%, rgba(145,92,221,.17), transparent 38%),
    linear-gradient(135deg, #092532, #112c38 58%, #271a3d);
  box-shadow: 0 30px 80px rgba(0,0,0,.32);
}
.hg-meshy-lab::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(115deg, transparent 46%, rgba(255,255,255,.05) 46.2%, transparent 46.4%); }
.hg-meshy-lab-stage { position: relative; min-height: 460px; overflow: hidden; cursor: grab; touch-action: pan-y; }
.hg-meshy-lab-stage:active { cursor: grabbing; }
.hg-meshy-lab-stage::before { content: ""; position: absolute; inset: 12% 10%; border-radius: 50%; background: radial-gradient(circle, rgba(82,219,230,.24), rgba(131,89,215,.11) 46%, transparent 70%); filter: blur(16px); }
.hg-meshy-lab-stage img,
.hg-meshy-lab-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hg-meshy-lab-stage canvas { z-index: 2; }
.hg-meshy-start {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 22px;
  min-width: 220px;
  min-height: 48px;
  padding: 12px 18px;
  transform: translateX(-50%);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 999px;
  color: #07131d;
  background: #f7f4ef;
  box-shadow: 0 16px 38px rgba(0,0,0,.34);
  font: 950 9px/1 Arial, sans-serif;
  letter-spacing: .1em;
  cursor: pointer;
}
.hg-meshy-start:hover,
.hg-meshy-start:focus-visible { color: #fff; background: #e3062f; outline: 2px solid #fff; outline-offset: 3px; }
.hg-meshy-lab-drag { position: absolute; left: 18px; bottom: 16px; z-index: 3; padding: 8px 10px; border: 1px solid rgba(255,255,255,.17); color: rgba(255,255,255,.68); background: rgba(5,12,17,.55); font-size: 7px; font-weight: 900; letter-spacing: .12em; }
.hg-meshy-lab-copy { position: relative; z-index: 3; display: flex; flex-direction: column; justify-content: center; padding: clamp(26px, 4vw, 58px); }
.hg-meshy-lab-copy small { color: var(--hgd-sea); font-size: 8px; font-weight: 950; letter-spacing: .15em; }
.hg-meshy-lab-copy h3 { max-width: 8ch; margin: 14px 0 18px; font-size: clamp(42px, 5vw, 74px); font-weight: 1000; letter-spacing: -.075em; line-height: .82; }
.hg-meshy-lab-copy p { max-width: 46ch; margin: 0; color: rgba(244,239,228,.72); font-size: 12px; line-height: 1.65; }
.hg-meshy-lab-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 24px; }
.hg-meshy-lab-meta b { padding: 7px 9px; border: 1px solid rgba(255,255,255,.17); color: rgba(255,255,255,.78); font-size: 7px; letter-spacing: .09em; }
.hg-meshy-build-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 18px; }
.hg-meshy-build-tabs button { min-width: 0; min-height: 42px; display: flex; align-items: center; gap: 8px; padding: 8px 10px; overflow: hidden; border: 1px solid rgba(255,255,255,.13); color: rgba(244,239,228,.66); background: rgba(3,11,17,.48); font: 850 7px/1.1 Arial, sans-serif; letter-spacing: .06em; text-align: left; cursor: pointer; transition: border-color .2s ease, color .2s ease, transform .2s ease, background .2s ease; }
.hg-meshy-build-tabs button span { flex: 0 0 auto; color: var(--hgd-sea); font-size: 8px; }
.hg-meshy-build-tabs button[aria-pressed="true"] { border-color: var(--hgd-amber); color: #fff; background: linear-gradient(110deg, rgba(93,48,16,.66), rgba(22,16,35,.72)); box-shadow: inset 3px 0 0 var(--hgd-amber); }
.hg-meshy-build-tabs button:hover,
.hg-meshy-build-tabs button:focus-visible { border-color: var(--hgd-sea); color: #fff; transform: translateX(2px); }
.hg-meshy-lab-controls { display: flex; gap: 7px; margin-top: 24px; }
.hg-meshy-lab-controls button { width: 44px; height: 44px; border: 1px solid rgba(99,215,221,.42); border-radius: 50%; color: #fff; background: rgba(8,26,35,.74); font-size: 16px; cursor: pointer; }
.hg-meshy-lab-controls button:hover,
.hg-meshy-lab-controls button:focus-visible { border-color: var(--hgd-amber); background: rgba(54,35,13,.76); transform: translateY(-2px); }

@media (max-width: 820px) {
  .hg-depth-world-fallback { background-image: linear-gradient(180deg, rgba(5,20,27,.02), rgba(5,20,27,.08) 48%, rgba(7,25,34,.42) 86%), url("/assets/visuals/hamburg-depth-tunnel-mobile-v15.webp"); }
  .hg-depth-world-wash { background: linear-gradient(180deg, rgba(5,20,27,0), rgba(5,20,27,.07) 38%, rgba(7,25,34,.36) 78%, #0b202b 97%); }
  .hg-depth-route { right: 16px; left: 16px; grid-template-columns: auto 1fr; }
  .hg-depth-route small { display: none; }
  .hg-meshy-lab { grid-column: 1 / -1; min-height: 0; grid-template-columns: 1fr; }
  .hg-meshy-lab-stage { min-height: min(68svh, 560px); }
  .hg-meshy-start { min-width: min(260px, calc(100% - 36px)); min-height: 52px; }
  .hg-meshy-lab-copy { padding: 25px 20px 30px; }
  .hg-meshy-lab-copy h3 { font-size: clamp(46px, 15vw, 68px); }
  .hg-meshy-build-tabs { grid-template-columns: repeat(3, minmax(112px, 1fr)); margin-right: -20px; padding-right: 20px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .hg-meshy-build-tabs::-webkit-scrollbar { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .hg-meshy-lab-controls button { transition: none !important; }
}
