/* ==========================================================================
   Avezz App & Game Shell — Full-Viewport Controls and App Guides
   ========================================================================== */

/* Keep inline SVG sprite hidden and app-shell icons crisp even when base.css is omitted */
.svg-sprite {
  display: none;
}

/* Visually hidden SEO heading for native app pages that omit base.css */
.vhide {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-fab-btn .icon {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
  flex-shrink: 0;
}

/* Remove site nav top padding on minimal-shell game pages (Defcon, ReactionTime, PoliticalAxis) */
body.scroll-body {
  margin: 0;
  padding: 0;
  padding-top: 0 !important;
}

/* Top-left floating buttons (matches Reader / Article Scroll .fab-btn) */
.app-fab-stack {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: calc(14px + env(safe-area-inset-left, 0px));
  z-index: 9500;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.app-fab-btn {
  pointer-events: auto;
  position: relative;
  width: 38px;
  height: 38px;
  padding: 0;
  margin: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.86);
  color: #1d1d1f;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.app-fab-btn:hover {
  transform: translateY(-1px);
  background: #ffffff;
  color: #0071e3;
  text-decoration: none;
}

.app-fab-btn:active {
  transform: scale(0.95);
}

.app-fab-btn:focus-visible {
  outline: 2px solid var(--accent, #0071e3);
  outline-offset: 2px;
}

.app-fab-btn svg,
.app-fab-btn .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
}

[data-theme="dark"] .app-fab-btn,
.app-fab-stack--dark .app-fab-btn {
  background: rgba(22, 22, 26, 0.82);
  color: #f5f5f7;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .app-fab-btn:hover,
.app-fab-stack--dark .app-fab-btn:hover {
  background: rgba(36, 36, 42, 0.96);
  color: #2997ff;
}

/* Keep full-screen game UI within its own viewport-sized stage. */
body.native-game-page {
  display: block;
  margin: 0;
  height: auto;
  overflow-x: clip !important;
  overflow-y: auto !important;
  touch-action: auto !important;
}

.native-game-stage {
  position: relative;
  height: 100dvh;
  contain: paint;
}

.app-guide {
  box-sizing: border-box;
  background: var(--surface, #fff);
  color: var(--text, #1d1d1f);
  font-family: system-ui, sans-serif;
  padding: clamp(32px, 6vw, 72px) max(20px, calc((100% - 72ch) / 2));
  scroll-margin-top: 68px;
  text-align: left;
  cursor: auto;
  user-select: text;
  overflow-wrap: anywhere;
}

.app-guide-title {
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1em;
}

.app-guide-body {
  color: var(--text-secondary, #52525b);
  line-height: 1.68;
}

.app-guide-body > :first-child {
  margin-top: 0;
}

.app-guide-body > :last-child {
  margin-bottom: 0;
}

.app-guide-body h1,
.app-guide-body h2,
.app-guide-body h3,
.app-guide-body h4 {
  color: var(--text, #1d1d1f);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 1.4em 0 0.55em;
  padding: 0;
  border: 0;
}

.app-guide-body h1 {
  font-size: 20px;
}

.app-guide-body h2 {
  font-size: 17px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.app-guide-body h3 {
  font-size: 15.5px;
}

.app-guide-body h4 {
  font-size: 14.5px;
  color: var(--text, #1d1d1f);
}

.app-guide-body p {
  margin: 0 0 0.9em;
  color: var(--text-secondary, #52525b);
}

.app-guide-body strong,
.app-guide-body b {
  color: var(--text, #1d1d1f);
  font-weight: 600;
}

.app-guide-body em {
  font-style: italic;
}

.app-guide-body a {
  color: var(--accent, #0071e3);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.app-guide-body ul,
.app-guide-body ol {
  margin: 0 0 1em;
  padding-left: 1.45em;
}

.app-guide-body ul {
  list-style: disc;
}

.app-guide-body ol {
  list-style: decimal;
}

.app-guide-body li {
  margin-bottom: 0.35em;
  color: var(--text-secondary, #52525b);
}

.app-guide-body li::marker {
  color: var(--text-tertiary, #86868b);
}

.app-guide-body hr {
  border: 0;
  border-top: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  margin: 1.35em 0;
}

.app-guide-body blockquote {
  margin: 0 0 1em;
  padding: 10px 14px;
  border-left: 3px solid var(--accent, #0071e3);
  background: var(--surface-subtle, #fafafa);
  border-radius: 0 10px 10px 0;
  color: var(--text, #1d1d1f);
}

.app-guide-body blockquote p:last-child {
  margin-bottom: 0;
}

.app-guide-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--surface-alt, #f2f3f5);
  color: var(--text, #1d1d1f);
}

.app-guide-body pre {
  margin: 0 0 1em;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--surface-alt, #f2f3f5);
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  overflow-x: auto;
}

.app-guide-body pre code {
  padding: 0;
  background: transparent;
}

.app-guide-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1.1em;
  font-size: 13.5px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.08));
  border-radius: 10px;
  overflow: hidden;
  display: table;
}

.app-guide-body th,
.app-guide-body td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border, rgba(0, 0, 0, 0.08));
}

.app-guide-body th {
  background: var(--surface-alt, #f2f3f5);
  color: var(--text, #1d1d1f);
  font-weight: 600;
}

.app-guide-body tr:last-child td {
  border-bottom: 0;
}
