*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #faf7f2;
    --card-bg: #ffffff;
    --text: #2a1a20;
    --text-secondary: #6b4b55;
    --accent: #8b1e3f;
    --accent-light: #c44569;
    --accent-gold: #c8a84e;
    --border: #e5dfd8;
    --radius: 12px;
    --focus-ring: 0 0 0 3px rgba(139, 30, 63, 0.15);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #faf7f2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Crect x='0' y='0' width='110' height='110' rx='8' fill='%23c8a84e' opacity='0.12'/%3E%3Crect x='125' y='10' width='100' height='100' rx='8' fill='%238b1e3f' opacity='0.10'/%3E%3Crect x='10' y='125' width='100' height='100' rx='8' fill='%23c8a84e' opacity='0.08'/%3E%3Crect x='125' y='125' width='100' height='100' rx='8' fill='%238b1e3f' opacity='0.09'/%3E%3Ccircle cx='55' cy='55' r='4' fill='%23c8a84e' opacity='0.5'/%3E%3Ccircle cx='175' cy='60' r='5' fill='%238b1e3f' opacity='0.45'/%3E%3Ccircle cx='60' cy='175' r='3' fill='%23c8a84e' opacity='0.4'/%3E%3Ccircle cx='175' cy='175' r='6' fill='%238b1e3f' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 240px 240px;
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 4px;
    background: var(--accent);
    transition: width 0.4s ease;
    z-index: 100;
}

.container {
    width: 90%;
    max-width: 720px;
    padding: 40px 0 100px;
    margin-top: 8px;
    position: relative;
    z-index: 1;
}

.container::before {
    content: "🌹  🕯️  ✨  🌙  💫  🥂";
    display: block;
    text-align: center;
    font-size: 1.2rem;
    letter-spacing: 12px;
    opacity: 0.4;
    margin-bottom: 16px;
    padding: 10px 0;
}

.card {
    background: #ffffff;
    border-radius: var(--radius);
    padding: 40px 32px;
    box-shadow: 0 2px 16px rgba(139, 30, 63, 0.07), 0 1px 3px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(139, 30, 63, 0.06);
}

.card h1 {
    font-size: 1.8rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--text);
}

.subtitle {
    color: var(--text-secondary);
    margin-bottom: 28px;
    font-size: 0.95rem;
}

.intro {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 16px;
    color: var(--text);
}

.intro.soft {
    color: var(--text-secondary);
    font-style: italic;
}

.inspiration {
    margin-bottom: 24px;
}

.inspiration a {
    display: inline-block;
    color: var(--accent-light);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 6px 14px;
    border: 1px solid var(--accent-light);
    border-radius: 20px;
    transition: background 0.2s, color 0.2s;
}

.inspiration a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    text-decoration: none;
}

.options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option {
    display: block;
    cursor: pointer;
}

.option input[type="radio"],
.option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: var(--radius);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    background: rgba(139, 30, 63, 0.015);
}

.option input[type="radio"]:checked + .option-content,
.option input[type="checkbox"]:checked + .option-content {
    border-color: var(--accent);
    background: rgba(139, 30, 63, 0.04);
    box-shadow: var(--focus-ring);
}

.option input[type="radio"]:focus-visible + .option-content,
.option input[type="checkbox"]:focus-visible + .option-content {
    box-shadow: var(--focus-ring);
}

.option:hover .option-content {
    border-color: var(--accent-light);
    background: rgba(139, 30, 63, 0.04);
}

.option-nsfw {
    border-color: rgba(200, 168, 78, 0.3);
}

.option input:checked + .option-nsfw {
    border-color: var(--accent-gold);
    background: rgba(200, 168, 78, 0.08);
}

.option-emoji {
    font-size: 1.4rem;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.option-text {
    font-size: 1rem;
    color: var(--text);
}

.sub-detail {
    margin: -4px 0 6px 0;
    padding-left: 50px;
}

.sub-detail input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid rgba(139, 30, 63, 0.2);
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    outline: none;
    background: #fdfaf6;
    transition: border-color 0.2s;
}

.sub-detail input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.sub-detail input::placeholder {
    color: #b0a0a0;
    font-style: italic;
}

.date-detail {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.toggle-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.toggle-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--border);
    transition: 0.2s;
    border-radius: 24px;
}

.slider::before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: 0.2s;
    border-radius: 50%;
}

.switch input:checked + .slider {
    background: var(--accent-gold);
}

.switch input:checked + .slider::before {
    transform: translateX(20px);
}

.field {
    margin-bottom: 24px;
}

.field-label {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text);
}

.field-hint {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 6px;
}

.text-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #fdfaf6;
    resize: vertical;
    color: var(--text);
}

.text-input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.text-input::placeholder {
    color: #b0a0a0;
}

.nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.btn {
    padding: 14px 32px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s, opacity 0.2s;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    margin-left: auto;
}

.btn-primary:hover {
    background: var(--accent-light);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(0,0,0,0.03);
}

#btn-prev {
    display: none;
}

#btn-prev:not([hidden]) {
    display: inline-block;
}

.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.success-card {
    text-align: center;
    padding: 56px 32px;
}

.success-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.success-card h2 {
    color: var(--accent);
    margin-bottom: 16px;
}

.success-card p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.success-card .soft {
    margin-top: 12px;
    font-style: italic;
    color: var(--text-secondary);
}

.btn-ics {
    font-size: 0.95rem;
    padding: 12px 24px;
}

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-6px); }
    40%      { transform: translateX(6px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

.bg-deco,
.deco-blob,
.deco-emoji { display: none; }

.particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    animation: float-particle var(--dur) ease-in-out infinite;
    animation-delay: var(--delay);
    opacity: var(--op);
}

@keyframes float-particle {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25%  { transform: translate(var(--x1), var(--y1)) scale(var(--s1)); }
    50%  { transform: translate(var(--x2), var(--y2)) scale(var(--s2)); }
    75%  { transform: translate(var(--x3), var(--y3)) scale(var(--s3)); }
}

.gate {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #faf7f2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240' viewBox='0 0 240 240'%3E%3Crect x='0' y='0' width='110' height='110' rx='8' fill='%23c8a84e' opacity='0.12'/%3E%3Crect x='125' y='10' width='100' height='100' rx='8' fill='%238b1e3f' opacity='0.10'/%3E%3Crect x='10' y='125' width='100' height='100' rx='8' fill='%23c8a84e' opacity='0.08'/%3E%3Crect x='125' y='125' width='100' height='100' rx='8' fill='%238b1e3f' opacity='0.09'/%3E%3Ccircle cx='55' cy='55' r='4' fill='%23c8a84e' opacity='0.5'/%3E%3Ccircle cx='175' cy='60' r='5' fill='%238b1e3f' opacity='0.45'/%3E%3Ccircle cx='60' cy='175' r='3' fill='%23c8a84e' opacity='0.4'/%3E%3Ccircle cx='175' cy='175' r='6' fill='%238b1e3f' opacity='0.4'/%3E%3C/svg%3E");
    background-size: 240px 240px;
    transition: opacity 0.5s ease;
}

.gate.hidden {
    opacity: 0;
    pointer-events: none;
}

.gate-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 48px 40px;
    text-align: center;
    box-shadow: 0 2px 16px rgba(139, 30, 63, 0.07);
    border: 1px solid rgba(139, 30, 63, 0.06);
    width: 90%;
    max-width: 360px;
}

.gate-card h2 {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--text);
}

.gate-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.gate-field {
    margin-bottom: 12px;
}

.gate-input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1.2rem;
    text-align: center;
    font-family: inherit;
    letter-spacing: 2px;
    outline: none;
    background: #fdfaf6;
    transition: border-color 0.2s;
}

.gate-input:focus {
    border-color: var(--accent);
    box-shadow: var(--focus-ring);
}

.gate-error {
    color: var(--accent-light);
    font-size: 0.85rem;
    margin-top: 8px;
}

.gate-card.shake {
    animation: shake 0.4s ease;
}

@media (max-width: 480px) {
    .container {
        padding: 20px 12px 80px;
    }
    .card {
        padding: 28px 20px;
    }
    .card h1 {
        font-size: 1.5rem;
    }
    .card h2 {
        font-size: 1.3rem;
    }
    .btn {
        padding: 12px 24px;
    }
}
