/* HG_RACE_FIRST_CREATOR_V13 */
:root {
  --hg-v2-lime: #c8ff38;
  --hg-v2-cyan: #49d7ff;
  --hg-v2-ink: #07100d;
  --hg-v2-panel: rgba(7, 16, 13, 0.94);
  --hg-v2-line: rgba(232, 246, 239, 0.16);
}

[hidden] {
  display: none !important;
}

.hg-v2-locale {
  position: fixed;
  z-index: 9000;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: auto 24px auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 10, 8, 0.78);
  color: rgba(239, 247, 243, 0.52);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.12em;
  backdrop-filter: blur(18px);
  cursor: pointer;
}

.hg-v2-locale i {
  position: relative;
  width: 24px;
  height: 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
}

.hg-v2-locale i::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hg-v2-lime);
  box-shadow: 0 0 12px rgba(200, 255, 56, 0.65);
  transition: transform 180ms ease;
}

.hg-v2-locale[data-locale="tr"] i::after {
  transform: translateX(10px);
}

.hg-v2-locale[data-locale="de"] span:first-child,
.hg-v2-locale[data-locale="tr"] span:last-child {
  color: #fff;
}

.hg-v2-name {
  display: grid;
  gap: 7px;
  margin: 20px 0 14px;
}

.hg-v2-name > span {
  color: rgba(235, 245, 240, 0.58);
  font: 800 10px/1.2 system-ui, sans-serif;
  letter-spacing: 0.16em;
}

.hg-v2-name input,
.hg-v2-new-setup input {
  width: 100%;
  min-height: 54px;
  box-sizing: border-box;
  border: 1px solid rgba(200, 255, 56, 0.32);
  border-radius: 14px;
  outline: none;
  background: rgba(2, 8, 6, 0.76);
  color: #f5faf7;
  padding: 0 16px;
  font: 700 17px/1.2 system-ui, sans-serif;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hg-v2-name input:focus,
.hg-v2-new-setup input:focus {
  border-color: var(--hg-v2-lime);
  box-shadow: 0 0 0 3px rgba(200, 255, 56, 0.1);
}

.hg-v2-name small {
  min-height: 16px;
  color: #ff7d73;
  font: 700 12px/1.3 system-ui, sans-serif;
}

.hg-v2-reset-note {
  display: grid;
  gap: 5px;
  margin: 18px 0 8px;
  padding: 15px 16px;
  border: 1px solid rgba(73, 215, 255, 0.26);
  border-radius: 15px;
  background: linear-gradient(135deg, rgba(73, 215, 255, 0.1), rgba(200, 255, 56, 0.04));
}

.hg-v2-reset-note span {
  color: var(--hg-v2-cyan);
  font: 800 9px/1 system-ui, sans-serif;
  letter-spacing: 0.14em;
}

.hg-v2-reset-note strong {
  color: #fff;
  font: 800 15px/1.2 system-ui, sans-serif;
}

.hg-v2-reset-note p {
  margin: 0;
  color: rgba(238, 247, 243, 0.65);
  font: 500 12px/1.45 system-ui, sans-serif;
}

.entry-character-grid.hg-v2-entry-grid,
.hg-v2-new-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.entry-character-grid .hg-v2-starter,
.hg-v2-new-grid .hg-v2-starter {
  position: relative;
  display: grid;
  grid-template-rows: minmax(82px, 1fr) auto;
  min-width: 0;
  min-height: 164px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--hg-v2-line);
  border-radius: 14px;
  background: rgba(4, 10, 8, 0.72);
  color: #eff7f3;
  text-align: left;
  align-items: stretch;
  justify-items: stretch;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.hg-v2-starter:hover,
.hg-v2-starter[aria-pressed="true"] {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--hg-origin, #e2001a) 74%, white);
  background: rgba(17, 28, 22, 0.94);
}

.hg-v2-starter > img,
.entry-character-grid .hg-v2-custom-visual,
.hg-v2-new-grid .hg-v2-custom-visual {
  display: grid;
  width: 100%;
  height: 94px;
  object-fit: cover;
  object-position: top center;
  background: radial-gradient(circle at 50% 28%, rgba(73, 215, 255, 0.25), rgba(3, 9, 7, 0.95) 72%);
}

.hg-v2-starter > span:not(.hg-v2-custom-visual) {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.hg-v2-starter strong {
  overflow: hidden;
  color: #fff;
  font: 850 11px/1.1 system-ui, sans-serif;
  letter-spacing: 0.04em;
  text-overflow: ellipsis;
}

.hg-v2-starter small {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(235, 245, 240, 0.56);
  font: 550 9px/1.3 system-ui, sans-serif;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.hg-v2-starter > i {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--hg-v2-lime);
  color: #07100d;
  font: 900 11px/1 system-ui, sans-serif;
  opacity: 0;
  transform: scale(0.72);
  transition: 150ms ease;
}

.hg-v2-starter[aria-pressed="true"] > i {
  opacity: 1;
  transform: scale(1);
}

.hg-v2-custom-visual {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 38%, rgba(200, 255, 56, 0.24), transparent 34%),
    linear-gradient(145deg, rgba(73, 215, 255, 0.15), rgba(8, 13, 11, 0.94));
}

/* HG_ORIGIN_PORTRAITS_V13: one honest portrait per race; never recolor a reused avatar. */
.entry-character-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art,
.hg-v2-new-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art {
  display: block;
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
  min-width: 0;
  overflow: hidden;
  padding: 0;
  background: #07090a;
  isolation: isolate;
}

.entry-character-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art::after,
.hg-v2-new-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art::after {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 48%, rgba(3, 5, 6, 0.72) 100%),
    linear-gradient(90deg, rgba(226, 0, 26, 0.18), transparent 40%, rgba(255, 255, 255, 0.08));
  content: "";
  pointer-events: none;
}

.entry-character-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art > img,
.hg-v2-new-grid .hg-v2-starter.hg-v2-origin > .hg-v2-choice-art > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: scale(1.015);
  transition: transform 300ms cubic-bezier(0.2, 0.7, 0.2, 1), filter 180ms ease;
}

.hg-v2-origin:hover > .hg-v2-choice-art > img,
.hg-v2-origin[aria-pressed="true"] > .hg-v2-choice-art > img {
  filter: saturate(1.06) contrast(1.03);
  transform: scale(1.07);
}

.hg-v2-origin .hg-v2-choice-copy {
  position: relative;
  z-index: 2;
  align-content: start;
}

.hg-v2-origin .hg-v2-choice-art > b {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid color-mix(in srgb, var(--hg-origin) 72%, white);
  border-radius: 50%;
  background: color-mix(in srgb, #030a08 78%, var(--hg-origin));
  color: var(--hg-origin);
  font: 900 15px/1 system-ui, sans-serif;
  box-shadow: 0 0 26px color-mix(in srgb, var(--hg-origin) 32%, transparent);
}

.hg-v2-custom-visual b {
  color: var(--hg-v2-lime);
  font: 300 46px/1 system-ui, sans-serif;
}

.hg-v2-custom-visual em {
  position: absolute;
  right: 8px;
  bottom: 7px;
  color: rgba(255, 255, 255, 0.42);
  font: 800 8px/1 system-ui, sans-serif;
  letter-spacing: 0.08em;
}

.hg-v2-launcher,
.hg-v2-vault-create {
  display: flex;
  align-items: center;
  gap: 11px;
  border: 1px solid rgba(200, 255, 56, 0.35);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(15, 30, 22, 0.96), rgba(5, 12, 9, 0.94));
  color: #f4faf6;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.38);
  cursor: pointer;
}

.hg-v2-launcher {
  position: fixed;
  z-index: 180;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(92px, calc(env(safe-area-inset-bottom) + 82px));
  max-width: min(320px, calc(100vw - 32px));
  padding: 9px 13px 9px 9px;
  backdrop-filter: blur(18px);
}

.hg-v2-vault-create {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 14px;
  padding: 12px;
  text-align: left;
}

.hg-v2-launcher > b,
.hg-v2-vault-create > b {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--hg-v2-lime);
  color: #07100d;
  font: 400 28px/1 system-ui, sans-serif;
}

.hg-v2-launcher span,
.hg-v2-vault-create span {
  display: grid;
  gap: 3px;
}

.hg-v2-launcher strong,
.hg-v2-vault-create strong {
  font: 850 11px/1.1 system-ui, sans-serif;
  letter-spacing: 0.06em;
}

.hg-v2-launcher small,
.hg-v2-vault-create small {
  color: rgba(236, 246, 241, 0.54);
  font: 500 9px/1.3 system-ui, sans-serif;
}

.hg-v2-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(10px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left));
}

.hg-v2-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 4, 3, 0.78);
  backdrop-filter: blur(18px);
}

.hg-v2-modal-card {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1180px, 100%);
  height: min(860px, 100%);
  overflow: hidden;
  border: 1px solid rgba(200, 255, 56, 0.24);
  border-radius: 22px;
  background: #080d0b;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.72);
}

.hg-v2-modal-card > header {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(5, 10, 8, 0.95);
}

.hg-v2-modal-card > header span {
  display: grid;
  gap: 3px;
}

.hg-v2-modal-card > header small {
  color: var(--hg-v2-lime);
  font: 800 9px/1 system-ui, sans-serif;
  letter-spacing: 0.18em;
}

.hg-v2-modal-card > header strong {
  color: #f3faf6;
  font: 850 15px/1.1 system-ui, sans-serif;
  letter-spacing: 0.06em;
}

.hg-v2-modal-card > header button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: 300 27px/1 system-ui, sans-serif;
  cursor: pointer;
}

/* The studio already owns its brand and navigation.  In studio mode the
   parent becomes a true full-bleed viewport with one floating escape hatch,
   instead of rendering a second portal frame around the iframe. */
.hg-v2-modal-card.is-studio {
  display: block;
}

.hg-v2-modal-card.is-studio > header {
  position: absolute;
  z-index: 8;
  top: 14px;
  right: 14px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.hg-v2-modal-card.is-studio > header > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.hg-v2-modal-card.is-studio > header button {
  width: 46px;
  height: 46px;
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(4, 9, 8, 0.78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.38);
  pointer-events: auto;
  backdrop-filter: blur(16px);
}

.hg-v2-modal-card.is-studio .hg-v2-studio-stage {
  width: 100%;
  height: 100%;
}

.hg-v2-new-setup {
  align-self: center;
  width: min(760px, calc(100% - 32px));
  margin: auto;
  padding: 24px 0;
}

.hg-v2-new-setup > label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.hg-v2-new-setup > label span {
  color: rgba(238, 247, 242, 0.6);
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.16em;
}

.hg-v2-modal-next {
  width: 100%;
  min-height: 54px;
  margin-top: 14px;
  border: 0;
  border-radius: 14px;
  background: var(--hg-v2-lime);
  color: #07100d;
  font: 900 12px/1 system-ui, sans-serif;
  letter-spacing: 0.09em;
  cursor: pointer;
}

.hg-v2-modal-next:disabled {
  opacity: 0.55;
  cursor: progress;
}

.hg-v2-modal-error {
  min-height: 18px;
  margin: 10px 0 0;
  color: #ff8178;
  font: 700 12px/1.35 system-ui, sans-serif;
}

.hg-v2-studio-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #090b10;
}

.hg-v2-studio-stage iframe {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #090b10;
}

.hg-v2-studio-stage > .hg-v2-modal-error {
  position: absolute;
  z-index: 4;
  right: 16px;
  bottom: 12px;
  max-width: calc(100% - 32px);
  padding: 8px 11px;
  border-radius: 9px;
  background: rgba(9, 14, 12, 0.88);
}

.hg-v2-studio-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.46);
  font: 800 10px/1 system-ui, sans-serif;
  letter-spacing: 0.18em;
}

.hg-v2-studio-loading span {
  width: 52px;
  height: 52px;
  margin: auto;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--hg-v2-lime);
  border-radius: 50%;
  animation: hg-v2-spin 900ms linear infinite;
}

.hg-v2-modal-open {
  overflow: hidden;
}

.entry-character-grid.hg-v2-roster-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hg-v2-roster-card {
  position: relative;
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 76px;
  overflow: hidden;
  padding: 6px 9px 6px 6px;
  border: 1px solid var(--hg-v2-line);
  border-radius: 14px;
  background: rgba(3, 10, 7, 0.78);
  color: #f3faf6;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.hg-v2-roster-card:hover,
.hg-v2-roster-card:focus-visible,
.hg-v2-roster-card[aria-pressed="true"] {
  border-color: rgba(200, 255, 56, 0.68);
  background: rgba(15, 28, 21, 0.94);
  transform: translateY(-1px);
}

.hg-v2-roster-card:focus-visible,
.hg-v2-tour button:focus-visible {
  outline: 2px solid var(--hg-v2-cyan);
  outline-offset: 2px;
}

.hg-v2-roster-card:disabled {
  opacity: 0.62;
  cursor: progress;
}

.hg-v2-roster-visual {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 34%, rgba(73, 215, 255, 0.22), rgba(3, 9, 7, 0.96) 70%);
}

.hg-v2-roster-visual img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.hg-v2-roster-visual b {
  color: var(--hg-v2-lime);
  font: 300 32px/1 system-ui, sans-serif;
}

.hg-v2-roster-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.hg-v2-roster-card small {
  color: var(--hg-v2-cyan);
  font: 800 8px/1 system-ui, sans-serif;
  letter-spacing: 0.1em;
}

.hg-v2-roster-card strong {
  overflow: hidden;
  color: #fff;
  font: 850 12px/1.15 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hg-v2-roster-card > i {
  color: rgba(238, 247, 242, 0.48);
  font: 800 15px/1 system-ui, sans-serif;
  text-align: center;
}

.hg-v2-roster-card[aria-pressed="true"] > i {
  color: var(--hg-v2-lime);
}

.hg-v2-roster-new {
  border-style: dashed;
}

.hg-v2-tour {
  position: fixed;
  z-index: 9800;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
}

.hg-v2-tour-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 35%, rgba(73, 215, 255, 0.1), transparent 35%),
    rgba(1, 7, 5, 0.82);
  backdrop-filter: blur(18px);
}

.hg-v2-tour-card {
  position: relative;
  width: min(460px, 100%);
  box-sizing: border-box;
  overflow: hidden;
  padding: 20px;
  border: 1px solid rgba(200, 255, 56, 0.28);
  border-radius: 22px;
  outline: none;
  background:
    linear-gradient(145deg, rgba(73, 215, 255, 0.07), transparent 34%),
    rgba(5, 14, 10, 0.97);
  color: #f3faf6;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.66), inset 0 1px rgba(255, 255, 255, 0.04);
}

.hg-v2-tour-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

#hgTutorialKicker {
  color: var(--hg-v2-cyan);
  font: 850 9px/1 system-ui, sans-serif;
  letter-spacing: 0.15em;
}

.hg-v2-tour-progress {
  display: flex;
  align-items: center;
  gap: 5px;
}

.hg-v2-tour-progress i {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  transition: width 180ms ease, background 180ms ease;
}

.hg-v2-tour-progress i.is-done {
  background: rgba(200, 255, 56, 0.52);
}

.hg-v2-tour-progress i.is-active {
  width: 22px;
  background: var(--hg-v2-lime);
  box-shadow: 0 0 16px rgba(200, 255, 56, 0.46);
}

.hg-v2-tour-character {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 18px 0 14px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.hg-v2-tour-character img {
  width: 96px;
  height: 108px;
  border-radius: 12px;
  object-fit: contain;
  background: radial-gradient(circle at 50% 32%, rgba(200, 255, 56, 0.18), rgba(2, 8, 6, 0.9) 68%);
}

.hg-v2-tour-character span {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.hg-v2-tour-character small {
  color: var(--hg-v2-lime);
  font: 850 9px/1 system-ui, sans-serif;
  letter-spacing: 0.14em;
}

.hg-v2-tour-character strong {
  overflow-wrap: anywhere;
  color: #fff;
  font: 850 23px/1 system-ui, sans-serif;
}

.hg-v2-tour-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: 22px;
  border: 1px solid rgba(73, 215, 255, 0.34);
  border-radius: 15px;
  color: var(--hg-v2-lime);
  background: rgba(73, 215, 255, 0.07);
  font: 750 22px/1 system-ui, sans-serif;
}

.hg-v2-tour.is-entry .hg-v2-tour-icon {
  display: none;
}

.hg-v2-tour h2 {
  margin: 16px 0 8px;
  color: #fff;
  font: 850 clamp(25px, 4vw, 34px)/1.02 system-ui, sans-serif;
  letter-spacing: -0.035em;
}

.hg-v2-tour p {
  margin: 0;
  color: rgba(236, 246, 241, 0.74);
  font: 540 13px/1.52 system-ui, sans-serif;
}

.hg-v2-tour-card > small {
  display: block;
  margin-top: 10px;
  color: rgba(236, 246, 241, 0.45);
  font: 720 9px/1.45 system-ui, sans-serif;
  letter-spacing: 0.04em;
}

.hg-v2-tour-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.hg-v2-tour-actions:empty {
  display: none;
}

.hg-v2-tour-actions button {
  min-height: 50px;
  padding: 0 15px;
  border-radius: 13px;
  font: 900 10px/1.1 system-ui, sans-serif;
  letter-spacing: 0.07em;
  cursor: pointer;
}

.hg-v2-tour-primary {
  border: 0;
  background: var(--hg-v2-lime);
  color: #07100d;
}

.hg-v2-tour-primary span {
  margin-left: 8px;
}

.hg-v2-tour-secondary {
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(243, 250, 246, 0.72);
}

.hg-v2-tour-state {
  min-height: 12px;
  margin-top: 12px;
  color: var(--hg-v2-cyan);
  font: 850 8px/1.2 system-ui, sans-serif;
  letter-spacing: 0.13em;
}

.hg-v2-tour.is-coach {
  place-items: end center;
  pointer-events: none;
}

.hg-v2-tour.is-coach .hg-v2-tour-scrim {
  background: linear-gradient(180deg, transparent 60%, rgba(1, 7, 5, 0.38));
  backdrop-filter: none;
  pointer-events: none;
}

.hg-v2-tour.is-coach .hg-v2-tour-card {
  width: min(390px, 100%);
  padding: 16px;
  border-color: rgba(73, 215, 255, 0.38);
  border-radius: 18px;
  pointer-events: auto;
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.58), inset 3px 0 var(--hg-v2-cyan);
}

.hg-v2-tour.is-coach .hg-v2-tour-icon {
  float: left;
  width: 38px;
  height: 38px;
  margin: 15px 12px 0 0;
  border-radius: 12px;
  font-size: 17px;
}

.hg-v2-tour.is-coach h2 {
  margin-top: 15px;
  font-size: 22px;
}

.hg-v2-tour.is-done .hg-v2-tour-card {
  text-align: center;
}

.hg-v2-tour.is-done .hg-v2-tour-icon {
  margin-inline: auto;
  border-color: rgba(200, 255, 56, 0.45);
  background: rgba(200, 255, 56, 0.08);
}

.hg-v2-tour.is-done .hg-v2-tour-actions {
  grid-template-columns: 1fr;
}

.hg-v2-tutorial-target {
  position: relative;
  z-index: 9700 !important;
  outline: 2px solid var(--hg-v2-lime) !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px rgba(200, 255, 56, 0.1), 0 0 38px rgba(200, 255, 56, 0.24) !important;
  animation: hg-v2-signal-pulse 1.7s ease-in-out infinite;
}

@keyframes hg-v2-signal-pulse {
  50% { outline-color: var(--hg-v2-cyan); box-shadow: 0 0 0 10px rgba(73, 215, 255, 0.08), 0 0 44px rgba(73, 215, 255, 0.22); }
}

@keyframes hg-v2-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 720px) {
  .hg-v2-locale {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    min-height: 34px;
    padding: 0 9px;
  }

  .entry-character-grid.hg-v2-entry-grid,
  .hg-v2-new-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .entry-character-grid .hg-v2-starter,
  .hg-v2-new-grid .hg-v2-starter {
    grid-template-columns: 82px minmax(0, 1fr);
    grid-template-rows: 92px;
    min-height: 92px;
  }

  .hg-v2-starter > img,
  .hg-v2-custom-visual {
    width: 82px;
    height: 92px;
  }

  .hg-v2-starter > span:not(.hg-v2-custom-visual) {
    align-content: center;
    padding: 12px 34px 12px 13px;
  }

  .hg-v2-starter strong {
    font-size: 12px;
  }

  .hg-v2-starter small {
    font-size: 10px;
  }

  .hg-v2-launcher {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(80px, calc(env(safe-area-inset-bottom) + 72px));
    padding: 7px;
  }

  .hg-v2-launcher > b {
    width: 40px;
    height: 40px;
  }

  .hg-v2-launcher span {
    display: none;
  }

  .hg-v2-modal {
    padding: 0;
  }

  .hg-v2-modal-card {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
  }

  .hg-v2-modal-card > header {
    min-height: calc(56px + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) 12px 0;
  }

  .hg-v2-modal-card.is-studio > header {
    top: max(10px, env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    min-height: 0;
    padding: 0;
  }

  .hg-v2-modal-card.is-studio > header button {
    width: 42px;
    height: 42px;
  }

  .hg-v2-new-setup {
    align-self: start;
    width: calc(100% - 24px);
    overflow-y: auto;
    padding: 18px 0 max(24px, env(safe-area-inset-bottom));
  }

  .entry-character-grid.hg-v2-roster-grid {
    display: grid;
    grid-auto-columns: min(82vw, 310px);
    grid-auto-flow: column;
    grid-template-columns: none;
    gap: 7px;
    overflow-x: auto;
    padding: 2px 2px 7px;
    scroll-padding-inline: 2px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .entry-character-grid.hg-v2-roster-grid::-webkit-scrollbar {
    display: none;
  }

  .hg-v2-roster-card {
    grid-template-columns: 58px minmax(0, 1fr) 22px !important;
    grid-template-rows: 66px !important;
    min-height: 66px !important;
    height: 66px !important;
    justify-items: stretch !important;
    scroll-snap-align: start;
  }

  .hg-v2-roster-visual {
    width: 58px;
    height: 58px;
  }

  .hg-v2-roster-card > span:nth-child(2) {
    display: grid !important;
  }

  .hg-v2-tour {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }

  .hg-v2-tour.is-entry,
  .hg-v2-tour.is-done {
    place-items: end center;
    padding: 0;
  }

  .hg-v2-tour.is-entry .hg-v2-tour-card,
  .hg-v2-tour.is-done .hg-v2-tour-card {
    width: 100%;
    max-height: calc(100dvh - max(10px, env(safe-area-inset-top)));
    overflow-y: auto;
    padding: 18px 16px max(18px, calc(env(safe-area-inset-bottom) + 12px));
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }

  .hg-v2-tour-character {
    grid-template-columns: 78px minmax(0, 1fr);
    margin-top: 14px;
  }

  .hg-v2-tour-character img {
    width: 78px;
    height: 88px;
  }

  .hg-v2-tour-character strong {
    font-size: 20px;
  }

  .hg-v2-tour h2 {
    font-size: 27px;
  }

  .hg-v2-tour-actions {
    grid-template-columns: 1fr;
  }

  .hg-v2-tour-actions .hg-v2-tour-primary {
    grid-row: 1;
  }

  .hg-v2-tour.is-coach {
    place-items: end stretch;
    padding-bottom: max(76px, calc(env(safe-area-inset-bottom) + 70px));
  }

  .hg-v2-tour.is-coach .hg-v2-tour-card {
    width: 100%;
    padding: 13px 14px;
    border-radius: 15px;
  }

  .hg-v2-tour.is-coach .hg-v2-tour-card > header {
    gap: 8px;
  }

  .hg-v2-tour.is-coach .hg-v2-tour-icon {
    width: 34px;
    height: 34px;
    margin-top: 12px;
  }

  .hg-v2-tour.is-coach h2 {
    margin: 12px 0 5px;
    font-size: 19px;
  }

  .hg-v2-tour.is-coach p {
    font-size: 11px;
    line-height: 1.4;
  }

  .hg-v2-tour.is-coach .hg-v2-tour-card > small {
    margin-top: 6px;
    font-size: 8px;
  }

  .hg-v2-tour.is-coach .hg-v2-tour-state {
    margin-top: 7px;
  }

  .hg-v2-tour.is-coach[data-step="capture"] {
    place-items: start stretch;
    padding-top: max(70px, calc(env(safe-area-inset-top) + 62px));
    padding-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hg-v2-starter,
  .hg-v2-locale i::after {
    transition: none;
  }

  .hg-v2-studio-loading span {
    animation: none;
  }

  .hg-v2-roster-card,
  .hg-v2-tour-progress i {
    transition: none;
  }

  .hg-v2-tutorial-target {
    animation: none;
  }
}

/* HG_TUTORIAL_READABILITY_V12
   The coach card guides one action at a time without turning the playable
   Hamburg scene into a black modal. */
.hg-v2-tour.is-coach .hg-v2-tour-scrim {
  background: linear-gradient(180deg, transparent 76%, rgba(1, 7, 5, 0.12)) !important;
}

/* HG_RANDOM_SIGNAL_CREATOR_V14: compact WEB window, obvious escape hatch. */
.hg-v2-modal-card,
.hg-v2-modal-card.is-studio {
  width: min(820px, calc(100vw - 40px));
  height: min(620px, calc(100dvh - 40px));
  max-width: 100%;
  max-height: 100%;
}

.hg-v2-modal-card.is-studio > header {
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
}

.hg-v2-modal-card > header button[data-hg-action="close-creator"] {
  position: relative;
  z-index: 60;
  width: 50px;
  min-width: 50px;
  height: 50px;
  min-height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.82);
  color: #fff;
  background: #e2001a;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.56), 0 0 0 5px rgba(226, 0, 26, 0.16);
}

.hg-v2-modal-card > header button[data-hg-action="close-creator"]:hover,
.hg-v2-modal-card > header button[data-hg-action="close-creator"]:focus-visible {
  border-color: #fff;
  outline: 3px solid #fff;
  outline-offset: 3px;
  background: #ff1833;
}

@media (max-width: 720px) {
  .hg-v2-modal-card,
  .hg-v2-modal-card.is-studio {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
  }
}
