/* ==========================================================================
   DUANG TAROT - Dark Fantasy Gothic Arcana Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@700;900&family=Cinzel:wght@500;700;900&family=MedievalSharp&family=Prompt:wght@300;400;500;600;700&family=Sarabun:wght@300;400;500;600&display=swap');

:root {
    --bg-dark: #020005;
    --bg-card: rgba(12, 5, 22, 0.92);
    --bg-glass: rgba(139, 0, 0, 0.08);
    --border-gold: rgba(197, 160, 89, 0.55);
    --border-gold-bright: #d4af37;
    --border-crimson: rgba(220, 38, 38, 0.75);
    --border-gothic: rgba(147, 51, 234, 0.45);
    --primary-gold: #f5d061;
    --primary-crimson: #ff2a2a;
    --gold-gradient: linear-gradient(135deg, #fffbeb 0%, #d4af37 35%, #92400e 75%, #451a03 100%);
    --crimson-gradient: linear-gradient(135deg, #ff8888 0%, #dc2626 40%, #7f1d1d 80%, #2a0000 100%);
    --dark-fantasy-gradient: linear-gradient(165deg, #1e0730 0%, #0d0317 55%, #020005 100%);
    --purple-glow: rgba(147, 51, 234, 0.5);
    --crimson-glow: rgba(220, 38, 38, 0.6);
    --gold-glow: rgba(212, 175, 55, 0.45);
    --text-main: #f8fafc;
    --text-muted: #a1a1aa;
    --text-gold: #fef08a;
    --text-crimson: #fca5a5;
    --font-heading: 'Cinzel Decorative', 'UnifrakturMaguntia', 'MedievalSharp', 'Cinzel', serif;
    --font-gothic: 'UnifrakturMaguntia', 'MedievalSharp', 'Cinzel Decorative', serif;
    --font-body: 'Prompt', 'Sarabun', sans-serif;
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --shadow-gold: 0 0 30px rgba(212, 175, 55, 0.35);
    --shadow-crimson: 0 0 35px rgba(220, 38, 38, 0.45);
    --shadow-mystic: 0 20px 45px rgba(0, 0, 0, 0.98), inset 0 0 25px rgba(139, 0, 0, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    padding-bottom: 70px;
}

/* Starry Canvas Background */
#starry-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

/* Blood Heartbeat Vignette Horror Overlay */
.fate-vignette-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 90;
    background: radial-gradient(circle at 50% 50%, transparent 35%, rgba(139, 0, 0, 0.45) 75%, rgba(20, 0, 0, 0.95) 100%);
    animation: heartbeatPulse 4s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    mix-blend-mode: multiply;
}

@keyframes heartbeatPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    15% { opacity: 0.95; transform: scale(1.02); }
    30% { opacity: 0.7; transform: scale(1.01); }
    45% { opacity: 0.9; transform: scale(1.02); }
}

/* Chromatic Horror Glitch & Screen Shake */
.fate-glitch-active {
    animation: horrorGlitch 0.45s ease-in-out forwards;
}

@keyframes horrorGlitch {
    0% { transform: translate(0, 0); filter: hue-rotate(0deg) contrast(1); }
    20% { transform: translate(-5px, 3px); filter: hue-rotate(90deg) contrast(1.5); }
    40% { transform: translate(5px, -3px); filter: hue-rotate(-90deg) contrast(1.7); }
    60% { transform: translate(-3px, -2px); filter: hue-rotate(180deg) contrast(1.4); }
    80% { transform: translate(3px, 2px); filter: hue-rotate(0deg) contrast(1.2); }
    100% { transform: translate(0, 0); filter: hue-rotate(0deg) contrast(1); }
}

/* Seal of Bound Destiny */
.fate-bound-seal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, rgba(139, 0, 0, 0.45) 0%, rgba(50, 0, 0, 0.95) 100%);
    border: 1.5px solid var(--primary-crimson);
    border-radius: 20px;
    color: var(--text-crimson);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-gothic);
    margin-bottom: 12px;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.6);
    animation: sealPulse 2s ease-in-out infinite alternate;
}

@keyframes sealPulse {
    0% { box-shadow: 0 0 10px rgba(220, 38, 38, 0.5); }
    100% { box-shadow: 0 0 25px rgba(255, 42, 42, 0.95); }
}

/* ============================
   THE ALL-SEEING EYE (FLOATING)
   ============================ */
.all-seeing-eye {
    position: fixed;
    bottom: 90px;
    right: 14px;
    width: 48px;
    height: 48px;
    z-index: 9999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.7))
            drop-shadow(0 0 28px rgba(139, 0, 0, 0.5));
    animation: eyeFloat 4s ease-in-out infinite alternate, eyeBlink 6s ease-in-out infinite;
    transition: filter 0.4s ease;
}

.all-seeing-eye:hover {
    filter: drop-shadow(0 0 20px rgba(255, 42, 42, 1))
            drop-shadow(0 0 40px rgba(220, 38, 38, 0.8));
}

/* Photorealistic Vector Eye Styling */
.real-eye-socket {
    width: 62px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.8));
}

.real-eye-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.eye-iris-group {
    transition: transform 0.08s ease-out;
}

.giant-eye-svg {
    width: 90px;
    height: 54px;
}

.giant-eye-pulse {
    animation: eyePupilPulse 2s ease-in-out infinite alternate;
}

/* Eye Dialogue Speech Bubble Emerging from Bottom Right */
.eye-speech-bubble {
    position: absolute;
    bottom: 54px;
    right: 0px;
    width: 250px;
    background: rgba(16, 3, 7, 0.96);
    border: 1.5px solid var(--border-crimson);
    box-shadow: 0 0 25px rgba(220, 38, 38, 0.7), inset 0 0 12px rgba(139, 0, 0, 0.6);
    color: var(--text-gold);
    padding: 10px 14px;
    border-radius: 14px 14px 2px 14px;
    font-size: 12px;
    line-height: 1.55;
    font-family: var(--font-gothic);
    pointer-events: auto;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10001;
    animation: bubblePulse 3s ease-in-out infinite alternate;
}

/* Bubble Tail pointing down-right to the Eye */
.eye-speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    right: 12px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 2px solid transparent;
    border-top: 10px solid var(--border-crimson);
}

@keyframes bubblePulse {
    0% { box-shadow: 0 0 15px rgba(220, 38, 38, 0.5), inset 0 0 8px rgba(139, 0, 0, 0.4); }
    100% { box-shadow: 0 0 30px rgba(255, 42, 42, 0.95), inset 0 0 18px rgba(220, 38, 38, 0.7); }
}

.eye-white {
    width: 44px;
    height: 26px;
    background: radial-gradient(ellipse, #e8dcd0 55%, #a08060 80%, #3a2818 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid rgba(139, 0, 0, 0.6);
    position: relative;
    overflow: hidden;
}

.eye-iris {
    width: 20px;
    height: 20px;
    background: radial-gradient(circle at 35% 35%, #c4402a, #8b0000 55%, #2a0000 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 8px rgba(220, 38, 38, 0.8);
    position: relative;
}

.eye-pupil {
    width: 9px;
    height: 9px;
    background: #000;
    border-radius: 50%;
    transition: transform 0.12s ease-out;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.9);
    position: relative;
}

.eye-pupil::after {
    content: '';
    position: absolute;
    top: 1.5px;
    left: 2px;
    width: 3px;
    height: 3px;
    background: rgba(255, 255, 255, 0.65);
    border-radius: 50%;
}

@keyframes eyeFloat {
    0% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-5px) rotate(1deg); }
    100% { transform: translateY(2px) rotate(-1deg); }
}

@keyframes eyeBlink {
    0%, 42%, 46%, 100% { clip-path: ellipse(50% 50% at 50% 50%); }
    44% { clip-path: ellipse(50% 5% at 50% 50%); }
}

/* App Container */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at 50% 0%, rgba(90, 15, 30, 0.75) 0%, rgba(20, 5, 35, 0.94) 45%, rgba(2, 0, 5, 0.99) 100%);
    box-shadow: 0 0 80px rgba(0, 0, 0, 0.98), inset 0 0 100px rgba(139, 0, 0, 0.15);
}

.gothic-frame {
    border-left: 1px solid var(--border-gold);
    border-right: 1px solid var(--border-gold);
}

/* Header */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: rgba(8, 2, 18, 0.88);
    backdrop-filter: blur(16px);
    border-bottom: 1.5px solid var(--border-gold);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

/* Sentient Dark Oracle Whispering Banner */
.sentient-oracle-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.18) 0%, rgba(15, 5, 25, 0.95) 50%, rgba(147, 51, 234, 0.18) 100%);
    border-bottom: 1px solid var(--border-crimson);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 12px rgba(139, 0, 0, 0.3);
}

.sentient-oracle-banner:hover {
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.3) 0%, rgba(25, 8, 40, 0.95) 50%, rgba(147, 51, 234, 0.3) 100%);
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5), inset 0 0 15px rgba(220, 38, 38, 0.4);
}

.oracle-eye-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.9));
    animation: eyePulse 3s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes eyePulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.7)); }
    50% { transform: scale(1.15); filter: drop-shadow(0 0 16px rgba(255, 42, 42, 1)); }
}

.oracle-speech-wrapper {
    flex: 1;
    overflow: hidden;
}

.oracle-whisper-text {
    font-size: 12px;
    color: var(--text-gold);
    font-family: var(--font-gothic);
    letter-spacing: 0.4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

.oracle-hint-sparkle {
    font-size: 12px;
    color: var(--primary-gold);
    animation: sparkleFlicker 1.5s infinite alternate;
}

@keyframes sparkleFlicker {
    0% { opacity: 0.3; transform: rotate(0deg); }
    100% { opacity: 1; transform: rotate(45deg); }
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.brand-icon {
    font-size: 24px;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.8));
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 900;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-user-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid var(--border-gold-bright);
    object-fit: cover;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.5);
}

.header-user-name {
    font-size: 13px;
    color: var(--text-gold);
    font-weight: 500;
    font-family: var(--font-body);
}

.btn-icon {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid var(--border-gold);
    color: var(--text-main);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.btn-icon:hover {
    border-color: var(--border-gold-bright);
    background: rgba(220, 38, 38, 0.3);
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.5);
}

/* App Screens */
.app-screen {
    display: none;
    padding: 20px;
    flex: 1;
    animation: fadeIn 0.4s ease-out forwards;
}

.app-screen.active {
    display: block;
}

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

/* Gothic Ornaments & Boxes */
.gothic-box {
    position: relative;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1.5px solid var(--border-gold);
    box-shadow: var(--shadow-mystic);
}

.gothic-box::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px dashed rgba(212, 175, 55, 0.22);
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
}

.runic-divider {
    font-size: 12px;
    color: var(--primary-gold);
    letter-spacing: 4px;
    margin-top: 10px;
    opacity: 0.85;
    text-shadow: 0 0 10px rgba(220, 38, 38, 0.9);
}

/* Hero Section */
.hero-banner {
    text-align: center;
    padding: 28px 18px;
    background: linear-gradient(165deg, rgba(40, 10, 50, 0.85) 0%, rgba(18, 5, 25, 0.95) 50%, rgba(5, 1, 10, 0.98) 100%);
    margin-bottom: 24px;
    overflow: hidden;
}

.hero-banner::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, rgba(147, 51, 234, 0.25) 45%, transparent 70%);
    pointer-events: none;
    animation: heroGlowPulse 6s ease-in-out infinite alternate;
}

@keyframes heroGlowPulse {
    0% { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.05); opacity: 0.9; }
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 23px;
    font-weight: 900;
    letter-spacing: 1.5px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
    text-shadow: 0 0 25px rgba(212, 175, 55, 0.6), 0 0 10px rgba(220, 38, 38, 0.5);
    position: relative;
    z-index: 2;
}

.hero-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    letter-spacing: 0.4px;
    position: relative;
    z-index: 2;
}

/* Spreads Grid */
.section-title {
    font-family: var(--font-gothic);
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.8px;
    text-shadow: 0 0 12px rgba(220, 38, 38, 0.6);
}

.spreads-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.spread-card-item {
    background: rgba(15, 6, 26, 0.9);
    border: 1.5px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.8);
}

.spread-card-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--crimson-gradient);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.spread-card-item:hover, .spread-card-item:active {
    transform: translateY(-3px) scale(1.01);
    border-color: var(--border-gold-bright);
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.45), 0 0 20px rgba(212, 175, 55, 0.3);
    background: rgba(35, 12, 50, 0.95);
}

.spread-card-item:hover::after {
    opacity: 1;
    box-shadow: 0 0 10px rgba(255, 42, 42, 0.9);
}

.spread-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.35) 0%, rgba(10, 3, 18, 0.98) 100%);
    border: 1.5px solid var(--border-gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 0 15px rgba(220, 38, 38, 0.5), inset 0 0 10px rgba(212, 175, 55, 0.3);
}

.spread-details {
    flex: 1;
}

.spread-title {
    font-family: var(--font-gothic);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.spread-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
    line-height: 1.35;
}

.spread-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-gold);
}

.spread-badge-btn {
    color: var(--primary-crimson);
    font-weight: 700;
    font-family: var(--font-gothic);
    text-shadow: 0 0 8px rgba(220, 38, 38, 0.7);
}

/* Setup Screen */
.setup-box {
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: var(--primary-gold);
    margin-bottom: 6px;
    font-weight: 600;
    font-family: var(--font-gothic);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.4);
}

.form-input {
    width: 100%;
    padding: 13px 16px;
    background: rgba(6, 2, 14, 0.92);
    border: 1.5px solid var(--border-gold);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.9);
}

.form-input::placeholder {
    color: rgba(161, 161, 170, 0.45);
    font-style: italic;
}

.form-input:focus {
    border-color: var(--border-gold-bright);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), inset 0 0 8px rgba(139, 0, 0, 0.3);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #b91c1c 0%, #7f1d1d 50%, #3b0707 100%);
    color: #fef08a;
    font-family: var(--font-gothic);
    font-weight: 700;
    font-size: 17px;
    letter-spacing: 0.8px;
    border: 1.5px solid var(--border-gold-bright);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.35s ease;
    box-shadow: var(--shadow-crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
}

.btn-primary:hover, .btn-primary:active {
    transform: scale(0.99);
    filter: brightness(1.25);
    box-shadow: 0 0 35px rgba(220, 38, 38, 0.7), 0 0 20px rgba(212, 175, 55, 0.5);
}

.btn-primary:hover, .btn-primary:active {
    transform: scale(0.99);
    filter: brightness(1.1);
}

/* Drawing Card Screen & Deck Fan */
.draw-area {
    text-align: center;
}

.selection-slots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.slot-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.slot-card-preview {
    width: 70px;
    height: 110px;
    border: 1.5px dashed var(--border-gold);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

.slot-card-preview.filled {
    border-style: solid;
    border-color: var(--border-gold-bright);
    background: radial-gradient(circle, rgba(243, 208, 120, 0.3) 0%, rgba(15, 11, 33, 0.9) 100%);
    box-shadow: 0 0 12px rgba(243, 208, 120, 0.4);
}

.slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-muted);
}

.slot-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-gold);
}

.slot-text {
    font-size: 9px;
}

.slot-label {
    font-size: 11px;
    color: var(--text-gold);
    max-width: 80px;
    line-height: 1.2;
}

/* Deck Fan Container */
.deck-fan-wrapper {
    position: relative;
    height: 280px;
    margin: 20px 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    perspective: 800px;
    overflow: visible;
}

.deck-fan-container {
    position: relative;
    width: 280px;
    height: 200px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.fan-card {
    position: absolute;
    width: 75px;
    height: 120px;
    bottom: 0;
    border-radius: 10px;
    border: 1.5px solid var(--border-gold-bright);
    background: linear-gradient(145deg, #24072b 0%, #0d0214 100%);
    cursor: pointer;
    transform-origin: bottom center;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.9);
    user-select: none;
}

.fan-card:hover {
    transform: translateY(-24px) scale(1.15) !important;
    z-index: 50;
    border-color: #fff;
    box-shadow: 0 0 30px rgba(220, 38, 38, 0.9), 0 0 15px rgba(212, 175, 55, 0.8);
}

.card-inner-back {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-pattern-grid {
    width: 100%;
    height: 100%;
    border: 1.5px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    background: 
        radial-gradient(circle at 50% 50%, rgba(139, 0, 0, 0.35) 0%, transparent 70%),
        repeating-linear-gradient(45deg, rgba(212, 175, 55, 0.08) 0, rgba(212, 175, 55, 0.08) 6px, transparent 0, transparent 12px),
        repeating-linear-gradient(-45deg, rgba(220, 38, 38, 0.08) 0, rgba(220, 38, 38, 0.08) 6px, transparent 0, transparent 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8);
}

.card-center-emblem {
    font-size: 26px;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.9));
}

/* Mini Card Preview (in draw slots) */
.mini-card-back {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, rgba(12, 5, 22, 0.95) 100%);
    border: 1px solid var(--border-gold-bright);
}

.mini-emblem {
    font-size: 28px;
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.9));
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.7)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 18px rgba(255, 42, 42, 1)); transform: scale(1.08); }
}

.card-back-label {
    font-size: 10px;
    color: var(--text-gold);
    margin-top: 6px;
    text-align: center;
    font-family: var(--font-gothic);
}

/* Result Screen & 3D Card Flip */
.result-cards-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 24px 0;
}

.result-card-3d-wrapper {
    perspective: 1000px;
    width: 130px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.result-card-3d-inner {
    width: 100%;
    height: 200px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-card-3d-inner.flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    border: 1.5px solid var(--border-gold-bright);
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(220, 38, 38, 0.3);
}

.card-front {
    background: linear-gradient(145deg, #240a36 0%, #0d0217 100%);
    transform: rotateY(180deg);
    border-color: var(--border-gold-bright);
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.4), inset 0 0 15px rgba(139, 0, 0, 0.4);
}

.card-back {
    background: linear-gradient(145deg, #120421 0%, #2a072b 100%);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.4);
}

.card-border-gold {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px dashed rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    pointer-events: none;
}

.card-top-arcana {
    font-size: 9px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-family: var(--font-gothic);
}

.card-symbol-hero {
    font-size: 40px;
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.9));
    margin: 4px 0;
}

.card-title-th {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-gold);
    line-height: 1.2;
    font-family: var(--font-gothic);
}

.card-element-tag {
    font-size: 9px;
    color: var(--text-crimson);
}

.card-keywords {
    font-size: 8px;
    color: var(--primary-gold);
}

.card-tap-hint {
    font-size: 8px;
    color: var(--text-muted);
    margin-top: 2px;
}

.result-card-slot-tag {
    font-size: 11px;
    color: var(--text-gold);
    text-align: center;
    margin-top: 6px;
    font-family: var(--font-gothic);
}

/* Synthesis Result Box */
.synthesis-box {
    background: var(--bg-card);
    border: 1.5px solid var(--border-gold);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-mystic);
    position: relative;
}

.synthesis-box::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px dashed rgba(212, 175, 55, 0.25);
    border-radius: calc(var(--radius-lg) - 4px);
    pointer-events: none;
}

.score-gauge-container {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.score-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(220, 38, 38, 0.3) 0%, rgba(12, 5, 22, 0.95) 100%);
    border: 2px solid var(--border-gold-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    font-family: var(--font-gothic);
    color: var(--primary-gold);
    flex-shrink: 0;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6), inset 0 0 10px rgba(212, 175, 55, 0.3);
}

.score-progress-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-gold);
    border-radius: 5px;
    overflow: hidden;
}

.score-progress-fill {
    height: 100%;
    background: var(--crimson-gradient);
    border-radius: 4px;
    transition: width 1s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.8);
}

.lucky-attributes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text-gold);
    margin-bottom: 14px;
    background: rgba(139, 0, 0, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.oracle-speech-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, rgba(88, 28, 135, 0.4) 0%, rgba(53, 10, 85, 0.8) 100%);
    border: 1.5px solid var(--border-gold);
    color: #e9d5ff;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-gothic);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(147, 51, 234, 0.3);
}

.oracle-speech-btn:hover {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.5) 0%, rgba(88, 28, 135, 0.9) 100%);
    box-shadow: 0 0 25px rgba(147, 51, 234, 0.6);
}

.oracle-speech-btn.speaking {
    background: rgba(236, 72, 153, 0.3);
    border-color: #f472b6;
    color: #fbcfe8;
}

.oracle-speech-btn .pulse-ring {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #f472b6;
    animation: pulseBeat 1s ease-in-out infinite;
    margin-right: 6px;
}

@keyframes pulseBeat {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.5; }
}

.oracle-speech-btn:hover {
    background: rgba(147, 51, 234, 0.35);
    border-color: rgba(147, 51, 234, 0.9);
}

/* Card Detail Breakdown Tabs */
.card-detail-block {
    background: rgba(18, 13, 36, 0.6);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.card-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 10px;
}

.card-detail-symbol {
    font-size: 28px;
}

.card-detail-title {
    font-size: 15px;
    color: var(--primary-gold);
}

.card-detail-sub {
    font-size: 11px;
    color: var(--text-muted);
}

.detail-section {
    margin-bottom: 10px;
    font-size: 13px;
    line-height: 1.5;
}

.detail-section strong {
    color: var(--text-gold);
    display: block;
    margin-bottom: 2px;
}

.detail-section.highlight {
    background: rgba(243, 208, 120, 0.08);
    padding: 10px;
    border-radius: 8px;
    border-left: 3px solid var(--border-gold-bright);
}

/* History Screen */
.history-item-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 14px;
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-gold);
    margin-bottom: 8px;
}

.history-cards-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin: 8px 0;
}

.history-card-chip {
    background: rgba(243, 208, 120, 0.15);
    border: 1px solid var(--border-gold);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    color: var(--text-main);
}

.history-question {
    font-size: 12px;
    color: var(--text-gold);
    margin-bottom: 6px;
    font-style: italic;
    opacity: 0.85;
}

.history-summary {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Catalog Screen */
.catalog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.catalog-card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: var(--radius-sm);
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.catalog-card-item:hover {
    transform: translateY(-3px);
    border-color: var(--border-gold-bright);
    box-shadow: var(--shadow-gold);
}

.catalog-symbol {
    font-size: 32px;
    margin-bottom: 4px;
}

.catalog-card-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.2;
}

.catalog-arcana {
    font-size: 9px;
    color: var(--text-muted);
}

/* Modal Dialog */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 3, 15, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
}

.modal-card-box {
    background: linear-gradient(165deg, #1d072b 0%, #0c0214 100%);
    border: 1.5px solid var(--border-gold-bright);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), 0 0 25px rgba(220, 38, 38, 0.4);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close-btn:hover {
    color: var(--primary-crimson);
}

.modal-card-header {
    text-align: center;
    margin-bottom: 16px;
}

.modal-card-header h2 {
    font-size: 20px;
    color: var(--primary-gold);
    margin-top: 4px;
    font-family: var(--font-gothic);
}

.modal-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
    font-family: var(--font-gothic);
}

.modal-tags {
    text-align: center;
    margin-bottom: 16px;
    line-height: 2;
}

.modal-detail-content {
    margin-top: 12px;
}

.modal-card-symbol {
    font-size: 54px;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8));
}

.tag-chip {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid var(--border-gold);
    color: var(--text-gold);
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
    margin: 2px;
}

.detail-box {
    background: rgba(10, 4, 20, 0.8);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.detail-box h4 {
    color: var(--primary-gold);
    font-size: 14px;
    margin-bottom: 4px;
    font-family: var(--font-gothic);
}

.detail-box p {
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.45;
}

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: 64px;
    background: rgba(6, 2, 14, 0.94);
    backdrop-filter: blur(18px);
    border-top: 1.5px solid var(--border-gold);
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 200;
    box-shadow: 0 -5px 25px rgba(0, 0, 0, 0.9);
}

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-gothic);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn .nav-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 4px rgba(0,0,0,0.8));
}

.nav-btn.active {
    color: var(--primary-gold);
    font-weight: 700;
}

.nav-btn.active .nav-icon {
    transform: translateY(-2px);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.9));
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

/* ==========================================================================
   RESPONSIVE DESIGN — Media Queries
   ========================================================================== */

/* Small Phones (width <= 359px) */
@media (max-width: 359px) {
    .app-header {
        padding: 12px 12px;
    }

    .brand-name {
        font-size: 14px;
    }

    .header-user-name {
        display: none;
    }

    .hero-title {
        font-size: 18px;
    }

    .hero-desc {
        font-size: 12px;
    }

    .app-screen {
        padding: 14px 12px;
    }

    .spread-card-item {
        padding: 12px;
        gap: 10px;
    }

    .spread-icon-badge {
        width: 42px;
        height: 42px;
        font-size: 20px;
    }

    .spread-title {
        font-size: 13px;
    }

    .spread-subtitle {
        font-size: 11px;
    }

    .slot-card-preview {
        width: 56px;
        height: 90px;
    }

    .slot-label {
        font-size: 9px;
        max-width: 62px;
    }

    .fan-card {
        width: 55px;
        height: 90px;
    }

    .deck-fan-wrapper {
        height: 220px;
    }

    .result-card-3d-wrapper {
        width: 100px;
    }

    .result-card-3d-inner {
        height: 160px;
    }

    .card-symbol-hero {
        font-size: 28px;
    }

    .catalog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .lucky-attributes {
        flex-direction: column;
        gap: 6px;
    }
}

/* Regular Phones (360px — 480px) */
@media (min-width: 360px) and (max-width: 480px) {
    .header-user-name {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Tablets (481px — 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    .app-container {
        max-width: 600px;
    }

    .bottom-nav {
        max-width: 600px;
    }

    .hero-title {
        font-size: 28px;
    }

    .hero-desc {
        font-size: 14px;
    }

    .spreads-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }

    .spread-card-item {
        flex-direction: column;
        text-align: center;
        padding: 20px 14px;
    }

    .spread-icon-badge {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }

    .spread-meta {
        flex-direction: column;
        gap: 6px;
    }

    .result-cards-grid {
        gap: 24px;
    }

    .result-card-3d-wrapper {
        width: 150px;
    }

    .result-card-3d-inner {
        height: 230px;
    }

    .card-symbol-hero {
        font-size: 44px;
    }

    .catalog-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .deck-fan-container {
        width: 360px;
    }

    .fan-card {
        width: 80px;
        height: 125px;
    }
}

/* Desktop & Large Screens (769px+) */
@media (min-width: 769px) {
    body {
        display: flex;
        justify-content: center;
        background: #050312;
    }

    .app-container {
        max-width: 480px;
        min-height: 100vh;
        border-left: 1px solid var(--border-gold);
        border-right: 1px solid var(--border-gold);
        box-shadow: 0 0 60px rgba(243, 208, 120, 0.08);
    }

    .bottom-nav {
        max-width: 480px;
    }

    .modal-card-box {
        max-width: 460px;
    }
}

/* Safe Area for Notched Phones (iPhone X+) */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom));
    }

    .bottom-nav {
        height: calc(64px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Hover-capable devices: richer hover feedback */
@media (hover: hover) {
    .spread-card-item:hover {
        transform: translateY(-4px) scale(1.02);
    }

    .catalog-card-item:hover {
        transform: translateY(-4px) scale(1.03);
    }

    .nav-btn:hover {
        color: var(--primary-gold);
    }

    .modal-close-btn:hover {
        color: var(--primary-gold);
    }
}

/* Touch devices: more forgiving tap targets */
@media (hover: none) and (pointer: coarse) {
    .btn-icon {
        min-height: 40px;
        min-width: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-btn {
        min-width: 56px;
        min-height: 48px;
    }

    .fan-card {
        min-width: 50px;
    }

    .modal-close-btn {
        min-width: 40px;
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Reduce Motion preference */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===================================
   BLOOD PACT RITUAL OVERLAY & RUNES
   =================================== */
.blood-pact-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(3, 1, 6, 0.96);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.pact-content {
    max-width: 400px;
    width: 100%;
    text-align: center;
    background: rgba(18, 4, 7, 0.95);
    border: 2px solid var(--border-crimson);
    box-shadow: 0 0 35px rgba(220, 38, 38, 0.6), inset 0 0 25px rgba(139, 0, 0, 0.5);
    padding: 30px 20px;
    border-radius: 16px;
    animation: pactGlowPulse 3s ease-in-out infinite alternate;
}

@keyframes pactGlowPulse {
    0% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.4), inset 0 0 15px rgba(139, 0, 0, 0.3); }
    100% { box-shadow: 0 0 45px rgba(255, 42, 42, 0.8), inset 0 0 35px rgba(220, 38, 38, 0.6); }
}

.pact-seal-icon {
    font-size: 52px;
    color: var(--primary-crimson);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.9));
    margin-bottom: 8px;
    animation: sealSpin 20s linear infinite;
}

@keyframes sealSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Eerie Dark Loading Animation Styling */
.eerie-spinner-container {
    position: relative;
    width: 90px;
    height: 90px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eerie-spinning-pentagram {
    position: absolute;
    font-size: 72px;
    color: var(--primary-crimson);
    filter: drop-shadow(0 0 20px #ff0000);
    animation: eerieRuneSpin 4s linear infinite;
}

.eerie-eye-pulse {
    position: relative;
    z-index: 2;
    font-size: 32px;
    animation: pulse 1s infinite alternate;
    filter: drop-shadow(0 0 10px #ff2a2a);
}

@keyframes eerieRuneSpin {
    0% { transform: rotate(0deg) scale(0.95); opacity: 0.8; }
    50% { transform: rotate(180deg) scale(1.1); opacity: 1; filter: drop-shadow(0 0 35px #ff0000); }
    100% { transform: rotate(360deg) scale(0.95); opacity: 0.8; }
}

.pact-title {
    font-family: var(--font-gothic);
    color: var(--primary-crimson);
    font-size: 24px;
    margin-bottom: 8px;
    text-shadow: 0 0 12px rgba(220, 38, 38, 0.8);
}

.pact-subtitle {
    font-size: 13.5px;
    color: var(--text-gold);
    line-height: 1.6;
    margin-bottom: 24px;
}

.giant-opening-eye-container {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 0 25px rgba(255, 0, 0, 0.9)) drop-shadow(0 0 45px rgba(220, 38, 38, 0.8));
    animation: eyeUnveil 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.giant-eye-pupil-glow {
    font-size: 52px;
    animation: eyePupilPulse 2s ease-in-out infinite alternate;
}

@keyframes eyeUnveil {
    0% { transform: scale(0.1) rotate(-30deg); opacity: 0; filter: blur(10px); }
    50% { transform: scale(1.3) rotate(10deg); opacity: 0.9; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; filter: blur(0); }
}

@keyframes eyePupilPulse {
    0% { transform: scale(0.95); filter: drop-shadow(0 0 10px #ff0000); }
    100% { transform: scale(1.1); filter: drop-shadow(0 0 25px #ff2a2a); }
}

.pact-worthy-alert {
    position: relative;
    background: rgba(18, 3, 7, 0.95);
    border: 1.5px solid var(--border-crimson);
    border-radius: 12px;
    padding: 12px 16px;
    margin: 14px 0 20px 0;
    font-size: 12.5px;
    color: var(--text-gold);
    line-height: 1.6;
    font-family: var(--font-gothic);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6), inset 0 0 15px rgba(139, 0, 0, 0.5);
    transition: transform 0.1s ease, filter 0.1s ease;
    overflow: hidden;
}

.pact-worthy-typewriter {
    min-height: 42px;
}

.pact-worthy-alert.box-glitch-active {
    transform: skewX(-6deg) scale(1.03);
    filter: invert(0.85) hue-rotate(180deg) drop-shadow(0 0 35px #ff0000);
    box-shadow: 0 0 40px #ff0000, inset 0 0 25px #ff0000;
}

.pact-blood-drips {
    position: absolute;
    bottom: -6px;
    width: 100%;
    left: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
}

.pact-drip {
    font-size: 14px;
    animation: dripFloat 2s ease-in-out infinite alternate;
}

.pact-drip.drip-right {
    animation-delay: 1s;
}

@keyframes dripFloat {
    from { transform: translateY(-4px) scale(0.9); opacity: 0.6; }
    to { transform: translateY(4px) scale(1.2); opacity: 1; }
}

.pact-hold-container {
    position: relative;
    width: 140px;
    height: 140px;
    margin: 0 auto 20px auto;
    cursor: pointer;
    user-select: none;
    touch-action: manipulation;
}

.pact-progress-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.pact-bg-circle {
    fill: none;
    stroke: rgba(139, 0, 0, 0.3);
    stroke-width: 6;
}

.pact-fill-circle {
    fill: none;
    stroke: #ff2a2a;
    stroke-width: 7;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.03s linear;
    filter: drop-shadow(0 0 8px #ff2a2a);
}

.pact-btn-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pact-fingerprint-icon {
    font-size: 32px;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.7));
}

.pact-btn-text {
    font-size: 10px;
    color: var(--text-gold);
    font-weight: 700;
    text-align: center;
    width: 100px;
}

.pact-warning {
    font-size: 11.5px;
    color: var(--text-gold);
    border-top: 1px dashed rgba(220, 38, 38, 0.4);
    padding-top: 12px;
    line-height: 1.6;
    background: rgba(139, 0, 0, 0.15);
    border-radius: 8px;
    padding: 10px 12px;
    margin-top: 8px;
}

.pact-warning strong {
    color: var(--primary-crimson);
    text-shadow: 0 0 8px rgba(255, 42, 42, 0.8);
}

/* Shatter Animation on complete */
.shatter-animation {
    animation: pactShatter 0.8s ease-in forwards;
}

@keyframes pactShatter {
    0% { opacity: 1; transform: scale(1); filter: contrast(1); }
    30% { opacity: 0.9; transform: scale(1.05); filter: contrast(2) hue-rotate(90deg); }
    60% { opacity: 0.5; transform: scale(0.9) rotate(3deg); filter: invert(1); }
    100% { opacity: 0; transform: scale(1.3); display: none; }
}

/* Demonic Rune Glitch Text */
.rune-glitch-text {
    color: var(--primary-crimson);
    font-weight: 900;
    text-shadow: 0 0 8px #ff0000, 0 0 15px #8b0000;
    animation: runeFlicker 0.15s infinite alternate;
    display: inline-block;
}

@keyframes runeFlicker {
    0% { transform: skewX(-5deg) scale(1.05); filter: brightness(1.5); }
    100% { transform: skewX(5deg) scale(0.95); filter: brightness(0.8); }
}

/* ===================================
   PHANTOM DEMONIC HAND CARD GRAB FX
   =================================== */
.phantom-hand-overlay {
    position: fixed;
    width: 150px;
    height: 180px;
    z-index: 999999;
    pointer-events: none;
    transform: translateY(60px) scale(0.3) rotate(-15deg);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease-in;
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.9)) drop-shadow(0 0 40px rgba(0, 0, 0, 0.95));
}

.phantom-hand-overlay.hand-grabbing {
    transform: translateY(0px) scale(1) rotate(0deg);
    opacity: 1;
}

.phantom-hand-overlay.hand-dissolve {
    transform: translateY(-40px) scale(1.2) rotate(10deg);
    opacity: 0;
    filter: blur(8px) brightness(2) drop-shadow(0 0 30px #ff0000);
}

.phantom-hand-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.phantom-hand-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.hand-grab-sparkles {
    position: absolute;
    top: 20px;
    left: 45px;
    font-size: 24px;
    animation: sparklePulse 0.4s ease-out infinite alternate;
}

@keyframes sparklePulse {
    from { opacity: 0.5; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1.3); }
}

/* ===================================
   SPECTRAL TOUCH SCRATCH TRAIL
   =================================== */
.spectral-scratch-mark {
    position: fixed;
    width: 24px;
    height: 24px;
    font-size: 18px;
    z-index: 999999;
    pointer-events: none;
    user-select: none;
    opacity: 0.85;
    filter: drop-shadow(0 0 8px rgba(255, 0, 0, 0.9));
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.spectral-scratch-mark.fade-out {
    opacity: 0;
    transform: scale(1.6) translateY(-10px);
}

/* ===================================
   CARD REVEAL BLOOD DRIPS & GHOST FLASH
   =================================== */
.card-blood-drip-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    pointer-events: none;
    overflow: hidden;
    z-index: 5;
}

.blood-drop {
    position: absolute;
    top: -10px;
    width: 6px;
    height: 22px;
    background: linear-gradient(to bottom, #8b0000, #ff0000);
    border-radius: 0 0 50% 50%;
    filter: drop-shadow(0 0 5px #ff0000);
    animation: bloodDrip 2.5s ease-in infinite;
}

.blood-drop.drop-1 { left: 20%; animation-delay: 0.2s; }
.blood-drop.drop-2 { left: 55%; animation-delay: 1.1s; height: 30px; width: 8px; }
.blood-drop.drop-3 { left: 82%; animation-delay: 0.7s; }

@keyframes bloodDrip {
    0% { transform: translateY(-10px) scaleY(0.2); opacity: 0; }
    30% { opacity: 0.9; }
    100% { transform: translateY(45px) scaleY(1.3); opacity: 0; }
}

.card-ghost-silhouette-flash {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(139, 0, 0, 0.4);
    backdrop-filter: invert(0.9) hue-rotate(180deg);
    -webkit-backdrop-filter: invert(0.9) hue-rotate(180deg);
    border-radius: 12px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.9;
    transition: opacity 0.4s ease-out;
}

.ghost-eyes {
    font-size: 38px;
    filter: drop-shadow(0 0 15px #ff0000);
    animation: pulse 0.3s infinite alternate;
}

.ghost-face-label {
    font-size: 11px;
    color: var(--primary-crimson);
    font-weight: 700;
    font-family: var(--font-gothic);
    margin-top: 4px;
}

.card-ghost-silhouette-flash.ghost-dissolve {
    opacity: 0;
    transform: scale(1.1);
}

@keyframes spiritFloat {
    0% { transform: translateY(0) rotate(-4deg) scale(0.95); }
    100% { transform: translateY(-12px) rotate(4deg) scale(1.08); }
}

/* ===================================
   SCROLL-DRIVEN EERIE REVEAL ANIMATIONS
   =================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(35px) scale(0.96);
    filter: blur(6px);
    transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                transform 0.7s cubic-bezier(0.16, 1, 0.3, 1), 
                filter 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform, opacity, filter;
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
}

.chapter-badge {
    display: inline-block;
    background: rgba(139, 0, 0, 0.3);
    border: 1px solid var(--border-crimson);
    color: var(--primary-crimson);
    font-size: 11px;
    font-weight: 700;
    font-family: var(--font-gothic);
    padding: 4px 12px;
    border-radius: 12px;
    margin-bottom: 10px;
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
}

.card-detail-block {
    margin-bottom: 24px;
    background: rgba(15, 3, 7, 0.95);
    border: 1.5px solid var(--border-crimson);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.4), inset 0 0 15px rgba(0, 0, 0, 0.8);
    position: relative;
    overflow: hidden;
}

.card-detail-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-crimson), transparent);
}

/* ===================================
   BLOOD STRIKETHROUGH & DEMONIC NAME MUTATION
   =================================== */
.user-name-original.blood-strikethrough {
    position: relative;
    color: #ff4d4d;
    text-decoration: line-through;
    text-decoration-color: #ff0000;
    text-decoration-thickness: 3px;
    animation: namePulse 0.3s infinite alternate;
}

.crypted-demon-name {
    color: var(--primary-crimson);
    font-weight: 900;
    text-shadow: 0 0 10px #ff0000, 0 0 20px #8b0000;
    animation: runeFlicker 0.2s infinite alternate;
    font-family: var(--font-gothic);
}

/* ===================================
   DEGENERATIVE UI & SOUNDSCAPE STAGES
   =================================== */
body.deg-stage-1 #app-main-container {
    filter: contrast(1.1) brightness(0.92);
}

body.deg-stage-2 #app-main-container {
    filter: contrast(1.25) brightness(0.85) sepia(0.2) hue-rotate(330deg);
    box-shadow: inset 0 0 50px rgba(139, 0, 0, 0.7);
}

body.deg-stage-2 .fate-vignette-overlay {
    opacity: 0.55 !important;
    animation-duration: 1.2s !important;
}

body.deg-stage-3 #app-main-container {
    filter: contrast(1.4) brightness(0.78) sepia(0.4) hue-rotate(320deg);
    box-shadow: inset 0 0 90px rgba(255, 0, 0, 0.9);
}

body.deg-stage-3 .fate-vignette-overlay {
    opacity: 0.8 !important;
    animation-duration: 0.8s !important;
}

/* ===================================
   MACABRE ART OVERLAY
   =================================== */
.macabre-art-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 0, 2, 0.92);
    z-index: 99;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    animation: macabreFlash 0.25s linear forwards;
}

.macabre-symbol {
    font-size: 56px;
    filter: drop-shadow(0 0 25px #ff0000);
    animation: pulse 0.1s infinite alternate;
}

.macabre-glow {
    font-size: 32px;
    margin-top: 6px;
}

.macabre-art-overlay.macabre-fade {
    opacity: 0;
    transition: opacity 0.2s ease-out;
}

/* Mobile Responsive Adjustments for Eye Speech Bubble */
@media (max-width: 480px) {
    .eye-speech-bubble {
        width: calc(100vw - 44px);
        right: -10px;
        font-size: 11.5px;
        padding: 8px 12px;
    }
}




