html, body {
    max-width: 100%;
    overflow-x: hidden;
}

:root {
    --ps-red: #C8102E;
    --ps-green: #007A3D;
    --ps-black: #0a0c10;
    --ps-ink: #1c1917;
    --ps-cream: #F7F1E8;
    --ps-cream-2: #FBF7F0;
    --ps-gold: #c4a574;
}

.fabric {
    background-color: var(--ps-cream);
    background-image:
        url('/brand/tatreez-bg.svg'),
        radial-gradient(ellipse at 20% 0%, rgba(200,16,46,.04), transparent 42%),
        radial-gradient(ellipse at 90% 80%, rgba(0,122,61,.05), transparent 46%);
    background-size: 120px 120px, 100% 100%, 100% 100%;
    color: var(--ps-ink);
}
.fabric-card {
    background: rgba(255,252,247,.86);
    border: 1px solid rgba(200,16,46,.12);
    box-shadow: 0 10px 30px -18px rgba(80,20,20,.25);
}
.tatreez-corner {
    position: relative;
}
.tatreez-corner::before,
.tatreez-corner::after {
    content: '';
    position: absolute;
    width: 44px;
    height: 44px;
    pointer-events: none;
    opacity: .28;
    background-image:
        linear-gradient(45deg, transparent 46%, #C8102E 46% 54%, transparent 54%),
        linear-gradient(-45deg, transparent 46%, #007A3D 46% 54%, transparent 54%);
    background-size: 8px 8px;
}
.tatreez-corner::before { top: 10px; right: 10px; }
.tatreez-corner::after { bottom: 10px; left: 10px; }

.tatreez-bar {
    background-image:
        repeating-linear-gradient(45deg, var(--ps-red) 0 2px, transparent 2px 6px),
        repeating-linear-gradient(-45deg, var(--ps-red) 0 2px, transparent 2px 6px);
    background-size: 8px 8px;
    background-color: #1a0508;
}
.tatreez-bar-green {
    background-image:
        repeating-linear-gradient(45deg, var(--ps-green) 0 2px, transparent 2px 6px),
        repeating-linear-gradient(-45deg, var(--ps-green) 0 2px, transparent 2px 6px);
    background-size: 8px 8px;
}
.flag-stripe {
    height: 6px;
    background: linear-gradient(to left, #000 0 33%, #fff 33% 66%, var(--ps-green) 66% 100%);
    position: relative;
}
.flag-stripe::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-style: solid;
    border-width: 3px 12px 3px 0;
    border-color: transparent var(--ps-red) transparent transparent;
}

/* ─── شاشة الافتتاح ─── */
#forums-splash {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: var(--ps-ink);
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    font-family: Cairo, sans-serif;
}
#forums-splash.is-out {
    animation: splashOut 0.85s cubic-bezier(.22,1,.36,1) forwards;
    pointer-events: none;
}
#forums-splash.is-gone { display: none; }

.splash-grid {
    position: absolute;
    inset: -20%;
    background-image:
        repeating-linear-gradient(45deg, rgba(200,16,46,.18) 0 1px, transparent 1px 18px),
        repeating-linear-gradient(-45deg, rgba(200,16,46,.12) 0 1px, transparent 1px 18px);
    animation: gridPulse 2.4s ease-in-out infinite, gridSpin 28s linear infinite;
    transform-origin: center;
}
.splash-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 20%, #070b14 72%);
}
.splash-flag {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 0;
    overflow: hidden;
    animation: flagReveal 0.7s 0.15s ease-out forwards;
}
.splash-flag .flag-stripe { height: 5px; }

.splash-ring {
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    border: 1px solid rgba(232,213,181,.15);
    animation: ringIn 1.1s cubic-bezier(.22,1,.36,1) both;
}
.splash-ring::before,
.splash-ring::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px dashed rgba(200,16,46,.35);
    animation: spin 12s linear infinite;
}
.splash-ring::after {
    inset: -36px;
    border-color: rgba(0,122,61,.25);
    animation-direction: reverse;
    animation-duration: 18s;
}

.splash-stitches {
    position: absolute;
    width: 260px;
    height: 260px;
}
.splash-stitches i {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 10px;
    height: 10px;
    margin: -5px;
    opacity: 0;
    color: #C8102E;
    font-style: normal;
    font-size: 11px;
    font-weight: 900;
    transform: rotate(var(--a)) translateY(-112px) scale(.2);
    animation: stitchPop 0.45s cubic-bezier(.2,1.4,.3,1) forwards;
    animation-delay: var(--d);
}
.splash-stitches i::before { content: '✕'; }

.splash-core {
    position: relative;
    z-index: 2;
    text-align: center;
}
.splash-seal {
    width: 132px;
    height: 132px;
    margin: 0 auto 18px;
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 0 0 0 rgba(200,16,46,.5);
    transform: scale(0.2) rotate(-12deg);
    opacity: 0;
    animation: stampHit 0.9s 0.55s cubic-bezier(.15,1.4,.3,1) forwards;
}
.splash-seal img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.splash-word {
    font-weight: 900;
    font-size: 2.4rem;
    letter-spacing: 0.12em;
    opacity: 0;
    transform: translateY(18px);
    animation: riseIn 0.7s 1.05s cubic-bezier(.22,1,.36,1) forwards;
}
.splash-tag {
    margin-top: 8px;
    font-size: 0.78rem;
    font-weight: 600;
    color: #e8d5b5;
    opacity: 0;
    transform: translateY(10px);
    animation: riseIn 0.7s 1.28s cubic-bezier(.22,1,.36,1) forwards;
}
.splash-line {
    width: 0;
    height: 2px;
    margin: 16px auto 0;
    background: linear-gradient(to left, var(--ps-red), #fff, var(--ps-green));
    animation: lineGrow 0.8s 1.45s cubic-bezier(.22,1,.36,1) forwards;
}

@keyframes gridPulse {
    0%, 100% { opacity: .35; }
    50% { opacity: .7; }
}
@keyframes gridSpin { to { transform: rotate(8deg) scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flagReveal { from { height: 0; } to { height: 5px; } }
@keyframes ringIn {
    from { opacity: 0; transform: scale(.4); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes stitchPop {
    0% { opacity: 0; transform: rotate(var(--a)) translateY(-40px) scale(.2); }
    70% { opacity: 1; transform: rotate(var(--a)) translateY(-118px) scale(1.15); }
    100% { opacity: .9; transform: rotate(var(--a)) translateY(-112px) scale(1); }
}
@keyframes stampHit {
    0% { opacity: 0; transform: scale(1.55) rotate(-14deg); filter: blur(8px); }
    55% { opacity: 1; transform: scale(.92) rotate(2deg); filter: blur(0); box-shadow: 0 0 0 18px rgba(200,16,46,.0); }
    75% { transform: scale(1.04) rotate(-1deg); box-shadow: 0 0 0 0 rgba(200,16,46,.35); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}
@keyframes riseIn {
    to { opacity: 1; transform: none; letter-spacing: 0.02em; }
}
@keyframes lineGrow { to { width: 168px; } }
@keyframes splashOut {
    0% { opacity: 1; clip-path: circle(150% at 50% 46%); }
    100% { opacity: 0; clip-path: circle(0% at 50% 46%); visibility: hidden; }
}

@media (prefers-reduced-motion: reduce) {
    #forums-splash, #forums-splash * { animation: none !important; }
    #forums-splash { display: none !important; }
}

/* لوحة السوبر الفاتحة — تحويل البطاقات الداكنة القديمة */
.super-app main [class*="bg-slate-9"] {
    background-color: #fff !important;
    color: #1c1917 !important;
}
.super-app main [class*="border-white"] {
    border-color: rgba(200, 16, 46, 0.12) !important;
}
.super-app main .text-slate-300,
.super-app main .text-slate-400,
.super-app main .text-slate-500 {
    color: #78716c !important;
}
.super-app main .text-violet-400,
.super-app main .text-cyan-400 {
    color: #C8102E !important;
}
.super-app main .text-emerald-300,
.super-app main .text-emerald-400 {
    color: #007A3D !important;
}
.super-app main .bg-violet-600 {
    background-color: #C8102E !important;
    color: #fff !important;
}
.super-app main .bg-slate-700 {
    background-color: #f5f0e8 !important;
    color: #57534e !important;
}
.super-app main input,
.super-app main select,
.super-app main textarea {
    background-color: #fff !important;
    color: #1c1917 !important;
}
