.nav {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: var(--layer-nav);
  display: flex;
  gap: 3px;
  padding: 5px;
  border-radius: 30px;
}
/* altura que as barras fixas de baixo ocupam: a navegação, e o botão de trocar de subtela onde ele existe. Toda área que rola termina acima dela */
.app {
  --bottom-bars: calc(76px + var(--sab));
}
.app[data-place="shop"],
.app[data-place="inventory"],
.app[data-place="arcade"],
.app[data-place="bets"] {
  --bottom-bars: calc(128px + var(--sab));
}
.nav button {
  font-size: 0 !important;
  padding: 9px 9px !important;
}
.app.petting .nav {
  background: rgba(255, 255, 255, 0.4) !important;
}
.nav button {
  position: relative;
  border: 0;
  background: transparent;
  border-radius: 24px;
  padding: 8px 18px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-weight: 900;
  font-size: 11.5px;
  color: rgba(242, 233, 238, 0.6);
  transition: background 0.25s;
}
.nav button svg {
  width: 28px;
  height: 28px;
}
.nav button::after {
  content: "";
  position: absolute;
  inset: -6px -1.5px;
}
.nav button:first-child::after {
  left: -8px;
}
.nav button:last-child::after {
  right: -8px;
}
.nav button:active,
.seg button:active,
.chip:active,
.close:active,
.iconbtn:active {
  transform: scale(0.92);
  filter: brightness(1.3);
}
.nav button.on {
  background: var(--place-mark);
  color: var(--place-mark-ink);
}
.scr.page {
  display: block;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--place-surface);
  border-top: var(--hud-top) solid var(--place-surface);
  border-bottom: var(--bottom-bars) solid var(--place-surface);
  padding: 12px 16px 16px;
}
#s-shop,
#s-inventory {
  padding-bottom: 16px;
}
#subscreen_toggle {
  color: #ffd23f;
}
.nav .dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--surf);
}
.alert-low::before,
.alert-critical::before {
  content: "";
  display: inline-block;
  width: 13px;
  height: 13px;
  margin-right: 4px;
  vertical-align: -2px;
  background: #f5b400;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2 23 21H1zM10.8 9h2.4v6h-2.4zM10.8 16.6h2.4V19h-2.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2 23 21H1zM10.8 9h2.4v6h-2.4zM10.8 16.6h2.4V19h-2.4z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.alert-critical::before {
  background: #ff2a44;
  animation: alert-critical-blink 1s ease-in-out infinite;
}
@keyframes alert-critical-blink {
  50% {
    opacity: 0.35;
  }
}
.toast {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(14px + env(safe-area-inset-top, 0px));
  background: #000;
  border: 1px solid var(--accent);
  color: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  transform: translateY(-12px);
  transition: 0.25s;
  pointer-events: none;
  z-index: var(--layer-toast);
}
.toast.show {
  opacity: 1;
  transform: none;
}
.btn {
  position: relative;
  border: 0;
  border-radius: 16px;
  padding: 13px 18px;
  font-weight: 900;
  font-size: 15px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 var(--ui-drop) 0 var(--accent-d);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--accent-d);
}
.btn::after {
  content: "";
  position: absolute;
  inset: -3.5px 0;
}
.btn.sec {
  background: var(--surf2);
  color: var(--ink);
  box-shadow: 0 4px 0 #000;
  border: 1px solid var(--line);
}
.btn.dark {
  background: #000;
  box-shadow: 0 4px 0 #000;
  border: 1px solid var(--line);
}
.btn.money {
  background: #17834a;
  box-shadow: 0 4px 0 #0e5a32;
}
.btn.sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 12px;
}
.btn.sm::after {
  inset: -10px -4px;
}
.topbar .btn.sm::after {
  inset: -5px -4px;
}
.btn.w {
  width: 100%;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.sheet {
  position: absolute;
  inset: 0;
  z-index: var(--layer-sheet);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: rgba(0, 0, 0, calc(0.65 * var(--sheet-backdrop-strength, 1)));
}
.sheet-handle {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 23px;
  margin-bottom: -1px;
  background: var(--soft);
  border-radius: 28px 28px 0 0;
  touch-action: none;
  cursor: grab;
  animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet-handle::before {
  content: "";
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--ink2);
  opacity: 0.55;
}
.sheet .in {
  flex: 0 1 auto;
  width: 100%;
  min-height: 0;
  max-height: calc(92% - 22px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--soft);
  padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet.full .sheet-handle {
  display: none;
}
.sheet.full .in {
  max-height: 100%;
  height: 100%;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.sheet.dragging .sheet-handle {
  cursor: grabbing;
}
.sheet.settling {
  transition: background 0.2s ease-out;
}
.sheet.settling .sheet-handle,
.sheet.settling .in {
  transition: transform 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes up {
  from {
    transform: translateY(40px);
    opacity: 0.5;
  }
  to {
    transform: none;
    opacity: 1;
  }
}
.shead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
h2 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 22px;
  line-height: 1.1;
  margin: 0;
  text-wrap: balance;
}
h3 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: 17px;
  margin: 16px 0 8px;
}
.muted {
  color: var(--ink2);
  font-size: 13.5px;
  line-height: 1.45;
}
.close {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 0;
  background: var(--surf2);
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
.close svg {
  width: 18px;
  height: 18px;
}
.card {
  --ink: var(--place-panel-ink);
  --ink2: var(--place-panel-ink2);
  background: var(--place-panel);
  color: var(--ink);
  border-radius: var(--ui-radius-card);
  padding: 14px;
  border: var(--ui-border) solid var(--place-line);
}
.seg {
  display: flex;
  background: var(--surf);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  position: relative;
  flex: 1;
  border: 0;
  background: transparent;
  border-radius: 11px;
  padding: 8px 4px;
  font-weight: 900;
  font-size: 13px;
  color: var(--ink2);
}
.seg button.on {
  background: var(--place-mark);
  color: var(--place-mark-ink);
}
.seg button::after {
  content: "";
  position: absolute;
  inset: -9px -1px;
}
.chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0 6px;
  scrollbar-width: none;
}
.chip {
  position: relative;
  flex: none;
  border: 1px solid var(--line);
  background: var(--surf);
  border-radius: 99px;
  padding: 7px 12px;
  font-weight: 900;
  font-size: 12.5px;
}
.chip.on {
  background: var(--place-mark);
  color: var(--place-mark-ink);
  border-color: var(--place-mark);
}
.chips .chip::after {
  content: "";
  position: absolute;
  inset: -10px -4px;
}
.app[data-place="shop"],
.sheet[data-place="shop"] {
  --place-panel: #fff4d6;
  --place-panel-ink: #231b33;
  --place-panel-ink2: #6b5f78;
  --place-line: #d9c48a;
  --place-line-shade: #a8935a;
  --place-mark: #f5c030;
  --place-mark-shade: #b07c00;
  --place-mark-ink: #231b33;
}
.app[data-place="inventory"] {
  --place-panel: #e3cfa6;
  --place-panel-ink: #2b2233;
  --place-panel-ink2: #66574a;
  --place-line: #b89b68;
  --place-line-shade: #8a7146;
  --place-mark: #2d8cff;
  --place-mark-shade: #1559b5;
  --place-mark-ink: #fff;
}
.app[data-place="arcade"] {
  --place-surface: #141033;
  --place-panel: #241b5c;
  --place-line: var(--ui-edge);
  --place-line-shade: var(--ui-edge);
  --place-mark: #2d8cff;
  --place-mark-shade: #1559b5;
  --place-mark-ink: #fff;
}
.app[data-place="bets"] {
  --place-surface: #0b2a20;
  --place-panel: #124a36;
  --place-line: var(--ui-edge);
  --place-line-shade: var(--ui-edge);
  --place-mark: #f5c030;
  --place-mark-shade: #b07c00;
  --place-mark-ink: #231b33;
}
.app[data-place="friends"] {
  --place-mark: #ff2e6d;
  --place-mark-shade: #b81d4c;
  --place-mark-ink: #fff;
}
.sheet,
#game,
.onb {
  --place-surface: var(--soft);
  --place-panel: var(--surf);
  --place-panel-ink: var(--ink);
  --place-panel-ink2: var(--ink2);
  --place-line: var(--line);
  --place-line-shade: var(--ui-edge);
  --place-mark: #f2e9ee;
  --place-mark-shade: #a596b4;
  --place-mark-ink: #231b33;
}
.sheet[data-place="paper"] {
  --soft: var(--paper);
  --surf: #e6dcc2;
  --surf2: #efe7cf;
  --ink: var(--paper-ink);
  --ink2: #5c5466;
  --line: var(--paper-rule);
  --place-mark: var(--paper-stamp);
  --place-mark-ink: #fff;
  color: var(--ink);
}
.sheet[data-place="paper"] h2,
.sheet[data-place="paper"] h3 {
  font-family: var(--f-typewriter);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sheet[data-place="paper"] h3 {
  border-bottom: var(--ui-border) solid var(--paper-rule);
  padding-bottom: 4px;
}
.sheet[data-place="paper"] .btn.sec {
  border: var(--ui-border) solid var(--paper-ink);
  box-shadow: 0 var(--ui-drop) 0 var(--paper-ink);
}
.sheet[data-place="paper"] .close {
  border: var(--ui-border) solid var(--paper-ink);
  box-shadow: none;
  color: var(--paper-ink);
}
[data-rank-tier="enlisted"] {
  --rank-color: #d39a5c;
  --rank-color-deep: #6b3f17;
}
[data-rank-tier="officer"] {
  --rank-color: #d9dee8;
  --rank-color-deep: #4a5263;
}
[data-rank-tier="high_command"] {
  --rank-color: #f5c030;
  --rank-color-deep: #7a5600;
}
.rank-insignia {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rank-color);
}
.rank-insignia svg {
  display: block;
  width: 100%;
  height: 100%;
}
.rank-frame {
  position: relative;
  box-shadow: 0 0 0 2px var(--rank-color);
}
.rank-badge {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 18px;
  height: 18px;
  padding: 2px;
  box-sizing: border-box;
  border-radius: 50%;
  background: #15121b;
  border: 1.5px solid var(--rank-color);
  pointer-events: none;
}
