/* Tatami Plus shared header contract v1.3.2. All selectors are limited to the site header/drawer. */
body > header {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(4px, .8vw, 12px);
  padding-inline: clamp(8px, 1.5vw, 20px);
  animation: none !important;
}
body > header > .logo {
  flex: 0 0 auto;
  min-width: max-content;
  line-height: 1.25;
}
body > header > nav#nv {
  display: flex;
  flex: 1 1 0%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--tp-color-border-strong) transparent;
}
body > header > nav#nv > a {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-items: center;
  min-height: 44px;
}
body > header > nav#nv::-webkit-scrollbar { height: 4px; }
body > header > nav#nv::-webkit-scrollbar-thumb {
  background: var(--tp-color-border-strong);
  border-radius: 999px;
}
body > header > .hb {
  display: flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: clamp(2px, .45vw, 7px);
  margin-inline-start: auto;
}
body > header > .hb > .ib {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding-inline: .55rem;
}
body > header > .hb > .tp-header-register { min-width: auto; }
body > header #hbu {
  min-width: 44px;
  max-width: 10rem;
}
body > header #hbu .hb-t {
  display: block;
  min-width: 0;
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
body > header #hgem,
body > header #hcart { min-width: 44px; position: relative; }
body > header #hgem[hidden] { display: none !important; }
body > header .mnb {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
body > header .tp-cart-header-count:empty { display: none !important; }
body > header .tp-cart-header-count:not(:empty) {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  padding-inline: .25rem;
  border-radius: 999px;
  background: var(--tp-color-brand);
  color: var(--tp-color-text-on-brand);
  font-size: var(--tp-font-size-xs);
  font-weight: var(--tp-font-weight-bold);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
/* Desktop: every destination stays reachable; the navigation scrolls instead of dropping links. */
@media (min-width: 1024px) {
  body > header > nav#nv { display: flex !important; }
  body > header .mnb-l { display: none; }
  body > header .mnb-m { display: inline; }
  body > header .mnb {
    color: var(--tp-color-text-primary) !important;
    border-color: var(--tp-color-border) !important;
  }
}
/* Tablet and mobile: the same destinations move into the drawer and header actions become compact. */
@media (max-width: 1023px) {
  body > header { min-height: 56px; }
  body > header > nav#nv { display: none !important; }
  body > header .hb-t {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  body > header .tp-header-register { display: none !important; }
  body > header #hbu {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-inline: 0;
  }
  body > header .tp-gem-header-value,
  body > header .tp-gem-demo { display: none !important; }
  body > header .mnb-l { display: inline; }
  body > header #hcart .tp-cart-header-count:not(:empty) {
    position: absolute;
    top: 1px;
    inset-inline-end: 1px;
    min-width: 1.1rem;
    height: 1.1rem;
    padding-inline: .18rem;
    font-size: .68rem;
  }
}
@media (min-width: 1024px) and (max-width: 1365px) {
  body > header .hb-t {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
  }
  body > header .tp-header-register { display: none !important; }
  body > header .tp-gem-header-value,
  body > header .tp-gem-demo { display: none !important; }
  body > header #hbu {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    padding-inline: 0;
  }
}
@media (max-width: 600px) {
  body > header {
    min-height: 54px;
    gap: 4px;
    padding-inline: 8px;
  }
  body > header > .logo { font-size: clamp(1rem, 4.2vw, 1.125rem); }
  body > header > .hb { gap: 3px; }
}
@media (max-width: 380px) {
  body > header { gap: 2px; padding-inline: 6px; }
  body > header > .logo { font-size: 1rem; }
  body > header > .hb { gap: 2px; }
  body > header #hgem .tp-gem-header-value { display: none !important; }
  body > header #mnb .mnb-l,
  body > header #mnb .mnb-m { display: none !important; }
  body > header .ib { padding-inline: 0; }
}
/* Native-dialog fallback. The game page never loads this stylesheet. */
.tp-drawer.tp-drawer-fallback[open] {
  display: flex !important;
  flex-direction: column;
  z-index: 9999;
  box-shadow: 0 0 0 100vmax var(--tp-color-scrim), var(--tp-shadow-popover);
}
html.tp-drawer-fallback-open,
html.tp-drawer-fallback-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
  body > header > nav#nv { scroll-behavior: auto; }
}
