/* Shared by the portal and standalone game pages. */
dialog.ip-sheet {
  --ip-accent: #bcee62;
  --ip-text: #f3f5f4;
  --ip-muted: #b0bac0;
  --ip-panel: #191d22;
  color-scheme: dark;
  position: fixed;
  /* The layout viewport can extend beyond the screen on a wide game or portal. */
  inset: auto;
  left: 50vw;
  top: 50vh;
  top: 50dvh;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(426px, calc(100vw - 24px));
  max-width: none;
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  height: auto;
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding: 12px;
  box-sizing: border-box;
  border: 1px solid #454e50;
  border-radius: 16px;
  box-shadow: 0 20px 90px #000a;
  background: var(--ip-panel);
  color: var(--ip-text);
  font: 500 15px/1.45 Inter, "Segoe UI", Arial, sans-serif;
  text-align: left;
  letter-spacing: normal;
  user-select: text;
  touch-action: auto;
}
.ip-sheet::backdrop { background: rgb(6 9 13 / .76); backdrop-filter: blur(4px); }
.ip-sheet *, .ip-sheet *::before, .ip-sheet *::after { box-sizing: border-box; }
.ip-sheet .ip-mast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 6px 10px 6px clamp(18px, 5vw, 28px);
  border-bottom: 1px solid #3b463b;
  background: linear-gradient(90deg, #222b27, #1b2625b3 60%, #151c2099) right center / 192px 100% no-repeat,
              url("art/circuit-link.webp") right 48% / 192px auto no-repeat #222b27;
}
.ip-sheet .ip-brand {
  width: 86px;
  height: 24px;
  background: var(--ip-accent);
  mask: url("identity/brat.svg") left center / contain no-repeat;
}
.ip-sheet .ip-content { padding: clamp(19px, 4.8vw, 28px); }
.ip-sheet #ip-title {
  margin: 0 0 8px;
  color: var(--ip-text);
  font: 730 clamp(25px, 5.8vw, 32px)/1.12 Inter, "Segoe UI", Arial, sans-serif;
  text-transform: none;
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.ip-sheet .ip-copy { margin: 0 0 20px; color: var(--ip-muted); font: inherit; }
.ip-sheet button {
  width: auto;
  min-width: 0;
  min-height: 44px;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: none;
  cursor: pointer;
  color: var(--ip-text);
  background: transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: normal;
  text-transform: none;
  touch-action: manipulation;
}
.ip-sheet .ip-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #e1e7e4;
  background: #151b1ee0;
  border-color: #43504b;
  font: 400 26px/1 Arial, sans-serif;
}
.ip-sheet .ip-form, .ip-sheet .ip-profile-actions, .ip-sheet .ip-code-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin: 0;
}
.ip-sheet .ip-form label, .ip-sheet .ip-code-label { color: #e0e5e6; font: 620 14px/1.35 Inter, "Segoe UI", Arial, sans-serif; }
.ip-sheet .ip-form label, .ip-sheet .ip-field { display: grid; gap: 6px; }
.ip-sheet .ip-form input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  height: 46px;
  padding: 9px 12px;
  border: 1px solid #495158;
  border-radius: 8px;
  background: #101419;
  color: var(--ip-text);
  font: 500 16px/1.35 Inter, "Segoe UI", Arial, sans-serif;
  appearance: none;
  user-select: text;
}
.ip-sheet .ip-password { position: relative; }
.ip-sheet .ip-form .ip-password input { padding-right: 93px; }
.ip-sheet .ip-peek {
  position: absolute;
  inset: 1px 1px 1px auto;
  width: 84px;
  padding: 0 6px;
  border-radius: 0 7px 7px 0;
  color: #cfdfa9;
  font-size: 13px;
}
.ip-sheet .ip-peek::before { position: absolute; inset: 11px auto 11px 0; width: 1px; background: #3e4749; content: ""; }
.ip-sheet .ip-peek[aria-pressed="true"] { background: #252e23; }
.ip-sheet .ip-form .ip-check { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.ip-sheet .ip-check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--ip-accent); appearance: auto; }
.ip-sheet .ip-hint, .ip-sheet .ip-error, .ip-sheet .ip-status { margin: 0; font: 500 14px/1.4 Inter, "Segoe UI", Arial, sans-serif; }
.ip-sheet .ip-hint { color: var(--ip-muted); font-size: 13px; }
.ip-sheet .ip-error, .ip-sheet .ip-status { padding: 9px 12px; border-radius: 6px; }
.ip-sheet .ip-error { color: #ffbfaa; background: #362922; border-left: 3px solid #e1a18c; }
.ip-sheet .ip-status { color: #d7efb3; background: #273222; border-left: 3px solid #8eb55e; }
.ip-sheet .ip-content > .ip-status { margin-bottom: 14px; }
.ip-sheet .ip-profile-actions + .ip-error { margin-top: 12px; }
.ip-sheet :is(.ip-status,.ip-error):empty { display: none; }
.ip-sheet .ip-primary, .ip-sheet .ip-secondary {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 16px;
  font-weight: 700;
}
.ip-sheet .ip-primary { background: var(--ip-accent); color: #16200d; }
.ip-sheet .ip-secondary { color: var(--ip-text); border-color: #46504f; background: #252c2f; }
.ip-sheet .ip-profile-actions .ip-secondary { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-align: left; }
.ip-sheet .ip-profile-actions .ip-secondary::after { content: ""; width: 8px; height: 8px; flex: none; margin-right: 3px; border: solid #b7c5b0; border-width: 2px 2px 0 0; transform: rotate(45deg); }
.ip-sheet .ip-forgot { justify-self: end; margin-block: -6px; padding-inline: 5px; color: #d6e9b3; font-size: 14px; }
.ip-sheet .ip-switch { display: block; width: 100%; margin-top: 10px; color: #d3dccf; font-size: 14px; }
.ip-sheet .ip-code-label { display: block; margin-bottom: 6px; }
.ip-sheet .ip-destination {
  width: fit-content; max-width: 100%; margin: -8px 0 16px; padding: 5px 10px;
  border: 1px solid #405049; border-radius: 6px; color: #d9eadc;
  font-size: 14px; overflow-wrap: anywhere;
}
.ip-sheet .ip-form input.ip-otp {
  height: 54px; font-family: ui-monospace, Consolas, monospace; font-size: 23px;
  font-weight: 650; letter-spacing: .21em; font-variant-numeric: tabular-nums;
}
.ip-sheet .ip-mail {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin: 0 0 14px; border: 1px solid #435044; border-radius: 10px;
  background: #202823;
}
.ip-sheet .ip-mail > div { display: grid; gap: 2px; min-width: 0; }
.ip-sheet .ip-mail span { color: #c7d5c9; font-size: 13px; }
.ip-sheet .ip-mail-address { color: #f4f7f4; font-size: 15px; overflow-wrap: anywhere; }
.ip-sheet .ip-mail button { width: auto; min-height: 40px; padding: 7px 10px; font-size: 14px; }
.ip-sheet .ip-issued {
  display: block;
  width: 100%;
  padding: 12px max(6px, calc((100% - 24ch) / 2));
  margin: 0 0 14px;
  border: 1px dashed #728858;
  border-radius: 8px;
  background: #131a17;
  color: #e0f8be;
  resize: none;
  font: 600 clamp(16px, 4.5vw, 19px)/1.55 Consolas, ui-monospace, monospace;
  text-align: center;
  letter-spacing: .025em;
  user-select: all;
}
.ip-sheet :is(input, textarea, button):focus-visible { outline: 2px solid var(--ip-accent); outline-offset: 2px; }
.ip-sheet button:disabled { opacity: .62; cursor: wait; }
@media (hover: hover) {
  .ip-sheet .ip-primary:hover:enabled { background: #cefb80; }
  .ip-sheet :is(.ip-secondary,.ip-close):hover:enabled { background: #323c39; border-color: #6e7d6c; }
  .ip-sheet :is(.ip-peek,.ip-forgot,.ip-switch):hover:enabled { color: #e1f7ba; background: #2a322a; }
}
@media (max-height: 620px) {
  .ip-sheet .ip-mast { min-height: 50px; padding-block: 3px; }
  .ip-sheet .ip-content { padding-block: 16px; }
  .ip-sheet .ip-copy { margin-bottom: 13px; }
  .ip-sheet .ip-form { gap: 9px; }
}
.ip-notice { position: fixed; z-index: 90; inset: auto auto max(12px, env(safe-area-inset-bottom)) 50%; translate: -50% 0; width: max-content; max-width: min(395px, calc(100vw - 24px)); box-sizing: border-box; padding: 9px 13px; color: #f1f4ef; background: #202825f5; border: 1px solid #536455; border-radius: 9px; font: 500 13px/1.4 "Segoe UI", Arial, sans-serif; text-align: center; pointer-events: none; }
.ip-notice[hidden] { display: none; }
.ip-boot { position: absolute; z-index: 99; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); box-sizing: border-box; padding: 7px 13px; border: 1px solid #52624f; border-radius: 20px; background: #17201bf5; color: #eef6e8; font: 600 13px/1.4 "Segoe UI", Arial, sans-serif; white-space: nowrap; pointer-events: none; }
[data-game-screen]:has(dialog[open]) > .ip-boot { display: none; }
