/* Core Structural & Color Science Variables */
:root {
    --bg-dark: #16191f; /* Obsidian Dark */
    --text-light: #ffffff; /* Stark White */
    --accent-gold: #d4af37; /* Electric Amber */
    --cell-bg: #1e222a; /* Slightly lighter than Obsidian for contrast */
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.lang-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px;
    text-align: center;
}

.lang-title {
    margin-bottom: 40px;
    color: var(--accent-gold);
    font-weight: normal;
    letter-spacing: 1px;
}

/* Fluid CSS Grid for Automatic Sorting and Scaling */
.lang-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 25px;
}

/* Interactive Cell Affordance */
.lang-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background-color: var(--cell-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 20px 15px;
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

/* Hover Indicator */
.lang-cell:hover {
    transform: translateY(-5px);
    border-color: rgba(212, 175, 55, 0.4);
    border-bottom: 4px solid var(--accent-gold);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
}

/* "Sense of Click" Physical Compression */
.lang-cell:active {
    transform: translateY(2px) scale(0.97);
    border-bottom-width: 1px;
    margin-top: 3px;
    margin-bottom: -3px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* Flag Image Controls (3:2 Ratio Enforced via object-fit) */
.flag-img {
    width: 100%;
    max-width: 120px;
    height: 80px;
    object-fit: contain; /* Prevents stretching, handles Nepal transparency correctly */
    margin-bottom: 15px;
    pointer-events: none; /* Passes clicks directly to the parent <a> */
}

/* Native Font Typography */
.lang-name {
    color: var(--text-light);
    font-size: 1.1rem;
    font-weight: bold;
    pointer-events: none;
}