/* --- Landing Page Specific Main --- */
.landing-area {
    overflow-y: auto !important; 
    -webkit-overflow-scrolling: touch;
    padding-bottom: 3rem; 
}

/* FIX: Prevent button text from wrapping (e.g. "Let's\nPractice") */
.landing-area .btn {
    white-space: nowrap;
}

/* --- Chart Section --- */
.chart-header-screen {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    width: 100%;
}

.chart-header-screen h3 {
    margin: 0;
    font-size: var(--fs-h3);
    color: var(--text-main);
    font-weight: 800;
}

/* Print Only Elements */
.print-only-header, .print-only-footer { display: none; }

/* Screen Grid */
.syllabics-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px; 
}

.grid-header {
    display: flex;
    align-items: flex-end; 
    justify-content: center;
    text-align: center;
    padding-bottom: 0.5rem;
    font-family: var(--font-english);
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--text-muted); 
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0.4rem 0;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 2px solid transparent; 
    cursor: pointer; 
    position: relative; /* For feedback context */
}

/* COPIED FEEDBACK STATE */
.grid-item.copied {
    background-color: var(--c-green) !important;
    transform: scale(1.1) !important;
    z-index: 20;
    box-shadow: 0 4px 10px rgba(0, 122, 51, 0.4);
}
.grid-item.copied .symbol,
.grid-item.copied .pronounce {
    color: white !important;
}

@media (hover: hover) {
    .grid-item:hover {
        background-color: var(--c-yellow);
        box-shadow: var(--shadow-hover);
        transform: translateY(-4px) scale(1.05);
        z-index: 10;
    }
}

.symbol {
    font-family: var(--font-syllabic);
    font-size: var(--fs-syl-grid);
    font-weight: 700;
    color: var(--text-main);
    line-height: 1.1;
}

.pronounce {
    font-size: var(--fs-sm);
    color: var(--c-blue);
    font-weight: 800;
}

@media (max-width: 600px) {
    .syllabics-grid { gap: 4px; }
}

/* --- Resources Grid --- */
.resources-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--gap-md);
}

/* --- Getting Started Button Grid --- */
.button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--gap-lg); 
    margin-bottom: 2rem;
}

@media (max-width: 600px) {
    .button-grid { grid-template-columns: 1fr; }
}

/* Static Container */
.btn-wrapper {
    position: relative;
    height: 85px;
    z-index: 1;
}

/* Interactive Button */
.row-btn {
    appearance: none;
    width: 100%;
    height: 100%;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    border: var(--border-width) solid var(--border-subtle);
    box-shadow: 0 6px 0 var(--border-subtle);
    padding: 0 1.5rem;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    position: relative;
    transform: translateZ(0); 
    will-change: transform;
    transition: transform 0.1s cubic-bezier(0.3, 0, 0.5, 1), 
                box-shadow 0.1s cubic-bezier(0.3, 0, 0.5, 1),
                border-color 0.1s;
    overflow: hidden; 
}

/* Hover: Blue Stroke -> Blue Shadow */
@media (hover: hover) {
    .row-btn:hover {
        border-color: var(--c-blue);
        background-color: var(--c-grey-50);
        transform: translateY(-2px);
        box-shadow: 0 8px 0 var(--c-blue);
    }
}

.row-btn[aria-pressed="true"] {
    background-color: var(--c-blue);
    border-color: var(--c-blue-dark);
    color: white;
    transform: translateY(6px); 
    box-shadow: 0 0 0 var(--c-blue-dark); 
}

/* Button Text Styling */
.btn-text-group {
    display: flex;
    flex-direction: column;
    z-index: 2;
    position: relative;
    line-height: 1.1;
}

.btn-label {
    font-family: var(--font-english);
    font-weight: 800;
    font-size: var(--fs-btn);
    color: var(--text-main);
}

.btn-subtext {
    font-family: var(--font-english);
    font-size: var(--fs-sm);
    font-weight: 800;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.row-btn[aria-pressed="true"] .btn-label { color: white; }
.row-btn[aria-pressed="true"] .btn-subtext { color: #D9E2EC; }

/* Ghost Syllabics */
.btn-syllabics {
    font-family: var(--font-syllabic);
    font-size: var(--fs-syl-row-bg);
    font-weight: 700;
    color: var(--text-main);
    line-height: normal;
    padding: 1rem 0;
    white-space: nowrap;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    transition: all 0.2s ease;
    opacity: 0.15; 
    mask-image: linear-gradient(to right, transparent 0%, black 80%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 80%);
}

@media (hover: hover) {
    .row-btn:hover .btn-syllabics {
        color: var(--c-blue);
        opacity: 0.35; 
    }
}

.row-btn[aria-pressed="true"] .btn-syllabics { 
    color: white; 
    opacity: 0.3; 
    mask-image: linear-gradient(to right, transparent 0%, white 90%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, white 90%);
}

.btn-label {
    font-family: var(--font-english);
    font-weight: 800;
    font-size: var(--fs-btn);
    color: var(--text-main);
    z-index: 2;
    position: relative; 
}

/* --- Orienting Card Layout --- */
.orient-row-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem; 
    flex-wrap: wrap; 
}

.orient-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 10 1 300px;
}

.orient-text h3 {
    font-size: var(--fs-h3);
    color: var(--text-main);
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.orient-text p {
    font-size: var(--fs-body);
    color: var(--text-main);
    margin: 0;
}

.orient-row-layout .btn {
    flex: 1 1 auto;
    text-align: center;
}

/* --- Focused Practice & Control Card Footers --- */
.card-footer {
    display: flex;
    align-items: center;
    border-top: var(--border-width) solid var(--border-subtle);
    padding-top: var(--gap-lg);
    gap: var(--gap-md);
    margin-top: auto;
    
    /* Fallback wrapping logic */
    flex-wrap: wrap; 
}

.toggle-btn {
    flex: 0 0 auto;
    margin-right: auto;
}

.button-group-right { 
    display: flex; 
    gap: var(--gap-sm); 
    align-items: center; 
    
    /* Allow wrapping internally if needed */
    flex-wrap: wrap; 
    flex: 0 1 auto;
    justify-content: flex-end;
}

/* 
   UPDATED MEDIA QUERY: 850px 
   Matches the max-width of the main container. 
   If screen is smaller than the design max-width, strictly stack.
*/
@media (max-width: 850px) {
    .card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 1.5rem;
    }

    .toggle-btn {
        width: 100%;
        margin-right: 0;
        justify-content: space-between; /* Label left, toggle right */
    }

    .button-group-right {
        width: 100%;
        margin-left: 0;
        /* Forced Vertical Stack */
        flex-direction: column; 
        align-items: stretch; /* Stretch buttons to full width */
        gap: 1rem;
    }

    .button-group-right .btn {
        width: 100%;
        display: flex; /* Ensure flex behavior */
        flex: 1 1 auto;
    }
}

/* --- LEGAL FOOTER --- */
.legal-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: var(--border-width) solid var(--border-subtle);
    
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    
    text-align: center;
    color: var(--text-muted);
    font-size: 0.75rem; 
    font-weight: 700;
    font-family: var(--font-english);
    opacity: 0.8;
}

.legal-footer p {
    margin: 0;
}