






.shell-bar {
  display: flex;
  align-items: center;
  gap: var(--step-6);
  height: 56px;
  padding: 0 var(--step-5);
  border-bottom: 1px solid var(--line-1);
  background: var(--surface-ground);
  color: var(--ink-1);
}
.shell-wordmark {
  display: inline-flex;
  align-items: center;
  min-height: var(--touch);
  color: inherit;
  text-decoration: none;
}

.brand-img { display: block; height: auto; max-width: none; }
.shell-wordmark .brand-img { width: 180px; flex: none; }
.shell-wordmark .shell-mark { display: none; width: 32px; }
.shell-nav { display: flex; align-items: stretch; align-self: stretch; gap: var(--step-2); min-width: 0; }
.shell-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--step-2);
  min-height: 44px;
  padding: 0 var(--step-3);
  color: var(--ink-2);
  font-size: var(--type-read);
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--motion-1) var(--ease-inout), transform var(--motion-1) var(--ease-standard);
}

.shell-tab::before { content: attr(data-glyph); display: none; font-size: 18px; line-height: 1; }

.shell-tab::after {
  content: "";
  position: absolute;
  left: var(--step-3);
  right: var(--step-3);
  bottom: -1px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
}
@media (hover: hover) { a.shell-tab:hover { color: var(--ink-1); } }
@media (hover: hover) { a.shell-tab:hover::after { background: var(--line-2); } }
a.shell-tab { transition: scale var(--motion-1) var(--ease-standard); }
a.shell-tab:active { scale: var(--tap); transition-duration: 0s; }
.shell-tab.is-current { color: var(--ink-1); }
.shell-tab-short { display: none; }
.shell-tab.is-current::after { background: var(--ink-1); }

.shell-more { border: 0; background: none; font: inherit; font-size: var(--type-read); font-weight: 500; cursor: pointer; }
@media (hover: hover) { .shell-more:hover { color: var(--ink-1); } }
@media (hover: hover) { .shell-more:hover::after { background: var(--line-2); } }
.shell-more.is-current::after { background: var(--ink-1); }
.shell-more[aria-expanded="true"] { color: var(--ink-1); }
.shell-more:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
@media (min-width: 1180px) {
  .shell-more { display: none; }
}
@media (max-width: 1179.98px) {
  .shell-tab.shell-tab-more { display: none; }
}

.shell-menu.shell-menu-more { left: var(--menu-left); right: auto; min-width: 220px; }
.shell-more-item {
  display: flex; align-items: center; gap: var(--step-3);
  min-height: var(--touch); padding: 0 var(--step-3);
  border-radius: var(--round-1);
  color: var(--ink-1); font-size: var(--type-read); text-decoration: none;
}
.shell-more-item::before { content: attr(data-glyph); width: 1.25rem; color: var(--ink-2); font-size: 18px; line-height: 1; text-align: center; }
.shell-more-item:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-in); }
@media (hover: hover) { .shell-more-item:hover { background: var(--surface-2); outline: none; } }
.shell-more-item.is-current { background: var(--surface-2); font-weight: 600; }
.shell-more-item.is-soon { color: var(--ink-3); cursor: default; }
@media (hover: hover) { .shell-more-item.is-soon:hover { background: none; } }
.shell-more-item .shell-soon { margin-left: auto; }

.shell-scrim { display: none; }

.shell-tab.is-soon { color: var(--ink-3); cursor: default; }
.shell-soon {
  padding: 1px 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--round-pill);
  font-size: var(--type-tag);
  text-transform: uppercase;
  letter-spacing: var(--track-caps);
}

.shell-badge {
  min-width: 18px;
  padding: 1px 6px;
  border-radius: var(--round-pill);
  background: var(--ink-1);
  color: var(--surface-ground);
  font-size: var(--type-tag);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.shell-tab:focus-visible, .shell-wordmark:focus-visible, .shell-chip:focus-visible {
  outline: var(--ring-w) solid var(--focus);
  outline-offset: var(--ring-off);
}
.shell-right { display: flex; align-items: center; gap: var(--step-3); margin-left: auto; }

.shell-friends {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-2);
  cursor: pointer;
}
.shell-friends[aria-expanded="true"] { background: var(--surface-2); color: var(--ink-1); }
@media (hover: hover) { .shell-friends:hover { background: var(--surface-2); color: var(--ink-1); } }
.shell-friends:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.shell-friends-icon { width: 22px; height: 22px; }
.shell-friends .shell-badge { position: absolute; top: -2px; right: -4px; }

.shell-lang { display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--step-3); border: 1px solid var(--line-2); border-radius: var(--round-pill); background: none; color: var(--ink-2); font: inherit; font-size: var(--type-label); white-space: nowrap; cursor: pointer; }
.shell-lang[aria-expanded="true"] { background: var(--surface-2); color: var(--ink-1); }
@media (hover: hover) { .shell-lang:hover { background: var(--surface-2); color: var(--ink-1); } }
.shell-lang:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.shell-lang-short { display: none; }
.shell-lang-row { display: none; }
.shell-menu-lang { right: var(--menu-right); }
.shell-menu-lang .ui-btn[aria-pressed="true"] { color: var(--ink-1); font-weight: 600; }
:root[data-input="touch"] .shell-lang { min-height: var(--touch); }

.shell-menu .ui-btn .shell-badge { margin-left: auto; }

.shell-search { display: inline-flex; align-items: center; gap: var(--step-2); min-height: 32px; padding: 0 var(--step-3); border: 1px solid var(--line-2); border-radius: var(--round-pill); color: var(--ink-1); font-size: var(--type-label); font-variant-numeric: tabular-nums; text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .shell-search:hover { background: var(--surface-2); } }
.shell-search:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.shell-search-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
:root[data-input="touch"] .shell-search { min-height: var(--touch); }


.shell-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 3px var(--surface-1); }
.shell-dot-up { background: var(--good); }
.shell-dot-down { background: var(--bad); }

.shell-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--step-2);
  min-height: var(--touch);
  padding: 0 var(--step-3) 0 6px;
  border: 1px solid var(--line-2);
  border-radius: var(--round-pill);
  background: var(--surface-1);
  color: var(--ink-1);
  font: inherit;
  cursor: pointer;
  transition: border-color var(--motion-1) var(--ease-inout), background-color var(--motion-1) var(--ease-inout), scale var(--motion-1) var(--ease-standard);
}
@media (hover: hover) { .shell-chip:hover { border-color: var(--ink-3); background: var(--surface-2); } }
.shell-chip:active { scale: var(--tap); transition-duration: 0s; }
.shell-chip[aria-expanded="true"] { border-color: var(--ink-2); }
.shell-chip-initial {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--you);
  color: var(--surface-ground);
  font-weight: 700;
}
.shell-chip-name { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }


.shell-desk-only { display: none; }


#shell {
  position: relative;
  z-index: 80;
}

#shell:has(.ui-sheet:not([hidden])) { z-index: var(--z-sheet); }

.shell-menu {
  position: fixed;
  
  top: calc(var(--shell-h) + var(--step-1));
  right: var(--step-4);
  z-index: var(--z-anchored);
  display: grid;
  gap: var(--step-1);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: var(--step-2);
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
  box-shadow: var(--win-shadow);
}
.shell-menu[hidden], .shell-menu .ui-btn[hidden] { display: none; }

.shell-menu-game { top: var(--menu-top); bottom: var(--menu-bottom); max-height: calc(100vh - 16px); overflow-y: auto; left: auto; right: var(--menu-right); min-width: 260px; }
.shell-none { display: none; }
.shell-menu > .ui-btn { justify-content: flex-start; }

.shell-menu > a.ui-btn { text-decoration: none; }

.shell-menu .ui-btn { height: var(--touch); }

.shell-presence { margin: 0; padding: var(--step-1) var(--step-2); font-size: var(--type-note); color: var(--ink-2); }
.shell-presence[hidden] { display: none; }

.shell-gameid { display: grid; justify-self: stretch; min-height: 24px; margin: 0; padding: var(--step-1) var(--step-2); border: 0; border-radius: var(--round-1); background: none; font-family: var(--mono); font-size: var(--type-note); line-height: 1.5; color: var(--ink-3); text-align: start; overflow-wrap: anywhere; cursor: copy; }
.shell-gameid > span { grid-area: 1 / 1; }
.shell-gameid-covered { visibility: hidden; }
@media (hover: hover) { .shell-gameid:hover { color: var(--ink-2); } }
.shell-gameid:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
.shell-gameid[hidden] { display: none; }
:root[data-input="touch"] .shell-gameid { min-height: var(--touch); }

.shell-field { display: grid; gap: var(--step-1); }
.shell-field-label { font-size: var(--type-label); color: var(--ink-2); }
.shell-input {
  min-height: var(--control-md);
  padding: 0 var(--step-2);
  border: 1px solid var(--line-2);
  border-radius: var(--round-1);
  background: var(--surface-well);
  color: var(--ink-1);
  font: inherit;
}
.shell-value { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.shell-range { width: 100%; min-height: 44px; accent-color: var(--ink-2); }
.shell-motion { display: flex; flex-wrap: wrap; align-items: center; gap: var(--step-2); }
.shell-motion .shell-field-label { flex-basis: 100%; }

.shell-help { flex-basis: 100%; margin: 0; font-size: var(--type-note); line-height: 1.45; color: var(--ink-2); }
.ui-btn[aria-pressed="true"] {
  border-color: var(--ink-2);
  background: var(--surface-2);
}

.ui-btn-primary[aria-pressed="true"] { color: var(--ink-1); }
@media (hover: hover) { .ui-btn-primary[aria-pressed="true"]:not(.is-blocked):hover { border-color: var(--ink-1); background: var(--surface-2); } }

.shell-slot { display: grid; gap: var(--step-2); }
.shell-slot-title {
  margin: 0;
  font-size: var(--type-tag);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-3);
}
.shell-slot-empty { margin: 0; color: var(--ink-3); font-size: var(--type-body); }


@media (max-width: 600px) {
  .shell-bar { height: 52px; gap: var(--step-3); padding: 0 var(--step-4); }
  .shell-wordmark .brand-horizontal { display: none; }
  .shell-wordmark .shell-mark { display: block; }
  .shell-chip-name { display: none; }
  .shell-chip { justify-content: center; min-width: var(--touch); padding: 0 6px; }
  .shell-lang-desk { display: none; }
  .shell-lang-row { display: flex; }
  .shell-lang .shell-lang-long { display: none; }
  .shell-lang .shell-lang-short { display: inline; }
  .shell-wordmark { justify-content: center; min-width: var(--touch); }
  .shell-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: 0;
    height: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    border-top: 1px solid var(--line-1);
    background: var(--surface-ground);
  }
  .shell-tab {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0;
    font-size: var(--type-label);
  }
  .shell-tab::before { display: block; }
  .shell-tab::after { top: -1px; bottom: auto; left: 28%; right: 28%; border-radius: 0 0 2px 2px; }
  .shell-tab .shell-tab-label { order: 0; }
  
  .shell-tab .shell-tab-long { display: none; }
  .shell-tab .shell-tab-short { display: inline; }
  .shell-soon { display: none; }
  body:has(.shell-bar) { padding-bottom: calc(var(--rail-h) + env(safe-area-inset-bottom, 0px)); }
  .shell-desk-only {
    display: grid;
    gap: var(--step-3);
    justify-items: start;
    padding: var(--step-7) var(--step-5);
  }
  .shell-desk-only-title { margin: 0; font: 700 var(--type-lead) / 1.15 var(--font-display); letter-spacing: var(--track-display); }
  .shell-desk-only-body { margin: 0; max-width: 34ch; font-size: var(--type-read); line-height: 1.5; color: var(--ink-2); }
  .shell-desk-only-home {
    display: inline-flex;
    align-items: center;
    min-height: var(--touch);
    padding: 0 var(--step-4);
    border: 1px solid var(--line-2);
    border-radius: var(--round-2);
    color: var(--ink-1);
    text-decoration: none;
  }
  .shell-desk-only-home:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }
  body:has(.shell-desk-only:not([hidden])) #app { display: none; }
}


:root[data-compact] .shell-bar { height: var(--touch); }
@media (min-width: 601px) {
  :root[data-compact] .shell-tab { min-height: var(--touch); }
  
  :root[data-compact] .shell-wordmark .brand-horizontal { width: 140px; }
}

@media (min-width: 601px) {
  :root[data-input="touch"] .shell-soon { font-size: var(--type-label); }
}

@media (min-width: 601px) and (max-width: 1023.98px) {
  .shell-bar { gap: var(--step-4); padding: 0 var(--step-4); }
  .shell-wordmark .brand-horizontal { display: none; }
  .shell-wordmark .shell-mark { display: block; }
  .shell-wordmark { justify-content: center; min-width: var(--touch); }
  .shell-chip-name { display: none; }
  .shell-chip { justify-content: center; min-width: var(--touch); padding: 0 6px; }
  .shell-nav { gap: 0; }
}

@media (min-width: 601px) and (max-width: 1023.98px) {
  :root[data-input="touch"] .shell-tab { min-height: var(--touch); }
}

:root[data-input="touch"] .shell-friends { width: var(--touch); height: var(--touch); }


@media (max-width: 600px) {
  .shell-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: var(--z-scrim); }
  .shell-menu, .shell-menu.shell-menu-game, .shell-menu.shell-menu-more {
    z-index: var(--z-sheet);
    top: auto; bottom: 0; left: 0; right: 0;
    min-width: 0; max-width: none; width: 100%; max-height: 80dvh; overflow-y: auto;
    box-sizing: border-box;
    padding: var(--step-3) var(--page-gutter) calc(var(--step-4) + env(safe-area-inset-bottom, 0px));
    border-width: 1px 0 0; border-radius: var(--round-2) var(--round-2) 0 0;
  }
  .shell-menu > .ui-btn, .shell-more-item { min-height: var(--touch); }
}
:root[data-compact] .shell-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: var(--z-scrim); }
:root[data-compact] :is(.shell-menu, .shell-menu.shell-menu-game, .shell-menu.shell-menu-more) {
  z-index: var(--z-sheet);
  top: auto; bottom: 0; left: 0; right: 0;
  min-width: 0; max-width: none; width: 100%; max-height: 85dvh; overflow-y: auto;
  box-sizing: border-box;
  padding: var(--step-2) var(--page-gutter) calc(var(--step-3) + env(safe-area-inset-bottom, 0px));
  border-width: 1px 0 0; border-radius: var(--round-2) var(--round-2) 0 0;
}






.shell-confirm-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-scrim);
  display: grid;
  place-items: center;
  padding: var(--step-4);
}
.shell-confirm-backdrop[hidden] { display: none; }
.shell-confirm {
  display: grid;
  gap: var(--step-3);
  width: min(400px, 100%);
  padding: var(--step-4);
  border: 1px solid var(--line-2);
  border-radius: var(--round-2);
  background: var(--surface-overlay);
  color: var(--ink-1);
  box-shadow: var(--win-shadow);
}
.shell-confirm-title { margin: 0; font-size: var(--type-head); }
.shell-confirm-said { margin: 0; font-size: var(--type-read); color: var(--ink-2); }

.shell-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--step-3);
}
.shell-confirm-actions .ui-btn { height: var(--touch); }

@media (max-width: 520px) {
  .shell-confirm-backdrop { place-items: end stretch; padding: var(--step-3); }
  .shell-confirm { width: 100%; }
  .shell-confirm-actions { flex-direction: column-reverse; }
  .shell-confirm-actions .ui-btn { width: 100%; justify-content: center; }
}






.site-footer {
  box-sizing: border-box;
  
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  justify-content: space-between;
  align-items: center;
  column-gap: var(--step-6);
  row-gap: var(--step-2);
  padding: var(--step-4) var(--step-5);
  border-top: 1px solid var(--line-1);
  background: var(--surface-ground);
  color: var(--ink-3);
  font-size: var(--type-label);
  line-height: 1.5;
}
.site-footer-brand { grid-column: 1; grid-row: 1 / span 2; display: inline-flex; align-items: center; min-height: var(--touch); line-height: 0; }
.site-footer-brand .brand-img { width: 120px; }


.site-footer-mission { grid-column: 2; grid-row: 1; margin: 0; text-align: center; font-size: var(--type-tag); line-height: 1.4; color: var(--ink-2); text-wrap: balance; }
.site-footer-fine { grid-column: 2; grid-row: 2; max-width: none; margin: 0; text-align: center; font-size: var(--type-tag); line-height: 1.4; text-wrap: balance; }
.site-footer-links { grid-column: 3; grid-row: 1 / span 2; display: flex; justify-self: end; gap: var(--step-4); }
.site-footer-links a { display: inline-flex; align-items: center; justify-content: center; min-width: var(--touch); min-height: var(--touch); color: var(--ink-2); text-underline-offset: 3px; }
@media (hover: hover) { .site-footer-links a:hover { color: var(--ink-1); } }
.site-footer-links a:focus-visible, .site-footer-brand:focus-visible { outline: var(--ring-w) solid var(--focus); outline-offset: var(--ring-off); }

body:has(.dm-dock) .site-footer { padding-right: 9rem; }

@media (min-width: 721px) and (max-width: 1499px) {
  .site-footer {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "brand mission links" "fine fine fine";
    row-gap: var(--step-1);
    padding-block: 6px;
  }
  .site-footer-brand { grid-area: brand; }
  .site-footer-links { grid-area: links; }
  .site-footer-mission { grid-area: mission; }
  .site-footer-fine { grid-area: fine; }
}
@media (max-width: 720px) {
  
  .site-footer { grid-template-columns: max-content minmax(0, 1fr); grid-template-areas: "brand mission" "fine fine" "links links"; justify-items: stretch; column-gap: var(--step-3); row-gap: var(--step-1); }
  .site-footer-brand { grid-area: brand; }
  .site-footer-brand .brand-img { width: 96px; }
  .site-footer-mission { grid-area: mission; text-align: start; line-height: 1.25; }
  .site-footer-fine { grid-area: fine; text-align: center; line-height: 1.25; }
  .site-footer-links { grid-area: links; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0 var(--step-2); justify-self: stretch; }
  .site-footer-links a { text-align: center; }
  body:has(.dm-dock) .site-footer { padding-right: var(--step-5); padding-bottom: calc(var(--step-4) + 44px + var(--step-3)); }
}
@media (max-width: 480px) {
  .site-footer { padding: var(--step-2) var(--step-4); }
}
@media (prefers-reduced-motion: reduce) {
  :root:not([data-motion="full"]) :is(.shell-menu, .shell-menu.shell-menu-game, .shell-menu.shell-menu-more) { animation: none; }
  :root:not([data-motion="full"]) :is(.shell-tab, .shell-chip) { transition: none; }
}
:root[data-motion="reduce"] :is(.shell-menu, .shell-menu.shell-menu-game, .shell-menu.shell-menu-more) { animation: none; }
:root[data-motion="reduce"] :is(.shell-tab, .shell-chip) { transition: none; }


.shell-yields { display: flex; flex-direction: column; gap: var(--step-1); }
.shell-yield { display: flex; align-items: center; justify-content: space-between; gap: var(--step-2); }
.shell-yield-word { min-width: 0; overflow-wrap: anywhere; font-size: 12px; color: var(--ink-1); }


.screen-seam {
  position: fixed;
  left: 0;
  width: 100%;
  height: 2px;
  z-index: 46;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--rift-light) 30%, var(--rift-light) 70%, transparent);
  box-shadow: 0 0 12px var(--rift-glow);
  transform-origin: 50% 50%;
}
