﻿.tongue-map {
    width: 100%;
}

.tongue-map-section {
    padding: 16px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 8%, transparent);
}

.tongue-map-header {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---------- VOWELS ---------- */

.tongue-vowel-table {
    --tongue-line: color-mix(in srgb, var(--mud-palette-text-primary) 32%, transparent);
    --tongue-cell-empty-bg: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    --tongue-cell-filled-bg: color-mix(in srgb, var(--mud-palette-primary) 32%, var(--mud-palette-surface));
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    padding: 1px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--tongue-line);
}

/* ---------- AXIS ---------- */

.tongue-axis-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    margin: 4px 0 8px;
    padding: 0 4px;
}

.tongue-axis-label {
    color: var(--mud-palette-tertiary);
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.2;
}

.tongue-axis-front {
    text-align: left;
}

.tongue-axis-center {
    text-align: center;
}

.tongue-axis-back {
    text-align: right;
}

/* ---------- CONSONANT TABLE ---------- */

.tongue-consonant-table {
    --tongue-row-height: 96px;
    --tongue-line: color-mix(in srgb, var(--mud-palette-text-primary) 32%, transparent);
    --tongue-cell-empty-bg: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    --tongue-cell-filled-bg: color-mix(in srgb, var(--mud-palette-primary) 32%, var(--mud-palette-surface));
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 2px;
    border-radius: 12px;
    overflow: hidden;
    background: var(--tongue-line);
}

.tongue-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    min-height: var(--tongue-row-height);
}

/* ---------- CELLS ---------- */

.tongue-cell {
    min-width: 0;
    min-height: var(--tongue-row-height, 104px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.tongue-cell-empty {
    background: var(--tongue-cell-empty-bg);
}

.tongue-cell-filled {
    background: var(--tongue-cell-filled-bg);
}

/* ---------- ACTUAL TILE ---------- */

.tongue-button {
    width: 100%;
    height: 100%;
    min-height: inherit;
    padding: 0;
    border-radius: 12px;
}

.tongue-tile-content {
    width: 100%;
    height: 100%;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.tongue-image {
    display: block;
    width: auto;
    height: auto;
    max-width: min(140px, 85%);
    max-height: 68px;
    object-fit: contain;
}

.tongue-label {
    color: var(--mud-palette-text-primary);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.035em;
}

/* ---------- PRECISE MAP (Library › Tongue Styles – Precise) ---------- */

.tongue-precise-axis,
.tongue-precise-table {
    display: grid;
    grid-template-columns: minmax(64px, 0.6fr) repeat(3, minmax(0, 1fr));
    gap: 2px;
}

.tongue-precise-table {
    --tongue-row-height: 104px;
    --tongue-cell-empty-bg: color-mix(in srgb, var(--mud-palette-primary) 4%, var(--mud-palette-surface));
    --tongue-cell-filled-bg: color-mix(in srgb, var(--mud-palette-primary) 32%, var(--mud-palette-surface));
    padding: 1px;
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--mud-palette-text-primary) 32%, transparent);
}

.tongue-precise-height {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4px;
    background: var(--tongue-cell-empty-bg);
    text-align: center;
}

.tongue-precise-height-name {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--mud-palette-tertiary);
}

/* Round the four corner cells like the Simple map does (label column top/bottom left, last area column top/bottom right) */
.tongue-precise-table > :nth-child(1) {
    border-top-left-radius: 12px;
}

.tongue-precise-table > :nth-child(4) {
    border-top-right-radius: 12px;
}

.tongue-precise-table > :nth-last-child(4) {
    border-bottom-left-radius: 12px;
}

.tongue-precise-table > :last-child {
    border-bottom-right-radius: 12px;
}

.tongue-precise-height-code,
.tongue-precise-code {
    font-size: 0.68rem;
    color: var(--lp-text-muted);
}
