/**
 * War 2050 - Game UI Base Styles
 * Reset and typography defaults for game interface
 */

/* =================================================================
   CSS RESET
   ================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.6;
    color: var(--color-text-primary);
    background-color: var(--color-primary-900);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =================================================================
   TYPOGRAPHY

   The floor for every stylesheet under frontend/game/ is --text-xs
   (12px at the 16px root set above). docs/TYPE-LEGIBILITY.md is
   normative: no rendered text below 12px, in any media query, badges
   and uppercase micro-labels included. If something does not fit at
   12px, spend padding or letter-spacing, not size (rule 6).

   Note html { font-size: 16px } is a hard px value, so a rem here is a
   fixed px and --text-xs cannot be pushed under 12 by a root change.
   ================================================================= */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-semibold);
    line-height: 1.3;
    color: var(--color-text-primary);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

.display-text {
    font-family: var(--font-display);
    font-weight: var(--font-bold);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

p {
    margin-bottom: var(--space-4);
    color: var(--color-text-secondary);
}

a {
    color: var(--color-accent-gold);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-accent-gold-light);
}

/* =================================================================
   LISTS
   ================================================================= */

ul, ol {
    list-style: none;
}

/* =================================================================
   IMAGES & MEDIA
   ================================================================= */

img, video {
    display: block;
    max-width: 100%;
    height: auto;
}

/* SVGs here are inline UI icons, not media, and must be excluded from the
   media reset above.
   `height: auto` overrides the height="16" presentation attribute every icon
   in this app relies on, so inside a flex row the icon still reserved its
   width but rendered at zero height — the glyph vanished and the button label
   shifted right by icon-width + gap. That was the missing Build/Units/
   Research/Map icons. Nine of the eleven inline SVGs carry no class, so there
   is no per-component rule to rescue them; this has to be fixed at the reset.
   flex-shrink guards the same icons against being squeezed in a tight bar. */
svg {
    display: block;
    flex-shrink: 0;
}

/* =================================================================
   FORMS
   ================================================================= */

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

input:focus,
select:focus,
textarea:focus,
button:focus {
    outline: none;
}

/* =================================================================
   SCROLLBAR STYLING
   ================================================================= */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary-800);
}

::-webkit-scrollbar-thumb {
    background: var(--color-primary-600);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary-500);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary-600) var(--color-primary-800);
}

/* =================================================================
   SELECTION
   ================================================================= */

::selection {
    background-color: var(--color-accent-gold);
    color: var(--color-primary-900);
}

/* =================================================================
   UTILITY CLASSES
   ================================================================= */

.text-gold { color: var(--color-accent-gold); }
.text-cyan { color: var(--color-accent-cyan); }
.text-green { color: var(--color-accent-green); }
.text-red { color: var(--color-accent-red); }
.text-muted { color: var(--color-text-muted); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
