/* ============================================================
   Spin the Bottle — Premium CSS
   thewheelofname.com/spinthebottle
   ============================================================ */

:root {
    --stb-purple:      #7C3AED;
    --stb-purple-dark: #5B21B6;
    --stb-pink:        #EC4899;
    --stb-pink-dark:   #BE185D;
    --stb-gold:        #F59E0B;
    --stb-text:        #1E1B4B;
    --stb-muted:       #6B7280;
    --stb-radius:      16px;
    --stb-shadow:      0 4px 24px rgba(0,0,0,0.10);
}

/* ── Hero ───────────────────────────────────────────────────── */
.stb-hero {
    background: linear-gradient(135deg, #4C1D95 0%, #7C3AED 50%, #BE185D 100%);
    color: #fff;
    border-radius: var(--stb-radius);
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}
.stb-hero::before {
    content: '🍾🎯🎉🎲💫🎊🔮🎭';
    position: absolute;
    top: 0.5rem; left: 0; right: 0;
    font-size: 1.5rem;
    letter-spacing: 0.8rem;
    opacity: 0.15;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}
.stb-hero h1 { font-size: clamp(1.6rem,4vw,2.4rem); font-weight: 800; margin-bottom: 0.5rem; }
.stb-hero p  { opacity: 0.9; font-size: 1.05rem; margin: 0; }

/* ── Page layout ────────────────────────────────────────────── */
.stb-content-wrapper { position: relative; z-index: 1; }

/* ── Tool row ───────────────────────────────────────────────── */
.stb-tool-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 2rem;
}

/* ── Participants card ──────────────────────────────────────── */
.participants-card {
    background: #fff;
    border: 1px solid #E5E7EB;
    border-radius: var(--stb-radius);
    padding: 1.25rem;
    box-shadow: var(--stb-shadow);
    min-width: 260px;
    max-width: 340px;
    flex: 1 1 280px;
}
.participants-card h2 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--stb-text);
    margin: 0;
}
.participants-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.input-text {
    flex: 1;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.15s;
    min-width: 0;
}
.input-text:focus { outline: none; border-color: var(--stb-purple); box-shadow: 0 0 0 3px rgba(124,58,237,0.12); }

.participants-list { margin-top: 10px; max-height: 240px; overflow: auto; }
.participant-row { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px; border-radius: 8px; margin: 4px 0; border: 1px solid #F3F4F6; }
.participant-name { font-weight: 600; font-size: 0.9rem; color: var(--stb-text); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { padding: 6px 12px; border-radius: 8px; border: 0; cursor: pointer; font-size: 0.85rem; font-weight: 600; transition: background 0.15s, transform 0.1s; }
.btn-primary { background: var(--stb-purple); color: #fff; }
.btn-primary:hover { background: var(--stb-purple-dark); }
.btn-ghost { background: transparent; border: 1px solid #D1D5DB; color: var(--stb-text); }
.btn-ghost:hover { background: #F3F4F6; }
.btn-ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.small { font-size: 0.82rem; }

/* ── Spin button ────────────────────────────────────────────── */
#spinBtn {
    background: linear-gradient(135deg, var(--stb-pink-dark), var(--stb-pink));
    color: #fff;
    padding: 0.6rem 1.6rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(236,72,153,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}
#spinBtn:hover  { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(236,72,153,0.45); }
#spinBtn:active { transform: translateY(0); }
#spinBtn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* ── Players circle ─────────────────────────────────────────── */
.players-circle {
    position: relative;
    width: min(500px, 82vw);
    height: min(500px, 82vw);
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 30% 30%, rgba(124,58,237,0.04), transparent 60%);
    box-shadow: 0 6px 28px rgba(0,0,0,0.09);
    border: 2px dashed rgba(124,58,237,0.15);
}

.player { position: absolute; transform-origin: center center; text-align: center; pointer-events: none; width: 140px; }
.player .label {
    background: rgba(255,255,255,0.97);
    padding: 5px 10px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    display: inline-block;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--stb-text);
    border: 1px solid #E5E7EB;
    white-space: nowrap;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
}
.player .label.selected { background: linear-gradient(90deg, #FDE68A, #FCD34D); border-color: #F59E0B; transform: scale(1.08); }

/* ── Bottle ─────────────────────────────────────────────────── */
.bottle-viewport { position: absolute; width: 220px; height: 220px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.bottle {
    width: 90px;
    height: 240px;
    transform-origin: 50% 82%;
    transition: transform 3.4s cubic-bezier(.08,.9,.2,1);
    will-change: transform;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.18));
}
.bottle:hover { filter: drop-shadow(0 6px 18px rgba(124,58,237,0.35)); }

/* ── Result box ─────────────────────────────────────────────── */
.result-box {
    margin-top: 1rem;
    padding: 14px 18px;
    background: linear-gradient(135deg, #F5F3FF, #EDE9FE);
    border: 2px solid var(--stb-purple);
    width: 100%;
    max-width: 400px;
    text-align: center;
    border-radius: 12px;
    box-shadow: var(--stb-shadow);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--stb-purple-dark);
    display: none;
}

/* ── Confetti ───────────────────────────────────────────────── */
#confettiCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 1100; }

/* ── GEO section ────────────────────────────────────────────── */
.stb-geo-section { margin: 2.5rem 0 1rem; padding-top: 1.5rem; border-top: 2px solid #F3F4F6; }
.stb-geo-section h2 { font-size: 1.45rem; font-weight: 800; color: var(--stb-purple-dark); margin-bottom: 0.75rem; }
.stb-geo-section h3 { font-size: 1.05rem; font-weight: 700; color: var(--stb-pink-dark); margin: 1.25rem 0 0.4rem; }
.stb-geo-section p  { color: #374151; line-height: 1.75; margin-bottom: 0.75rem; }

/* ── Content cards ──────────────────────────────────────────── */
.stb-content-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px,1fr)); gap: 1rem; margin: 1.25rem 0; }
.stb-content-card { background: linear-gradient(135deg,#FAFAFF,#fff); border: 1px solid #DDD6FE; border-radius: 12px; padding: 1.1rem; }
.stb-content-card h4 { font-size: 0.9rem; font-weight: 700; color: var(--stb-purple-dark); margin-bottom: 0.4rem; }
.stb-content-card p  { font-size: 0.84rem; color: #4B5563; margin: 0; line-height: 1.6; }

/* ── Comparison table ───────────────────────────────────────── */
.stb-table { width: 100%; border-collapse: collapse; margin: 1rem 0; font-size: 0.9rem; }
.stb-table th { background: var(--stb-purple); color: #fff; padding: 0.65rem 1rem; text-align: left; }
.stb-table td { padding: 0.6rem 1rem; border-bottom: 1px solid #E5E7EB; }
.stb-table tr:nth-child(even) td { background: #F5F3FF; }

/* ── FAQ accordion ──────────────────────────────────────────── */
.stb-faq-section { margin: 2.5rem 0; }
.stb-faq-section h2 { font-size: 1.45rem; font-weight: 800; color: var(--stb-purple-dark); margin-bottom: 1rem; }
.stb-faq-item { border: 1px solid #E5E7EB; border-radius: 10px; margin-bottom: 0.5rem; overflow: hidden; transition: box-shadow 0.2s; }
.stb-faq-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }
.stb-faq-q { display: flex; justify-content: space-between; align-items: center; padding: 0.9rem 1.1rem; cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--stb-text); background: #fff; user-select: none; gap: 1rem; }
.stb-faq-q:hover { background: #F5F3FF; color: var(--stb-purple-dark); }
.stb-faq-icon { font-size: 1.1rem; transition: transform 0.25s; flex-shrink: 0; }
.stb-faq-item.stb-open .stb-faq-icon { transform: rotate(45deg); }
.stb-faq-a { display: none; padding: 0 1.1rem 1rem; font-size: 0.9rem; color: #374151; line-height: 1.7; background: #fff; }
.stb-faq-item.stb-open .stb-faq-a { display: block; }

/* ── Related tools ──────────────────────────────────────────── */
.stb-related { background: linear-gradient(135deg,#1E1B4B,#312E81); color: #fff; border-radius: var(--stb-radius); padding: 1.5rem; margin: 2rem 0; }
.stb-related h3 { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; color: #C4B5FD; }
.stb-related-grid { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.stb-related-link { background: rgba(255,255,255,0.1); color: #fff; border-radius: 50px; padding: 0.4rem 1rem; font-size: 0.85rem; font-weight: 600; text-decoration: none; transition: background 0.15s; }
.stb-related-link:hover { background: rgba(196,181,253,0.3); color: #C4B5FD; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 600px) {
    .player { width: 110px; }
    .bottle-viewport { width: 160px; height: 160px; }
    .bottle { width: 66px; height: 190px; }
    .participants-card { max-width: 100%; }
    .stb-hero { padding: 1.5rem 1rem 1rem; }
}
