/* ==========================================================================
   SpeedCube PRO — CSS Reset, Base Typography, Scrollbars & Global Utilities
   ========================================================================== */

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Custom Sleek Glass Scrollbars (Pure WebKit/Blink styling so Chromium never renders OS grey bars/arrows) */
*::-webkit-scrollbar {
  width: 4px;
  height: 4px;
}

*::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9999px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

*::-webkit-scrollbar-corner {
  background: transparent;
}

.no-scrollbar,
.no-scrollbar::-webkit-scrollbar {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  display: none !important;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  /* Dark native controls; no automatic text enlarging when an iPhone turns sideways */
  color-scheme: dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Default glow edge (emerald); SC.UI.syncEdgeColor keeps it in step with the theme */
  background-color: rgb(9, 33, 17);
  width: 100%;
  height: 100%;
  min-height: 100%;
  min-height: -webkit-fill-available;
  min-height: 100dvh;
  min-height: calc(100% + env(safe-area-inset-top, 0px));
}

body {
  font-family: var(--font-sans);
  background-color: var(--edge-color, rgb(9, 33, 17));
  color: var(--text-primary);
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  height: var(--app-height, 100dvh);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  letter-spacing: -0.014em;
  overscroll-behavior: none;
  /* No double-tap zoom anywhere (two quick taps on +2 / DNF zoomed the page in mobile Safari) */
  touch-action: manipulation;
}

/* Full-height backdrop: reaches the physical bottom of the screen even where
   the app itself stops above Safari's floating toolbar */
body::after {
  content: '';
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 100lvh;
  background: var(--edge-color, rgb(9, 33, 17));
  z-index: -1;
  pointer-events: none;
}

::selection {
  background: rgba(var(--accent-rgb), 0.35);
  color: #FFFFFF;
}

/* Unified Optical Focus Indicator for Keyboard Accessibility */
:focus {
  outline: none;
}

:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px #000000, 0 0 0 4px rgba(var(--accent-rgb), 0.75) !important;
}

/* Touch screens: opening a sheet focuses its first control (usually ✕). With no keyboard in play
   that ring reads as a pressed button, so sheets don't draw it there */
@media (hover: none) and (pointer: coarse) {
  dialog[open] :focus-visible {
    box-shadow: none !important;
  }
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hidden {
  display: none !important;
}

/* Inline SVG icons (SC.Icons) sit on the text baseline and take its colour */
.sc-icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.14em;
}

/* Respect the system "Reduce motion" preference */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.sc-spin {
  animation: scSpin 0.9s linear infinite;
}

@keyframes scSpin {
  to { transform: rotate(360deg); }
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.svg-defs-hidden {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
  overflow: hidden;
}
