/* ==========================================================================
   Base - CSS Custom Properties, Reset, Typography
   ========================================================================== */

:root {
    /* Colors */
    --tc-bg-primary: #0D0D0D;
    --tc-bg-secondary: #1A1A1A;
    --tc-bg-card: #1E1E1E;
    --tc-bg-elevated: #252525;
    --tc-bg-input: #2A2A2A;

    --tc-text-primary: #F5F5F5;
    --tc-text-secondary: #B0B0B0;
    --tc-text-muted: #777777;

    --tc-accent: #FF6B00;
    --tc-accent-hover: #FF8533;
    --tc-accent-dark: #CC5500;
    --tc-accent-glow: rgba(255, 107, 0, 0.3);

    /* Rarity colors */
    --tc-rarity-common: #A8A8A8;
    --tc-rarity-uncommon: #4FC3F7;
    --tc-rarity-rare: #FFD700;
    --tc-rarity-ultra-rare: #E040FB;
    --tc-rarity-secret: #FF1744;

    /* Status */
    --tc-success: #4CAF50;
    --tc-warning: #FFC107;
    --tc-error: #F44336;
    --tc-info: #2196F3;

    /* Typography */
    --tc-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tc-font-heading: 'Exo 2', 'Inter', sans-serif;

    --tc-text-xs: 0.75rem;
    --tc-text-sm: 0.875rem;
    --tc-text-base: 1rem;
    --tc-text-lg: 1.125rem;
    --tc-text-xl: 1.25rem;
    --tc-text-2xl: 1.5rem;
    --tc-text-3xl: 2rem;
    --tc-text-4xl: 2.5rem;
    --tc-text-5xl: 3.5rem;

    /* Spacing */
    --tc-space-xs: 0.25rem;
    --tc-space-sm: 0.5rem;
    --tc-space-md: 1rem;
    --tc-space-lg: 1.5rem;
    --tc-space-xl: 2rem;
    --tc-space-2xl: 3rem;
    --tc-space-3xl: 4rem;

    /* Layout */
    --tc-container-max: 1280px;
    --tc-container-wide: 1440px;
    --tc-header-height: 70px;
    --tc-top-bar-height: 36px;

    /* Borders */
    --tc-radius-sm: 6px;
    --tc-radius-md: 8px;
    --tc-radius-lg: 12px;
    --tc-radius-xl: 16px;
    --tc-radius-full: 9999px;
    --tc-border-color: #2A2A2A;
    --tc-border: 1px solid var(--tc-border-color);

    /* Shadows */
    --tc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --tc-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --tc-shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.5);
    --tc-shadow-glow: 0 0 20px var(--tc-accent-glow);

    /* Transitions */
    --tc-transition-fast: 150ms ease;
    --tc-transition-base: 250ms ease;
    --tc-transition-slow: 400ms ease;

    /* Z-index scale */
    --tc-z-dropdown: 100;
    --tc-z-sticky: 200;
    --tc-z-overlay: 300;
    --tc-z-modal: 400;
    --tc-z-toast: 500;
}

/* ==========================================================================
   Reset
   ========================================================================== */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    scrollbar-color: var(--tc-accent) var(--tc-bg-secondary);
}

body {
    font-family: var(--tc-font-body);
    font-size: var(--tc-text-base);
    font-weight: 400;
    line-height: 1.6;
    color: var(--tc-text-primary);
    background-color: var(--tc-bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--tc-bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--tc-accent);
    border-radius: var(--tc-radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--tc-accent-hover);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--tc-font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--tc-text-primary);
}

h1 { font-size: var(--tc-text-4xl); }
h2 { font-size: var(--tc-text-3xl); }
h3 { font-size: var(--tc-text-2xl); }
h4 { font-size: var(--tc-text-xl); }
h5 { font-size: var(--tc-text-lg); }
h6 { font-size: var(--tc-text-base); }

p {
    margin-bottom: var(--tc-space-md);
    color: var(--tc-text-secondary);
}

a {
    color: var(--tc-accent);
    text-decoration: none;
    transition: color var(--tc-transition-fast);
}

a:hover {
    color: var(--tc-accent-hover);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

ul, ol {
    list-style: none;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: inherit;
}

/* Selection */
::selection {
    background: var(--tc-accent);
    color: var(--tc-text-primary);
}

/* Focus styles */
:focus-visible {
    outline: 2px solid var(--tc-accent);
    outline-offset: 2px;
}

/* Screen reader text */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    clip: auto !important;
    display: block;
    height: auto;
    left: 5px;
    top: 5px;
    width: auto;
    z-index: var(--tc-z-toast);
    background: var(--tc-bg-card);
    padding: var(--tc-space-md);
}
