@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Crimson+Text:ital,wght@0,400;0,600;1,400;1,600&family=Cinzel:wght@400;500;600;700&display=swap');

:root {
    --scale-factor: 1;
    --card-size: 120px;
    --gap-size: 8px;
    --card-title-font-size: 0.85rem;
    --card-image-height: 140px;
    --card-object-fit: fill;
}
@keyframes twinkle {
    0%, 100% { opacity: 0.3; transform: scale3d(0.9, 0.9, 1); }
    50% { opacity: 1; transform: scale3d(1.05, 1.05, 1); }
}

@keyframes shootingstar {
    0% { transform: translate3d(0, 0, 0) rotate(315deg) scale(0); opacity: 0; }
    15% { transform: translate3d(-80px, 80px, 0) rotate(315deg) scale(1); opacity: 1; }
    100% { transform: translate3d(-350px, 350px, 0) rotate(315deg) scale(0.3); opacity: 0; }
}

@keyframes shootingstar-reverse {
    0% { transform: translate3d(0, 0, 0) rotate(135deg) scale(0); opacity: 0; }
    15% { transform: translate3d(80px, 80px, 0) rotate(135deg) scale(1); opacity: 1; }
    100% { transform: translate3d(350px, 350px, 0) rotate(135deg) scale(0.3); opacity: 0; }
}

@keyframes shootingstar-vertical {
    0% { transform: translate3d(0, 0, 0) rotate(270deg) scale(0); opacity: 0; }
    15% { transform: translate3d(0, 80px, 0) rotate(270deg) scale(1); opacity: 1; }
    100% { transform: translate3d(0, 400px, 0) rotate(270deg) scale(0.3); opacity: 0; }
}

@keyframes mystic-trail {
    0% { 
        transform: translate3d(0, 0, 0) rotate(315deg) scale(0); 
        opacity: 0;
        filter: hue-rotate(0deg) brightness(1);
    }
    15% { 
        transform: translate3d(-80px, 80px, 0) rotate(315deg) scale(1); 
        opacity: 1;
        filter: hue-rotate(60deg) brightness(1.5);
    }
    50% {
        filter: hue-rotate(180deg) brightness(2);
    }
    100% { 
        transform: translate3d(-350px, 350px, 0) rotate(315deg) scale(0.3); 
        opacity: 0;
        filter: hue-rotate(360deg) brightness(0.5);
    }
}

@keyframes stardust-explosion {
    0% { 
        transform: scale(0) rotate(0deg); 
        opacity: 0;
        box-shadow: 0 0 0px rgba(255, 255, 255, 0);
    }
    50% { 
        transform: scale(1.5) rotate(180deg); 
        opacity: 1;
        box-shadow: 0 0 30px rgba(255, 255, 255, 0.8), 0 0 60px var(--accent-glow);
    }
    100% { 
        transform: scale(0.3) rotate(360deg); 
        opacity: 0;
        box-shadow: 0 0 100px rgba(255, 255, 255, 0.2);
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 6px var(--accent-glow), 0 0 12px rgba(var(--accent-color-rgb), 0.25);
    }
    50% {
        box-shadow: 0 0 10px var(--accent-glow), 0 0 18px rgba(var(--accent-color-rgb), 0.35);
    }
}

/* Reduce animations on mobile for better performance */
@media (max-width: 768px) {
    @keyframes pulse-glow {
        0%, 100% {
            box-shadow: 0 0 4px var(--accent-glow);
        }
        50% {
            box-shadow: 0 0 6px var(--accent-glow);
        }
    }
}

@keyframes mystic-shimmer {
    0% { background-position: -150% 0; }
    100% { background-position: 150% 0; }
}
.card-type-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 15px auto 15px;
    max-width: 600px;
}
.card-type-button {
    background: var(--button-primary);
    padding: 10px 25px;
    font-size: 1.1rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.15s ease;
    flex: 1;
    max-width: 200px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}
.card-type-button.active {
    background: linear-gradient(135deg, rgba(166, 124, 0, 0.8), rgba(255, 215, 0, 0.85));
    color: var(--bg-color);
    font-weight: bold;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
    animation: pulse-glow 2s infinite;
}

.katina-theme .card-type-button.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.85), rgba(230, 126, 34, 0.8));
    color: var(--bg-color);
    font-weight: bold;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(243, 156, 18, 0.5), 0 0 30px rgba(230, 126, 34, 0.3);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.spread-type-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 5px auto 25px;
    max-width: 700px;
    flex-wrap: wrap;
}
.spread-type-button {
    background: var(--button-primary);
    padding: 8px 18px;
    font-size: 0.95rem;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.spread-type-button.active {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.85), rgba(166, 124, 0, 0.8));
    color: var(--bg-color);
    font-weight: bold;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.4);
}

.katina-theme .spread-type-button.active {
    background: linear-gradient(135deg, rgba(108, 52, 131, 0.8), rgba(107, 91, 149, 0.85));
    color: var(--text-primary);
    font-weight: bold;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 52, 131, 0.4), 0 0 25px rgba(116, 76, 158, 0.3);
    border: 1px solid rgba(243, 156, 18, 0.3);
}
.spread-type-button .card-count {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-left: 5px;
}

@keyframes shuffle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-2deg); }
    50% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
    100% { transform: rotate(0deg); }
}
@keyframes magicParticle {
    0% { transform: translate(0, 0) scale(0); opacity: 1; }
    100% { transform: translate(var(--x), var(--y)) scale(1); opacity: 0; }
}
@keyframes quickFlip {
    0% { 
        transform: rotateY(0deg) scale(1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    }
    25% { 
        transform: rotateY(-15deg) scale(1.05);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }
    50% { 
        transform: rotateY(90deg) scale(1.1);
        box-shadow: 0 12px 25px rgba(0, 0, 0, 0.4);
    }
    75% { 
        transform: rotateY(105deg) scale(1.05);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
    }
    100% { 
        transform: rotateY(180deg) scale(1);
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
    }
}



:root {
    --primary-color: #4A3B8C;
    --primary-color-rgb: 74, 59, 140;
    --secondary-color: #6B5B95;
    --secondary-color-rgb: 107, 91, 149;
    --accent-color: #FFD700;
    --accent-color-rgb: 255, 215, 0;
    --bg-color: #2A1B3D;
    --overlay-color: rgba(42, 27, 61, 0.75);
    --gradient-start: rgba(74, 59, 140, 0.3);
    --gradient-mid: rgba(42, 27, 61, 0.6);
    --gradient-end: rgba(107, 91, 149, 0.4);
    --button-primary: linear-gradient(135deg, #4A3B8C, #6B5B95);
    --button-hover: linear-gradient(135deg, #6B5B95, #8A7CA8);
    --accent-glow: rgba(255, 215, 0, 0.7);
    --mystic-silver: #E6E6FA;
    --mystic-silver-rgb: 230, 230, 250;
    --text-primary: #F5F5F5;
    --text-secondary: #E0E0E0;
}
.katina-theme {
    --primary-color: #2D1B69;
    --primary-color-rgb: 45, 27, 105;
    --secondary-color: #744C9E;
    --secondary-color-rgb: 116, 76, 158;
    --accent-color: #F39C12;
    --accent-color-rgb: 243, 156, 18;
    --bg-color: #1A0E2E;
    --overlay-color: rgba(26, 14, 46, 0.85);
    --gradient-start: rgba(45, 27, 105, 0.6);
    --gradient-mid: rgba(26, 14, 46, 0.8);
    --gradient-end: rgba(116, 76, 158, 0.4);
    --button-primary: linear-gradient(135deg, #2D1B69, #744C9E);
    --button-hover: linear-gradient(135deg, #3D2B79, #8A5CAE);
    --accent-glow: rgba(243, 156, 18, 0.8);
    --text-primary: #F8F9FA;
    --text-secondary: #E9ECEF;
    --mystic-gold: #E67E22;
    --mystic-gold-rgb: 230, 126, 34;
    --deep-purple: #6C3483;
    --deep-purple-rgb: 108, 52, 131;
}
body {
    font-family: 'Playfair Display', serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    text-align: center;
    margin: 0;
    padding: 0;
    width: 100%;
    background-image: url('assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow-x: hidden;
    box-sizing: border-box;
}
.overlay {
    background-color: var(--overlay-color);
    min-height: 100vh;
    width: 100%;
    padding: 20px 0;
    background-image: linear-gradient(to bottom, var(--gradient-start), var(--gradient-mid), var(--gradient-end));
    position: relative;
    box-sizing: border-box;
}
h1 {
    font-size: 2.8rem;
    margin-top: 30px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-family: 'Cinzel', serif;
    letter-spacing: 2px;
    font-weight: 600;
}

.introduction {
    max-width: 800px;
    margin: 0 auto 15px;
    line-height: 1.5;
    font-size: 1.05rem;
    padding: 15px 20px;
    background: rgba(var(--primary-color-rgb), 0.6);
    border-radius: 12px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.4);
    box-shadow: 0 5px 20px rgba(var(--primary-color-rgb), 0.4), 0 0 15px var(--accent-glow);
    position: relative;
    overflow: hidden;
}

.introduction::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(var(--mystic-silver-rgb), 0.1), transparent);
    animation: mystic-shimmer 3s infinite;
}

.mode-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 8px 10px;
    flex-direction: row;
    gap: 12px;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.7), rgba(var(--secondary-color-rgb), 0.7));
    padding: 8px 15px;
    border-radius: 30px;
    box-shadow: 0 3px 6px rgba(var(--primary-color-rgb), 0.2);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    flex: 1;
}
.mode-labels {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}
.mode-label {
    font-size: 0.95rem;
    opacity: 0.4;
    transition: all 0.15s ease;
    padding: 2px 0;
    border-radius: 10px;
    color: var(--accent-color);
    text-shadow: 0 0 5px var(--accent-glow);
    font-weight: 500;
}
.mode-label.active {
    opacity: 1;
    font-weight: 700;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 30px;
    margin: 0 5px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(var(--primary-color-rgb), 0.5);
    transition: .4s;
    border: 1px solid rgba(var(--accent-color-rgb), 0.3);
}
.slider:before {
    position: absolute;
    content: "";
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 3px;
    background-color: var(--accent-color);
    transition: .4s;
    box-shadow: 0 0 5px var(--accent-glow);
}
input:checked + .slider {
    background-color: rgba(var(--primary-color-rgb), 0.7);
}
input:checked + .slider:before {
    transform: translateX(29px);
}
.slider.round {
    border-radius: 34px;
}
.slider.round:before {
    border-radius: 50%;
}
.control-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 15px;
    padding: 10px 15px;
    background: rgba(var(--primary-color-rgb), 0.55);
    border-radius: 10px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.25);
    max-width: 800px;
}

@media (min-width: 769px) {
    .control-panel {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .control-panel .button-row {
        display: flex;
        gap: 10px;
    }

    .control-panel .slider-row {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        justify-content: flex-end;
    }

    .scale-controls {
        flex: 0 1 auto;
        margin: 0 5px;
    }
}
.controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 5px 0;
}
button {
    background: var(--button-primary);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 20px;
    margin: 0;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.15s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}
button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--button-hover);
    transition: all 0.15s ease;
    z-index: -1;
}
button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(0, 0, 0, 0.4), 0 0 15px var(--accent-glow);
    color: #fff;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}
button:hover::before { left: 0; }
button:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}
.reset-button {
    background: linear-gradient(135deg, rgba(166, 124, 0, 0.8), rgba(255, 215, 0, 0.85));
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.auto-select-button {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.8), rgba(41, 128, 185, 0.9));
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.auto-select-button:hover {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9), rgba(41, 128, 185, 1));
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.auto-select-button.auto-selecting {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.8), rgba(192, 57, 43, 0.9));
    animation: pulse-glow 1s infinite;
}

.auto-select-button.auto-selecting:hover {
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.9), rgba(192, 57, 43, 1));
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.auto-select-button.disabled,
.auto-select-button:disabled {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none;
}

.auto-select-button.disabled:hover,
.auto-select-button:disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.card-counter {
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.8), rgba(var(--secondary-color-rgb), 0.8));
    color: white;
    padding: 8px 15px;
    border-radius: 30px;
    font-weight: bold;
    font-family: 'Crimson Text', serif;
    box-shadow: 0 3px 6px rgba(var(--primary-color-rgb), 0.25);
    border: 1px solid rgba(var(--accent-color-rgb), 0.4);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 1.05rem;
    margin: 5px 0;
    position: relative;
}

.katina-theme .card-counter {
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.9), rgba(116, 76, 158, 0.8));
    border: 1px solid rgba(243, 156, 18, 0.6);
    box-shadow: 0 4px 12px rgba(45, 27, 105, 0.4), 0 0 20px rgba(243, 156, 18, 0.2);
    backdrop-filter: blur(10px);
}
.card-counter #selectedCount {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.5);
}

.scale-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.7), rgba(var(--secondary-color-rgb), 0.7));
    padding: 5px 10px;
    border-radius: 30px;
    box-shadow: 0 3px 6px rgba(var(--primary-color-rgb), 0.2);
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    margin: 0;
    flex: 1;
}
.scale-slider {
    width: 100px;
    margin: 0 8px;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
    outline: none;
}
.scale-slider::-webkit-slider-thumb, .scale-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffd700;
    cursor: pointer;
    box-shadow: 0 0 5px rgba(255, 215, 0, 0.8);
    -webkit-appearance: none;
    appearance: none;
    border: none;
}
.scale-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #a67c00, #d4af37);
    color: white;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}
#scaleValue {
    font-family: 'Crimson Text', serif;
    color: #ffd700;
    font-weight: bold;
    margin-left: 6px;
    min-width: 40px;
    text-align: center;
    font-size: 0.8rem;
}

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--card-size), 1fr));
    grid-auto-rows: 1fr;
    gap: 8px;
    justify-content: stretch;
    margin: 15px auto;
    width: 100%;
    padding: 0 15px;
    box-sizing: border-box;
    transition: all 0.15s ease;
}
.card {
    width: 100%;
    aspect-ratio: 2/3;
    contain: layout style paint;
    position: relative;
    cursor: pointer;
    perspective: 1000px;
    transform-style: preserve-3d;
    transition: transform 0.08s ease, border 0.08s ease, box-shadow 0.08s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    margin: 0 auto;
    max-width: 160px;
    border-radius: 10px;
    z-index: 1;
}
.card:hover {
    transform: translateY(-2px);
}
.card.flipped {
    border: 1px solid var(--accent-color);
    transform: scale(1.02) rotateY(180deg);
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card.flipped .card-front {
    z-index: 2;
    opacity: 1;
}

.card.flipped .card-back {
    z-index: 0;
    opacity: 0;
}

.card.selected {
    border: 1px solid var(--accent-color);
    transform: scale(1.02);
    z-index: 10;
}
.card:not(.selected):not(.flipped):hover {
    transform: scale(1.01);
}

.card .selected-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.85), rgba(255, 179, 71, 0.85));
    color: rgba(42, 27, 61, 0.9);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Crimson Text', serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 1;
    text-align: center;
    z-index: 15;
    opacity: 0;
    transform: scale3d(0, 0, 1);
    transition: opacity 0.05s, transform 0.05s;
    box-shadow: 0 2px 6px rgba(255, 215, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.card.selected .selected-badge {
    opacity: 1;
    transform: scale3d(1, 1, 1);
}
.card.reversed.flipped { transform: scale(1.02); }
.card-front .card-image { }
.card.reversed .card-front .card-image { transform: rotate(180deg) !important; }

.card.reversed .card-front .card-title {
    transform: rotateZ(0deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.card-back {
    background-size: cover;
    background-position: center;
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.3);
    box-sizing: border-box;
    border-width: 1px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    border-radius: inherit;
}
.card-back.tarot-back {
    background-image: url('cards/cardback0.jpg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.card-back.katina-back {
    background-image: url('cards/cardback13.jpeg');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}
.card-front {
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-sizing: border-box;
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    z-index: 0;
    opacity: 0;
}

.card.selected .card-front {
    background-color: color-mix(in srgb, var(--secondary-color) 85%, black);
}

.katina-theme .card.selected .card-front {
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.9), rgba(116, 76, 158, 0.8));
    border: 1px solid var(--accent-color);
}

.katina-theme .card.selected .card-back {
    border: 1px solid var(--accent-color);
}
.card.selected .card-front,
.card.selected .card-back {
  border: none;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 8px;
    display: block;
    margin: 0;
    background-color: transparent;
}

.card:hover .card-image {
    filter: brightness(1.05);
}

.card.selected .card-image {
    filter: brightness(1.05);
}
.card-title {
    display: none;
}
.katina-theme .card-front .card-title {
}
.card-meaning {
    font-size: 0.7rem;
    text-align: center;
}
.shuffling {
    animation: shuffle 0.6s ease-in-out;
    z-index: 10;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.4);
}

.quick-flipping {
    animation: quickFlip 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    z-index: 10;
    transform-style: preserve-3d;
    perspective: 1000px;
    will-change: transform;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
}

/* Reduced motion for mobile and users who prefer reduced motion */
@media (prefers-reduced-motion: reduce), (max-width: 768px) {
    .quick-flipping {
        animation: quickFlipMobile 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }
    
    @keyframes quickFlipMobile {
        0% { 
            transform: rotateY(0deg) scale(1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
        }
        30% { 
            transform: rotateY(-10deg) scale(1.02);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
        }
        70% { 
            transform: rotateY(70deg) scale(1.05);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
        }
        100% { 
            transform: rotateY(180deg) scale(1);
            box-shadow: 0 6px 15px rgba(0, 0, 0, 0.35);
        }
    }
}

.selected-cards-list {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 30px auto;
    max-width: 800px;
}
.selected-card-item {
    display: flex;
    width: 100%;
    background-color: rgba(var(--primary-color-rgb), 0.7);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 15px;
    align-items: center;
    text-align: left;
    transition: all 0.15s ease;
    position: relative;
}
.selected-card-item:hover {
    transform: translateY(-5px);
    background-color: rgba(var(--secondary-color-rgb), 0.8);
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.4), 0 0 10px rgba(var(--accent-color-rgb), 0.3);
    border: 1px solid var(--accent-color);
}
.selected-card-item::after {
    content: "";
    position: absolute;
    bottom: -5px;
    left: 10%;
    width: 80%;
    height: 5px;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.5), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}
.selected-card-item:hover::after {
    opacity: 1;
}
.selected-card-image {
    width: 80px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    margin-right: 15px;
    border: 1px solid var(--accent-color);
    transition: all 0.15s ease;
}
.selected-card-item:hover .selected-card-image {
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(var(--accent-color-rgb), 0.5);
}
.selected-card-info { flex: 1; }
.selected-card-title {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}
.selected-card-item:hover .selected-card-title {
    color: var(--accent-color);
}
.selected-card-position {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}
.selected-card-item:hover .selected-card-position {
    color: var(--accent-color);
}
.selected-card-meaning {
    font-size: 1rem;
    line-height: 1.4;
}

.reading-result {
    max-width: 1000px;
    margin: 30px auto;
    padding: 25px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    border: 1px solid var(--accent-color);
    display: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.reading-card {
    margin-bottom: 30px;
    padding: 25px;
    border-radius: 12px;
    background: rgba(var(--primary-color-rgb), 0.7);
    border: 1px solid var(--accent-color);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.reading-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.5);
}

.reading-card h3 {
    font-size: 1.6rem;
    margin: 0 0 20px 0;
    color: var(--accent-color);
    text-align: center;
    text-shadow: 0 2px 5px rgba(0,0,0,0.8);
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(var(--accent-color-rgb), 0.5);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.card-content {
    display: flex;
    align-items: flex-start;
    gap: 25px;
    flex-wrap: nowrap;
    justify-content: flex-start;
}

.reading-card .card-image-container {
    flex: 0 0 auto;
    text-align: center;
    min-width: 140px;
    position: relative;
    width: 140px;
    height: 220px;
    margin: 0;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--accent-color);
}

.reading-card .card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 8px;
    position: static;
    margin: 0;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    box-shadow: none;
}

.reading-card .card-image:hover {
    transform: scale(1.05);
}

.card-text {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
}

.card-meaning {
    margin: 0 0 15px 0;
    font-size: 1.05rem;
    color: var(--text-primary);
    line-height: 1.7;
    text-align: left;
    padding: 0 5px;
}

.card-detailed-meaning {
    margin: 15px 0 0 0;
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    border-left: 3px solid var(--accent-color);
    padding: 12px 15px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 0 6px 6px 0;
    text-align: left;
}

@media (max-width: 768px) {
    .reading-card {
        padding: 15px 12px;
    }

    .card-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .card-text {
        min-width: 100%;
        margin-top: 10px;
    }

    .reading-card .card-image-container {
        margin: 0 auto;
        width: 120px;
        height: 190px;
    }

    .reading-card h3 {
        font-size: 1.4rem;
    }

    .card-meaning {
        font-size: 1.05rem;
    }

    .card-detailed-meaning {
        font-size: 1rem;
    }

    .card-image {
        width: 150px;
        height: auto;
        max-height: 100%;
        object-fit: contain;
    }
}
.share-section {
    margin: 20px auto;
    max-width: 800px;
    background: rgba(var(--primary-color-rgb), 0.6);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(var(--accent-color-rgb), 0.4);
    box-shadow: 0 5px 15px rgba(var(--primary-color-rgb), 0.3);
}
#shareUrl {
    width: calc(100% - 30px);
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid var(--accent-color);
    background-color: rgba(var(--secondary-color-rgb), 0.4);
    color: var(--text-primary);
    font-family: 'Crimson Text', serif;
    font-size: 1rem;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}
.copy-btn, .share-btn {
    padding: 10px 20px;
    font-size: 1rem;
    border: none;
    border-radius: 25px;
    color: #fff;
    cursor: pointer;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.15s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.copy-btn {
    background: linear-gradient(135deg, rgba(166, 124, 0, 0.8), rgba(255, 215, 0, 0.85));
    margin-left: 10px;
}

.share-btn {
    background: linear-gradient(135deg, rgba(74, 109, 167, 0.8), rgba(107, 140, 206, 0.85));
}

.copy-btn:hover, .share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.copy-btn:active, .share-btn:active {
    transform: translateY(0);
}

.share-icon {
    display: inline-flex;
    align-items: center;
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(42, 27, 61, 0.92);
    background-image: radial-gradient(circle at 20% 80%, rgba(var(--primary-color-rgb), 0.4) 0%, transparent 50%),
                      radial-gradient(circle at 80% 20%, rgba(var(--secondary-color-rgb), 0.4) 0%, transparent 50%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    flex-direction: column;
    transition: opacity 0.5s ease;
}
.loader {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(var(--accent-color-rgb), 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
    margin-bottom: 20px;
    box-shadow: 0 0 30px var(--accent-glow), 0 0 50px var(--accent-glow);
}
.magic-particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--accent-color) 0%, rgba(var(--accent-color-rgb), 0.5) 60%, rgba(var(--accent-color-rgb), 0) 100%);
    pointer-events: none;
    z-index: 100;
    animation: magicParticle 1.2s ease-out forwards;
    will-change: transform, opacity;
    backface-visibility: hidden;
}
.stars-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
    transition: transform 0.2s ease-out;
    will-change: transform;
}
.star {
    position: absolute;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    animation: twinkle 4s infinite;
    z-index: 0;
    mix-blend-mode: screen;
    will-change: transform, opacity;
    backface-visibility: hidden;
}

.big-star {
    z-index: 1;
    animation: twinkle 4s infinite;
}

.shooting-star {
    position: absolute;
    width: 100px;
    height: 1px;
    background: linear-gradient(to right, rgba(var(--mystic-silver-rgb), 0) 0%, rgba(var(--mystic-silver-rgb), 0.8) 50%, var(--accent-color) 100%);
    border-radius: 50%;
    opacity: 0;
    z-index: 2;
    box-shadow: 0 0 10px rgba(var(--mystic-silver-rgb), 0.8), 0 0 20px var(--accent-glow);
    animation: shootingstar 5s ease-out infinite;
    animation-iteration-count: 1;
}

.shooting-star-reverse {
    position: absolute;
    width: 120px;
    height: 1.5px;
    background: linear-gradient(to left, rgba(255, 215, 0, 0) 0%, rgba(255, 215, 0, 0.9) 50%, #ff6b6b 100%);
    border-radius: 50%;
    opacity: 0;
    z-index: 2;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 30px rgba(255, 107, 107, 0.6);
    animation: shootingstar-reverse 6s ease-out infinite;
    animation-iteration-count: 1;
}

.shooting-star-vertical {
    position: absolute;
    width: 80px;
    height: 2px;
    background: linear-gradient(to bottom, rgba(138, 43, 226, 0) 0%, rgba(138, 43, 226, 0.9) 50%, #4ecdc4 100%);
    border-radius: 50%;
    opacity: 0;
    z-index: 2;
    box-shadow: 0 0 12px rgba(138, 43, 226, 0.8), 0 0 25px rgba(78, 205, 196, 0.6);
    animation: shootingstar-vertical 4s ease-out infinite;
    animation-iteration-count: 1;
}

.mystic-trail {
    position: absolute;
    width: 150px;
    height: 2px;
    background: linear-gradient(to right, 
        rgba(255, 0, 255, 0) 0%, 
        rgba(255, 0, 255, 0.6) 25%,
        rgba(0, 255, 255, 0.8) 50%, 
        rgba(255, 255, 0, 0.9) 75%,
        rgba(255, 255, 255, 1) 100%);
    border-radius: 50%;
    opacity: 0;
    z-index: 3;
    box-shadow: 
        0 0 20px rgba(255, 0, 255, 0.6),
        0 0 40px rgba(0, 255, 255, 0.4),
        0 0 60px rgba(255, 255, 0, 0.3);
    animation: mystic-trail 7s ease-out infinite;
    animation-iteration-count: 1;
}

.stardust-particle {
    position: absolute;
    width: 3px;
    height: 3px;
    background: radial-gradient(circle, #fff 0%, rgba(255, 255, 255, 0.8) 50%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    animation: stardust-explosion 3s ease-out infinite;
    animation-iteration-count: 1;
}

.cosmic-dust {
    position: absolute;
    width: 1px;
    height: 1px;
    background: #fff;
    border-radius: 50%;
    opacity: 0;
    z-index: 1;
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.8);
    animation: twinkle 2s infinite, mystic-shimmer 4s infinite;
}

.fixed-card-counter {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.95), rgba(var(--secondary-color-rgb), 0.95));
    color: white;
    padding: 8px 18px;
    border-radius: 30px;
    font-weight: bold;
    font-family: 'Crimson Text', serif;
    box-shadow: 0 3px 15px rgba(var(--primary-color-rgb), 0.4);
    border: 1px solid rgba(var(--accent-color-rgb), 0.6);
    z-index: 200;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2.5s infinite;
}

.confirm-button-container {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 201;
}
.confirm-button {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.9), rgba(255, 179, 71, 0.85));
    color: #53336d;
    font-family: 'Playfair Display', serif;
    font-weight: 600;
    padding: 12px 30px;
    font-size: 1.2rem;
    border-radius: 30px;
    border: none;
    box-shadow: 0 5px 20px rgba(255, 215, 0, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    animation: pulse-glow 2s infinite;
}
.confirm-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}
.fixed-card-counter #fixedSelectedCount {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(var(--accent-color-rgb), 0.5);
    margin: 0 3px;
}

@media (max-width: 768px) {
    .control-panel {
        display: flex;
        flex-direction: column;
        padding: 8px;
        gap: 8px;
        width: 100%;
        margin: 0 auto 10px;
        box-sizing: border-box;
    }

    .control-panel .button-row {
        display: flex;
        justify-content: space-between;
        width: 100%;
    }

    .control-panel .slider-row {
        display: flex;
        align-items: center;
        width: 100%;
        gap: 5px;
    }

    #resetTopButton, #modeSwitchButton {
        flex: 1;
        margin: 0 3px;
    }

    .scale-controls {
        display: flex;
        align-items: center;
        flex: 1;
        padding: 5px 8px;
        border-radius: 20px;
        height: 40px;
    }

    .sound-btn {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
        margin-left: 5px;
    }

    .sound-icon {
        width: 22px;
        height: 22px;
    }

    .control-panel > button:not(.scale-btn):not(.sound-btn) {
        border-radius: 20px;
        padding: 10px 8px;
        font-size: 0.95rem;
        margin: 0;
        min-height: 44px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    #modeSwitchButton {
        font-size: 0.9rem;
        padding: 10px 6px;
    }

    .card.selected {
        border-width: 2px;
        transform: scale3d(1.03, 1.03, 1);
        animation: none;
        will-change: auto;
    }

    .card.flipped {
        border-width: 2px;
        transform: rotateY(180deg) scale3d(1.03, 1.03, 1);
        animation: none;
        will-change: auto;
    }
    
    .card:hover {
        transform: translate3d(0, -2px, 0);
        will-change: auto;
    }
    
    .card:not(.selected):not(.flipped):hover {
        transform: scale3d(1.01, 1.01, 1);
        will-change: auto;
    }

    .card .selected-badge {
        width: 28px;
        height: 28px;
        font-size: 14px;
        top: 5px;
        right: 5px;
        font-weight: 600;
    }

    .scale-controls {
        padding: 5px 15px;
        border-radius: 20px;
        height: 40px;
        box-sizing: border-box;
    }

    .scale-slider {
        flex: 1;
        height: 4px;
        margin: 0 5px;
    }

    .scale-btn {
        width: 26px;
        height: 26px;
        min-width: 26px;
        font-size: 15px;
        padding: 0;
        line-height: 1;
        flex-shrink: 0;
    }

    #scaleValue {
        min-width: 35px;
        font-size: 0.85rem;
        margin-left: 5px;
        flex-shrink: 0;
    }

    .share-section {
        padding: 15px;
        margin: 15px auto;
    }

    .share-section > div {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

    .copy-btn, .share-btn {
        margin: 0;
        padding: 12px 16px;
        font-size: 0.95rem;
        min-height: 44px;
        width: 100%;
        justify-content: center;
    }

    #shareUrl {
        width: 100%;
        margin-bottom: 10px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .card-container {
    }

    h1 {
        font-size: 2.2rem;
        margin-top: 20px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 10px;
        max-width: 100%;
    }

    #readingTitle {
        font-size: 1.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 10px;
        max-width: 100%;
    }

    .card-type-selector {
        margin: 10px auto 15px;
        padding: 0 10px;
        gap: 10px;
        flex-wrap: nowrap;
    }

    .card-type-button {
        padding: 8px 12px;
        font-size: 0.95rem;
        min-width: 0;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .confirm-button {
        padding: 12px 24px !important;
        font-size: 1.1rem !important;
        border-radius: 25px !important;
        box-shadow: 0 3px 15px rgba(255, 215, 0, 0.3) !important;
    }

    .confirm-button:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 5px 20px rgba(255, 215, 0, 0.4) !important;
    }
}

@media (max-width: 400px) {
    .control-panel {
        padding: 6px;
        gap: 4px 3px;
        grid-template-columns: 1fr 1fr 36px;
    }

    .control-panel > button:not(.scale-btn):not(.sound-btn) {
        padding: 8px 5px;
        min-height: 38px;
        font-size: 0.85rem;
    }

    #modeSwitchButton {
        font-size: 0.8rem;
        padding: 8px 4px;
    }

    .card.selected {
        border-width: 1px;
        transform: scale3d(1.02, 1.02, 1);
        animation: none;
        will-change: auto;
    }

    .card.flipped {
        border-width: 1px;
        transform: rotateY(180deg) scale3d(1.02, 1.02, 1);
        animation: none;
        will-change: auto;
    }
    
    .card:hover {
        transform: translate3d(0, -1px, 0);
        will-change: auto;
    }
    
    .card:not(.selected):not(.flipped):hover {
        transform: none;
        will-change: auto;
    }

    .card .selected-badge {
        width: 24px;
        height: 24px;
        font-size: 12px;
        top: 4px;
        right: 4px;
        font-weight: 600;
    }

    .scale-controls {
        padding: 4px 10px;
        height: 36px;
    }

    .sound-btn {
        width: 36px;
        height: 36px;
        margin-left: 0;
        justify-self: flex-end;
    }

    .sound-icon {
        width: 18px;
        height: 18px;
    }

    .scale-btn {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 14px;
    }

    #scaleValue {
        min-width: 30px;
        font-size: 0.8rem;
    }

    .card-container {
    }

    h1 {
        font-size: 1.8rem;
        margin-top: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 8px;
        max-width: 100%;
    }

    #readingTitle {
        font-size: 1.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 8px;
        max-width: 100%;
    }

    .card-type-selector {
        margin: 8px auto 12px;
        padding: 0 8px;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .card-type-button {
        padding: 6px 10px;
        font-size: 0.85rem;
        min-width: 0;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .share-section {
        padding: 12px;
        margin: 10px auto;
    }

    .copy-btn, .share-btn {
        padding: 10px 12px;
        font-size: 0.9rem;
        min-height: 40px;
    }

    #shareUrl {
        padding: 8px 10px;
        font-size: 0.85rem;
    }

    .confirm-button {
        padding: 10px 20px !important;
        font-size: 1rem !important;
        border-radius: 20px !important;
        box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3) !important;
    }

    .confirm-button:hover {
        transform: translateY(-1px) !important;
        box-shadow: 0 3px 15px rgba(255, 215, 0, 0.4) !important;
    }
}

.controls-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin: 5px 0;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.sound-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(var(--primary-color-rgb), 0.7), rgba(var(--secondary-color-rgb), 0.7));
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    cursor: pointer;
    position: relative;
}

.sound-icon {
    width: 24px;
    height: 24px;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    display: block;
}

.sound-icon.sound-on {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd700'%3E%3Cpath d='M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z'/%3E%3C/svg%3E");
}

.sound-icon.sound-off {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffd700'%3E%3Cpath d='M16.5 12c0-1.77-1.02-3.29-2.5-4.03v2.21l2.45 2.45c.03-.2.05-.41.05-.63zm2.5 0c0 .94-.2 1.82-.54 2.64l1.51 1.51C20.63 14.91 21 13.5 21 12c0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zM4.27 3L3 4.27 7.73 9H3v6h4l5 5v-6.73l4.25 4.25c-.67.52-1.42.93-2.25 1.18v2.06c1.38-.31 2.63-.95 3.69-1.81L19.73 21 21 19.73l-9-9L4.27 3zM12 4L9.91 6.09 12 8.18V4z'/%3E%3C/svg%3E");
}

#modeSwitchButton {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

#modeSwitchButton::after {
    content: '';
    display: inline-block;
    width: 0;
}

.katina-card-details {
    margin-top: 15px;
}

.card-properties-section {
    background: linear-gradient(135deg, rgba(45, 27, 105, 0.15), rgba(116, 76, 158, 0.1));
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(243, 156, 18, 0.3);
    box-shadow: 0 4px 12px rgba(45, 27, 105, 0.2);
    backdrop-filter: blur(10px);
}

.properties-title {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 700;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border-bottom: 2px solid rgba(243, 156, 18, 0.4);
    padding-bottom: 8px;
}

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

.card-property {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border-left: 3px solid var(--deep-purple);
    transition: all 0.3s ease;
}

.card-property:hover {
    background: rgba(243, 156, 18, 0.1);
    border-left-color: var(--accent-color);
    transform: translateX(5px);
}

.property-label {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 110px;
    margin-right: 12px;
    font-size: 0.9em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.property-value {
    color: var(--accent-color);
    font-weight: 500;
    font-size: 0.9em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .card-properties-section {
        padding: 12px;
    }
    
    .property-label {
        min-width: 80px;
        font-size: 0.85em;
    }
    
    .property-value {
        font-size: 0.85em;
    }
    
    .properties-title {
        font-size: 0.9em;
    }
}

.card-detail-item {
    display: inline-block;
    margin: 4px 8px 4px 0;
    padding: 4px 8px;
    background: rgba(var(--secondary-color-rgb), 0.4);
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid rgba(var(--accent-color-rgb), 0.2);
    color: var(--text-primary);
}

.card-detail-item strong {
    color: var(--accent-color);
    font-weight: 600;
}

.version-footer {
    position: fixed;
    bottom: 5px;
    right: 10px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Crimson Text', serif;
    z-index: 10;
    pointer-events: none;
}

/* Otomatik seçim bildirimi */
.auto-select-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95), rgba(255, 165, 0, 0.95));
    color: #1a1a2e;
    padding: 12px 24px;
    border-radius: 25px;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    font-size: 1.1rem;
    box-shadow: 0 8px 32px rgba(255, 215, 0, 0.4), 0 0 20px rgba(255, 215, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.auto-select-notification.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1.05);
}

.auto-select-notification.hide {
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -50%) scale(0.9);
}

@keyframes notification-pulse {
    0% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.05); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

.auto-select-notification.pulse {
    animation: notification-pulse 0.6s ease-in-out;
}

/* Mobil uyumluluk */
@media (max-width: 768px) {
    .auto-select-notification {
        font-size: 1rem;
        padding: 10px 20px;
        max-width: 80vw;
        text-align: center;
    }
}

/* Seed Modal Styles */
.seed-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(12px) saturate(1.2);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 20px;
    box-sizing: border-box;
}

.seed-modal {
    background: linear-gradient(135deg,
        rgba(15, 15, 25, 0.98),
        rgba(35, 25, 45, 0.98),
        rgba(20, 20, 35, 0.98));
    border: 1px solid rgba(255, 215, 0, 0.4);
    border-radius: 24px;
    padding: 32px;
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(255, 215, 0, 0.15),
        0 0 80px rgba(138, 43, 226, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    animation: modalSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.seed-modal-header {
    text-align: center;
    margin-bottom: 25px;
}

.seed-modal-header h2 {
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 1.9rem;
    margin: 0 0 12px 0;
    text-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        0 0 40px rgba(255, 215, 0, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 1px;
}

.seed-modal-subtitle {
    color: #e8d5b7;
    font-size: 1.1rem;
    margin: 8px 0;
    font-family: 'Playfair Display', serif;
    font-weight: 400;
    line-height: 1.4;
}

.seed-modal-info {
    color: #c4a875;
    font-size: 0.95rem;
    margin: 8px 0;
    font-style: italic;
    opacity: 0.9;
}

.seed-modal-body {
    margin-bottom: 28px;
}

.seed-input-container {
    position: relative;
    margin-top: 5px;
}

.seed-input {
    width: calc(100% - 16px);
    max-width: 400px;
    padding: 14px 18px;
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.08),
        rgba(255, 255, 255, 0.04));
    border: 2px solid rgba(255, 215, 0, 0.4);
    border-radius: 14px;
    color: #ffd700;
    font-size: 1.2rem;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-weight: 600;
    outline: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow:
        inset 0 2px 6px rgba(0, 0, 0, 0.4),
        0 0 15px rgba(255, 215, 0, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    margin: 0 auto;
    display: block;
}

.seed-input:focus {
    border-color: #ffd700;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.5),
        0 0 25px rgba(255, 215, 0, 0.3),
        0 0 45px rgba(255, 215, 0, 0.15);
    background: linear-gradient(135deg,
        rgba(255, 255, 255, 0.12),
        rgba(255, 255, 255, 0.06));
    transform: translateY(-1px);
}

.seed-input::placeholder {
    color: rgba(255, 215, 0, 0.6);
    font-style: italic;
    opacity: 0.8;
}

.seed-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 15px;
    gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg,
        rgba(255, 215, 0, 0.05),
        rgba(255, 215, 0, 0.02));
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.seed-icon {
    color: #ffd700;
    font-size: 1.2rem;
    animation: twinkle 2s infinite;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.seed-text {
    color: #e8d5b7;
    font-size: 0.9rem;
    font-family: 'Crimson Text', serif;
    font-weight: 400;
    opacity: 0.95;
}

.seed-error {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 10px;
    margin-top: 15px;
    text-align: center;
    color: #ff6b7a;
    font-size: 0.9rem;
    display: none;
    animation: slideInFromTop 0.3s ease-out;
}

.seed-modal-footer {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 10px;
}

.seed-cancel-btn,
.seed-confirm-btn {
    padding: 14px 30px;
    border: none;
    border-radius: 14px;
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.seed-cancel-btn {
    background: linear-gradient(135deg,
        rgba(108, 117, 125, 0.3),
        rgba(108, 117, 125, 0.1));
    color: #adb5bd;
    border: 1px solid rgba(108, 117, 125, 0.4);
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.seed-cancel-btn:hover {
    background: linear-gradient(135deg,
        rgba(108, 117, 125, 0.4),
        rgba(108, 117, 125, 0.2));
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.seed-confirm-btn {
    background: linear-gradient(135deg,
        #ffd700,
        #ffb347,
        #ffed4e);
    color: #2c1810;
    border: 1px solid rgba(255, 215, 0, 0.6);
    box-shadow:
        0 4px 20px rgba(255, 215, 0, 0.3),
        0 0 40px rgba(255, 215, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.seed-confirm-btn:hover {
    background: linear-gradient(135deg,
        #ffed4e,
        #ffd700,
        #ffb347);
    transform: translateY(-3px);
    box-shadow:
        0 8px 30px rgba(255, 215, 0, 0.4),
        0 0 60px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.seed-confirm-btn:active {
    transform: translateY(-1px);
    box-shadow:
        0 2px 10px rgba(255, 215, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* İyileştirilmiş Animasyonlar */
@keyframes fadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0px);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(12px);
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-40px) scale(0.85);
        filter: blur(8px);
    }
    60% {
        opacity: 0.9;
        transform: translateY(-5px) scale(1.02);
        filter: blur(2px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes inputGlow {
    0%, 100% {
        box-shadow:
            inset 0 2px 6px rgba(0, 0, 0, 0.4),
            0 0 15px rgba(255, 215, 0, 0.1);
    }
    50% {
        box-shadow:
            inset 0 2px 6px rgba(0, 0, 0, 0.4),
            0 0 25px rgba(255, 215, 0, 0.15),
            0 0 40px rgba(255, 215, 0, 0.08);
    }
}

@keyframes buttonPulse {
    0%, 100% {
        transform: translateY(-3px);
        box-shadow:
            0 8px 30px rgba(255, 215, 0, 0.4),
            0 0 60px rgba(255, 215, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: translateY(-5px);
        box-shadow:
            0 12px 40px rgba(255, 215, 0, 0.5),
            0 0 80px rgba(255, 215, 0, 0.3),
            inset 0 1px 0 rgba(255, 255, 255, 0.4);
    }
}

/* Input'a odaklandığında hafif glow efekti */
.seed-input:focus {
    animation: inputGlow 3s ease-in-out infinite;
}

/* Confirm butonuna odaklandığında pulse efekti */
.seed-confirm-btn:hover {
    animation: buttonPulse 2s ease-in-out infinite;
}

/* Mobil uyumluluk için seed modal */
@media (max-width: 768px) {
    .seed-modal-overlay {
        padding: 15px;
        align-items: flex-start;
        padding-top: 50px;
    }

    .seed-modal {
        padding: 24px 20px;
        max-width: 100%;
        margin: 0;
        border-radius: 20px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }

    .seed-modal-header h2 {
        font-size: 1.6rem;
        margin-bottom: 15px;
        line-height: 1.2;
    }

    .seed-modal-subtitle {
        font-size: 1rem;
        margin: 6px 0;
        line-height: 1.3;
    }

    .seed-modal-info {
        font-size: 0.9rem;
        margin: 6px 0;
    }

    .seed-modal-body {
        margin-bottom: 20px;
    }

    .seed-input {
        padding: 12px 16px;
        font-size: 1.1rem;
        border-radius: 12px;
        max-width: 350px;
        width: calc(100% - 12px);
    }

    .seed-modal-footer {
        flex-direction: column;
        gap: 12px;
        margin-top: 15px;
    }

    .seed-cancel-btn,
    .seed-confirm-btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
        border-radius: 12px;
        min-width: unset;
    }

    .seed-hint {
        margin-top: 12px;
        gap: 8px;
        padding: 10px 14px;
    }

    .seed-icon {
        font-size: 1.1rem;
    }

    .seed-text {
        font-size: 0.85rem;
    }
}

/* Küçük ekranlar için ekstra optimizasyon */
@media (max-width: 480px) {
    .seed-modal-overlay {
        padding: 10px;
        padding-top: 30px;
    }

    .seed-modal {
        padding: 20px 16px;
        border-radius: 16px;
    }

    .seed-modal-header h2 {
        font-size: 1.4rem;
        margin-bottom: 12px;
    }

    .seed-modal-subtitle {
        font-size: 0.95rem;
    }

    .seed-input {
        padding: 10px 14px;
        font-size: 1rem;
        border-radius: 10px;
        max-width: 300px;
        width: calc(100% - 8px);
    }

    .seed-cancel-btn,
    .seed-confirm-btn {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}