/* ═══════════════════════════════════════════════════════════
   Random Yes No Wheel — Premium CSS
   Brand: Crimson/Rose  |  Accent: Green (YES) & Red (NO)
═══════════════════════════════════════════════════════════ */

/* ── Design Tokens ─────────────────────────────────────── */
:root {
    --yn-brand:        #DC2626;
    --yn-brand-dark:   #B91C1C;
    --yn-brand-glow:   rgba(220,38,38,0.28);
    --yn-yes:          #16A34A;
    --yn-no:           #DC2626;
    --yn-maybe:        #D97706;
    --yn-try:          #2563EB;
    --yn-surface:      #FFFFFF;
    --yn-surface-2:    #F9FAFB;
    --yn-border:       #E5E7EB;
    --yn-text:         #111827;
    --yn-text-muted:   #6B7280;
    --yn-shadow-xs:    0 1px 2px rgba(0,0,0,.06);
    --yn-shadow-sm:    0 1px 4px rgba(0,0,0,.08);
    --yn-shadow:       0 4px 16px rgba(0,0,0,.10);
    --yn-shadow-lg:    0 8px 32px rgba(0,0,0,.13);
    --yn-radius-sm:    10px;
    --yn-radius:       16px;
    --yn-radius-lg:    24px;
}

/* ── Base ──────────────────────────────────────────────── */
body {
    background: var(--yn-surface-2);
    font-family: 'Poppins', 'Inter', system-ui, sans-serif;
    color: var(--yn-text);
}

/* ── Hero ──────────────────────────────────────────────── */
.yn-hero {
    background: linear-gradient(135deg, #0F0E17 0%, #1A0814 50%, #2D0B0B 100%);
    margin: 0 -0.75rem 0;
    padding: 2.2rem 1.5rem 2rem;
    border-radius: 0 0 28px 28px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.yn-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(220,38,38,0.18) 0%, transparent 70%);
    pointer-events: none;
}

.yn-hero-title {
    font-size: clamp(1.55rem, 4vw, 2.4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.yn-hero-title span {
    background: linear-gradient(90deg, #F87171, #DC2626);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.yn-hero-sub {
    color: rgba(255,255,255,0.70);
    font-size: 0.97rem;
    margin-bottom: 1rem;
}

.yn-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
}

.yn-hero-badge {
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    color: rgba(255,255,255,0.88);
    border-radius: 99px;
    padding: 0.22rem 0.75rem;
    font-size: 0.78rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

/* ── Main Two-Column Section ───────────────────────────── */
.yn-main {
    padding: 1.5rem 0;
}

/* ── Left Column — Wheel ───────────────────────────────── */
.yn-wheel-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Container for fullscreen targeting */
#yn-wheel-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Outer wrap — static container, ring spins via ::before only.
   isolation:isolate creates a stacking context so ::before z-index:-1
   stays inside this element and doesn't bleed through to the page. */
.yn-wheel-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    isolation: isolate;
}

/* Only the conic ring rotates — canvas stays perfectly still */
.yn-wheel-wrap::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(
        #DC2626, #F87171, #22C55E, #86EFAC,
        #DC2626, #F87171, #22C55E, #86EFAC, #DC2626
    );
    animation: yn-ring-spin 9s linear infinite;
    z-index: -1;
}

@keyframes yn-ring-spin {
    to { transform: rotate(360deg); }
}

.yn-wheel-inner {
    position: relative;
    z-index: 1;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
}

/* Arrow pointer — sits above the wheel */
.yn-pointer {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 14px solid transparent;
    border-right: 14px solid transparent;
    border-top: 28px solid #DC2626;
    filter: drop-shadow(0 0 6px rgba(220,38,38,0.6));
    z-index: 5;
    cursor: pointer;
}

/* Canvas — let JS control all sizing, no CSS max-width that would
   constrain width but not height (causing oval shape in fullscreen) */
#ynWheel {
    display: block;
    border-radius: 50%;
}

/* ── Spin Button ───────────────────────────────────────── */
#ynSpinBtn {
    background: linear-gradient(135deg, #DC2626, #B91C1C);
    color: #fff;
    border: none;
    border-radius: 99px;
    padding: 0.75rem 2.4rem;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    box-shadow: 0 4px 18px rgba(220,38,38,0.40);
    transition: transform .15s, box-shadow .15s;
    animation: yn-spin-pulse 2.8s ease-out infinite;
    cursor: pointer;
    width: 100%;
    max-width: 320px;
}

#ynSpinBtn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 24px rgba(220,38,38,0.50);
}

#ynSpinBtn:active { transform: scale(.97); }

@keyframes yn-spin-pulse {
    0%, 100% { box-shadow: 0 4px 18px rgba(220,38,38,0.40); }
    50%       { box-shadow: 0 4px 28px rgba(220,38,38,0.70), 0 0 0 8px rgba(220,38,38,0.10); }
}

/* ── Speed Row ─────────────────────────────────────────── */
.yn-speed-row {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    max-width: 320px;
}

.yn-speed-row .btn {
    flex: 1;
    border-radius: 99px;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.4rem 0;
}

/* ── Sound Pills ───────────────────────────────────────── */
.yn-sound-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
    max-width: 360px;
}

.yn-sound-pill {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.38rem 0.9rem;
    border-radius: 99px;
    border: 1.5px solid var(--yn-border);
    background: var(--yn-surface);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--yn-text-muted);
    transition: border-color .18s, background .18s, color .18s;
    user-select: none;
}

.yn-sound-pill input[type="checkbox"] { display: none; }

.yn-sound-pill:has(input:checked) {
    border-color: var(--yn-brand);
    background: linear-gradient(135deg, #FEF2F2, #FFF5F5);
    color: var(--yn-brand);
}

/* ── Action Row ────────────────────────────────────────── */
.yn-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    width: 100%;
    max-width: 360px;
}

.yn-action-row .btn {
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.38rem 0.85rem;
    flex: 1;
    min-width: 90px;
}

.yn-spin-hint {
    font-size: 0.78rem;
    color: var(--yn-text-muted);
    margin: 0;
}

.yn-spin-hint kbd {
    background: var(--yn-surface);
    border: 1px solid var(--yn-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.75rem;
}

/* ── Right Column — Panel ──────────────────────────────── */
.yn-panel {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Result Card ───────────────────────────────────────── */
.yn-result-card {
    border-radius: var(--yn-radius);
    background: linear-gradient(135deg, #F9FAFB, #F3F4F6);
    border: 2px solid var(--yn-border);
    padding: 1.4rem 1.25rem;
    text-align: center;
    transition: border-color .3s, background .3s, box-shadow .3s;
}

.yn-result-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yn-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.yn-result-answer {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -1px;
    color: var(--yn-text-muted);
    transition: color .3s;
    line-height: 1.1;
}

.yn-result-question {
    font-size: 0.82rem;
    color: var(--yn-text-muted);
    margin-top: 0.4rem;
    font-style: italic;
    min-height: 1.2em;
}

/* Result variants */
.yn-result-card.yn-yes {
    border-color: #16A34A;
    background: linear-gradient(135deg, #F0FDF4, #DCFCE7);
    box-shadow: 0 0 20px rgba(22,163,74,0.18);
}
.yn-result-card.yn-yes .yn-result-answer { color: #16A34A; }

.yn-result-card.yn-no {
    border-color: #DC2626;
    background: linear-gradient(135deg, #FEF2F2, #FEE2E2);
    box-shadow: 0 0 20px rgba(220,38,38,0.18);
}
.yn-result-card.yn-no .yn-result-answer { color: #DC2626; }

.yn-result-card.yn-maybe {
    border-color: #D97706;
    background: linear-gradient(135deg, #FFFBEB, #FEF3C7);
    box-shadow: 0 0 20px rgba(217,119,6,0.18);
}
.yn-result-card.yn-maybe .yn-result-answer { color: #D97706; }

.yn-result-card.yn-try {
    border-color: #2563EB;
    background: linear-gradient(135deg, #EFF6FF, #DBEAFE);
    box-shadow: 0 0 20px rgba(37,99,235,0.18);
}
.yn-result-card.yn-try .yn-result-answer { color: #2563EB; }

/* ── Options Card ──────────────────────────────────────── */
.yn-options-card {
    background: var(--yn-surface);
    border-radius: var(--yn-radius);
    border: 1.5px solid var(--yn-border);
    padding: 1.1rem 1.1rem 1rem;
    box-shadow: var(--yn-shadow-xs);
}

.yn-options-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yn-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.75rem;
}

/* Toggle checkboxes */
.yn-toggle-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.yn-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.85rem;
    border-radius: 99px;
    border: 1.5px solid var(--yn-border);
    background: var(--yn-surface-2);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--yn-text-muted);
    transition: all .18s;
    user-select: none;
}

.yn-toggle input[type="checkbox"] { display: none; }

.yn-toggle.yn-toggle-yes:has(input:checked)   { border-color: #16A34A; background: #F0FDF4; color: #16A34A; }
.yn-toggle.yn-toggle-no:has(input:checked)    { border-color: #DC2626; background: #FEF2F2; color: #DC2626; }
.yn-toggle.yn-toggle-maybe:has(input:checked) { border-color: #D97706; background: #FFFBEB; color: #D97706; }
.yn-toggle.yn-toggle-try:has(input:checked)   { border-color: #2563EB; background: #EFF6FF; color: #2563EB; }

/* Custom option input */
.yn-custom-input-row {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
}

.yn-custom-input-row input {
    flex: 1;
    border-radius: 10px;
    border: 1.5px solid var(--yn-border);
    padding: 0.4rem 0.7rem;
    font-size: 0.85rem;
    outline: none;
    transition: border-color .18s;
}

.yn-custom-input-row input:focus { border-color: var(--yn-brand); }

.yn-custom-input-row button {
    border-radius: 10px;
    padding: 0.4rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    background: var(--yn-brand);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background .15s;
}

.yn-custom-input-row button:hover { background: var(--yn-brand-dark); }

/* Options list */
#ynOptionsList {
    min-height: 40px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.yn-option-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--yn-surface-2);
    border: 1px solid var(--yn-border);
    border-radius: var(--yn-radius-sm);
    padding: 0.32rem 0.6rem;
    font-size: 0.83rem;
    font-weight: 600;
}

.yn-option-item button {
    background: none;
    border: none;
    color: #EF4444;
    cursor: pointer;
    font-size: 0.8rem;
    padding: 0 0.2rem;
    line-height: 1;
}

/* Quick mode buttons */
.yn-mode-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.yn-mode-btn {
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border: 1.5px solid var(--yn-border);
    background: var(--yn-surface-2);
    color: var(--yn-text-muted);
    cursor: pointer;
    transition: all .15s;
}

.yn-mode-btn:hover,
.yn-mode-btn.active {
    border-color: var(--yn-brand);
    background: #FEF2F2;
    color: var(--yn-brand);
}

/* ── Question Input ────────────────────────────────────── */
.yn-question-card {
    background: var(--yn-surface);
    border-radius: var(--yn-radius);
    border: 1.5px solid var(--yn-border);
    padding: 1rem 1.1rem;
    box-shadow: var(--yn-shadow-xs);
}

.yn-question-card label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yn-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.5rem;
}

.yn-question-card input {
    width: 100%;
    border-radius: 10px;
    border: 1.5px solid var(--yn-border);
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    outline: none;
    transition: border-color .18s;
    box-sizing: border-box;
}

.yn-question-card input:focus { border-color: var(--yn-brand); }

/* ── History Card ──────────────────────────────────────── */
.yn-history-card {
    background: var(--yn-surface);
    border-radius: var(--yn-radius);
    border: 1.5px solid var(--yn-border);
    padding: 1rem 1.1rem;
    box-shadow: var(--yn-shadow-xs);
}

.yn-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.6rem;
}

.yn-history-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--yn-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.yn-history-actions { display: flex; gap: 0.4rem; }

.yn-history-actions .btn {
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.65rem;
}

#ynHistoryList {
    max-height: 180px;
    overflow-y: auto;
    list-style: none;
    margin: 0;
    padding: 0;
}

#ynHistoryList li {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--yn-border);
    font-size: 0.82rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

#ynHistoryList li:last-child { border-bottom: none; }

.yn-hist-badge {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 99px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}
.yn-hist-yes  { background: #16A34A; }
.yn-hist-no   { background: #DC2626; }
.yn-hist-maybe { background: #D97706; }
.yn-hist-try  { background: #2563EB; }
.yn-hist-custom { background: #7C3AED; }

/* ── Fullscreen result overlay — hidden normally ───────── */
.yn-fs-result {
    display: none;
}

/* ── Fullscreen ────────────────────────────────────────── */
#yn-wheel-container:fullscreen,
#yn-wheel-container:-webkit-full-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: radial-gradient(ellipse at center, #1A0814 0%, #0A0812 100%);
    padding: 2rem;
}

/* Show result overlay in fullscreen */
#yn-wheel-container:fullscreen .yn-fs-result,
#yn-wheel-container:-webkit-full-screen .yn-fs-result {
    display: block;
    text-align: center;
}

.yn-fs-answer {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    font-weight: 900;
    letter-spacing: -1px;
    color: #fff;
    line-height: 1;
    text-shadow: 0 0 30px currentColor;
    transition: color .3s;
}

.yn-fs-answer.yn-fs-yes   { color: #4ADE80; }
.yn-fs-answer.yn-fs-no    { color: #F87171; }
.yn-fs-answer.yn-fs-maybe { color: #FCD34D; }
.yn-fs-answer.yn-fs-try   { color: #93C5FD; }

.yn-fs-question {
    font-size: 1rem;
    color: rgba(255,255,255,0.65);
    margin-top: 0.4rem;
    font-style: italic;
}

#yn-wheel-container:fullscreen #ynSpinBtn,
#yn-wheel-container:-webkit-full-screen #ynSpinBtn {
    max-width: 260px;
    width: 100%;
}

/* ── Confetti Canvas ───────────────────────────────────── */
#ynConfettiCanvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* ── GEO Section ───────────────────────────────────────── */
.yn-geo-section {
    background: var(--yn-surface);
    border-top: 1px solid var(--yn-border);
    padding: 2.5rem 0;
    margin: 2rem -0.75rem 0;
}

.yn-geo-inner {
    max-width: 860px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

.yn-geo-inner h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--yn-brand);
    margin-top: 1.8rem;
    margin-bottom: 0.5rem;
}

.yn-geo-inner h2:first-child { margin-top: 0; }

.yn-geo-inner p {
    color: var(--yn-text);
    line-height: 1.75;
    font-size: 0.95rem;
}

.yn-geo-inner ul {
    padding-left: 1.25rem;
    line-height: 1.8;
    font-size: 0.95rem;
}

.yn-geo-inner li { margin-bottom: 0.2rem; }

/* ── Content Sections ──────────────────────────────────── */
.yn-content-section {
    background: var(--yn-surface);
    border-radius: var(--yn-radius);
    border: 1.5px solid var(--yn-border);
    padding: 1.5rem 1.5rem 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--yn-shadow-xs);
}

.yn-content-section h2 {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--yn-brand);
    margin-bottom: 0.75rem;
}

.yn-content-section h5 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--yn-text);
    margin-top: 1rem;
    margin-bottom: 0.3rem;
}

.yn-content-section p,
.yn-content-section li {
    font-size: 0.92rem;
    color: #374151;
    line-height: 1.7;
}

.yn-content-section ul {
    padding-left: 1.25rem;
    margin-bottom: 0;
}

/* ── FAQ Accordion ─────────────────────────────────────── */
.yn-faq-item {
    border-bottom: 1px solid var(--yn-border);
    padding: 0.1rem 0;
}

.yn-faq-item:last-child { border-bottom: none; }

.yn-faq-q {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    background: none;
    border: none;
    padding: 0.8rem 0;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--yn-text);
    cursor: pointer;
    text-align: left;
    gap: 0.5rem;
    transition: color .18s;
}

.yn-faq-q:hover { color: var(--yn-brand); }
.yn-faq-q.open  { color: var(--yn-brand); }

.yn-faq-arrow {
    font-size: 0.85rem;
    transition: transform 0.25s;
    flex-shrink: 0;
}

.yn-faq-q.open .yn-faq-arrow { transform: rotate(180deg); }

.yn-faq-a {
    display: none;
    padding: 0 0 0.8rem;
    font-size: 0.88rem;
    color: #4B5563;
    line-height: 1.7;
}

.yn-faq-a.open { display: block; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 991px) {
    .yn-wheel-col { margin-bottom: 0.5rem; }
    #ynWheel { max-width: 360px; }
}

@media (max-width: 575px) {
    .yn-hero { padding: 1.5rem 1rem 1.4rem; }
    .yn-hero-title { font-size: 1.4rem; }
    .yn-content-section { padding: 1.1rem; }
    .yn-geo-inner { padding: 0 0.85rem; }
    #ynWheel { max-width: 300px; }
    #ynSpinBtn { font-size: 0.95rem; padding: 0.65rem 1.6rem; }
}
