/* Roda Arisan & Undian Publik: semua style dibatasi di .ra agar tidak bentrok dengan template */
.ra {
    --ra-blue: #2563eb;
    --ra-blue-dark: #1d4ed8;
    --ra-blue-soft: #eff6ff;
    --ra-green: #16a34a;
    --ra-green-dark: #15803d;
    --ra-ink: #0f172a;
    --ra-text: #475569;
    --ra-muted: #94a3b8;
    --ra-line: #e2e8f0;
    --ra-bg: #f8fafc;
    --ra-red: #dc2626;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px;
    color: var(--ra-ink);
}

.ra *,
.ra *::before,
.ra *::after {
    box-sizing: border-box;
}

.ra [hidden] {
    display: none !important;
}

.ra-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Judul */
.ra-head {
    text-align: center;
    margin-bottom: 24px;
}

.ra-head h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
}

.ra-head p {
    margin: 0 auto;
    max-width: 560px;
    color: var(--ra-text);
    font-size: 15px;
    line-height: 1.6;
}

@media (min-width: 640px) {
    .ra-head h1 {
        font-size: 32px;
    }
}

/* Grid: di HP roda tampil lebih dulu, di laptop pengaturan di kiri dan roda di kanan */
.ra-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
}

.ra-wheel-col {
    order: -1;
}

@media (min-width: 1024px) {
    .ra-grid {
        grid-template-columns: 5fr 7fr;
    }

    .ra-wheel-col {
        order: 0;
        position: sticky;
        top: 16px;
    }
}

.ra-side {
    display: grid;
    gap: 20px;
}

/* Card */
.ra-card {
    background: #fff;
    border: 1px solid var(--ra-line);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

@media (min-width: 640px) {
    .ra-card {
        padding: 24px;
    }
}

.ra-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.ra-card-head h2 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

/* Form */
.ra-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ra-text);
    margin-bottom: 8px;
}

.ra-textarea {
    display: block;
    width: 100%;
    min-height: 140px;
    padding: 12px;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ra-ink);
    background: var(--ra-bg);
    border: 1.5px solid var(--ra-line);
    border-radius: 12px;
    resize: vertical;
}

.ra-textarea:focus {
    outline: 3px solid #bfdbfe;
    border-color: var(--ra-blue);
    background: #fff;
}

.ra-textarea:disabled {
    opacity: .6;
}

.ra-meta {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--ra-muted);
}

.ra-note {
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13px;
    background: #fef3c7;
    color: #78350f;
}

.ra-note.is-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Tombol */
.ra-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, transform .05s;
}

.ra-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.ra-btn:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: 2px;
}

.ra-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ra-btn-primary {
    background: var(--ra-blue);
    color: #fff;
}

.ra-btn-primary:hover:not(:disabled) {
    background: var(--ra-blue-dark);
}

.ra-btn-success {
    background: var(--ra-green);
    color: #fff;
}

.ra-btn-success:hover:not(:disabled) {
    background: var(--ra-green-dark);
}

.ra-btn-ghost {
    background: #fff;
    color: var(--ra-ink);
    border: 1.5px solid var(--ra-line);
}

.ra-btn-ghost:hover:not(:disabled) {
    background: var(--ra-bg);
}

.ra-btn-danger {
    background: #fff;
    color: var(--ra-red);
    border: 1.5px solid #fecaca;
}

.ra-btn-danger:hover:not(:disabled) {
    background: #fef2f2;
}

.ra-btn-sm {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
    border-radius: 9px;
}

.ra-btn-block {
    width: 100%;
}

.ra-actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.ra-actions .ra-btn {
    flex: 1;
}

/* Tab */
.ra-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--ra-line);
    margin-bottom: 12px;
}

.ra-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    margin-bottom: -1px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--ra-text);
    cursor: pointer;
}

.ra-tab:hover {
    color: var(--ra-ink);
}

.ra-tab.is-active {
    color: var(--ra-blue);
    border-bottom-color: var(--ra-blue);
}

.ra-tab:focus-visible {
    outline: 3px solid #93c5fd;
    outline-offset: -3px;
    border-radius: 8px;
}

.ra-pill {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #f1f5f9;
    color: var(--ra-text);
    font-size: 11px;
    text-align: center;
}

.ra-tab.is-active .ra-pill {
    background: var(--ra-blue-soft);
    color: var(--ra-blue);
}

/* Daftar */
.ra-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 260px;
    overflow-y: auto;
}

.ra-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 4px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
}

.ra-item:last-child {
    border-bottom: 0;
}

.ra-num {
    flex: none;
    width: 24px;
    color: var(--ra-muted);
    font-size: 12px;
    text-align: right;
}

.ra-name {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ra-item.is-won .ra-name {
    color: var(--ra-green-dark);
    font-weight: 700;
}

.ra-empty {
    padding: 22px 8px;
    text-align: center;
    font-size: 13px;
    color: var(--ra-muted);
}

/* Tabel riwayat */
.ra-table-wrap {
    max-height: 260px;
    overflow: auto;
    border: 1px solid var(--ra-line);
    border-radius: 12px;
}

.ra-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ra-table th {
    position: sticky;
    top: 0;
    background: var(--ra-bg);
    text-align: left;
    padding: 9px 10px;
    font-weight: 700;
    color: var(--ra-ink);
    border-bottom: 1px solid var(--ra-line);
}

.ra-table td {
    padding: 9px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--ra-text);
}

.ra-table td.ra-win {
    color: var(--ra-green-dark);
    font-weight: 700;
    overflow-wrap: anywhere;
}

/* Toolbar riwayat & tombol hapus per baris */
.ra-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ra-muted);
}

.ra-row-del {
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--ra-muted);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.ra-row-del:hover:not(:disabled) {
    background: #fef2f2;
    color: var(--ra-red);
}

.ra-row-del:focus-visible {
    outline: 3px solid #fca5a5;
}

.ra-row-del:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* Roda */
.ra-wheel-card {
    text-align: center;
}

.ra-wheel-wrap {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin: 8px auto 4px;
}

.ra-wheel-wrap canvas {
    display: block;
    margin: 0 auto;
}

.ra-pointer {
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-top: 32px solid var(--ra-red);
    filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .3));
    z-index: 2;
}

.ra-remaining {
    margin: 10px 0 14px;
    font-size: 13px;
    color: var(--ra-text);
}

.ra-spin {
    max-width: 340px;
    margin: 0 auto;
    min-height: 52px;
    font-size: 16px;
}

.ra-announce {
    min-height: 32px;
    margin-top: 14px;
    font-size: 18px;
    font-weight: 800;
    color: var(--ra-ink);
    overflow-wrap: anywhere;
}

.ra-announce strong {
    color: var(--ra-green-dark);
}

.ra-announce small {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ra-muted);
}

/* Modal pemenang */
.ra-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, .55);
    backdrop-filter: blur(3px);
}

.ra-dialog {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, .25);
    animation: ra-pop .25s ease-out;
}

.ra-dialog-top {
    padding: 22px 16px;
    background: var(--ra-green);
    color: #fff;
}

.ra-dialog-top h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
}

.ra-dialog-body {
    padding: 28px 20px 12px;
}

.ra-dialog-body small {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .06em;
    color: var(--ra-muted);
    margin-bottom: 10px;
}

.ra-dialog-body strong {
    display: block;
    font-size: 34px;
    line-height: 1.15;
    font-weight: 800;
    color: var(--ra-green-dark);
    overflow-wrap: anywhere;
}

.ra-dialog-foot {
    padding: 16px 20px 24px;
}

@keyframes ra-pop {
    from {
        opacity: 0;
        transform: scale(.94);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ra-dialog {
        animation: none;
    }
}

/* Artikel panduan */
.ra-article {
    margin-top: 28px;
    font-size: 15px;
    line-height: 1.75;
    color: #334155;
}

.ra-article h2,
.ra-article h3 {
    color: var(--ra-ink);
    font-weight: 700;
    margin: 1.6em 0 .5em;
}

.ra-article h2:first-child {
    margin-top: 0;
    font-size: 22px;
}

.ra-article h3 {
    font-size: 1.1em;
}

.ra-article p {
    margin: 0 0 1em;
}

.ra-article ul {
    list-style: disc;
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.ra-article ol {
    list-style: decimal;
    padding-left: 1.4em;
    margin: 0 0 1em;
}

.ra-article a {
    color: var(--ra-blue);
    text-decoration: underline;
}

.ra-article img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.ra-ads {
    margin: 28px 0;
}