body {
    background-color: skyblue;
}

@keyframes floatUp {
	from { transform: translateY(0) translateX(-50%); opacity: 1; }
	to   { transform: translateY(-80vh) translateX(calc(-50% + var(--drift))); opacity: 0; }
}

@keyframes floatUpSlow {
	0%   { transform: translateY(0) translateX(-50%); opacity: 1; }
	65%  { opacity: 1; }
	100% { transform: translateY(-80vh) translateX(calc(-50% + var(--drift))); opacity: 0; }
}

/* ── Shared: dot grid background ── */
.page-bg {
    background-image: radial-gradient(circle, #d1d5db 1px, transparent 1px);
    background-size: 24px 24px;
    position: fixed;
    inset: 0;
    z-index: -1;
    opacity: 0.35;
}
.dark .page-bg {
    background-image: radial-gradient(circle, #374151 1px, transparent 1px);
    opacity: 0.4;
}

/* ── Shared: form fields ── */
.field-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: #6b7280;
    margin-bottom: 0.35rem;
}
.dark .field-label { color: #9ca3af; }
.field-input {
    width: 100%;
    padding: 0.6rem 0.875rem;
    border-radius: 0.625rem;
    border: 1.5px solid #e5e7eb;
    background: #f9fafb;
    font-size: 0.9375rem;
    color: #111827;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    outline: none;
    font-family: inherit;
}
.dark .field-input {
    border-color: #374151;
    background: #111827;
    color: #f3f4f6;
}
.field-input:focus {
    border-color: #6366f1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.13);
}
.dark .field-input:focus {
    background: #1a2236;
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.field-input::placeholder { color: #b0b7c3; }

/* ── Shared: buttons ── */
.btn-primary {
    width: 100%;
    margin-top: 0.25rem;
    padding: 0.8125rem 1rem;
    background: #4f46e5;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 16px rgba(79,70,229,0.38);
    transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
    letter-spacing: -0.01em;
    font-family: inherit;
}
.btn-primary:hover {
    background: #4338ca;
    box-shadow: 0 6px 22px rgba(79,70,229,0.48);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); box-shadow: 0 2px 8px rgba(79,70,229,0.3); }

.btn-secondary {
    width: 100%;
    padding: 0.8125rem 1rem;
    background: #111827;
    color: #fff;
    font-weight: 600;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: -0.01em;
    font-family: inherit;
}
.dark .btn-secondary { background: #374151; }
.btn-secondary:hover { background: #1f2937; transform: translateY(-1px); }
.dark .btn-secondary:hover { background: #4b5563; }
.btn-secondary:active { transform: translateY(0); }

/* ── Shared: enter animations ── */
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.anim { opacity: 0; animation: fadeSlideUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.anim-1 { animation-delay: 0s; }
.anim-2 { animation-delay: 0.1s; }
.anim-3 { animation-delay: 0.2s; }

/* ── Home page ── */
.home-hero {
    background: linear-gradient(145deg, #1e1b4b 0%, #3730a3 55%, #4338ca 100%);
    border-radius: 1.5rem;
    padding: 3.5rem 2rem 3.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.75rem;
}
.suit-deco {
    position: absolute;
    font-family: Georgia, serif;
    color: rgba(255,255,255,0.055);
    user-select: none;
    pointer-events: none;
    line-height: 1;
}
.hero-title {
    font-family: 'Fraunces', Georgia, serif;
    font-optical-sizing: auto;
    font-size: clamp(3rem, 9vw, 6rem);
    font-weight: 900;
    line-height: 0.93;
    letter-spacing: -0.04em;
    color: #fff;
    position: relative;
    z-index: 1;
}
.hero-title em {
    font-style: italic;
    color: #a5b4fc;
}
.hero-sub {
    color: rgba(255,255,255,0.6);
    font-size: 1rem;
    margin-top: 1.125rem;
    position: relative;
    z-index: 1;
    letter-spacing: 0.01em;
}
.hero-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    position: relative;
    z-index: 1;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3rem 0.8125rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.09);
    border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.82);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.01em;
}
.form-combined {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e9e8f0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 8px 28px rgba(79,70,229,0.07);
    margin-bottom: 1.25rem;
}
.dark .form-combined {
    background: #1f2937;
    border-color: #2e3a4e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 8px 28px rgba(79,70,229,0.09);
}
@media (min-width: 768px) {
    .form-combined { flex-direction: row; }
}
.form-half {
    flex: 1;
    padding: 2.25rem;
}
.or-divider {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.75rem;
}
@media (min-width: 768px) {
    .or-divider {
        flex-direction: column;
        padding: 2.25rem 0;
        gap: 0.75rem;
    }
}
.or-line {
    flex: 1;
    background: #e9e8f0;
    height: 1px;
}
.dark .or-line { background: #2e3a4e; }
@media (min-width: 768px) {
    .or-line { width: 1px; height: auto; }
}
.or-badge {
    font-size: 0.7rem;
    color: #9ca3af;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    padding: 0.3rem 0.6rem;
    border: 1px solid #e9e8f0;
    border-radius: 999px;
    background: #fff;
}
.dark .or-badge {
    border-color: #2e3a4e;
    background: #1f2937;
    color: #6b7280;
}
.card-heading {
    font-size: 1.1875rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}
.card-icon {
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.code-input {
    font-family: 'Courier New', Courier, monospace;
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.28em;
    text-align: center;
    text-transform: uppercase;
    padding: 0.875rem 1rem;
}
.code-input::placeholder {
    letter-spacing: 0.18em;
    color: #c4c9d4;
}
.toggle-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.375rem 0;
    user-select: none;
}
.toggle-track {
    position: relative;
    width: 2.625rem;
    height: 1.4375rem;
    border-radius: 999px;
    background: #e5e7eb;
    flex-shrink: 0;
    transition: background 0.2s ease;
}
.dark .toggle-track { background: #374151; }
.toggle-input:checked + .toggle-track { background: #4f46e5; }
.toggle-thumb {
    position: absolute;
    top: 0.1875rem;
    left: 0.1875rem;
    width: 1.0625rem;
    height: 1.0625rem;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.22);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.toggle-input:checked + .toggle-track .toggle-thumb {
    transform: translateX(1.1875rem);
}
.toggle-switch:hover .toggle-track { filter: brightness(0.95); }
.toggle-text {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.4;
}
.dark .toggle-text { color: #d1d5db; }
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 640px) {
    .features-grid { grid-template-columns: repeat(4, 1fr); }
}
.feature-chip {
    background: #f7f7fb;
    border: 1px solid #eeeef4;
    border-radius: 1rem;
    padding: 1.125rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: default;
}
.dark .feature-chip {
    background: #181f2e;
    border-color: #2a3347;
}
.feature-chip:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.1);
    border-color: #c7c5f0;
}
.dark .feature-chip:hover {
    box-shadow: 0 6px 20px rgba(79,70,229,0.18);
    border-color: #4338ca;
}
.feature-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}
.mini-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 2.125rem;
    border-radius: 0.25rem;
    border: 1.5px solid #dde0ea;
    background: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    color: #374151;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    line-height: 1;
}
.dark .mini-card {
    background: #1f2937;
    border-color: #374151;
    color: #d1d5db;
}
.feature-emojis {
    font-size: 1.125rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
}
.feature-name {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.01em;
}
.dark .feature-name { color: #f3f4f6; }
.feature-desc {
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}
.dark .feature-desc { color: #9ca3af; }

/* ── Room page ── */
.emoji-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 1.5px solid #e9e8f0;
    font-size: 1.125rem;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.dark .emoji-btn { background: #1f2937; border-color: #374151; }
.emoji-btn:hover {
    transform: scale(1.35);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #c4b5fd;
    z-index: 1;
    position: relative;
}
@keyframes will-slap {
    0%, 38% { transform: translateX(95px) perspective(200px) rotateY(0deg);    opacity: 0; }
    44%     { transform: translateX(95px) perspective(200px) rotateY(0deg);    opacity: 1; }
    58%     { transform: translateX(10px)  perspective(200px) rotateY(0deg);    opacity: 1; }
    72%     { transform: translateX(10px)  perspective(200px) rotateY(0deg);    opacity: 1; }
    76%     { transform: translateX(10px)  perspective(200px) rotateY(-110deg); opacity: 1; }
    80%     { transform: translateX(10px)  perspective(200px) rotateY(40deg);   opacity: 1; }
    84%     { transform: translateX(10px)  perspective(200px) rotateY(0deg);    opacity: 1; }
    93%     { transform: translateX(95px) perspective(200px) rotateY(0deg);    opacity: 0; }
    100%    { transform: translateX(95px) perspective(200px) rotateY(0deg);    opacity: 0; }
}
@keyframes avatar-slapped {
    0%,78%,92%,100% { transform: none; }
    81%  { transform: translateX(-14px) rotate(-14deg); }
    84%  { transform: translateX(11px)  rotate(9deg);   }
    87%  { transform: translateX(-6px)  rotate(-4deg);  }
    90%  { transform: translateX(3px)   rotate(2deg);   }
}
.will-slap      { animation: will-slap      6s ease-in-out infinite; }
.avatar-smashed { animation: avatar-slapped 6s ease-in-out infinite; }

/* ── Join page ── */
.join-card {
    background: #fff;
    border: 1px solid #e9e8f0;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04), 0 8px 28px rgba(79,70,229,0.07);
    padding: 2.25rem;
}
.dark .join-card {
    background: #1f2937;
    border-color: #2e3a4e;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3), 0 8px 28px rgba(79,70,229,0.09);
}
.room-name {
    font-size: clamp(1.375rem, 4vw, 1.875rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    color: #111827;
    margin-bottom: 0.25rem;
}
.dark .room-name { color: #f9fafb; }
