/* Headline Games shared game-page brand shell.
   Load this after a game's own stylesheet. Game worlds may vary; the site frame may not. */
:root {
  --hg-ink: #071323;
  --hg-paper: #fffaf0;
  --hg-surface: #ffffff;
  --hg-page: #dbe6ef;
  --hg-muted: #526477;
  --hg-line: #a9b8c5;
  --hg-gold: #f8c35a;
  --hg-global: #28527a;
  --hg-japan: #d9563f;
  --hg-news: #f36f45;
  --hg-focus: #0086ff;
  --hg-radius-card: 28px;
  --hg-radius-control: 11px;
  --hg-shadow-card: 0 10px 0 rgba(7, 19, 35, .14);
  --hg-shadow-control: 0 5px 0 var(--hg-ink);
  --hg-space-1: 4px;
  --hg-space-2: 8px;
  --hg-space-3: 12px;
  --hg-space-4: 16px;
  --hg-space-5: 24px;
  --hg-info-pad-block: 14px;
  --hg-info-pad-inline: 16px;
  --hg-tile-pad-block: 8px;
  --hg-tile-pad-inline: 10px;
  --hg-entry-copy-pad-block: 24px;
  --hg-entry-copy-pad-inline: 24px;
}

body.hg-game-page {
  margin: 0;
  min-width: 320px;
  color: var(--hg-ink);
  background-color: var(--hg-page);
  background-image: linear-gradient(155deg, #eef4f8, #c6d5e2);
  font-family: Inter, "Noto Sans JP", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

html:lang(ja) body.hg-game-page {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  font-kerning: normal;
  line-height: 1.65;
}

body.hg-game-page :where(.site-head, .mast, .world > header) {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 28px));
  height: 62px;
  margin: 8px auto 0;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  position: relative;
  z-index: 30;
  color: var(--hg-ink);
  background: rgba(255, 255, 255, .94);
  border: 2px solid var(--hg-ink);
  border-radius: 16px;
  box-shadow: 0 4px 0 rgba(7, 19, 35, .13);
  font-size: 1rem;
  letter-spacing: 0;
}

body.hg-game-page :where(.site-head, .mast, .world > header) a {
  color: var(--hg-ink);
  text-decoration: none;
}

body.hg-game-page :where(.mast, .world > header) > a:first-child:not(:has(img)) {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 0;
  font-weight: 950;
}

body.hg-game-page :where(.mast, .world > header) > a:first-child:not(:has(img))::before {
  content: "";
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  background: url("/favicon.svg") center / contain no-repeat;
}

body.hg-game-page :where(.mast, .world > header) > a:first-child:not(:has(img))::after {
  content: "Headline Games";
  font-size: .94rem;
  letter-spacing: -.02em;
  text-transform: none;
  font-style: normal;
  white-space: nowrap;
}

body.hg-game-page .site-head .brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--hg-ink);
  font-size: .94rem;
  font-weight: 950;
  text-transform: none;
  font-style: normal;
}

body.hg-game-page .site-head .brand span {
  white-space: nowrap;
}

body.hg-game-page .site-head .head-tools {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

body.hg-game-page .site-head .brand img {
  width: 31px;
  height: 31px;
}

body.hg-game-page :where(.site-head .track, .mast::after, .world > header::after) {
  order: 2;
  padding: 5px 8px;
  color: #fff;
  background: var(--hg-global);
  border: 0;
  border-radius: 4px;
  box-shadow: none;
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1.15;
  white-space: nowrap;
}

body.hg-game-page[data-track="japan-export"] :where(.site-head .track, .mast::after, .world > header::after) {
  background: var(--hg-japan);
}

body.hg-game-page[data-track="global"] :where(.mast, .world > header)::after { content: "GLOBAL"; }
body.hg-game-page[data-track="japan-export"] :where(.mast, .world > header)::after { content: "JAPAN EXPORT"; }

body.hg-game-page :where(.site-head .head-tools, .mast, .world > header) > :where(a:last-child, .head-tools) {
  order: 3;
}

body.hg-game-page :where(.site-head .locale, .mast > a:last-child, .world > header > a:last-child) {
  min-height: 37px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--hg-ink);
  background: var(--hg-surface);
  border: 2px solid var(--hg-ink);
  border-radius: 9px;
  box-shadow: 0 3px 0 var(--hg-ink);
  font-size: .76rem;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}

body.hg-game-page :where(.site-head .locale, .mast > a:last-child, .world > header > a:last-child):active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--hg-ink);
}

body.hg-game-page #intro {
  box-sizing: border-box;
  width: min(1180px, calc(100% - 28px));
  margin: 12px auto 30px;
  color: var(--hg-ink);
  background-color: var(--hg-paper);
  border: 4px solid var(--hg-ink);
  border-radius: var(--hg-radius-card);
  box-shadow: var(--hg-shadow-card);
  overflow: hidden;
}

body.hg-game-page #intro .hg-entry-copy {
  box-sizing: border-box;
  min-width: 0;
  padding: var(--hg-entry-copy-pad-block) var(--hg-entry-copy-pad-inline);
}

body.hg-game-page .hg-art-frame {
  position: relative;
  overflow: hidden;
  background: var(--hg-paper);
  border: 4px solid var(--hg-ink);
  border-radius: 16px;
  box-shadow: 7px 7px 0 rgba(7, 19, 35, .22);
  isolation: isolate;
}

body.hg-game-page .hg-art-frame > img {
  max-width: 100%;
}

body.hg-game-page #intro :where(h1, h2) {
  color: var(--hg-ink);
  font-family: inherit;
  font-weight: 950;
}

html:lang(ja) body.hg-game-page #intro :where(h1, h2) {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
  line-height: 1.08;
  letter-spacing: -.035em;
  text-transform: none;
  word-break: normal;
  overflow-wrap: anywhere;
}

body.hg-game-page #intro :where(.eyebrow, .tag) {
  color: var(--hg-japan);
  font-weight: 950;
  letter-spacing: .1em;
}

body.hg-game-page[data-track="global"] #intro :where(.eyebrow, .tag) {
  color: var(--hg-global);
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) {
  box-sizing: border-box;
  width: min(100%, 760px);
  max-width: 100%;
  min-width: 0;
  margin: var(--hg-space-3) auto;
  padding: var(--hg-info-pad-block) var(--hg-info-pad-inline);
  color: var(--hg-ink);
  background: var(--hg-surface);
  border: 1px solid var(--hg-line);
  border-left: 6px solid var(--hg-news);
  border-radius: 9px;
  box-shadow: none;
  cursor: default;
  font-size: .9rem;
  line-height: 1.6;
  text-align: left;
  overflow-wrap: anywhere;
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) > :first-child {
  margin-top: 0;
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) > :last-child {
  margin-bottom: 0;
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) > :where(b, strong) {
  display: block;
  font-size: .78rem;
  font-weight: 950;
  letter-spacing: .045em;
  line-height: 1.45;
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) > p {
  margin: var(--hg-space-1) 0 0;
  font-size: inherit;
  line-height: inherit;
}

body.hg-game-page #intro :where(.how, .mini-flow, .rule-diagram, .split-targets, .rule-rights) {
  max-width: 100%;
  min-width: 0;
  gap: var(--hg-space-2);
}

body.hg-game-page #intro :where(
  .how > *,
  .mini-flow > span,
  .rule > span,
  .rule-diagram > span,
  .split-targets > span,
  .rule-rights > span
) {
  box-sizing: border-box;
  min-width: 0;
  padding: var(--hg-tile-pad-block) var(--hg-tile-pad-inline);
  border-radius: 7px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  text-align: center;
}

html:lang(ja) body.hg-game-page #intro :where(
  h1, h2, h3, p, b, strong, span, small, button
) {
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", Meiryo, sans-serif;
}

html:lang(ja) body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) {
  font-size: .94rem;
  line-height: 1.7;
}

body.hg-game-page #intro :where(.rule-card, .rule-paper, .one-rule, .rule) {
  background: var(--hg-paper);
  border-left-color: var(--hg-global);
}

body.hg-game-page[data-track="japan-export"] #intro :where(.rule-card, .rule-paper, .one-rule, .rule) {
  border-left-color: var(--hg-japan);
}

body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule):hover {
  transform: none;
  box-shadow: none;
}

body.hg-game-page :where(#start, #replay) {
  box-sizing: border-box;
  min-height: 52px;
  padding: 12px 18px;
  color: var(--hg-ink);
  background: var(--hg-gold);
  border: 3px solid var(--hg-ink);
  border-radius: var(--hg-radius-control);
  box-shadow: var(--hg-shadow-control);
  font: inherit;
  font-weight: 950;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, filter .12s;
}

body.hg-game-page :where(#share, #reply) {
  box-sizing: border-box;
  min-height: 50px;
  padding: 11px 16px;
  color: var(--hg-ink);
  background: var(--hg-surface);
  border: 3px solid var(--hg-ink);
  border-radius: var(--hg-radius-control);
  box-shadow: 0 4px 0 var(--hg-ink);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, background .12s;
}

body.hg-game-page :where(#start, #replay, #share, #reply):active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--hg-ink);
}

body.hg-game-page :where(#start, #replay, #share, #reply):disabled {
  opacity: .5;
  filter: grayscale(.6);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

body.hg-game-page :where(button, a, [tabindex]):focus-visible {
  outline: 4px solid var(--hg-focus);
  outline-offset: 4px;
}

@media (max-width: 680px) {
  body.hg-game-page :where(.site-head, .mast, .world > header) {
    width: calc(100% - 12px);
    height: 52px;
    margin-top: 6px;
    padding: 0 9px;
    border-radius: 12px;
  }

  body.hg-game-page .site-head .track,
  body.hg-game-page .mast::after,
  body.hg-game-page .world > header::after {
    display: inline-flex;
    padding: 4px 6px;
    font-size: .6rem;
  }

  body.hg-game-page .site-head .brand,
  body.hg-game-page :where(.mast, .world > header) > a:first-child:not(:has(img))::after {
    font-size: .82rem;
  }

  body.hg-game-page .site-head .head-tools {
    gap: 5px;
  }

  body.hg-game-page .site-head .brand img,
  body.hg-game-page :where(.mast, .world > header) > a:first-child:not(:has(img))::before {
    width: 28px;
    height: 28px;
  }

  body.hg-game-page :where(.site-head .locale, .mast > a:last-child, .world > header > a:last-child) {
    min-height: 34px;
    padding: 5px 8px;
    font-size: .7rem;
  }

  body.hg-game-page #intro {
    width: calc(100% - 12px);
    margin: 7px auto 20px;
    border-width: 3px;
    border-radius: 22px;
    box-shadow: 0 7px 0 rgba(7, 19, 35, .14);
  }

  body.hg-game-page #intro .hg-entry-copy {
    padding: 16px;
  }

  body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) {
    margin-block: 10px;
    padding: 12px 14px;
    border-left-width: 5px;
    border-radius: 8px;
    font-size: .86rem;
  }

  html:lang(ja) body.hg-game-page #intro :where(.news-brief, .rule-card, .rule-paper, .one-rule, .rule) {
    font-size: .9rem;
  }

  body.hg-game-page #intro :where(
    .how > *,
    .mini-flow > span,
    .rule > span,
    .rule-diagram > span,
    .split-targets > span,
    .rule-rights > span
  ) {
    padding: 7px 8px;
  }

  body.hg-game-page :where(#start, #replay) {
    width: 100%;
    min-height: 50px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.hg-game-page :where(#start, #replay, #share, #reply, .site-head .locale, .mast > a:last-child, .world > header > a:last-child) {
    transition: none;
  }
}


/* Prevent mobile text-selection/callout UI during game input. */
body.hg-game-page :where(
  button,
  [role="button"],
  [data-game-control],
  #game,
  #game *,
  .game-area,
  .game-area *,
  .game-stage,
  .game-stage *,
  .game-controls,
  .game-controls *,
  .controls,
  .controls *
) {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

body.hg-game-page :where(button, [role="button"], [data-game-control]) {
  touch-action: manipulation;
}
