/* ============================================================
   Word Combiner Game — word-combiner.css
   All selectors scoped to #wc-root to avoid theme conflicts
   ============================================================ */

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

#wc-root {
    font-family: 'Nunito', sans-serif;
    background: #ffffff;
    color: #1a1a2e;
    max-width: 760px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4.5rem;
    box-sizing: border-box;
}

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

/* ── Hero ─────────────────────────────── */
#wc-root .wc-hero {
    text-align: center;
    margin-bottom: 2.5rem;
}

#wc-root .wc-badge {
    display: inline-block;
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: #3730a3;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    padding: 5px 16px;
    border-radius: 100px;
    margin-bottom: 1rem;
}

#wc-root .wc-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 50%, #818cf8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
    /* Override any theme h2 styles */
    border: none;
    padding: 0;
}

#wc-root .wc-subtitle {
    font-size: 1rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Bouncing dots ─────────────────────── */
#wc-root .wc-bubbles {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 2rem;
}

#wc-root .wc-bubble {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    animation: wcBounce 1.4s ease-in-out infinite;
}

#wc-root .wc-bubble:nth-child(1) { background: #3b82f6; animation-delay: 0s; }
#wc-root .wc-bubble:nth-child(2) { background: #818cf8; animation-delay: .15s; }
#wc-root .wc-bubble:nth-child(3) { background: #38bdf8; animation-delay: .30s; }
#wc-root .wc-bubble:nth-child(4) { background: #c084fc; animation-delay: .45s; }

@keyframes wcBounce {
    0%, 100% { transform: translateY(0);    opacity: .6; }
    50%       { transform: translateY(-9px); opacity: 1;  }
}

/* ── Input grid ────────────────────────── */
#wc-root .wc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1rem;
}

@media (max-width: 540px) {
    #wc-root .wc-grid   { grid-template-columns: 1fr; }
    #wc-root .wc-title  { font-size: 2rem; }
}

/* ── Individual field card ─────────────── */
#wc-root .wc-field {
    position: relative;
    border-radius: 16px;
    padding: 3px;
    transition: transform .18s ease;
}
#wc-root .wc-field:focus-within { transform: translateY(-3px); }

#wc-root .wc-field-1 { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
#wc-root .wc-field-2 { background: linear-gradient(135deg, #4338ca, #818cf8); }
#wc-root .wc-field-3 { background: linear-gradient(135deg, #0891b2, #38bdf8); }
#wc-root .wc-field-4 { background: linear-gradient(135deg, #7c3aed, #c084fc); }

#wc-root .wc-field-inner {
    background: #ffffff;
    border-radius: 13px;
    padding: 12px 14px 10px;
}

#wc-root .wc-label {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 4px;
    /* Override theme label styles */
    line-height: 1.4;
}

#wc-root .wc-field-1 .wc-label { color: #1d4ed8; }
#wc-root .wc-field-2 .wc-label { color: #4338ca; }
#wc-root .wc-field-3 .wc-label { color: #0891b2; }
#wc-root .wc-field-4 .wc-label { color: #7c3aed; }

#wc-root .wc-input {
    width: 100%;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    font-family: 'Playfair Display', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    background: transparent;
    padding: 0;
    /* Override theme input styles */
    border-radius: 0;
    height: auto;
    line-height: 1.5;
}

#wc-root .wc-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
    font-style: italic;
}

/* Number badge */
#wc-root .wc-num {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 1;
}

#wc-root .wc-field-1 .wc-num { background: linear-gradient(135deg, #1d4ed8, #3b82f6); }
#wc-root .wc-field-2 .wc-num { background: linear-gradient(135deg, #4338ca, #818cf8); }
#wc-root .wc-field-3 .wc-num { background: linear-gradient(135deg, #0891b2, #38bdf8); }
#wc-root .wc-field-4 .wc-num { background: linear-gradient(135deg, #7c3aed, #c084fc); }

/* ── Error ─────────────────────────────── */
#wc-root .wc-error {
    font-size: .85rem;
    font-weight: 700;
    color: #ef4444;
    text-align: center;
    min-height: 1.4rem;
    margin: .4rem 0 .6rem;
}

/* ── Buttons ───────────────────────────── */
#wc-root .wc-btn-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 2.5rem;
}

#wc-root .wc-btn-primary {
    background: linear-gradient(135deg, #1d4ed8 0%, #6366f1 100%);
    color: #ffffff;
    border: none !important;
    padding: 14px 44px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: .5px;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(59,130,246,.35);
    transition: box-shadow .18s, transform .12s;
    line-height: 1.4;
    text-decoration: none;
}
#wc-root .wc-btn-primary:hover {
    box-shadow: 0 8px 28px rgba(59,130,246,.48);
    transform: translateY(-1px);
    color: #ffffff;
    background: linear-gradient(135deg, #1d4ed8 0%, #6366f1 100%);
}
#wc-root .wc-btn-primary:active  { transform: scale(.97); }
#wc-root .wc-btn-primary:focus   { outline: 3px solid #93c5fd; outline-offset: 2px; }

#wc-root .wc-btn-ghost {
    background: #ffffff;
    color: #94a3b8;
    border: 2px solid #e2e8f0 !important;
    padding: 14px 24px;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: border-color .15s, color .15s;
    line-height: 1.4;
}
#wc-root .wc-btn-ghost:hover  { border-color: #94a3b8 !important; color: #475569; }
#wc-root .wc-btn-ghost:focus  { outline: 3px solid #93c5fd; outline-offset: 2px; }

/* ── Results ────────────────────────────── */
#wc-root #wc-results {
    display: none;
}
#wc-root #wc-results.wc-visible {
    display: block;
}

#wc-root .wc-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed #e2e8f0;
}

#wc-root .wc-results-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #1e293b;
}

#wc-root .wc-count-pill {
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: #3730a3;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 14px;
    border-radius: 100px;
}

/* ── Sort buttons ───────────────────────── */
#wc-root .wc-sort-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 1.3rem;
}

#wc-root .wc-sort {
    font-family: 'Nunito', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 100px;
    border: 2px solid #e2e8f0 !important;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: all .14s;
    line-height: 1.4;
}
#wc-root .wc-sort:hover  { border-color: #93c5fd !important; color: #1d4ed8; }
#wc-root .wc-sort.wc-active {
    background: linear-gradient(135deg, #1d4ed8, #6366f1);
    color: #ffffff;
    border-color: transparent !important;
    box-shadow: 0 3px 10px rgba(99,102,241,.3);
}

/* ── Word chips ─────────────────────────── */
#wc-root .wc-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#wc-root .wc-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 100px;
    font-family: 'Playfair Display', serif;
    font-size: .97rem;
    font-weight: 700;
    cursor: pointer;
    user-select: none;
    border: 2px solid transparent;
    transition: transform .12s, box-shadow .12s;
    text-decoration: none;
}
#wc-root .wc-chip:hover  { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
#wc-root .wc-chip:active { transform: scale(.96); }

#wc-root .wc-chip.cc-0 { background: #dbeafe; color: #1d4ed8; }
#wc-root .wc-chip.cc-1 { background: #ede9fe; color: #5b21b6; }
#wc-root .wc-chip.cc-2 { background: #cffafe; color: #0e7490; }
#wc-root .wc-chip.cc-3 { background: #fce7f3; color: #9d174d; }
#wc-root .wc-chip.cc-4 { background: #dcfce7; color: #166534; }
#wc-root .wc-chip.cc-5 { background: #fef3c7; color: #92400e; }
#wc-root .wc-chip.cc-6 { background: #fee2e2; color: #991b1b; }

#wc-root .wc-chip.wc-copied {
    background: linear-gradient(135deg, #bbf7d0, #86efac) !important;
    color: #14532d !important;
    border-color: #4ade80;
}

#wc-root .wc-chip-len {
    font-family: 'Nunito', sans-serif;
    font-size: 9px;
    font-weight: 800;
    opacity: .5;
}
#wc-root .wc-chip.wc-copied .wc-chip-len { display: none; }

/* ── Empty state ────────────────────────── */
#wc-root .wc-empty {
    text-align: center;
    padding: 2.5rem 0;
    font-size: .9rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ── Tip bar ─────────────────────────────── */
#wc-root .wc-tip {
    margin-top: 2.5rem;
    background: linear-gradient(135deg, #eff6ff, #f5f3ff);
    border: 1.5px solid #c7d2fe;
    border-radius: 14px;
    padding: 1rem 1.4rem;
    font-size: .83rem;
    font-weight: 600;
    color: #4338ca;
    text-align: center;
    line-height: 1.7;
}
