/* ==========================================================================
   GameBuddy prototype - base styles (FOUNDATION owns this file)
   Reset, typography, focus, scrollbars, utilities. Prefix for utilities: pd-
   ========================================================================== */

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  background-color: var(--bg-canvas);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  font-weight: 400;
  font-feature-settings: 'cv11' 1, 'ss03' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

html[data-frame="launcher"] body { background-color: var(--bg-backdrop); }

h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; letter-spacing: -.01em; line-height: var(--lh-tight); color: var(--text); }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
dl, dd { margin: 0; }
figure { margin: 0; }
img, svg, video, canvas { display: block; max-width: 100%; }
svg.pd-icon { flex: none; max-width: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; margin: 0; }
button:disabled { cursor: not-allowed; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--sp-4) 0; }
table { border-collapse: collapse; border-spacing: 0; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: .92em; }
b, strong { font-weight: 600; }
small { font-size: var(--fs-sm); }
[hidden] { display: none !important; }
::selection { background: var(--selection); color: inherit; }

/* ---------- focus: visible ring on keyboard focus only ---------- */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: inherit;
}
input:focus-visible, textarea:focus-visible, select:focus-visible { outline-offset: 0; }
#main:focus { outline: none; }

/* ---------- scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: var(--text-4); background-clip: content-box; border: 2px solid transparent; }

/* ---------- utilities ---------- */
.pd-sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
.pd-skip {
  position: fixed; left: 12px; top: -64px; z-index: 999;
  padding: 10px 14px; border-radius: var(--r-btn);
  background: var(--accent); color: var(--accent-fg); font-weight: 600;
  transition: top var(--dur-2) var(--ease);
}
.pd-skip:focus { top: 12px; }
.pd-num { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1, 'cv11' 1, 'ss03' 1; }
.pd-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pd-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pd-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pd-muted { color: var(--text-3); }
.pd-dim { color: var(--text-4); }
.pd-strong { color: var(--text); font-weight: 600; }
.pd-mono { font-family: var(--font-mono); }
.pd-upper { text-transform: uppercase; letter-spacing: .05em; }
.pd-right { text-align: right; }
.pd-center { text-align: center; }
.pd-nowrap { white-space: nowrap; }
.pd-tone-green { color: var(--green-text); }
.pd-tone-red { color: var(--red-text); }
.pd-tone-amber { color: var(--amber-text); }
.pd-tone-purple { color: var(--purple-text); }
.pd-tone-blue { color: var(--blue-text); }
.pd-tone-orange { color: var(--orange-text); }
.pd-tone-accent { color: var(--accent-text); }

/* ---------- motion ---------- */
@keyframes pd-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pd-rise-in { from { opacity: .75; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pd-screen-in { from { transform: translateY(6px); } to { transform: none; } }
@keyframes pd-pop-in { from { opacity: .75; transform: scale(.97) translateY(-2px); } to { opacity: 1; transform: none; } }
@keyframes pd-spin { to { transform: rotate(360deg); } }
@keyframes pd-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
