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

@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap');

/* Cocon Font Declarations */
@font-face {
    font-family: 'Cocon';
    src: url('fonts/Cocon-Bold.woff2') format('woff2'),
         url('fonts/Cocon-Bold.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* Lexia Font Declarations */
@font-face {
    font-family: 'Lexia';
    src: url('fonts/Lexia W01 Regular.woff') format('woff'),
         url('fonts/lexia.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

body {
    font-family: 'Lexia', 'Lexend', 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: white;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    cursor: default;
}

.container {
    padding: 10px;
    max-width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

h1 {
    font-family: 'Cocon', 'Lexend', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
    text-shadow: none;
    line-height: 1.2;
}

h2 {
    font-family: 'Cocon', 'Lexend', sans-serif;
    font-weight: 700;
}

.subheader {
    text-align: center;
    margin-bottom: 10px;
}

.subheader p {
    font-size: 1.15rem;
    font-weight: bold;
    margin: -1rem 0 0 0;
    color: #333;
    text-align: center;
}


.oracle-deck {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
}

.shuffle-area {
    width: 250px;
    height: auto;
    margin-bottom: 40px;
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.card-deck {
    position: relative;
    width: 100%;
    height: 400px;
}

.shuffle-card {
    position: absolute;
    width: 250px;
    height: 375px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9) 0%, rgba(240,248,255,0.8) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    cursor: pointer;
}

.shuffle-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.9);
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(240,248,255,0.9) 100%);
}

.top-card {
    z-index: 10 !important;
    pointer-events: auto;
    animation: cardFloat 4s ease-in-out infinite;
}

.top-card.selected {
    animation: cardDrawAndFlip 0.8s ease-out forwards !important;
    z-index: 20 !important;
}

.top-card::after {
    content: 'Tap card to start';
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: black;
    font-size: 0.9rem;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.top-card.shuffling::after {
    display: none;
}

.shuffle-text {
    margin-top: 10px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

.card-area {
    position: relative;
    width: 250px;
    height: 375px;
    margin-bottom: 40px;
    margin-top: -30px;
    perspective: 1000px;
    z-index: 1;
}

.card-back,
.card-front {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    backface-visibility: hidden;
}

.card-back {
    cursor: pointer;
    transform: rotateY(0deg);
}

.card-back:hover {
    transform: rotateY(0deg) scale(1.05);
}

.card-back.flipped {
    transform: rotateY(-180deg);
}

.card-front {
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.card-front.revealed {
    transform: rotateY(0deg) scale(1.02);
}

.card-area.fading-in {
    margin-top: 40px;
}

.controls {
    margin-top: 15px;
    gap: 12px;
}

.card-pattern {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
}

.koru-design {
    width: 120px;
    height: 120px;
    border: 4px solid rgba(0, 196, 204, 0.6);
    border-radius: 50% 0 50% 0;
    position: relative;
    opacity: 0.8;
}

.koru-design::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 10px;
    width: 80px;
    height: 80px;
    border: 3px solid rgba(125, 42, 232, 0.6);
    border-radius: 50% 0 50% 0;
}

.koru-design::after {
    content: '';
    position: absolute;
    top: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    border: 2px solid rgba(0, 196, 204, 0.8);
    border-radius: 50% 0 50% 0;
}

.card-image {
    flex: 1;
    background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, rgba(240,248,255,0.1) 100%);
    border-radius: 20px 20px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
    overflow: hidden;
}

.card-content {
    padding: 20px;
    text-align: center;
    background: rgba(255,255,255,0.1);
    border-radius: 0 0 20px 20px;
    backdrop-filter: blur(5px);
}

.card-name-maori {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, rgb(0, 196, 204), rgb(125, 42, 232));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    line-height: 1.2;
}

.card-name-english {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.8);
    font-weight: 400;
    margin-bottom: 0;
    font-style: italic;
}

.card-message-area {
    margin-top: 25px;
    padding: 0 20px;
    text-align: center;
}

.card-message {
    background: rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.card-visual-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.7);
    font-style: italic;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
}

.card-guidance {
    font-size: 1.1rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 0 20px;
}

.pull-card-btn {
    position: relative;
    background: linear-gradient(135deg, #d4af37 0%, #ffd700 100%);
    border: none;
    border-radius: 25px;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    color: #1a4f3a;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(212, 175, 55, 0.3);
    overflow: hidden;
}

.pull-card-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(212, 175, 55, 0.4);
}

.pull-card-btn:active {
    transform: translateY(-1px);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.pull-card-btn:hover .btn-glow {
    left: 100%;
}

.new-reading-btn {
    background: rgba(0,0,0,0.1);
    border: 2px solid rgba(0,0,0,0.6);
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: black;
    font-size: 1.2rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-shadow: none;
}

.new-reading-btn:hover {
    background: rgba(0,0,0,0.2);
    border-color: rgba(0,0,0,0.8);
    transform: translateY(-2px) rotate(-90deg);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.refresh-icon {
    font-size: 2rem;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.next-btn {
    background: rgba(0,0,0,0.1);
    border: 2px solid rgba(0,0,0,0.6);
    border-radius: 25px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: black;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-shadow: none;
}

.next-btn:hover {
    background: rgba(0,0,0,0.2);
    border-color: rgba(0,0,0,0.8);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}

.next-btn:hover .next-arrow {
    transform: translateX(3px);
}

.next-text {
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.next-arrow {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.spread-options {
    margin-top: 30px;
    text-align: center;
}

.spread-options h3 {
    margin-bottom: 20px;
    color: rgba(255,255,255,0.9);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.spread-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.spread-btn {
    background: rgba(255,255,255, 0.1);
    border: 1px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 10px 20px;
    color: rgba(255,255,255,0.9);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.spread-btn:hover {
    background: rgba(255,255,255, 0.2);
    border-color: rgba(255,255,255,0.7);
}

.hidden {
    display: none !important;
}

.card-footer {
    text-align: center;
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.7;
}

.music-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    z-index: 1000;
    font-size: 1rem;
    opacity: 0.7;
}

.music-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    opacity: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

footer {
    text-align: center;
    margin-top: -5px;
    padding: 10px 0;
    font-size: 0.75rem;
    opacity: 0.7;
}

@keyframes cardFlip {
    0% { transform: rotateY(0deg) scale(1); }
    50% { transform: rotateY(-90deg) scale(0.8); }
    100% { transform: rotateY(-180deg) scale(1); }
}

@keyframes cardReveal {
    0% { transform: rotateY(180deg) scale(1); }
    50% { transform: rotateY(90deg) scale(0.8); }
    100% { transform: rotateY(0deg) scale(1); }
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes casinoSplitLeft {
    0% { 
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateX(-60px) translateY(0) rotate(-15deg);
        opacity: 0.9;
    }
    100% { 
        transform: translateX(-80px) translateY(0) rotate(-20deg);
        opacity: 1;
    }
}

@keyframes casinoSplitRight {
    0% { 
        transform: translateX(0) translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% { 
        transform: translateX(60px) translateY(0) rotate(15deg);
        opacity: 0.9;
    }
    100% { 
        transform: translateX(80px) translateY(0) rotate(20deg);
        opacity: 1;
    }
}

@keyframes casinoRiffleLeft {
    0% { 
        transform: translateX(-80px) translateY(0) rotate(-20deg);
    }
    25% { 
        transform: translateX(-40px) translateY(0) rotate(-10deg);
    }
    50% { 
        transform: translateX(-20px) translateY(0) rotate(-5deg);
    }
    75% { 
        transform: translateX(-10px) translateY(0) rotate(-2deg);
    }
    100% { 
        transform: translateX(0) translateY(0) rotate(0deg);
    }
}

@keyframes casinoRiffleRight {
    0% { 
        transform: translateX(80px) translateY(0) rotate(20deg);
    }
    25% { 
        transform: translateX(40px) translateY(0) rotate(10deg);
    }
    50% { 
        transform: translateX(20px) translateY(0) rotate(5deg);
    }
    75% { 
        transform: translateX(10px) translateY(0) rotate(2deg);
    }
    100% { 
        transform: translateX(0) translateY(0) rotate(0deg);
    }
}

@keyframes cardInterlace {
    0% { 
        transform: translateY(0) scale(1);
        z-index: 1;
    }
    50% { 
        transform: translateY(0) scale(1.05);
        z-index: 10;
    }
    100% { 
        transform: translateY(0) scale(1);
        z-index: 1;
    }
}

@keyframes cardFall {
    0% { transform: translateY(-50px) rotate(0deg); opacity: 0; }
    50% { transform: translateY(10px) rotate(180deg); opacity: 0.8; }
    100% { transform: translateY(0) rotate(360deg); opacity: 1; }
}

@keyframes shuffleComplete {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes cardDrawAndFlip {
    0% { 
        transform: translateY(0) scale(1) rotateY(0deg);
        opacity: 1;
    }
    30% {
        transform: translateY(0) scale(1.05) rotateY(0deg);
        opacity: 1;
    }
    60% {
        transform: translateY(0) scale(1.1) rotateY(90deg);
        opacity: 0.9;
    }
    100% { 
        transform: translateY(0) scale(1.1) rotateY(180deg);
        opacity: 0.8;
    }
}

@keyframes cardGlow {
    0% { 
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
    50% { 
        box-shadow: 0 0 20px rgba(255,255,255,0.8);
    }
    100% { 
        box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    }
}

@keyframes cardFloat {
    0%, 100% { 
        transform: translateY(0) rotate(0deg);
    }
    25% { 
        transform: translateY(-5px) rotate(1deg);
    }
    50% { 
        transform: translateY(-8px) rotate(0deg);
    }
    75% { 
        transform: translateY(-3px) rotate(-1deg);
    }
}

@keyframes cardSlideAndFlip {
    0% { 
        transform: translateY(0) translateX(0) rotateY(0deg) scale(1);
        opacity: 1;
    }
    20% { 
        transform: translateY(-30px) translateX(0) rotateY(0deg) scale(1.1);
        opacity: 1;
    }
    40% { 
        transform: translateY(-60px) translateX(-20px) rotateY(45deg) scale(1.2);
        opacity: 0.9;
    }
    60% { 
        transform: translateY(-40px) translateX(20px) rotateY(135deg) scale(1.1);
        opacity: 0.7;
    }
    80% { 
        transform: translateY(-20px) translateX(0) rotateY(270deg) scale(1.05);
        opacity: 0.5;
    }
    100% { 
        transform: translateY(0) translateX(0) rotateY(360deg) scale(1);
        opacity: 1;
    }
}

.card-back.animating {
    animation: cardFlip 0.8s ease-in-out;
}

.card-front.animating {
    animation: cardReveal 0.8s ease-in-out;
}


@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 2.5rem;
    }
    
    .card-area {
        width: 250px;
        height: 375px;
    }
    
    .card-image {
        height: 160px;
        font-size: 3rem;
    }
    
    .card-name-maori {
        font-size: 1.5rem;
    }
    
    .card-content {
        padding: 20px;
    }
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        max-width: 100%;
    }

    h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }

    .subheader p {
        font-size: 1.2rem;
    }

    .oracle-deck {
        padding-top: 10px;
    }

    .shuffle-area,
    .card-area {
        width: 250px;
        height: auto;
    }

    .card-area {
        height: 375px;
    }

    .shuffle-text {
        font-size: 0.9rem;
        margin-top: 15px;
    }

    .controls {
        margin-top: 20px;
        gap: 15px;
    }

    .new-reading-btn {
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }

    .next-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    footer p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .subheader p {
        font-size: 1.15rem;
    }

    .shuffle-area,
    .card-area {
        width: 250px;
    }

    .shuffle-card {
        width: 250px;
    }

    .card-area {
        height: 375px;
    }

    .shuffle-text {
        font-size: 0.85rem;
        margin-top: 10px;
    }

    .controls {
        margin-top: 15px;
        gap: 12px;
    }

    .new-reading-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }

    .next-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

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

    footer {
        margin-top: 20px;
    }

    footer p {
        font-size: 0.75rem;
    }
}