/* ==========================================
   VOCAB PLAYGROUND - DESIGN SYSTEM
   Bubbly Pastel Theme - Friendly & Lively
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;500;600;700;800;900&display=swap');

html {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
}

:root {
    --color-bg: #f0fdfa;
    --color-bg-warm: #ecfdf5;
    --color-bg-mint: #ecfdf5;
    --color-bg-peach: #e0f7fa;
    --color-surface: #ffffff;
    --color-surface-hover: #f0fdfa;
    --color-glass: rgba(255, 255, 255, 0.80);
    --color-border: rgba(0, 0, 0, 0.08);
    --color-border-strong: rgba(0, 0, 0, 0.14);
    --color-text: #1a2e35;
    --color-text-muted: rgba(26, 46, 53, 0.75);
    --color-text-tertiary: rgba(26, 46, 53, 0.50);

    --color-pink: #14b8a6;
    --color-pink-hover: #0d9488;
    --color-pink-soft: #ccfbf1;
    --color-purple: #06b6d4;
    --color-purple-hover: #22d3ee;
    --color-purple-soft: #cffafe;
    --color-peach: #fb923c;
    --color-peach-soft: #fff3e8;
    --color-emerald: #34d399;
    --color-emerald-hover: #10b981;
    --color-emerald-soft: #d1fae5;
    --color-coral: #fb7185;
    --color-coral-hover: #f43f5e;
    --color-coral-soft: #ffe4e6;
    --color-sky: #7dd3fc;
    --color-sky-soft: #e0f2fe;
    --color-warning: #fbbf24;
    --color-warning-soft: #fef9c3;

    --color-indigo: #06b6d4;
    --color-indigo-hover: #22d3ee;
    --color-indigo-glow: rgba(6, 182, 212, 0.15);

    --gradient-coral: linear-gradient(135deg, #99f6e4, #5eead4);
    --gradient-purple: linear-gradient(135deg, #cffafe, #a5f3fc);
    --gradient-orange: linear-gradient(135deg, #fed7aa, #fdba74);
    --gradient-sky: linear-gradient(135deg, #bae6fd, #7dd3fc);
    --gradient-pink: linear-gradient(135deg, #ccfbf1, #a7f3d0);
    --gradient-emerald: linear-gradient(135deg, #a7f3d0, #6ee7b7);
    --gradient-pastel-bg: linear-gradient(160deg, #ccfbf1 0%, #d1fae5 30%, #cffafe 50%, #dbeafe 70%, #eff6ff 100%);

    --gradient-btn-primary: linear-gradient(135deg, #14b8a6, #06b6d4);
    --gradient-btn-success: linear-gradient(135deg, #34d399, #6ee7b7);
    --gradient-btn-danger: linear-gradient(135deg, #fb7185, #f43f5e);

    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-hero: 34px;
    --font-page-title: 26px;
    --font-section: 20px;
    --font-card-title: 17px;
    --font-body: 15px;
    --font-label: 14px;
    --font-caption: 13px;

    --line-hero: 40px;
    --line-page-title: 34px;
    --line-section: 28px;
    --line-card-title: 26px;
    --line-body: 22px;
    --line-label: 20px;
    --line-caption: 16px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    --radius-sm: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    --radius-pill: 50px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 0 4px rgba(20, 184, 166, 0.15);
    --shadow-warm: 0 4px 20px rgba(251, 146, 60, 0.08);

    --font-h1: 26px;
    --font-h2: 22px;
    --font-helper: 14px;
    --font-micro: 13px;
    --line-h1: 34px;
    --line-h2: 30px;
    --line-body-legacy: 24px;
    --line-helper: 20px;
    --line-micro: 16px;
    --font-display: 34px;
    --line-display: 40px;

    --color-graphite: #ffffff;
}

/* ==========================================
   BASE STYLES
   ========================================== */

* {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: var(--line-body);
    font-weight: 500;
    color: var(--color-text);
    background: var(--color-bg);
    background-attachment: fixed;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

body.pro-bg {
    background: var(--gradient-pastel-bg);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="url"],
textarea,
select,
.form-control,
.form-select {
    font-size: 16px !important;
}

h1 {
    font-size: var(--font-page-title);
    line-height: var(--line-page-title);
    font-weight: 900;
    margin: 0 0 var(--space-4) 0;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

h2 {
    font-size: var(--font-section);
    line-height: var(--line-section);
    font-weight: 900;
    margin: 0 0 var(--space-4) 0;
    letter-spacing: -0.02em;
    color: var(--color-text);
}

h3 {
    font-size: var(--font-card-title);
    line-height: var(--line-card-title);
    font-weight: 800;
    margin: 0 0 var(--space-2) 0;
}

h5 {
    font-size: var(--font-body);
    line-height: var(--line-body);
    font-weight: 700;
    margin: 0 0 var(--space-2) 0;
}

h6 {
    font-size: var(--font-label);
    line-height: var(--line-label);
    font-weight: 700;
    margin: 0;
}

p {
    margin: 0 0 var(--space-4) 0;
}

small {
    font-size: var(--font-label);
}

.section-heading {
    color: var(--color-pink);
    font-size: var(--font-caption);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: var(--space-1);
}

.section-heading i {
    color: var(--color-pink);
}

.word-detail-section {
    border-left: 3px solid rgba(20, 184, 166, 0.3);
    padding-left: var(--space-4);
    margin-bottom: var(--space-4);
}

/* ==========================================
   LAYOUT
   ========================================== */

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-6);
}

main {
    min-height: calc(100vh - 140px);
    padding: var(--space-6) 0;
    padding-top: 100px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}



/* ==========================================
   NAVIGATION
   ========================================== */

.navbar {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    padding: var(--space-4) 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    height: 80px;
    display: flex;
    align-items: center;
}

.navbar .container {
    display: flex;
    align-items: center;
    width: 100%;
}

.navbar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.navbar-header .navbar-brand {
    flex: 1 1 auto;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.navbar-header .burger-menu {
    flex: 0 0 auto;
    margin-left: var(--space-4);
}

.navbar-brand {
    font-size: 28px;
    font-weight: 800;
    color: var(--color-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    letter-spacing: -0.01em;
}

.navbar-brand i {
    font-size: 30px;
    color: var(--color-pink);
}

.burger-menu {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: 24px;
    cursor: pointer;
    padding: var(--space-2);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
    width: 48px;
    height: 48px;
}

.burger-menu:hover {
    color: var(--color-text-muted);
    background: transparent;
}

.navbar-nav {
    display: none;
    flex-direction: column;
    gap: 0;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    position: absolute;
    top: calc(100% + 6px);
    right: var(--space-6);
    min-width: 200px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    overflow: hidden;
    padding: var(--space-1) 0;
}

.navbar-nav.show {
    display: flex;
}

.navbar-nav li {
    width: 100%;
}

.navbar-nav .nav-link {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: var(--font-body);
    font-weight: 600;
    padding: var(--space-3) var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    transition: all 0.15s ease;
}

.navbar-nav .nav-link i {
    width: 18px;
    text-align: center;
    font-size: 14px;
}

.navbar-nav .nav-link:hover {
    background: var(--color-pink-soft);
    color: var(--color-pink);
}

.navbar-nav .nav-link.active {
    color: var(--color-pink);
    background: var(--color-pink-soft);
    font-weight: 700;
}

/* ==========================================
   PAGE HEADER
   ========================================== */

.page-header {
    margin-bottom: var(--space-5);
}

.page-header h2 {
    margin-bottom: 0;
    font-size: var(--font-section);
    line-height: var(--line-section);
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.page-header h2 i {
    color: var(--color-pink);
    font-size: 20px;
}

.page-header .text-muted {
    margin-top: var(--space-1);
    margin-bottom: 0;
    font-size: var(--font-label);
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-xl);
    padding: var(--space-5);
    transition: all 0.2s ease;
    box-shadow: var(--shadow-card);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-compact {
    padding: var(--space-3);
}

.card-header {
    margin: 0 0 var(--space-4) 0;
    padding: 0 0 var(--space-3) 0;
    background-color: transparent;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
}

.card-body {
    padding: 0;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    font-family: var(--font-family);
    font-size: var(--font-body);
    font-weight: 700;
    line-height: 1;
    padding: 12px 24px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn i {
    font-size: 0.9em;
}

.btn-primary {
    background: var(--gradient-btn-primary);
    color: #ffffff;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.25);
}

.btn-primary:hover {
    box-shadow: 0 6px 24px rgba(20, 184, 166, 0.35);
    transform: translateY(-1px);
}

.btn-primary:focus {
    box-shadow: var(--shadow-glow);
    outline: none;
}

.btn-secondary {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: var(--color-text);
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.07);
    border-color: rgba(0, 0, 0, 0.10);
}

.btn-outline-primary {
    background-color: transparent;
    border: 2px solid var(--color-pink);
    color: var(--color-pink);
}

.btn-outline-primary:hover {
    background: var(--gradient-btn-primary);
    color: #ffffff;
    border-color: transparent;
}

.btn-outline-success {
    background-color: transparent;
    border: 2px solid var(--color-emerald);
    color: var(--color-emerald);
}

.btn-outline-success:hover {
    background-color: var(--color-emerald);
    color: #fff;
}

.btn-outline-info {
    background-color: transparent;
    border: 2px solid var(--color-sky);
    color: #0ea5e9;
}

.btn-outline-info:hover {
    background: linear-gradient(135deg, #7dd3fc, #38bdf8);
    color: #fff;
    border-color: transparent;
}

.btn-outline-danger {
    background-color: transparent;
    border: 2px solid var(--color-coral);
    color: var(--color-coral);
}

.btn-outline-danger:hover {
    background-color: var(--color-coral);
    color: #fff;
}

.btn-outline-secondary {
    background-color: transparent;
    border: 2px solid rgba(0, 0, 0, 0.08);
    color: var(--color-text-muted);
}

.btn-outline-secondary:hover {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--color-text);
}

.btn-outline-warning {
    background-color: transparent;
    border: 2px solid var(--color-warning);
    color: #d97706;
}

.btn-outline-warning:hover {
    background-color: var(--color-warning);
    color: #fff;
}

.btn-success {
    background: var(--gradient-btn-success);
    color: #fff;
    box-shadow: 0 4px 16px rgba(52, 211, 153, 0.25);
}

.btn-success:hover {
    box-shadow: 0 6px 24px rgba(52, 211, 153, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--gradient-btn-danger);
    color: #fff;
    box-shadow: 0 4px 16px rgba(251, 113, 133, 0.25);
}

.btn-danger:hover {
    box-shadow: 0 6px 24px rgba(251, 113, 133, 0.35);
    transform: translateY(-1px);
}

.btn-sm {
    font-size: var(--font-label);
    padding: 8px 16px;
}

.btn-lg {
    font-size: var(--font-card-title);
    padding: 16px 32px;
    border-radius: 10px;
}

.btn:disabled,
.btn.disabled,
.btn[disabled] {
    background: rgba(0, 0, 0, 0.05);
    border-color: transparent;
    color: var(--color-text-tertiary);
    cursor: not-allowed;
    opacity: 1;
    pointer-events: none;
    box-shadow: none;
}

.btn-outline-primary:disabled,
.btn-outline-success:disabled,
.btn-outline-danger:disabled {
    background-color: transparent;
    border-color: rgba(0, 0, 0, 0.06);
    color: var(--color-text-tertiary);
}

.btn-block {
    width: 100%;
}

/* ==========================================
   LIST GROUP
   ========================================== */

.list-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.list-group-item {
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    transition: all 0.15s ease;
    box-shadow: var(--shadow-sm);
}

.list-group-item:hover {
    box-shadow: var(--shadow-md);
}

.list-group-item-action {
    cursor: pointer;
}

/* ==========================================
   FORMS
   ========================================== */

.form-control {
    width: 100%;
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: var(--line-body);
    padding: 12px 16px;
    background: var(--color-surface);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    transition: all 0.15s ease;
    font-weight: 500;
}

.form-control::placeholder {
    color: var(--color-text-tertiary);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-pink);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
    background: #fff;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
    overflow-y: hidden;
    height: auto;
}

.form-select {
    width: auto;
    min-width: 200px;
    max-width: 300px;
    font-family: var(--font-family);
    font-size: var(--font-body);
    line-height: var(--line-body);
    padding: 12px 40px 12px 16px;
    background: var(--color-surface);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    font-weight: 500;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23666' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 10px;
}

.form-select:hover {
    border-color: var(--color-pink);
}

.form-select:focus {
    outline: none;
    border-color: var(--color-pink);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.form-select option {
    background: #fff;
    color: var(--color-text);
    padding: 10px;
}

.form-label {
    display: block;
    font-size: var(--font-body);
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: var(--space-2);
    letter-spacing: 0.01em;
}

.form-check-input {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 0, 0, 0.12);
    border-radius: 6px;
    background-color: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
}

.form-check-input:checked {
    background: var(--gradient-btn-primary);
    border-color: var(--color-pink);
}

.form-check-input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.form-check-input:focus {
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
    outline: none;
}

/* ==========================================
   INPUT GROUP
   ========================================== */

.input-group {
    display: flex;
    align-items: stretch;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--color-pink-soft);
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-right: none;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    color: var(--color-pink);
    font-weight: 600;
}

.input-group .form-control {
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
}

/* ==========================================
   BOOTSTRAP UTILITIES
   ========================================== */

.me-1 { margin-right: 4px; }
.me-2 { margin-right: 8px; }
.me-3 { margin-right: 12px; }
.ms-1 { margin-left: 4px; }
.ms-2 { margin-left: 8px; }
.ms-3 { margin-left: 12px; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

.fw-bold { font-weight: 700; }
.fst-italic { font-style: italic; }
.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }
.w-100 { width: 100%; }

.g-3 { gap: var(--space-4); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }

.btn-group {
    display: flex;
    gap: var(--space-1);
}

.text-lg-start { text-align: left; }
.text-primary { color: var(--color-pink); }
.text-info { color: #0ea5e9; }
.text-success { color: var(--color-emerald); }
.text-danger { color: var(--color-coral); }
.text-warning { color: #d97706; }

@media (max-width: 991px) {
    .text-lg-start { text-align: center; }
}

/* ==========================================
   ALERTS
   ========================================== */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    border-left: 4px solid;
    margin-bottom: var(--space-4);
    font-size: var(--font-body);
    line-height: var(--line-body);
    font-weight: 600;
}

.alert i {
    margin-right: var(--space-2);
}

.alert-success {
    background: var(--color-emerald-soft);
    border-left-color: var(--color-emerald);
    color: #047857;
}

.alert-danger {
    background: var(--color-coral-soft);
    border-left-color: var(--color-coral);
    color: #be123c;
}

.alert-info {
    background: var(--color-sky-soft);
    border-left-color: var(--color-sky);
    color: #0369a1;
}

.alert-warning {
    background: var(--color-warning-soft);
    border-left-color: var(--color-warning);
    color: #92400e;
}

/* ==========================================
   FOOTER
   ========================================== */

footer {
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: var(--space-4) 0;
    margin-top: auto;
    text-align: center;
    font-size: var(--font-label);
    color: var(--color-text-tertiary);
    font-weight: 600;
}

/* ==========================================
   UTILITIES
   ========================================== */

.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); font-weight: 600; }
.text-secondary { color: var(--color-pink); }
.text-white-50 { color: rgba(255, 255, 255, 0.7); }

.d-flex { display: flex; }
.d-none { display: none; }
.flex-column { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.align-items-center { align-items: center; }
.align-items-start { align-items: flex-start; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }

.gap-sm { gap: var(--space-2); }
.gap-md { gap: var(--space-4); }
.gap-lg { gap: var(--space-6); }

.mt-sm { margin-top: var(--space-2); }
.mt-md { margin-top: var(--space-4); }
.mt-lg { margin-top: var(--space-6); }
.mt-xl { margin-top: var(--space-8); }

.mb-sm { margin-bottom: var(--space-2); }
.mb-md { margin-bottom: var(--space-4); }
.mb-lg { margin-bottom: var(--space-6); }
.mb-xl { margin-bottom: var(--space-8); }

/* ==========================================
   RESPONSIVE GRID
   ========================================== */

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 calc(var(--space-4) * -0.5);
}

.col, .col-6, .col-12, .col-md-4, .col-md-6, .col-md-8, .col-lg-3, .col-lg-4, .col-lg-6, .col-lg-8, .col-lg-10 {
    padding: 0 calc(var(--space-4) * 0.5);
    width: 100%;
}

.col-3 { width: 25%; }
.col-4 { width: 33.333%; }
.col-6 { width: 50%; }
.col-12 { width: 100%; }

@media (min-width: 768px) {
    .col-md-3 { width: 25%; }
    .col-md-4 { width: 33.333%; }
    .col-md-6 { width: 50%; }
    .col-md-8 { width: 66.667%; }
}

@media (min-width: 992px) {
    .col-lg-3 { width: 25%; }
    .col-lg-4 { width: 33.333%; }
    .col-lg-6 { width: 50%; }
    .col-lg-8 { width: 66.667%; }
    .col-lg-10 { width: 83.333%; }
}

@media (min-width: 576px) {
    .flex-sm-row { flex-direction: row; }
    .text-sm-start { text-align: left; }
}

/* ==========================================
   BADGE
   ========================================== */

.badge {
    font-size: var(--font-caption);
    font-weight: 700;
    padding: 4px 10px;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
}

.badge-success {
    background: var(--color-emerald-soft);
    color: #047857;
}

.badge-danger {
    background: var(--color-coral-soft);
    color: #be123c;
}

.badge-warning {
    background: var(--color-warning-soft);
    color: #92400e;
}

.badge-primary {
    background: var(--color-pink-soft);
    color: var(--color-pink-hover);
}

/* ==========================================
   PROGRESS BAR
   ========================================== */

.progress {
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--radius-pill);
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-pill);
    transition: width 0.3s ease;
}

/* ==========================================
   EMPTY STATE
   ========================================== */

.empty-state {
    text-align: center;
    padding: var(--space-12) var(--space-6);
    color: var(--color-text-muted);
}

.empty-state i {
    font-size: 48px;
    color: var(--color-pink);
    margin-bottom: var(--space-4);
    opacity: 0.4;
}

.empty-state h3 {
    color: var(--color-text-muted);
    font-weight: 700;
    margin-bottom: var(--space-2);
}

.empty-state p {
    color: var(--color-text-tertiary);
}

/* ==========================================
   TABLE
   ========================================== */

table {
    width: 100%;
    border-collapse: collapse;
}

table th, table td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

table th {
    font-size: var(--font-label);
    font-weight: 700;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 767px) {
    main {
        padding-left: var(--space-4);
        padding-right: var(--space-4);
    }
    
    .btn {
        padding: 10px 20px;
    }
    
    .navbar-brand {
        font-size: 22px;
    }
    
    .navbar-brand i {
        font-size: 24px;
    }
    
    .btn-lg {
        padding: 14px 28px;
        font-size: var(--font-body);
    }
    
    .col-3 {
        width: 25%;
    }
}

@media (max-width: 575px) {
    .col-6 {
        width: 100%;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

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

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

*:focus-visible {
    outline: 3px solid rgba(20, 184, 166, 0.4);
    outline-offset: 2px;
}

/* ==========================================
   CUSTOM MODAL
   ========================================== */

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: var(--space-4);
    backdrop-filter: blur(8px);
}

.custom-modal {
    background: #fff;
    border-radius: var(--radius-xl);
    max-width: 450px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.10);
    border: 1px solid rgba(0, 0, 0, 0.04);
    animation: modalSlideIn 0.25s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-modal-header {
    padding: var(--space-6) var(--space-6) var(--space-4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.custom-modal-header h5 {
    margin: 0;
    font-size: var(--font-section);
    font-weight: 800;
    color: var(--color-text);
}

.custom-modal-body {
    padding: var(--space-6);
}

.custom-modal-body p {
    margin: 0 0 var(--space-4);
    color: var(--color-text-muted);
    font-size: var(--font-body);
    line-height: 1.5;
}

.custom-modal-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: var(--space-2);
}

.custom-modal-list-item {
    padding: var(--space-2) var(--space-4);
    background: var(--color-pink-soft);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-1);
    font-size: var(--font-label);
    color: var(--color-text);
    font-weight: 600;
}

.custom-modal-list-item .badge {
    font-size: var(--font-caption);
    padding: 2px 8px;
    border-radius: var(--radius-pill);
    margin-left: var(--space-2);
}

.custom-modal-list-item .badge-warning {
    background: var(--color-warning-soft);
    color: #92400e;
}

.custom-modal-list-item .badge-skip {
    background: var(--color-coral-soft);
    color: #be123c;
}

.custom-modal-footer {
    padding: var(--space-4) var(--space-6) var(--space-6);
    display: flex;
    gap: var(--space-3);
    justify-content: flex-end;
}

.custom-modal-footer .btn {
    min-width: 100px;
}

/* ==========================================
   RESPONSIVE INPUT GROUPS
   ========================================== */

.word-search-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.word-search-group .form-control {
    border-radius: var(--radius-lg);
    width: 100%;
}

.word-search-group .btn {
    border-radius: var(--radius-pill);
    width: 100%;
}

@media (min-width: 576px) {
    .word-search-group {
        flex-direction: row;
        gap: 0;
    }
    .word-search-group .form-control {
        border-radius: var(--radius-lg) 0 0 var(--radius-lg);
        flex: 1;
    }
    .word-search-group .btn {
        border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
        width: auto;
        white-space: nowrap;
    }
}

/* ==========================================
   CUSTOM DROPDOWN COMPONENT
   ========================================== */

.custom-dropdown {
    position: relative;
    width: 100%;
    max-width: 340px;
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

.custom-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: #fff;
    border: 2px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    user-select: none;
    outline: none;
    line-height: 1.4;
}

.custom-dropdown-trigger:hover {
    border-color: var(--color-pink);
}

.custom-dropdown-trigger:focus,
.custom-dropdown.open .custom-dropdown-trigger {
    border-color: var(--color-pink);
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.custom-dropdown-trigger .dropdown-placeholder {
    color: #7c3aed;
    font-weight: 600;
    font-style: italic;
}

.custom-dropdown-trigger .dropdown-selected-text {
    color: var(--color-text);
    font-weight: 600;
}

.custom-dropdown-trigger .dropdown-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: var(--color-text-tertiary);
    transition: transform 0.25s ease;
    flex-shrink: 0;
    margin-left: 12px;
}

.custom-dropdown.open .dropdown-chevron {
    transform: rotate(180deg);
}

.custom-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    z-index: 1000;
    max-height: 240px;
    overflow-y: auto;
    display: none;
    padding: var(--space-1) 0;
}

.custom-dropdown.open .custom-dropdown-menu {
    display: block;
    animation: dropdownSlideIn 0.2s ease;
}

@keyframes dropdownSlideIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.custom-dropdown-item {
    display: block;
    width: 100%;
    padding: 11px 16px;
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    font-size: var(--font-body);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.4;
    font-family: var(--font-family);
    font-weight: 600;
}

.custom-dropdown-item:hover {
    background: var(--color-pink-soft);
    color: var(--color-pink);
}

.custom-dropdown-item.selected {
    background: var(--color-pink-soft);
    color: var(--color-pink);
    font-weight: 700;
}

.custom-dropdown-item.create-new {
    color: #7c3aed;
    font-weight: 800;
    border-top: none;
    border-bottom: 2px solid rgba(124, 58, 237, 0.15);
    font-style: italic;
}

.custom-dropdown-item.create-new:hover {
    background: rgba(124, 58, 237, 0.08);
}

.custom-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.custom-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.custom-dropdown-menu::-webkit-scrollbar-thumb {
    background-color: rgba(20, 184, 166, 0.2);
    border-radius: 3px;
}

@media (max-width: 767px) {
    .custom-dropdown {
        max-width: 100%;
    }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-8px); }
}

/* ==========================================
   SPINNER
   ========================================== */

.spinner-border {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    vertical-align: text-bottom;
    border: 0.2em solid var(--color-pink);
    border-right-color: transparent;

    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
}

.spinner-border.text-primary { border-color: var(--color-pink); border-right-color: transparent; }
.spinner-border.text-success { border-color: var(--color-emerald); border-right-color: transparent; }

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* ==========================================
   D-GRID
   ========================================== */

.d-grid {
    display: grid;
}

.d-grid.gap-3 {
    gap: var(--space-4);
}

/* Per-badge artwork scale + vertical centering correction */
#badgesvg-streak .badge-svg {
    transform: translateY(1.5px) scale(1.10);
    transform-origin: center center;
}
#badgesvg-master_list .badge-svg {
    transform: translateY(-1px) scale(1.12);
    transform-origin: center center;
}
