/* ============================================================
   Christmas Wheel — Premium CSS
   thewheelofname.com/christmaswheel
   ============================================================ */

/* ── Variables ──────────────────────────────────────────────── */
:root {
    --cw-red:         #DC2626;
    --cw-red-dark:    #B91C1C;
    --cw-green:       #16A34A;
    --cw-green-dark:  #15803D;
    --cw-gold:        #F59E0B;
    --cw-gold-dark:   #D97706;
    --cw-snow:        #F8FAFC;
    --cw-text:        #1E293B;
    --cw-muted:       #64748B;
    --cw-radius:      16px;
    --cw-shadow:      0 4px 24px rgba(0,0,0,0.10);
    --cw-ring-size:   6px;
}

/* ── Page hero header ───────────────────────────────────────── */
.cw-hero {
    background: linear-gradient(135deg, #B91C1C 0%, #DC2626 40%, #15803D 100%);
    color: #fff;
    border-radius: var(--cw-radius);
    padding: 2rem 1.5rem 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.cw-hero::before {
    content: '❄️🎄🎅🎁🦌⛄🔔🌟';
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    font-size: 1.5rem;
    letter-spacing: 0.8rem;
    opacity: 0.18;
    pointer-events: none;
    white-space: nowrap;
    overflow: hidden;
}

.cw-hero h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.cw-hero p {
    opacity: 0.9;
    font-size: 1.05rem;
    margin: 0;
}

/* ── Main tool layout ────────────────────────────────────────── */
.cw-tool-row {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cw-wheel-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 280px;
}

.cw-panel-col {
    flex: 1 1 320px;
    min-width: 280px;
}

/* ── Wheel container (fullscreen target) ────────────────────── */
#cw-wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

#cw-wheel-container:fullscreen,
#cw-wheel-container:-webkit-full-screen {
    background: linear-gradient(135deg, #1a0000 0%, #0a1a0a 50%, #1a1400 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    padding: 2rem;
}

/* ── Wheel wrap — spinning ring via ::before ─────────────────── */
.cw-wheel-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    isolation: isolate; /* CRITICAL: contains z-index stacking */
}

.cw-wheel-wrap::before {
    content: '';
    position: absolute;
    inset: calc(0px - var(--cw-ring-size));
    border-radius: 50%;
    background: conic-gradient(
        #DC2626, #F59E0B, #16A34A, #F59E0B,
        #DC2626, #F59E0B, #16A34A, #F59E0B,
        #DC2626
    );
    animation: cw-ring-spin 10s linear infinite;
    z-index: -1;
}

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

.cw-wheel-inner {
    position: relative;
    z-index: 1;
    border-radius: 50%;
    background: #fff;
    padding: 5px;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6), 0 8px 32px rgba(0,0,0,0.25);
}

/* NO max-width or width on canvas — JS controls all sizing */
#cwWheel {
    display: block;
    border-radius: 50%;
}

/* ── Pointer ────────────────────────────────────────────────── */
.cw-pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 30px solid #F59E0B;
    z-index: 10;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

/* ── Spin button ────────────────────────────────────────────── */
.cw-spin-btn {
    background: linear-gradient(135deg, var(--cw-red-dark), var(--cw-red));
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.85rem 2.5rem;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(220,38,38,0.4);
    transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
    letter-spacing: 0.02em;
}

.cw-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(220,38,38,0.5);
    background: linear-gradient(135deg, var(--cw-red), #EF4444);
}

.cw-spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.cw-spin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Fullscreen spin button override ────────────────────────── */
#cw-wheel-container:fullscreen .cw-spin-btn,
#cw-wheel-container:-webkit-full-screen .cw-spin-btn {
    font-size: 1.4rem;
    padding: 1rem 3rem;
}

/* ── Fullscreen result overlay ──────────────────────────────── */
.cw-fs-result {
    display: none;
    text-align: center;
}

#cw-wheel-container:fullscreen .cw-fs-result,
#cw-wheel-container:-webkit-full-screen .cw-fs-result {
    display: block;
}

.cw-fs-winner {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 900;
    color: #fff;
    text-shadow: 0 0 40px rgba(245,158,11,0.9), 0 2px 8px rgba(0,0,0,0.8);
    animation: cw-pop-in 0.4s cubic-bezier(0.34,1.56,0.64,1);
}

@@keyframes cw-pop-in {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* ── Control row (fullscreen / sound / share) ───────────────── */
.cw-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.cw-ctrl-btn {
    background: #fff;
    border: 2px solid #E2E8F0;
    color: var(--cw-text);
    border-radius: 50px;
    padding: 0.45rem 1.1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.cw-ctrl-btn:hover {
    border-color: var(--cw-red);
    background: #FEF2F2;
    color: var(--cw-red-dark);
}

/* ── Result card ────────────────────────────────────────────── */
.cw-result-card {
    background: linear-gradient(135deg, #FFF8F0, #FEF3C7);
    border: 2px solid var(--cw-gold);
    border-radius: var(--cw-radius);
    padding: 1.25rem 1.5rem;
    text-align: center;
    margin-bottom: 1.25rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.cw-result-card.cw-result-active {
    transform: scale(1.04);
    box-shadow: 0 8px 32px rgba(245,158,11,0.35);
}

.cw-result-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--cw-muted);
    margin-bottom: 0.25rem;
}

.cw-result-emoji {
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.cw-result-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cw-red-dark);
    word-break: break-word;
}

/* ── Panel sections ─────────────────────────────────────────── */
.cw-panel-section {
    background: #fff;
    border: 1px solid #E2E8F0;
    border-radius: var(--cw-radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--cw-shadow);
}

.cw-panel-section h3,
.cw-panel-section h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--cw-text);
    margin-bottom: 0.85rem;
}

/* ── Preset grid ────────────────────────────────────────────── */
.cw-preset-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.cw-preset-btn {
    background: #F8FAFC;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    padding: 0.55rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cw-preset-btn:hover {
    background: #FEF2F2;
    border-color: var(--cw-red);
    color: var(--cw-red-dark);
}

.cw-preset-btn.cw-active {
    background: #FEE2E2;
    border-color: var(--cw-red-dark);
    color: var(--cw-red-dark);
}

/* ── Textarea ───────────────────────────────────────────────── */
.cw-items-textarea {
    width: 100%;
    border: 1.5px solid #CBD5E1;
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    font-size: 0.88rem;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.15s;
    box-sizing: border-box;
}

.cw-items-textarea:focus {
    outline: none;
    border-color: var(--cw-red);
    box-shadow: 0 0 0 3px rgba(220,38,38,0.12);
}

/* ── Item action buttons ────────────────────────────────────── */
.cw-btn-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
}

.cw-action-btn {
    background: #fff;
    border: 1.5px solid #CBD5E1;
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.cw-action-btn:hover {
    background: #F1F5F9;
    border-color: #94A3B8;
}

.cw-action-btn.cw-update-btn {
    background: linear-gradient(135deg, var(--cw-green-dark), var(--cw-green));
    color: #fff;
    border-color: transparent;
}

.cw-action-btn.cw-update-btn:hover {
    background: linear-gradient(135deg, var(--cw-green), #22C55E);
}

/* ── History ────────────────────────────────────────────────── */
.cw-history-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.75rem;
    max-height: 200px;
    overflow-y: auto;
}

.cw-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.88rem;
    gap: 0.5rem;
}

.cw-history-text {
    font-weight: 600;
    color: var(--cw-text);
    flex: 1;
    word-break: break-word;
}

.cw-history-time {
    color: var(--cw-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

/* ── GEO / Content sections ─────────────────────────────────── */
.cw-geo-section {
    margin: 3rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid #F1F5F9;
}

.cw-geo-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cw-red-dark);
    margin-bottom: 0.75rem;
}

.cw-geo-section h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cw-green-dark);
    margin: 1.5rem 0 0.5rem;
}

.cw-geo-section p {
    color: #374151;
    line-height: 1.75;
    margin-bottom: 0.75rem;
}

/* ── Content cards ──────────────────────────────────────────── */
.cw-content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.cw-content-card {
    background: linear-gradient(135deg, #FFF8F0, #fff);
    border: 1px solid #FDE68A;
    border-radius: 12px;
    padding: 1.25rem;
}

.cw-content-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--cw-red-dark);
    margin-bottom: 0.5rem;
}

.cw-content-card p {
    font-size: 0.88rem;
    color: #4B5563;
    margin: 0;
    line-height: 1.6;
}

/* ── Comparison table ───────────────────────────────────────── */
.cw-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    margin: 1.5rem 0;
}

.cw-compare-table th {
    background: linear-gradient(135deg, var(--cw-red-dark), var(--cw-red));
    color: #fff;
    padding: 0.65rem 1rem;
    text-align: left;
    font-weight: 700;
}

.cw-compare-table th:first-child { border-radius: 10px 0 0 0; }
.cw-compare-table th:last-child  { border-radius: 0 10px 0 0; }

.cw-compare-table td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid #F1F5F9;
    vertical-align: top;
}

.cw-compare-table tr:nth-child(even) td { background: #F8FAFC; }
.cw-compare-table tr:last-child td { border-bottom: none; }

/* ── FAQ accordion ──────────────────────────────────────────── */
.cw-faq-section {
    margin: 2.5rem 0;
}

.cw-faq-section h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--cw-red-dark);
    margin-bottom: 1rem;
}

.cw-faq-item {
    border: 1px solid #E2E8F0;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.cw-faq-item:hover { box-shadow: 0 2px 12px rgba(0,0,0,0.07); }

.cw-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(--cw-text);
    background: #fff;
    user-select: none;
    gap: 1rem;
}

.cw-faq-q:hover { background: #FEF2F2; color: var(--cw-red-dark); }

.cw-faq-icon {
    font-size: 1.1rem;
    transition: transform 0.25s;
    flex-shrink: 0;
}

.cw-faq-item.cw-open .cw-faq-icon { transform: rotate(45deg); }

.cw-faq-a {
    display: none;
    padding: 0 1.1rem 1rem;
    font-size: 0.9rem;
    color: #374151;
    line-height: 1.7;
    background: #fff;
}

.cw-faq-item.cw-open .cw-faq-a { display: block; }

/* ── Related tools strip ────────────────────────────────────── */
.cw-related {
    background: linear-gradient(135deg, #0F172A, #1E293B);
    color: #fff;
    border-radius: var(--cw-radius);
    padding: 1.5rem;
    margin: 2rem 0;
}

.cw-related h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: #FCD34D;
}

.cw-related-grid {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cw-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;
}

.cw-related-link:hover {
    background: rgba(245,158,11,0.3);
    color: #FCD34D;
}

/* ── Responsive ─────────────────────────────────────────────── */
@@media (max-width: 767px) {
    .cw-tool-row {
        flex-direction: column;
    }

    .cw-wheel-col,
    .cw-panel-col {
        width: 100%;
        min-width: unset;
    }

    .cw-preset-grid {
        grid-template-columns: 1fr 1fr;
    }

    .cw-hero {
        padding: 1.5rem 1rem 1rem;
    }
}

@@media (max-width: 400px) {
    .cw-preset-grid { grid-template-columns: 1fr; }
    .cw-spin-btn { font-size: 1rem; padding: 0.75rem 1.5rem; }
}
