/* HAMBURG.GAMES RED/WHITE HARBOR SYSTEM V11 */
:root {
  --hg-red: #e2001a;
  --hg-red-dark: #8d0011;
  --hg-white: #f7f4ef;
  --hg-graphite: #080b0f;
  --hg-panel: rgba(8, 11, 15, 0.92);
  --hg-line: rgba(247, 244, 239, 0.2);
  --ink: var(--hg-white);
  --muted: #b7b5b1;
  --panel: var(--hg-panel);
  --panel-solid: #0d1015;
  --line: var(--hg-line);
  --lime: var(--hg-red);
  --cyan: var(--hg-white);
  --coral: #ff344a;
  --amber: #f7f4ef;
  --brick: #6f1a20;
  --hg-cinematic-lime: var(--hg-red);
  --hg-choice-accent: var(--hg-red);
  --hg-v2-lime: var(--hg-red);
  --hg-v2-cyan: var(--hg-white);
  --hg-entry-lime: var(--hg-red);
  --hg-entry-cyan: var(--hg-white);
  --studio-lime: var(--hg-red);
  --studio-cyan: var(--hg-white);
  --studio-accent: var(--hg-red);
  --studio-line: rgba(247, 244, 239, 0.18);
}

html,
body,
#app {
  background: var(--hg-graphite);
}

body {
  color: var(--hg-white);
}

/* Full-screen opening film: harbor -> heroes -> one clear entry action. */
.hg-cinema-launch {
  position: fixed;
  inset: 0;
  z-index: 50000;
  overflow: hidden;
  color: var(--hg-white);
  background-color: var(--hg-red-dark);
  background-image:
    radial-gradient(circle at 72% 28%, rgba(247, 244, 239, 0.2), transparent 18%),
    linear-gradient(135deg, #8d0011 0%, #e2001a 48%, #260008 100%);
  isolation: isolate;
  animation: hgCinemaFailsafe 12s step-end forwards;
  transition: opacity 0.7s ease, visibility 0.7s ease;
}

.hg-cinema-launch[data-state="leaving"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.hg-cinema-fallback,
.hg-cinema-shot,
.hg-cinema-wash {
  position: absolute;
  inset: -3%;
}

.hg-cinema-fallback {
  inset: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 11.8vw, rgba(247, 244, 239, 0.055) 11.8vw calc(11.8vw + 1px)),
    repeating-linear-gradient(0deg, transparent 0 11.8vw, rgba(247, 244, 239, 0.045) 11.8vw calc(11.8vw + 1px)),
    radial-gradient(circle at 76% 35%, rgba(247, 244, 239, 0.32) 0 2px, transparent 3px),
    linear-gradient(112deg, rgba(4, 6, 9, 0.82) 0 36%, rgba(226, 0, 26, 0.34) 68%, rgba(4, 6, 9, 0.2));
  transition: opacity 0.45s ease;
}

.hg-cinema-fallback::after {
  position: absolute;
  right: 8vw;
  bottom: 12vh;
  width: min(36vw, 520px);
  height: min(36vw, 520px);
  border: 1px solid rgba(247, 244, 239, 0.34);
  border-radius: 50%;
  box-shadow:
    0 0 0 38px rgba(247, 244, 239, 0.025),
    0 0 0 82px rgba(226, 0, 26, 0.13);
  content: "";
}

.hg-cinema-launch[data-assets="ready"] .hg-cinema-fallback {
  opacity: 0;
}

.hg-cinema-shot {
  width: 106%;
  height: 106%;
  display: block;
  max-width: none;
  object-fit: cover;
  object-position: center;
  will-change: transform, opacity;
}

.hg-cinema-shot-dock {
  animation: hgCinemaDock 6.2s cubic-bezier(.2,.72,.2,1) both;
}

.hg-cinema-shot-heroes {
  opacity: 0;
  object-position: 58% center;
  animation: hgCinemaHeroes 6.2s cubic-bezier(.2,.72,.2,1) both;
}

.hg-cinema-launch[data-assets="loading"] .hg-cinema-shot {
  opacity: 0 !important;
  animation: none !important;
}

.hg-cinema-wash {
  background:
    linear-gradient(90deg, rgba(2, 3, 5, 0.94), rgba(2, 3, 5, 0.58) 36%, rgba(2, 3, 5, 0.04) 72%),
    linear-gradient(180deg, rgba(226, 0, 26, 0.08), transparent 32%, rgba(2, 3, 5, 0.8));
}

.hg-cinema-lockup {
  position: absolute;
  z-index: 2;
  left: clamp(24px, 7vw, 112px);
  top: 50%;
  width: min(520px, 46vw);
  display: grid;
  justify-items: start;
  transform: translateY(-44%);
}

.hg-cinema-lockup img {
  width: clamp(72px, 8vw, 112px);
  height: auto;
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.55));
  animation: hgCinemaMark 1.2s 0.2s cubic-bezier(.2,.8,.2,1) both;
}

.hg-cinema-lockup small {
  margin-top: 22px;
  color: var(--hg-red);
  font-size: clamp(9px, 1vw, 13px);
  font-weight: 900;
  letter-spacing: 0.22em;
}

.hg-cinema-lockup h1 {
  margin: 4px 0 0;
  color: var(--hg-white);
  font-size: clamp(48px, 7.2vw, 112px);
  font-weight: 1000;
  line-height: 0.86;
  letter-spacing: -0.075em;
  text-wrap: balance;
}

.hg-cinema-lockup p {
  margin: 16px 0 0;
  color: rgba(247, 244, 239, 0.74);
  font-size: clamp(13px, 1.35vw, 19px);
  font-weight: 720;
}

.hg-cinema-lockup > button {
  min-height: 52px;
  margin-top: 26px;
  padding: 0 24px;
  opacity: 0;
  transform: translateY(12px);
  border: 1px solid var(--hg-red);
  border-radius: 999px;
  color: var(--hg-white);
  background: linear-gradient(135deg, #f20a25, #a90014);
  box-shadow: 0 18px 46px rgba(226, 0, 26, 0.28);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  transition: opacity 0.45s ease, transform 0.45s ease, filter 0.2s ease;
}

.hg-cinema-launch[data-ready="true"] .hg-cinema-lockup > button {
  opacity: 1;
  transform: translateY(0);
}

.hg-cinema-lockup > button:hover {
  filter: brightness(1.14);
}

.hg-cinema-skip {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 2;
  padding: 10px 14px;
  border: 1px solid rgba(247, 244, 239, 0.24);
  border-radius: 999px;
  color: rgba(247, 244, 239, 0.76);
  background: rgba(5, 7, 10, 0.56);
  backdrop-filter: blur(12px);
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.hg-cinema-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: rgba(247, 244, 239, 0.1);
}

.hg-cinema-progress i {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: left;
  background: var(--hg-red);
  animation: hgCinemaProgress 6.2s linear both;
}

.hg-cinema-launch[data-assets="loading"] .hg-cinema-progress i {
  transform: scaleX(0);
  animation: none;
}

@keyframes hgCinemaDock {
  0%, 31% { opacity: 1; transform: scale(1.08) translate3d(-1.5%, 0, 0); }
  52%, 100% { opacity: 0; transform: scale(1.015) translate3d(0, 0, 0); }
}

@keyframes hgCinemaHeroes {
  0%, 25% { opacity: 0; transform: scale(1.07) translate3d(1.5%, 0, 0); }
  54%, 100% { opacity: 1; transform: scale(1.015) translate3d(0, 0, 0); }
}

@keyframes hgCinemaMark {
  from { opacity: 0; transform: translateY(18px) scale(0.82) rotate(-7deg); }
  to { opacity: 1; transform: translateY(0) scale(1) rotate(0); }
}

@keyframes hgCinemaProgress {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes hgCinemaFailsafe {
  from { visibility: visible; pointer-events: auto; }
  to { visibility: hidden; pointer-events: none; }
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline-color: var(--hg-white) !important;
}

.onboarding {
  background-color: var(--hg-graphite) !important;
  background-image: url("/assets/visuals/hamburg-harbor-heroes-red-v1.webp") !important;
  background-position: 57% center !important;
}

.onboarding-shade {
  background:
    linear-gradient(90deg, rgba(3, 4, 7, 0.99) 0, rgba(3, 4, 7, 0.94) 34%, rgba(3, 4, 7, 0.34) 67%, rgba(3, 4, 7, 0.12)),
    linear-gradient(180deg, rgba(226, 0, 26, 0.07), transparent 45%, rgba(2, 3, 5, 0.78)) !important;
}

.world-backdrop {
  background-color: var(--hg-graphite) !important;
  background-image: url("/assets/visuals/hamburg-harbor-heroes-red-v1.webp") !important;
  filter: saturate(0.72) brightness(0.55) contrast(1.12) !important;
}

.world-vignette {
  background:
    linear-gradient(180deg, rgba(4, 5, 8, 0.42), transparent 28%, transparent 67%, rgba(3, 4, 7, 0.78)),
    linear-gradient(90deg, rgba(226, 0, 26, 0.1), transparent 22%, transparent 78%, rgba(226, 0, 26, 0.08)) !important;
}

.onboarding-signal,
.mission-head,
.section-label,
.panel-header small,
.entry-section-label span,
.hg-entry-guide > small,
.street-chat-dock header small,
.city-map-dock header small {
  color: var(--hg-white) !important;
}

.onboarding-signal::before,
.loading-brand::before,
.studio-brand::before {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
  background: url("/assets/visuals/hamburg-games-signal-mark-v13.png") center / contain no-repeat;
  content: "";
}

.onboarding-signal > svg,
.loading-brand > svg {
  display: none;
}

.brand-mark {
  border: 1px solid rgba(247, 244, 239, 0.36) !important;
  border-radius: 50% 50% 46% 46% !important;
  background: rgba(8, 11, 15, 0.88) url("/assets/visuals/hamburg-games-signal-mark-v13.png") center / 88% no-repeat !important;
  box-shadow: inset 0 0 0 1px rgba(226, 0, 26, 0.32), 0 0 22px rgba(226, 0, 26, 0.18);
}

.brand-mark > svg {
  opacity: 0;
}

.brand-lockup,
.identity-chip,
.stat-command,
.stat-block,
.mission-rail,
.city-map-dock,
.street-chat-dock,
.game-panel,
.command-dock,
/* HG_WORLD_TUTORIAL_READABILITY_V12: style the card, never the full-screen coach layer. */
.hg-v2-tour-card {
  border-color: var(--hg-line) !important;
  background-color: rgba(8, 11, 15, 0.88) !important;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.42) !important;
}

.brand-lockup,
.identity-chip,
.stat-command,
.stat-block,
.command-dock,
.game-panel,
.hg-v2-tour-card,
.hg-v2-choice,
.hg-v2-roster-card,
.primary-command,
.secondary-command,
.hold-button {
  border-radius: 14px !important;
}

.mission-rail,
.capture-command,
.game-panel,
.city-map-dock,
.street-chat-dock {
  border-left-color: var(--hg-red) !important;
}

.mission-progress,
.loading-track,
.hold-button,
.capture-command {
  overflow: hidden;
}

.mission-progress > span,
.loading-track > span,
.hold-fill,
.live-dot.online,
.mission-rail::after {
  background: var(--hg-red) !important;
}

.primary-command,
.compact-primary,
.hold-button,
.dock-primary,
.command-dock button.active,
.hg-v2-primary,
.hg-v2-choice.is-selected,
.hg-v2-choice[aria-pressed="true"],
.street-chat-tabs button.active {
  border-color: var(--hg-red) !important;
  color: var(--hg-white) !important;
  background: linear-gradient(135deg, #f20a25, #a90014) !important;
  box-shadow: 0 12px 30px rgba(226, 0, 26, 0.25) !important;
}

.primary-command:hover,
.compact-primary:hover,
.command-dock button:hover,
.hg-v2-primary:hover {
  filter: brightness(1.1);
}

.secondary-command,
.text-command,
.icon-button,
.map-actions button,
.hg-entry-hero-interaction > button {
  border-color: rgba(247, 244, 239, 0.28) !important;
  color: var(--hg-white) !important;
  background: rgba(247, 244, 239, 0.06) !important;
}

.stat-command svg,
.stat-block svg,
.character-command svg,
.online-count svg,
.studio-section-head small,
.studio-label,
.field-label {
  color: var(--hg-red) !important;
}

.identity-chip img,
.character-command img,
.returning-identity img,
.hg-v2-roster-visual img {
  border-color: rgba(226, 0, 26, 0.72) !important;
}

.city-map {
  filter: grayscale(0.9) contrast(1.08) brightness(0.82);
}

.city-map-dock footer b,
.street-chat-dock .online-count,
.hg-market-group header small,
.shop-row b,
.vault-create > header > span {
  color: var(--hg-red) !important;
}

.leaflet-control-zoom a {
  color: var(--hg-white) !important;
  border-color: rgba(247, 244, 239, 0.18) !important;
  background: rgba(8, 11, 15, 0.92) !important;
}

.loading-screen {
  background:
    linear-gradient(rgba(3, 4, 7, 0.8), rgba(3, 4, 7, 0.92)),
    url("/assets/visuals/hamburg-harbor-heroes-red-v1.webp") center / cover no-repeat !important;
}

.loading-brand::before {
  width: 54px;
  height: 54px;
}

.loading-brand {
  padding: 12px 18px;
  border: 1px solid rgba(247, 244, 239, 0.18);
  border-radius: 18px;
  background: rgba(8, 11, 15, 0.72);
  backdrop-filter: blur(16px);
}

.hg-entry-hero::before,
.hg-entry-hero-orbit i {
  border-color: rgba(226, 0, 26, 0.58) !important;
}

.hg-entry-hero-copy small,
.hg-entry-guide > small,
.hg-v2-kicker {
  color: var(--hg-red) !important;
}

/* Character origin is chosen here; fashion is intentionally earned in play. */
.studio-tabs {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.studio-tabs [hidden],
.studio-panel[hidden] {
  display: none !important;
}

.studio-species {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

.studio-species button {
  position: relative;
  min-height: 116px !important;
  display: grid !important;
  grid-template-columns: 32px minmax(0, 1fr) !important;
  grid-template-rows: auto auto !important;
  align-content: center;
  justify-items: stretch !important;
  gap: 6px 10px !important;
  padding: 14px !important;
  color: var(--hg-white) !important;
  text-align: left;
  white-space: normal !important;
  border: 1px solid rgba(247, 244, 239, 0.18) !important;
  border-radius: 12px !important;
  background: rgba(247, 244, 239, 0.035) !important;
}

.studio-species button > i {
  grid-row: 1 / span 2;
  align-self: start;
  color: var(--hg-red);
  font-size: 24px;
  font-style: normal;
}

.studio-species button > span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  white-space: normal !important;
}

.studio-species button strong {
  font-size: 15px;
  letter-spacing: 0.06em;
}

.studio-species button small {
  margin-top: 3px;
  color: var(--hg-red);
  font-size: 8px;
}

.studio-species button > em {
  grid-column: 2;
  color: #b7b5b1;
  font-size: 9px;
  font-style: normal;
  line-height: 1.35;
  white-space: normal;
}

.studio-species button:hover,
.studio-species button.is-active {
  border-color: var(--hg-red) !important;
  color: var(--hg-white) !important;
  background: linear-gradient(145deg, rgba(226, 0, 26, 0.22), rgba(247, 244, 239, 0.04)) !important;
  box-shadow: inset 0 -3px var(--hg-red), 0 14px 30px rgba(0, 0, 0, 0.26);
}

.studio-market-lock {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 3px solid var(--hg-red);
  border-radius: 4px 12px 12px 4px;
  background: rgba(226, 0, 26, 0.08);
}

.studio-market-lock b {
  color: var(--hg-white);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.studio-market-lock span {
  color: #b7b5b1;
  font-size: 9px;
  line-height: 1.45;
}

.identity-studio,
.cinematic-scenes,
.identity-stage-fallback {
  background-color: var(--hg-graphite) !important;
}

.identity-studio {
  background-image:
    linear-gradient(90deg, rgba(4, 6, 9, 0.9) 0, rgba(4, 6, 9, 0.45) 34%, rgba(4, 6, 9, 0.08) 68%),
    url("/assets/visuals/hamburg-character-dock-red-v1.webp") !important;
  background-position: center !important;
  background-size: cover !important;
}

.identity-studio[data-cinematic-only="true"] {
  --studio-accent: var(--hg-red) !important;
  --room-accent: var(--hg-red) !important;
}

.studio-editor-head > button,
.studio-tabs button.is-active,
.studio-profile-actions button[data-save],
.cinematic-book-status i,
.cinematic-chapter-rail button.is-active {
  border-color: var(--hg-red) !important;
  color: var(--hg-white) !important;
  background: var(--hg-red) !important;
}

.studio-load-orbit-a,
.studio-load-orbit-b,
.studio-load-orbit-c {
  border-color: rgba(247, 244, 239, 0.18) !important;
  border-top-color: var(--hg-red) !important;
}

.identity-stage-fallback,
.cinematic-scene img {
  filter: saturate(0.78) contrast(1.08) !important;
}

.studio-brand::before {
  position: absolute;
  top: -4px;
  left: -46px;
}

.studio-brand h1 b,
.studio-brand p,
.cinematic-page > p,
.cinematic-save-state {
  color: var(--hg-red) !important;
}

.cinematic-book,
.studio-editor,
.studio-profile {
  border-color: rgba(247, 244, 239, 0.18) !important;
  background-color: rgba(8, 11, 15, 0.92) !important;
}

.cinematic-edit-command,
.cinematic-final-actions button,
.studio-profile-actions button[data-save] {
  border-color: var(--hg-red) !important;
}

@media (max-width: 720px) {
  .hg-cinema-shot-dock {
    object-position: 57% center;
  }

  .hg-cinema-shot-heroes {
    object-position: 68% center;
  }

  .hg-cinema-wash {
    background:
      linear-gradient(180deg, rgba(2, 3, 5, 0.06) 0, rgba(2, 3, 5, 0.26) 34%, rgba(2, 3, 5, 0.96) 74%),
      linear-gradient(90deg, rgba(226, 0, 26, 0.08), transparent 50%);
  }

  .hg-cinema-lockup {
    left: 22px;
    right: 22px;
    top: auto;
    bottom: calc(52px + env(safe-area-inset-bottom));
    width: auto;
    transform: none;
  }

  .hg-cinema-lockup img {
    width: 64px;
  }

  .hg-cinema-lockup small {
    margin-top: 12px;
  }

  .hg-cinema-lockup h1 {
    max-width: 12ch;
    font-size: clamp(46px, 16vw, 72px);
  }

  .hg-cinema-lockup > button {
    width: 100%;
    min-height: 56px;
  }

  .onboarding {
    background-position: 68% center !important;
  }

  .onboarding-shade {
    background:
      linear-gradient(180deg, rgba(3, 4, 7, 0.1), rgba(3, 4, 7, 0.72) 38%, rgba(3, 4, 7, 0.99) 67%),
      linear-gradient(90deg, rgba(226, 0, 26, 0.06), transparent) !important;
  }

  .brand-lockup,
  .identity-chip,
  .stat-command,
  .stat-block,
  .command-dock {
    border-radius: 12px !important;
  }

  .studio-species {
    grid-template-columns: 1fr !important;
  }

  .studio-species button {
    min-height: 88px !important;
  }

  .studio-brand::before {
    display: none;
  }

  .identity-studio {
    background-position: 62% center !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hg-cinema-shot,
  .hg-cinema-lockup img,
  .hg-cinema-progress i {
    animation: none !important;
  }

  .hg-cinema-shot-dock {
    opacity: 0;
  }

  .hg-cinema-shot-heroes,
  .hg-cinema-lockup > button {
    opacity: 1;
    transform: none;
  }

  .brand-mark,
  .primary-command,
  .loading-brand {
    box-shadow: none !important;
  }
}

/* HG_WORLD_SURFACE_READABILITY_V12
   Keep the harbour-night mood, but never let the playable canvas disappear
   behind a nearly black photo/vignette while Unity content is being rebuilt. */
.world-backdrop {
  filter: saturate(0.9) brightness(0.78) contrast(1.04) !important;
}

.world-vignette {
  background:
    linear-gradient(180deg, rgba(4, 5, 8, 0.12), transparent 34%, transparent 76%, rgba(3, 4, 7, 0.34)),
    linear-gradient(90deg, rgba(226, 0, 26, 0.08), transparent 24%, transparent 76%, rgba(247, 244, 239, 0.04)) !important;
}
