/* Attrak game shell: the ONE menu every game shows (start card, Esc / pause card, floating Menu button) and the
 * brand skin for the shared dialogs (settings, log in) inside games. Everything is built by shared/menu.js.
 *
 * Look = the platform identity described in the README for the landing: night ink, one hot yellow (the action),
 * one cyan (interface lines), angular panels cut with clip-path, Chakra Petch display type, no text gradients,
 * no frosted glass, no emoji. The only per-game touch is --am-hue (a thin accent bar + the eyebrow square).
 *
 * All colours live in the --am-* block below so the whole shell can be re-pointed in one place if the landing's
 * identity moves. Nothing here uses a game class (.card, .btn, .row, ...): the games define those differently. */

@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/chakra-petch-vietnamese-500-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/chakra-petch-thai-500-normal.woff2) format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url(/fonts/chakra-petch-latin-500-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/chakra-petch-vietnamese-700-normal.woff2) format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/chakra-petch-thai-700-normal.woff2) format('woff2');
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: 'Chakra Petch';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(/fonts/chakra-petch-latin-700-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --am-ink: #070a15;
  --am-panel: #0e1430;
  --am-field: rgba(255, 255, 255, 0.06);
  --am-edge: rgba(130, 165, 255, 0.3);
  --am-line: rgba(150, 180, 255, 0.16);
  --am-text: #f1f4ff;
  --am-muted: #9aa5c9;
  --am-accent: #ffd043; /* yuzu: the one action colour */
  --am-accent-hi: #ffdd6e;
  --am-accent-ink: #0a0d1c;
  --am-cyan: #35d6ee; /* interface lines, focus */
  --am-hot: #ff6b7a;
  --am-good: #48e3a2;
  --am-hue: 265; /* the game's own hue, set by menu.js from the game's declaration */
  --am-display: 'Chakra Petch', var(--font, system-ui, sans-serif);
  --am-font: var(--font, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif);
  --am-track: 0.14em;
}
/* wide tracking and capitals are a Latin habit; CJK and Thai get a light touch, Vietnamese keeps its case */
:lang(ja),
:lang(ko),
:lang(zh-CN),
:lang(zh-TW),
:lang(th) {
  --am-track: 0.04em;
}

/* ---------------------------------------------------------------------------------------------- overlays */
.am-root,
.am-pause {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: auto;
  overscroll-behavior: contain;
  font-family: var(--am-font);
  color: var(--am-text);
  line-height: 1.35;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: auto; /* a game may keep its screens inside a pointer-events:none layer */
  background:
    radial-gradient(70% 46% at 50% 0%, hsl(var(--am-hue) 80% 52% / 0.16), transparent 70%),
    rgba(5, 8, 18, 0.78);
}
.am-pause {
  z-index: 70;
  background:
    radial-gradient(70% 46% at 50% 0%, hsl(var(--am-hue) 80% 52% / 0.12), transparent 70%),
    rgba(4, 6, 14, 0.7);
}
.am-root[hidden],
.am-pause[hidden],
.am-menubtn[hidden],
.am-card [hidden] {
  display: none !important;
}
.am-root *,
.am-pause *,
.am-menubtn,
.am-menubtn * {
  box-sizing: border-box;
}
.am-root input,
.am-root select,
.am-root a {
  -webkit-user-select: text;
  user-select: text;
}

/* ---------------------------------------------------------------------------------------------- the card */
/* Angular panel: an outer layer in the edge colour, an inset fill on a slightly smaller clipped shape. */
.am-card {
  --c: 14px;
  position: relative;
  isolation: isolate;
  width: min(440px, 100%);
  margin: auto;
  padding: 26px 24px 18px;
  display: grid;
  gap: 14px;
  background: var(--am-edge);
  clip-path: polygon(var(--c) 0, 100% 0, 100% calc(100% - var(--c)), calc(100% - var(--c)) 100%, 0 100%, 0 var(--c));
  animation: am-in 0.18s ease-out both;
}
.am-card::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  background: var(--am-panel);
  clip-path: polygon(calc(var(--c) - 0.6px) 0, 100% 0, 100% calc(100% - var(--c) + 0.6px), calc(100% - var(--c) + 0.6px) 100%, 0 100%, 0 calc(var(--c) - 0.6px));
}
.am-card::after {
  /* the game's signature: a short bar in its own hue on the top edge */
  content: '';
  position: absolute;
  left: 22px;
  top: 0;
  width: 56px;
  height: 3px;
  background: hsl(var(--am-hue) 90% 62%);
}
@keyframes am-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.am-head {
  display: grid;
  gap: 6px;
}
.am-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font: 500 0.7rem/1.2 var(--am-display);
  letter-spacing: var(--am-track);
  text-transform: uppercase;
  color: var(--am-cyan);
}
:lang(vi) .am-eyebrow,
:lang(vi) .am-sep,
:lang(vi) .am-sec {
  text-transform: none;
}
.am-eyebrow i {
  width: 8px;
  height: 8px;
  background: hsl(var(--am-hue) 90% 62%);
  clip-path: polygon(30% 0, 100% 0, 100% 70%, 70% 100%, 0 100%, 0 30%);
}
.am-title {
  margin: 0;
  font: 700 clamp(1.7rem, 7vw, 2.15rem) / 1.08 var(--am-display);
  letter-spacing: 0.01em;
  color: var(--am-text);
  overflow-wrap: anywhere;
}
.am-tag {
  margin: 0;
  color: var(--am-muted);
  font-size: 0.95rem;
}
.am-note {
  margin: 0;
  color: var(--am-muted);
  font-size: 0.85rem;
}

/* ---------------------------------------------------------------------------------------------- controls */
.am-btn,
.am-root .btn,
.am-pause .btn,
html.am-on dialog.dlg .btn {
  appearance: none;
  border: 0;
  margin: 0;
  min-height: 46px;
  padding: 12px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 700 1rem/1.15 var(--am-display);
  letter-spacing: 0.03em;
  text-align: center;
  text-decoration: none;
  color: var(--am-text);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--am-line);
  border-radius: 0;
  cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: background 0.12s ease, transform 0.12s ease;
}
.am-btn:hover,
.am-root .btn:hover,
.am-pause .btn:hover,
html.am-on dialog.dlg .btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.am-btn:active {
  transform: scale(0.98);
}
.am-btn.primary,
.am-root .btn.primary,
.am-pause .btn.primary,
html.am-on dialog.dlg .btn.primary {
  background: var(--am-accent);
  color: var(--am-accent-ink);
  box-shadow: none;
  filter: none;
}
.am-btn.primary:hover,
.am-root .btn.primary:hover,
.am-pause .btn.primary:hover,
html.am-on dialog.dlg .btn.primary:hover {
  background: var(--am-accent-hi);
}
.am-btn.primary:focus-visible,
.am-root .btn.primary:focus-visible,
.am-pause .btn.primary:focus-visible,
html.am-on dialog.dlg .btn.primary:focus-visible {
  outline-color: var(--am-accent-ink);
}
.am-btn.small,
.am-root .btn.small,
.am-pause .btn.small,
html.am-on dialog.dlg .btn.small {
  min-height: 38px;
  padding: 8px 12px;
  font-size: 0.9rem;
}
.am-root .btn.icon,
.am-pause .btn.icon,
html.am-on dialog.dlg .btn.icon {
  padding: 8px 10px;
  min-width: 42px;
}
.am-btn.danger,
html.am-on dialog.dlg .btn.danger {
  background: rgba(255, 107, 122, 0.16);
  color: #ffb6bf;
}
.am-btn[disabled],
.am-root .btn[disabled] {
  opacity: 0.55;
  cursor: wait;
}
.am-btn:focus-visible,
.am-root .btn:focus-visible,
.am-pause .btn:focus-visible,
html.am-on dialog.dlg .btn:focus-visible {
  outline: 3px solid var(--am-cyan);
  outline-offset: -5px;
}
.am-btn svg {
  flex: none;
}
.am-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 6px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--am-muted);
  text-decoration: underline;
  cursor: pointer;
}
.am-link:hover {
  color: var(--am-text);
}
.am-link:focus-visible,
.am-back:focus-visible {
  outline: 2px solid var(--am-cyan);
  outline-offset: 2px;
}

.am-input,
.am-select,
.am-root .lang,
html.am-on dialog.dlg .lang,
html.am-on dialog.dlg input[type='text'],
html.am-on dialog.dlg input[type='password'] {
  appearance: none;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--am-line);
  border-radius: 0;
  background-color: var(--am-field);
  color: var(--am-text);
  font: 500 0.98rem/1.2 var(--am-font);
}
.am-input:focus,
.am-select:focus,
html.am-on dialog.dlg input:focus {
  outline: none;
  border-color: var(--am-cyan);
  box-shadow: 0 0 0 1px var(--am-cyan);
}
.am-input::placeholder {
  color: var(--am-muted);
  opacity: 0.8;
}
.am-select,
.am-root .lang,
html.am-on dialog.dlg .lang {
  padding-right: 34px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2335d6ee' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.am-select option,
.am-root .lang option,
html.am-on dialog.dlg .lang option {
  background: var(--am-panel);
  color: #fff;
}
.am-code {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  text-align: center;
}

/* nickname + colours */
.am-ident {
  display: grid;
  gap: 12px;
}
.am-skins {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}
.am-skins button {
  appearance: none;
  width: 100%;
  max-width: 36px;
  aspect-ratio: 1;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  opacity: 0.82;
  clip-path: polygon(30% 0, 100% 0, 100% 70%, 70% 100%, 0 100%, 0 30%);
  transition: transform 0.1s ease, opacity 0.1s ease;
}
.am-skins button:hover {
  opacity: 1;
  transform: scale(1.08);
}
.am-skins button[aria-checked='true'] {
  opacity: 1;
  transform: scale(1.14);
  box-shadow: inset 0 0 0 3px #fff;
}
.am-skins button:focus-visible {
  outline: 3px solid var(--am-cyan);
  outline-offset: -3px;
}

/* what to press, and what just happened */
.am-actions {
  display: grid;
  gap: 10px;
}
.am-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
}
.am-row > * {
  flex: 1 1 0;
  min-width: 0;
}
.am-row > .am-btn {
  min-width: 7.5em;
}
.am-join {
  display: flex;
  gap: 8px;
  margin: 0;
}
.am-join .am-input {
  flex: 1.4 1 0;
  min-width: 0;
}
.am-join .am-btn {
  flex: 1 1 0;
  min-width: 5em;
}
.am-sep {
  display: block;
  margin: 2px 0 -2px;
  font: 500 0.7rem/1.2 var(--am-display);
  letter-spacing: var(--am-track);
  text-transform: uppercase;
  color: var(--am-muted);
}
.am-notice {
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 107, 122, 0.12);
  border-left: 3px solid var(--am-hot);
  color: #ffc4cb;
  font-size: 0.9rem;
}
.am-hint {
  margin: 0;
  color: var(--am-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}
.am-hint:empty {
  display: none;
}
.am-hint + .am-hint {
  margin-top: -6px;
}
.am-card kbd,
html.am-on dialog.dlg kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: 0 6px;
  border: 1px solid var(--am-line);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--am-text);
  font: 500 0.82em/1.5 var(--am-display);
  text-align: center;
}
.am-card .logo {
  background: none;
  color: var(--am-accent);
  -webkit-text-fill-color: currentColor;
  font-family: var(--am-display);
}
/* blocks a game draws itself into a slot (Backrooms: the daily run): same family, quieter than the main button */
.am-slot:empty {
  display: none;
}
.am-slot .daily,
.am-slot .banner {
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--am-line);
  border-radius: 0;
  background: rgba(53, 214, 238, 0.05);
  font-family: var(--am-font);
}
.am-slot .banner {
  border-color: rgba(255, 208, 67, 0.4);
  background: rgba(255, 208, 67, 0.08);
  color: var(--am-accent) !important;
}
.am-slot .daily h3 {
  margin: 0;
  font: 500 0.72rem/1.2 var(--am-display);
  letter-spacing: var(--am-track);
  text-transform: uppercase;
  color: var(--am-cyan);
}
.am-slot .daily .btn.primary {
  min-height: 40px;
  background: rgba(255, 208, 67, 0.14);
  box-shadow: inset 0 0 0 1px rgba(255, 208, 67, 0.55);
  color: var(--am-accent);
}
.am-slot .daily .btn.primary:hover {
  background: rgba(255, 208, 67, 0.26);
}
.am-slot .tab {
  border-radius: 0;
  font-family: var(--am-display);
}
.am-slot .tab.on {
  background: rgba(53, 214, 238, 0.14);
  border-color: var(--am-cyan);
}
.am-slot .board li {
  border-radius: 0;
}
.am-extra {
  margin: 0;
  color: var(--am-muted);
  font-size: 0.88rem;
}
.am-extra b {
  margin-left: 0.45em;
  color: var(--am-accent);
  font-family: var(--am-display);
  font-variant-numeric: tabular-nums;
}
.am-extra:empty {
  display: none;
}

.am-quick,
.am-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.am-quick > * {
  min-height: 44px;
}
.am-quick > .am-select {
  flex: 2 1 11em;
  padding-left: 10px;
  font-size: 0.92rem;
}
.am-quick > .am-btn {
  flex: 1 1 7em;
}
.am-meta > .am-select {
  flex: 1 1 9em;
  min-width: 8em;
}
.am-meta .acct {
  flex: 0 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
}
.am-meta .acct .btn {
  flex: 0 0 auto;
}
.am-meta .acct .chip {
  flex: 0 1 auto;
  max-width: 9em;
  padding: 6px 10px;
  border: 1px solid var(--am-line);
  background: var(--am-field);
  color: var(--am-text);
  font: 700 0.85rem var(--am-display);
}
.am-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--am-line);
}
.am-back {
  color: var(--am-muted);
  font-size: 0.9rem;
  text-decoration: none;
}
.am-back:hover {
  color: var(--am-text);
}

/* ---------------------------------------------------------------------------------------------- pause card extras */
.am-resume kbd {
  background: rgba(10, 13, 28, 0.14);
  border-color: rgba(10, 13, 28, 0.35);
  color: var(--am-accent-ink);
}
.am-share {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(53, 214, 238, 0.06);
  border: 1px solid var(--am-line);
}
.am-share .am-sep {
  margin: 0;
  color: var(--am-cyan);
}
.am-roomcode {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}
.am-roomcode b {
  font: 700 1.7rem/1 var(--am-display);
  letter-spacing: 0.24em;
  color: var(--am-accent);
  -webkit-user-select: text;
  user-select: text;
}
.am-status {
  margin: 0;
  flex: 1 0 100%;
  color: var(--am-good);
  font-size: 0.85rem;
}
.am-linkfield {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--am-cyan);
  border-radius: 0;
  background: var(--am-field);
  color: var(--am-text);
  font: 500 0.82rem var(--am-font);
}

/* ---------------------------------------------------------------------------------------------- floating Menu button */
.am-menubtn {
  position: fixed;
  z-index: 45;
  top: max(10px, env(safe-area-inset-top));
  left: max(10px, env(safe-area-inset-left));
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin: 0;
  padding: 7px 12px;
  border: 0;
  border-radius: 0;
  color: var(--am-text);
  background: rgba(7, 10, 21, 0.72);
  box-shadow: inset 0 0 0 1px var(--am-line);
  font: 700 0.85rem/1 var(--am-display);
  letter-spacing: 0.04em;
  cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.am-menubtn[data-corner='tr'] {
  left: auto;
  right: max(10px, env(safe-area-inset-right));
}
.am-menubtn[data-corner='bl'] {
  top: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
}
.am-menubtn[data-corner='br'] {
  top: auto;
  left: auto;
  bottom: max(10px, env(safe-area-inset-bottom));
  right: max(10px, env(safe-area-inset-right));
}
.am-menubtn:hover {
  background: rgba(24, 32, 66, 0.9);
}
.am-menubtn:focus-visible {
  outline: 3px solid var(--am-cyan);
  outline-offset: -4px;
}
.am-menubtn kbd {
  padding: 0 5px;
  border: 1px solid var(--am-line);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  font: 500 0.72rem/1.5 var(--am-display);
  color: var(--am-muted);
}
@media (pointer: coarse) {
  .am-menubtn {
    min-height: 44px;
    min-width: 44px;
    padding: 8px 14px;
  }
  .am-menubtn kbd {
    display: none;
  }
}

.am-lockhint {
  position: fixed;
  z-index: 45;
  left: 50%;
  bottom: max(14%, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  padding: 10px 18px;
  color: var(--am-text);
  background: rgba(7, 10, 21, 0.82);
  box-shadow: inset 0 0 0 1px var(--am-cyan);
  font: 700 0.95rem/1.2 var(--am-display);
  letter-spacing: 0.03em;
  pointer-events: none;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.am-lockhint[hidden] {
  display: none !important;
}

/* ---------------------------------------------------------------------------------------------- options rows (settings dialog) */
.am-sec {
  margin: 10px 0 0;
  font: 500 0.72rem/1.2 var(--am-display);
  letter-spacing: var(--am-track);
  text-transform: uppercase;
  color: var(--am-cyan);
}
.am-opt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
  align-items: center;
  gap: 4px 12px;
}
.am-opt > span {
  font-size: 0.92rem;
}
.am-opt .am-val {
  justify-self: end;
  font: 700 0.85rem var(--am-display);
  color: var(--am-accent);
  min-width: 3.2em;
  text-align: right;
}
.am-rangebox {
  display: flex;
  align-items: center;
  gap: 10px;
}
.am-rangebox input[type='range'] {
  flex: 1 1 auto;
  min-width: 0;
  accent-color: var(--am-accent);
  height: 28px;
  margin: 0;
}
.am-switch {
  appearance: none;
  justify-self: end;
  min-width: 5.6em;
  min-height: 38px;
  padding: 6px 12px;
  border: 0;
  cursor: pointer;
  font: 700 0.9rem var(--am-display);
  color: var(--am-text);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--am-line);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
.am-switch[aria-checked='true'] {
  background: var(--am-accent);
  color: var(--am-accent-ink);
  box-shadow: none;
}
.am-switch:focus-visible {
  outline: 3px solid var(--am-cyan);
  outline-offset: -5px;
}
.am-optnote {
  margin: 0;
  color: var(--am-muted);
  font-size: 0.8rem;
}

/* ---------------------------------------------------------------------------------------------- shared dialogs inside games */
html.am-on dialog.dlg {
  width: min(440px, calc(100vw - 24px));
  border: 1px solid var(--am-edge);
  border-radius: 0;
  background: var(--am-panel);
  color: var(--am-text);
  font-family: var(--am-font);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(0, 0, 0, 0.4);
  -webkit-user-select: none;
  user-select: none;
}
html.am-on dialog.dlg::backdrop {
  background: rgba(4, 6, 14, 0.78);
  backdrop-filter: none;
}
html.am-on dialog.dlg::before {
  content: '';
  position: sticky;
  top: 0;
  display: block;
  height: 3px;
  margin-bottom: -3px;
  width: 56px;
  margin-left: 22px;
  background: hsl(var(--am-hue) 90% 62%);
  z-index: 2;
}
html.am-on .dlg h2 {
  font: 700 1.4rem/1.1 var(--am-display);
}
html.am-on .dlg h3 {
  margin: 12px 0 0;
  font: 500 0.72rem/1.2 var(--am-display);
  letter-spacing: var(--am-track);
  color: var(--am-cyan);
}
:lang(vi) .dlg h3 {
  text-transform: none;
}
html.am-on .dlg .field label,
html.am-on .dlg .field small,
html.am-on .dlg .note {
  color: var(--am-muted);
}
html.am-on .dlg .keybtn {
  border: 0;
  border-radius: 0;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 0 0 1px var(--am-line);
  font: 700 0.92rem var(--am-display);
  color: var(--am-text);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}
html.am-on .dlg .keybtn.cap {
  background: var(--am-accent);
  color: var(--am-accent-ink);
}
html.am-on .dlg .linkbtn {
  color: var(--am-muted);
}
html.am-on .dlg .err {
  color: #ffb6bf;
}
html.am-on .dlg .status {
  color: var(--am-good);
}

/* ---------------------------------------------------------------------------------------------- motion */
@media (prefers-reduced-motion: reduce) {
  .am-card {
    animation: none;
  }
  .am-btn,
  .am-skins button {
    transition: none;
  }
}
@media (max-width: 420px) {
  .am-card {
    padding: 22px 18px 16px;
  }
}
@media (max-height: 520px) {
  .am-card {
    gap: 10px;
  }
}
