/* Scoped game-sharing sheet. Geometry stays fixed on hover/focus. */
.hshare-dialog {
  --hshare-bg: #111b24;
  --hshare-fg: #f3f2eb;
  --hshare-muted: #bcc8ce;
  --hshare-line: #435561;
  --hshare-accent: #dbea99;
  box-sizing: border-box;
  width: min(960px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 28px;
  border: 1px solid var(--hshare-line);
  border-radius: 22px;
  background: var(--hshare-bg);
  color: var(--hshare-fg);
  font:
    400 16px/1.5 system-ui,
    sans-serif;
  overflow: auto;
  overscroll-behavior: contain;
  text-align: start;
  color-scheme: dark;
  box-shadow: 0 24px 80px #0007;
}
.hshare-dialog[open] {
  animation: hshare-in 0.18s ease-out;
}
.hshare-dialog::backdrop {
  background: #071017c9;
  backdrop-filter: blur(8px);
}
.hshare-dialog * {
  box-sizing: border-box;
}
.hshare-dialog [hidden] {
  display: none !important;
}
.hshare-dialog .hshare-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--hshare-bg);
  padding-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--hshare-line);
}
.hshare-dialog .hshare-product {
  margin: 0 0 6px;
  color: var(--hshare-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}
.hshare-dialog h2 {
  margin: 0;
  font:
    650 28px/1.25 system-ui,
    sans-serif;
  letter-spacing: -0.025em;
  color: var(--hshare-fg);
}
.hshare-dialog .hshare-body {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 32px;
  align-items: start;
}
.hshare-dialog .hshare-body:has(.hshare-art[hidden]) {
  grid-template-columns: minmax(0, 1fr);
}
.hshare-dialog .hshare-art,
.hshare-dialog .hshare-tools {
  min-width: 0;
}
.hshare-dialog canvas {
  display: block;
  width: 100%;
  height: auto;
  max-height: 49dvh;
  object-fit: contain;
  margin: 16px auto 0;
  border: 1px solid var(--hshare-line);
  border-radius: 12px;
  background: #09131c;
}
.hshare-dialog canvas[aria-busy="true"] {
  opacity: 0.55;
  transition: opacity 0.16s ease;
}
.hshare-dialog .hshare-note,
.hshare-dialog .hshare-guide,
.hshare-dialog .hshare-file-hint {
  margin: 16px 0;
  color: var(--hshare-muted);
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.hshare-dialog .hshare-note:empty {
  display: none;
}
.hshare-dialog .hshare-channels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.hshare-dialog .hshare-actions,
.hshare-dialog .hshare-formats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.hshare-dialog :is(button, a[data-channel]) {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
  min-height: 48px;
  height: auto;
  padding: 13px 16px;
  margin: 0;
  border: 1px solid var(--hshare-line);
  border-radius: 10px;
  background: transparent;
  color: var(--hshare-fg);
  font:
    600 14px/1.45 system-ui,
    sans-serif;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  box-shadow: none;
  transform: none;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease,
    color 0.16s ease;
  touch-action: manipulation;
}
.hshare-dialog .hshare-channels :is(button, a) {
  flex-direction: column;
  gap: 10px;
  min-height: 94px;
  padding: 16px 12px;
  background: #ffffff03;
}
.hshare-dialog .hshare-channel-icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 1px solid var(--hshare-line);
  border-radius: 9px;
  font:
    500 21px/1 system-ui,
    sans-serif;
}
.hshare-dialog :is(button, a[data-channel]):hover {
  background: #ffffff0a;
  border-color: var(--hshare-accent);
  color: var(--hshare-accent);
  transform: none;
}
.hshare-dialog :is(button, a[data-channel]):focus-visible,
.hshare-dialog :is(input, textarea):focus-visible {
  outline: 2px solid var(--hshare-accent);
  outline-offset: 4px;
  box-shadow: none;
}
.hshare-dialog button:disabled {
  opacity: 0.45;
  cursor: wait;
  transform: none;
}
.hshare-dialog .hshare-close {
  flex: none;
  min-width: 44px;
  width: 44px;
  min-height: 44px;
  padding: 6px;
  font-size: 26px;
  line-height: 1;
  border-radius: 50%;
}
.hshare-dialog button[aria-pressed="true"] {
  background: var(--hshare-accent);
  border-color: var(--hshare-accent);
  color: var(--hshare-bg);
}
.hshare-dialog .hshare-field {
  display: grid;
  gap: 8px;
  margin: 20px 0 0;
  color: var(--hshare-muted);
  font-size: 13px;
  font-weight: 500;
}
.hshare-dialog :is(input, textarea) {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--hshare-line);
  border-radius: 9px;
  background: #0002;
  color: var(--hshare-fg);
  font:
    400 16px/1.5 system-ui,
    sans-serif;
  text-align: start;
  letter-spacing: normal;
  box-shadow: none;
  resize: vertical;
  user-select: text;
  -webkit-user-select: text;
}
.hshare-dialog .hshare-status {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--hshare-accent);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.hshare-dialog .hshare-official {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hshare-line);
}
.hshare-dialog .hshare-official a {
  padding: 10px;
  color: var(--hshare-muted);
}
@keyframes hshare-in {
  from {
    opacity: 0;
    translate: 0 8px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}
@media (max-width: 640px) {
  .hshare-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100dvh - 20px);
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 18px;
  }
  .hshare-dialog .hshare-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .hshare-dialog .hshare-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--hshare-bg);
    padding-top: 8px;
    margin-bottom: 20px;
    padding-bottom: 18px;
  }
  .hshare-dialog canvas {
    max-height: 31dvh;
  }
  .hshare-dialog .hshare-channels {
    gap: 10px;
  }
  .hshare-dialog .hshare-channels :is(button, a) {
    min-height: 84px;
    padding: 12px 6px;
    font-size: 13px;
  }
  .hshare-dialog .hshare-formats {
    gap: 10px;
  }
}
@media (max-width: 359px) {
  .hshare-dialog .hshare-channels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hshare-dialog .hshare-channel-icon {
    display: none;
  }
  .hshare-dialog .hshare-channels :is(button, a) {
    min-height: 50px;
    flex-direction: row;
  }
}
@media (max-height: 600px) and (min-width: 641px) {
  .hshare-dialog {
    padding: 20px;
  }
  .hshare-dialog canvas {
    max-height: 50dvh;
  }
  .hshare-dialog .hshare-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--hshare-bg);
    padding-top: 8px;
    margin-bottom: 18px;
    padding-bottom: 14px;
  }
  .hshare-dialog .hshare-body {
    gap: 24px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .hshare-dialog[open] {
    animation: none;
  }
  .hshare-dialog * {
    transition: none !important;
  }
}
