/* Velvet, sultry advent styling */
:root {
    --bg: #0b050b;
    --bg-2: #150914;
    --card: rgba(255, 255, 255, 0.06);
    --text: #f9eef7;
    --muted: #c7b3c6;
    --accent: #ff2f72;
    --accent-2: #ff8f6b;
    --accent-3: #9bf2d6;
    --border: rgba(255, 118, 162, 0.34);
    --glass: rgba(255, 255, 255, 0.08);
    --radius: 22px;
    --shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
    --shine: 0 0 28px rgba(255, 47, 114, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Manrope", "Raleway", system-ui, -apple-system, sans-serif;
    color: var(--text);
    background:
        radial-gradient(760px at 15% 20%, rgba(255, 47, 114, 0.22), transparent 55%),
        radial-gradient(640px at 82% 10%, rgba(155, 242, 214, 0.18), transparent 60%),
        radial-gradient(620px at 70% 75%, rgba(255, 143, 107, 0.15), transparent 60%),
        linear-gradient(160deg, var(--bg), var(--bg-2));
    padding: 0;
    overflow-x: hidden;
}

.background-lights {
    position: fixed;
    inset: -8%;
    background:
        radial-gradient(520px at 20% 24%, rgba(255, 74, 126, 0.22), transparent 58%),
        radial-gradient(560px at 82% 18%, rgba(255, 214, 168, 0.18), transparent 55%),
        radial-gradient(820px at 40% 80%, rgba(33, 10, 30, 0.9), transparent 65%),
        radial-gradient(640px at 68% 72%, rgba(255, 118, 162, 0.12), transparent 60%);
    filter: blur(40px);
    z-index: -3;
}

.velvet-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    background-size: 6px 6px;
    mix-blend-mode: screen;
    opacity: 0.25;
    z-index: -2;
}

.snow {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255, 255, 255, 0.6), transparent),
        radial-gradient(2px 2px at 120px 80px, rgba(255, 255, 255, 0.7), transparent),
        radial-gradient(3px 3px at 90px 150px, rgba(255, 255, 255, 0.75), transparent),
        radial-gradient(2px 2px at 200px 20px, rgba(255, 255, 255, 0.65), transparent),
        radial-gradient(3px 3px at 400px 120px, rgba(255, 255, 255, 0.55), transparent),
        radial-gradient(2px 2px at 600px 10px, rgba(255, 255, 255, 0.65), transparent);
    background-size: 650px 200px;
    animation: snow 18s linear infinite;
    opacity: 0.45;
    z-index: -1;
}

.page-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 32px 18px 90px;
    position: relative;
    z-index: 1;
}

.page-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    padding: 24px 24px 22px;
    background: linear-gradient(135deg, rgba(37, 16, 30, 0.9), rgba(23, 9, 21, 0.92));
    border: 1px solid rgba(255, 118, 162, 0.2);
    border-radius: 28px;
    box-shadow: var(--shadow), inset 0 0 30px rgba(255, 47, 114, 0.12);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    inset: -40% auto auto 30%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(255, 47, 114, 0.16), transparent 55%);
    filter: blur(12px);
}

.garland {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(90deg, rgba(255, 47, 114, 0.8), rgba(255, 143, 107, 0.8), rgba(155, 242, 214, 0.8));
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.desire-badge {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: 22px;
    display: grid;
    place-items: center;
    background: radial-gradient(circle at 35% 35%, rgba(255, 143, 107, 0.35), rgba(255, 47, 114, 0.35)), conic-gradient(from 90deg, rgba(255, 47, 114, 0.8), rgba(255, 143, 107, 0.9), rgba(155, 242, 214, 0.9), rgba(255, 47, 114, 0.8));
    box-shadow: 0 18px 44px rgba(255, 47, 114, 0.35), 0 0 34px rgba(255, 47, 114, 0.25);
    overflow: hidden;
}

.desire-badge::before {
    content: "";
    position: absolute;
    inset: 10%;
    border-radius: inherit;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.08), transparent 70%);
    filter: blur(4px);
}

.flame-emoji {
    position: relative;
    font-size: 32px;
    filter: drop-shadow(0 0 14px rgba(255, 47, 114, 0.4));
}

.badge-glow {
    position: absolute;
    inset: -20%;
    background: radial-gradient(circle, rgba(255, 47, 114, 0.22), transparent 65%);
    filter: blur(12px);
    z-index: -1;
}

.eyebrow {
    margin: 0;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    font-size: 12px;
    color: var(--accent-3);
}

.headline {
    margin: 6px 0 10px;
    font-family: "Cormorant Garamond", "Times New Roman", serif;
    font-size: clamp(34px, 5vw, 46px);
    letter-spacing: 0.02em;
}

.subline {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.small {
    font-size: 14px;
}

.date-pill {
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    text-align: right;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.05), 0 14px 34px rgba(0, 0, 0, 0.45);
}

.date-pill span {
    display: block;
    color: var(--muted);
    font-size: 12px;
}

.date-pill strong {
    font-size: 16px;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 12px;
    letter-spacing: 0.04em;
    border: 1px solid rgba(155, 242, 214, 0.4);
    background: rgba(155, 242, 214, 0.08);
    color: var(--accent-3);
}

.admin-strip {
    display: flex;
    gap: 8px;
    justify-self: flex-end;
    align-self: flex-start;
    flex-wrap: wrap;
}

.admin-foot {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 16px 0 4px;
}

.pill-admin {
    border-color: rgba(255, 47, 114, 0.4);
    background: rgba(255, 47, 114, 0.12);
    color: #ffd9e6;
    text-decoration: none;
}

.ghost-pill {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--muted);
}

.subtle {
    opacity: 0.65;
    font-weight: 600;
}

.subtle:hover {
    opacity: 1;
    transform: none;
}

.pill-test::before {
    content: "✦";
    color: var(--accent-3);
    font-size: 12px;
}

.muted {
    color: var(--muted);
}

.primary-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 14px;
    padding: 12px 16px;
    text-decoration: none;
    font-weight: 700;
    transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.primary-button {
    background: linear-gradient(120deg, #ff2f72, #ff8f6b);
    color: #0b050b;
    box-shadow: 0 14px 34px rgba(255, 47, 114, 0.4), var(--shine);
}

.primary-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 42px rgba(255, 47, 114, 0.45);
}

.ghost-button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.04);
}

.ghost-button:hover {
    transform: translateY(-2px);
}

.calendar-shell {
    margin-top: 20px;
    padding: 18px;
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(145deg, rgba(34, 12, 23, 0.9), rgba(19, 7, 17, 0.92));
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 47, 114, 0.2);
    position: relative;
    overflow: hidden;
}

.calendar-shell::before,
.calendar-shell::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    filter: blur(32px);
    opacity: 0.8;
}

.calendar-shell::before {
    width: 240px;
    height: 240px;
    inset: -28% auto auto -12%;
    background: radial-gradient(circle, rgba(255, 47, 114, 0.32), transparent 60%);
}

.calendar-shell::after {
    width: 260px;
    height: 260px;
    inset: -30% -12% auto auto;
    background: radial-gradient(circle, rgba(255, 143, 107, 0.28), transparent 60%);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
    margin-top: 12px;
}

.day-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    box-shadow: 0 20px 46px rgba(0, 0, 0, 0.42), inset 0 0 18px rgba(255, 255, 255, 0.02);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease, filter 150ms ease;
    position: relative;
    overflow: hidden;
}

.day-card::after {
    content: "";
    position: absolute;
    inset: -30% -30% auto auto;
    height: 140px;
    width: 160px;
    background: radial-gradient(circle, rgba(255, 47, 114, 0.15), transparent 60%), radial-gradient(circle, rgba(255, 255, 255, 0.06), transparent 60%);
    transform: rotate(12deg);
    opacity: 0.7;
}

.day-card.today-card {
    grid-column: span 2;
    border-color: rgba(255, 255, 255, 0.32);
    transform: translateY(-2px) scale(1.02);
    animation: pulse 2.2s ease-in-out infinite, floaty 6s ease-in-out infinite, shine 3s ease-in-out infinite;
    box-shadow: 0 20px 44px rgba(255, 47, 114, 0.28), 0 0 24px rgba(255, 47, 114, 0.25);
}

.day-card.unlocked:not(.today-card) {
    border-color: rgba(155, 242, 214, 0.38);
    background: linear-gradient(160deg, rgba(155, 242, 214, 0.12), rgba(255, 255, 255, 0.02));
}

.day-card.locked {
    opacity: 0.85;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0.05));
}

.day-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.day-core {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 14px 10px 10px;
}

.day-number {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    letter-spacing: 0.06em;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: #ffe7f0;
    text-transform: uppercase;
}

.status-pill.open {
    background: linear-gradient(135deg, rgba(155, 242, 214, 0.35), rgba(255, 255, 255, 0.06));
    border-color: rgba(155, 242, 214, 0.6);
}

.status-pill.closed {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.today-hint {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.today-hint.opened {
    color: var(--accent-3);
}

.lock-icon {
    margin-left: 6px;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35));
    color: var(--accent);
}

.lock-icon.wiggle {
    animation: wiggle 1.4s ease-in-out infinite;
}

.card-glow {
    position: absolute;
    inset: -40% -40% auto auto;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 143, 107, 0.24), transparent 65%);
    filter: blur(18px);
    opacity: 0.8;
    transition: transform 220ms ease, opacity 220ms ease;
}

.day-card:hover .card-glow {
    transform: translateY(-6px);
    opacity: 1;
}

.detail-card {
    margin-top: 24px;
    padding: 24px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, rgba(30, 12, 24, 0.9), rgba(16, 7, 16, 0.92));
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.detail-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    position: absolute;
    top: 16px;
    right: 18px;
    backdrop-filter: blur(8px);
}

.kiss-mark {
    color: var(--accent);
    filter: drop-shadow(0 0 8px rgba(255, 47, 114, 0.45));
}

.detail-whisper {
    font-weight: 700;
}

.scratch-page {
    position: relative;
    margin-top: 0;
    padding: 0 10px 20px;
    width: 100%;
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    z-index: 1;
}

.scratch-page .scratch-area {
    margin-top: 0;
    min-height: 78vh;
}

.scratch-page .scratch-content {
    padding: 30px 20px 34px;
}

.detail-card.today-detail {
    overflow: hidden;
    animation: reveal 820ms ease forwards;
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 22px 50px rgba(255, 47, 114, 0.32);
}

.reveal-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), transparent 50%);
    animation: sheen 1.2s ease forwards;
}

.sparkle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: radial-gradient(circle, #fff, rgba(255, 255, 255, 0));
    filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.8));
    opacity: 0;
    animation: sparkle 1.6s ease forwards;
}

.sparkle-1 {
    top: 20%;
    left: 18%;
    animation-delay: 0.2s;
}

.sparkle-2 {
    top: 42%;
    right: 12%;
    animation-delay: 0.4s;
}

.sparkle-3 {
    bottom: 18%;
    left: 42%;
    animation-delay: 0.6s;
}

.detail-title {
    margin: 6px 0 0;
    font-size: 30px;
    letter-spacing: 0.02em;
    font-family: "Cormorant Garamond", "Times New Roman", serif;
}

.detail-body {
    margin-top: 16px;
    line-height: 1.8;
    color: #f7f0f6;
    font-size: 17px;
}

.note {
    margin-top: 14px;
    padding: 12px;
    border-radius: 14px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.scratch-area {
    position: relative;
    margin-top: 10px;
}

.scratch-area,
.scratch-overlay {
    touch-action: none;
    overscroll-behavior: contain;
}

.scratch-page .scratch-content {
    background: linear-gradient(180deg, rgba(28, 10, 22, 0.9), rgba(12, 4, 12, 0.92));
    border-radius: 30px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 0 18px rgba(255, 255, 255, 0.05);
    overflow: hidden;
    position: relative;
}

.scratch-page .scratch-content::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 47, 114, 0.16), transparent 55%), radial-gradient(circle at 80% 30%, rgba(255, 143, 107, 0.14), transparent 50%), radial-gradient(circle at 60% 70%, rgba(155, 242, 214, 0.12), transparent 50%);
    pointer-events: none;
}

.scratch-page .scratch-area::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 32px;
    background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.04), transparent 50%);
    filter: blur(6px);
    pointer-events: none;
}

.scratch-page .scratch-overlay.full {
    inset: -12px;
}

.scratch-content {
    transition: filter 220ms ease, opacity 220ms ease;
}

.scratch-content.blurred {
    filter: blur(9px);
    opacity: 0.14;
}

.scratch-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4), 0 0 28px rgba(255, 47, 114, 0.2);
    cursor: pointer;
    transition: transform 150ms ease, box-shadow 150ms ease;
    background: radial-gradient(circle at 30% 30%, rgba(255, 47, 114, 0.14), transparent 55%), radial-gradient(circle at 70% 70%, rgba(255, 143, 107, 0.12), transparent 50%);
}

.scratch-overlay canvas {
    width: 100%;
    height: 100%;
    opacity: 1;
}

.scratch-overlay.scratching {
    transform: scale(1.01);
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.45);
}

.scratch-overlay.cleared {
    pointer-events: none;
    opacity: 0;
    transition: opacity 200ms ease;
}

.scratch-overlay.full {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: none;
    z-index: 4;
    box-shadow: inset 0 0 32px rgba(0, 0, 0, 0.35), 0 0 18px rgba(255, 255, 255, 0.08);
}

.media-block {
    margin-bottom: 16px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.4);
}

.media-embed {
    width: 100%;
    display: block;
    max-height: 420px;
    object-fit: cover;
}

.detail-actions {
    margin-top: 18px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.locked-card .detail-title,
.empty-card .detail-title {
    color: var(--accent-3);
}

code {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.unlock-card {
    margin-top: 28px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
    max-width: 520px;
}

.unlock-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.unlock-form label {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.unlock-form input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.editor-shell {
    margin-top: 24px;
    padding: 22px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--card);
    box-shadow: var(--shadow);
}

.editor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.editor-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.05);
    color: inherit;
    text-decoration: none;
    transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.editor-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.32);
}

.editor-day {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.editor-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.editor-form {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.editor-form label {
    font-weight: 700;
    letter-spacing: 0.02em;
}

.editor-form input,
.editor-form textarea {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-family: inherit;
}

.editor-form textarea {
    min-height: 140px;
    resize: vertical;
}

.pill-status {
    border-color: rgba(155, 242, 214, 0.4);
    background: rgba(155, 242, 214, 0.1);
}

.pill-status.empty {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.success {
    margin: 0;
    color: #9bf2d6;
}

.error {
    color: #ff9ab0;
    margin: 0;
}

.full {
    width: 100%;
    justify-content: center;
}

.detail-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
    position: relative;
    z-index: 3;
}

.dice-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.dice-trigger:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}

.dice-trigger-icon {
    font-size: 20px;
}

.detail-actions .dice-trigger {
    margin-left: auto;
}

.dice-panel {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 50;
}

.dice-panel.hidden {
    display: none;
}

.dice-panel__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 4, 7, 0.8);
    backdrop-filter: blur(12px);
}

.dice-panel__card {
    position: relative;
    width: min(960px, 94vw);
    background: linear-gradient(165deg, rgba(24, 12, 24, 0.95), rgba(12, 6, 12, 0.94));
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 28px;
    padding: 20px 20px 18px;
    box-shadow: 0 26px 90px rgba(0, 0, 0, 0.55), 0 0 40px rgba(255, 47, 114, 0.22);
    overflow: hidden;
    z-index: 1;
    animation: reveal 320ms ease;
}

.dice-panel__card::after {
    content: "";
    position: absolute;
    inset: -20% -20% auto auto;
    width: 240px;
    height: 240px;
    background: radial-gradient(circle, rgba(255, 47, 114, 0.2), transparent 65%);
    filter: blur(16px);
    opacity: 0.7;
}

.dice-panel__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dice-panel__title {
    margin: 4px 0 6px;
    font-size: 22px;
}

.dice-close {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-size: 18px;
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease;
}

.dice-close:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.32);
}

.dice-grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 18px;
    padding: 18px 0 12px;
}

.dice-grid.single {
    grid-template-columns: 1fr;
    justify-items: center;
}

.dice-hero {
    position: relative;
    min-height: 280px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.dice-glow {
    position: absolute;
    inset: 20px;
    border-radius: 32px;
    background: radial-gradient(circle, rgba(255, 143, 107, 0.2), transparent 60%);
    filter: blur(24px);
    z-index: 0;
}

.dice-shadow {
    position: absolute;
    bottom: 18%;
    width: 180px;
    height: 40px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7), transparent 70%);
    transform: translateZ(-50px);
    filter: blur(10px);
    z-index: 0;
}

.dice-3d {
    position: relative;
    width: 140px;
    height: 140px;
    transform-style: preserve-3d;
    transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 600ms cubic-bezier(0.25, 0.8, 0.35, 1.2);
    cursor: pointer;
    z-index: 1;
}

.dice-3d.rolling {
    animation: bounce 820ms ease;
}

.dice-3d .face {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 40px;
    font-weight: 800;
    color: #0b0d14;
    background: linear-gradient(135deg, #fff, #ffe7f0);
    border-radius: 22px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.12), 0 16px 40px rgba(0, 0, 0, 0.35);
}

.face-1 { transform: rotateY(0deg) translateZ(70px); }
.face-2 { transform: rotateX(90deg) translateZ(70px); }
.face-3 { transform: rotateY(90deg) translateZ(70px); }
.face-4 { transform: rotateY(-90deg) translateZ(70px); }
.face-5 { transform: rotateX(-90deg) translateZ(70px); }
.face-6 { transform: rotateY(180deg) translateZ(70px); }

.dice-cta {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    text-align: center;
    font-size: 13px;
    color: var(--muted);
    z-index: 1;
}

.dice-options {
    padding: 14px;
    border-radius: 20px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: inset 0 0 18px rgba(255, 255, 255, 0.02);
}

.option-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.option-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.option-input-row input {
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
}

.add-option {
    padding: 12px 16px;
    font-weight: 800;
    font-size: 14px;
}

.option-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 6px;
}

.option-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(155, 242, 214, 0.3);
    background: rgba(155, 242, 214, 0.08);
    color: var(--text);
}

.option-remove {
    width: 22px;
    height: 22px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    cursor: pointer;
}

.option-placeholder {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px dashed var(--border);
    color: var(--muted);
}

.dice-panel__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dice-result {
    font-weight: 700;
    color: var(--accent-3);
}

.roll-button {
    padding: 12px 16px;
    min-width: 140px;
}

.no-scroll {
    overflow: hidden;
}

@keyframes pulse {
    0% { box-shadow: 0 20px 44px rgba(255, 47, 114, 0.28); }
    50% { box-shadow: 0 20px 50px rgba(255, 255, 255, 0.32); }
    100% { box-shadow: 0 20px 44px rgba(255, 47, 114, 0.28); }
}

@keyframes floaty {
    0% { transform: translateY(-2px) scale(1.02); }
    50% { transform: translateY(-6px) scale(1.03); }
    100% { transform: translateY(-2px) scale(1.02); }
}

@keyframes shine {
    0% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0.3)); }
    50% { filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.5)); }
    100% { filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0.3)); }
}

@keyframes wobble {
    0% { transform: rotate(0deg); }
    20% { transform: rotate(-9deg); }
    40% { transform: rotate(6deg); }
    60% { transform: rotate(-4deg); }
    80% { transform: rotate(2deg); }
    100% { transform: rotate(0deg); }
}

@keyframes bounce {
    0% { transform: translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
    30% { transform: translateY(-24px) rotateX(calc(var(--rx, 0deg) + 90deg)) rotateY(calc(var(--ry, 0deg) + 90deg)); }
    60% { transform: translateY(-8px) rotateX(calc(var(--rx, 0deg) + 180deg)) rotateY(calc(var(--ry, 0deg) + 180deg)); }
    100% { transform: translateY(0) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
}

@keyframes reveal {
    0% { transform: translateY(12px) scale(0.98); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes sheen {
    0% { transform: translateX(-60%); opacity: 0; }
    40% { opacity: 1; }
    100% { transform: translateX(110%); opacity: 0; }
}

@keyframes sparkle {
    0% { opacity: 0; transform: scale(0.4) rotate(0deg); }
    40% { opacity: 1; }
    100% { opacity: 0; transform: scale(1.5) rotate(180deg); }
}

@keyframes snow {
    0% { background-position: 0 0, 0 0, 0 0, 0 0, 0 0, 0 0; }
    100% { background-position: 0 300px, 0 400px, 0 500px, 0 450px, 0 350px, 0 500px; }
}

@media (max-width: 720px) {
    .page-header {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .date-pill {
        justify-self: start;
    }

    .calendar-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .day-card.today-card,
    .day-card.pair-span {
        grid-column: span 2;
    }

    .page-shell {
        padding: 18px 12px 70px;
    }

    .primary-button,
    .ghost-button {
        width: 100%;
        justify-content: center;
    }

    .dice-grid {
        grid-template-columns: 1fr;
    }

    .dice-panel__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .detail-toolbar {
        justify-content: center;
    }

    .detail-ribbon {
        position: static;
        margin-bottom: 10px;
    }
}
