/* Reset and Base Theme */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f172a, #020617);
    color: white;
    overflow: hidden; /* Crucial: Prevents the screen from scrolling when swiping */
    display: flex;
    justify-content: center;
    align-items: center;
}

#app-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 75vh;
    justify-content: space-between;
    width: 100%;
}

/* Typography */
#text-display {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    text-align: center;
    opacity: 0.8;
    padding: 0 20px;
    transition: opacity 1s ease;
}

/* The Guitar Strings */
#strings-container {
    position: relative; /* Required to center the sound hole inside it */
    display: flex;
    gap: 24px; 
    height: 50vh;
    align-items: center;
    padding: 20px;
    width: 80%; 
    justify-content: center;
    z-index: 1;
}

/*The Sound Hole */
#sound-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background-color: #000000; /* Pure black for depth */
    /* An inset shadow creates the illusion of a deep cutout, and a subtle outer glow frames it */
    box-shadow: inset 0px 10px 30px rgba(0, 0, 0, 0.9), 
                0px 0px 15px rgba(255, 255, 255, 0.03);
    z-index: -1; /* Pushes it behind the strings */
}

/* The Base String */
.string {
    height: 100%;
    /* A very subtle metallic gradient */
    background: linear-gradient(to right, rgba(255,255,255,0.1), rgba(255,255,255,0.3), rgba(255,255,255,0.1));
    border-radius: 2px;
    transition: background-color 0.1s ease, box-shadow 0.1s ease, transform 0.1s ease;
    box-shadow: 2px 0px 5px rgba(0,0,0,0.5); /* Cast a slight shadow over the sound hole */
}

/* Realistic String Thicknesses */
.string[data-index="1"] { width: 5.5px; } /* Low E */
.string[data-index="2"] { width: 4.5px; } /* A */
.string[data-index="3"] { width: 3.5px; } /* D */
.string[data-index="4"] { width: 2.5px; } /* G */
.string[data-index="5"] { width: 1.5px; } /* B */
.string[data-index="6"] { width: 1px; }   /* High E */

/* The Glow Effect */
.string.strummed {
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 15px 4px rgba(255, 255, 255, 0.5);
    transform: scaleX(1.4);
}

/* --- First-Time Onboarding UI --- */
#onboarding-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(2, 6, 23, 0.95); /* Deep midnight background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50; /* Ensures it sits on top of the guitar strings */
    transition: opacity 0.5s ease;
}

/* Will toggle this class in JavaScript */
#onboarding-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.onboarding-card {
    background: rgba(255, 255, 255, 0.05);
    padding: 40px 30px;
    border-radius: 16px;
    backdrop-filter: blur(12px); /* The frosted glass effect */
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 80%;
    max-width: 320px;
}

.onboarding-card h2 { 
    font-family: 'Playfair Display', serif; 
    margin: 0; 
    font-size: 1.8rem;
}

.onboarding-card p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 10px;
}

.onboarding-card input, .onboarding-card select {
    padding: 14px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    outline: none;
}

.onboarding-card button {
    padding: 14px;
    border-radius: 8px;
    border: none;
    background: white;
    color: black;
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.1s ease;
}

.onboarding-card button:active {
    transform: scale(0.95);
}

/* --- UI Transitions --- */
.fade-out {
    opacity: 0 !important;
    pointer-events: none; /* Prevents any further touches or swipes */
    transition: opacity 2s ease; /* A nice, slow, dramatic fade */
}

/* make the AI text bigger and more central when it's the only thing on screen */
#text-display.playing-state {
    font-size: 2.2rem;
    line-height: 1.4;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    transform: translateY(20vh); /* Moves it down to the center of the screen */
    transition: all 2s ease;
}