/* ═══════════════════════════════════════════════════════
   WordDuel — Base Styles v2 (3D / Glassmorphism)
   ═══════════════════════════════════════════════════════ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-normal);
    line-height: var(--leading-normal);
    color: var(--text-primary);
    background: linear-gradient(165deg, var(--bg-gradient-from) 0%, var(--bg-gradient-to) 100%);
    background-attachment: fixed;
    transition: background var(--transition-slow), color var(--transition-slow);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Letter-scatter background pattern */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Ctext x='50' y='80' font-size='24' fill='%233B82F6' opacity='0.15' font-family='sans-serif'%3EW%3C/text%3E%3Ctext x='150' y='140' font-size='18' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EO%3C/text%3E%3Ctext x='280' y='60' font-size='22' fill='%233B82F6' opacity='0.12' font-family='sans-serif'%3ER%3C/text%3E%3Ctext x='400' y='120' font-size='16' fill='%233B82F6' opacity='0.08' font-family='sans-serif'%3ED%3C/text%3E%3Ctext x='500' y='80' font-size='20' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3ES%3C/text%3E%3Ctext x='100' y='250' font-size='20' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EA%3C/text%3E%3Ctext x='250' y='200' font-size='16' fill='%233B82F6' opacity='0.08' font-family='sans-serif'%3EL%3C/text%3E%3Ctext x='380' y='280' font-size='22' fill='%233B82F6' opacity='0.12' font-family='sans-serif'%3EG%3C/text%3E%3Ctext x='520' y='220' font-size='18' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EM%3C/text%3E%3Ctext x='70' y='400' font-size='18' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EP%3C/text%3E%3Ctext x='200' y='350' font-size='20' fill='%233B82F6' opacity='0.08' font-family='sans-serif'%3EE%3C/text%3E%3Ctext x='340' y='420' font-size='24' fill='%233B82F6' opacity='0.12' font-family='sans-serif'%3EN%3C/text%3E%3Ctext x='460' y='380' font-size='16' fill='%233B82F6' opacity='0.08' font-family='sans-serif'%3ET%3C/text%3E%3Ctext x='120' y='520' font-size='22' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EC%3C/text%3E%3Ctext x='300' y='540' font-size='18' fill='%233B82F6' opacity='0.12' font-family='sans-serif'%3EH%3C/text%3E%3Ctext x='450' y='500' font-size='20' fill='%233B82F6' opacity='0.1' font-family='sans-serif'%3EI%3C/text%3E%3C/svg%3E");
    opacity: var(--bg-pattern-opacity);
    pointer-events: none;
    z-index: 0;
}

/* All content above background */
body>* {
    position: relative;
    z-index: 1;
}

/* ── Typography ────────────────────────────────────── */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    color: var(--text-primary);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

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);
}

p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
    line-height: var(--leading-relaxed);
}

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

a:hover {
    color: var(--accent-primary-hover);
    text-shadow: 0 0 12px rgba(59, 130, 246, 0.3);
}

strong {
    font-weight: var(--weight-semibold);
}

small {
    font-size: var(--text-sm);
}

/* ── Lists ─────────────────────────────────────────── */
ul,
ol {
    list-style: none;
}

/* ── Images ────────────────────────────────────────── */
img,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ── Inputs ────────────────────────────────────────── */
button,
input,
select,
textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}

button {
    cursor: pointer;
}

input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px var(--accent-primary-light);
}

/* ── Utilities ─────────────────────────────────────── */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.container--sm {
    max-width: var(--max-width-sm);
}

.container--game {
    max-width: var(--max-width-game);
}

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

.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.flex-center {
    justify-content: center;
    align-items: center;
}

.flex-between {
    justify-content: space-between;
    align-items: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-xs {
    gap: var(--space-xs);
}

.gap-sm {
    gap: var(--space-sm);
}

.gap-md {
    gap: var(--space-md);
}

.gap-lg {
    gap: var(--space-lg);
}

/* ── Glass panel utility ───────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    border-radius: var(--radius-xl);
}

/* ── Scrollbar ─────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

/* ── Selection ─────────────────────────────────────── */
::selection {
    background: var(--accent-primary);
    color: #FFFFFF;
}

/* ── Keyframe Animations ───────────────────────────── */
@keyframes pulse-border {

    0%,
    100% {
        border-color: var(--accent-primary);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    50% {
        border-color: var(--accent-primary-hover);
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0);
    }
}

@keyframes flame-flicker {

    0%,
    100% {
        transform: scale(1) rotate(-2deg);
    }

    25% {
        transform: scale(1.1) rotate(2deg);
    }

    50% {
        transform: scale(0.95) rotate(-1deg);
    }

    75% {
        transform: scale(1.05) rotate(1deg);
    }
}

@keyframes shine-sweep {
    0% {
        transform: translateX(-100%) skewX(-15deg);
    }

    100% {
        transform: translateX(200%) skewX(-15deg);
    }
}

@keyframes float-up {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.2;
    }

    100% {
        transform: translateY(-10vh) scale(1);
        opacity: 0;
    }
}

@keyframes tile-pop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}