:root {
    --primary: #2563eb;
}

.logo-img {
    height: 200px;
    width: auto;
    vertical-align: middle;
}

.flag {
    font-family:
        "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol",
        "Noto Color Emoji", "Android Emoji", "EmojiOne Mozilla", sans-serif;
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    margin-right: 0.25em;
}

.help-text {
    font-size: 0.875rem;
    color: var(--muted-color);
}

.results-table {
    margin-top: 2rem;
}

.results-table th {
    background: var(--primary);
    color: white;
}

.results-table td {
    font-family: monospace;
    font-size: 1.1rem;
}

.points {
    font-weight: bold;
    color: var(--primary);
}

.count-badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
}

.error {
    background: #fee2e2;
    border: 1px solid #ef4444;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.empty {
    text-align: center;
    padding: 3rem;
    color: var(--muted-color);
}

.language-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--muted-border-color);
    border-radius: 0.5rem;
    padding: 0.5rem;
    background: var(--card-background-color);
}

.language-list li {
    margin: 0;
}

.language-list a {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    text-decoration: none;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.language-list a:hover {
    background: var(--primary-focus);
}

.language-list a.primary {
    background: var(--primary);
    color: white;
}

.language-list a.primary:hover {
    background: var(--primary-hover);
}

.language-list .flag {
    margin-right: 0.75rem;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.pattern-input {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 0.5rem;
    text-transform: uppercase;
}

.letters-input {
    font-family: monospace;
    font-size: 1.5rem;
    letter-spacing: 0.25rem;
    text-transform: uppercase;
}

/* Homepage specific styles */
.hero {
    text-align: center;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
}

.hero-compact {
    padding: 0.25rem 1rem;
    margin-bottom: 0.5rem;
}

.hero-compact p {
    margin: 0.1rem 0;
    font-size: 0.85rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    margin: 0.5rem 0;
}

.tool-card {
    padding: 1.5rem;
    border-radius: 0.5rem;
    background: var(--card-background-color);
    border: 1px solid var(--muted-border-color);
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block;
}

.tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.tool-card:hover [role="button"] {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.tool-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
}

.tool-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tool-card p {
    flex-grow: 1;
}

.language-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.language-card {
    padding: 1rem;
    border-radius: 0.5rem;
    background: var(--card-background-color);
    border: 1px solid var(--muted-border-color);
    text-decoration: none !important;
    color: inherit;
    display: block;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.language-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    color: inherit;
}

.language-card:hover h4,
.language-card:hover .word-count {
    text-decoration: none;
}

.language-card h4 {
    margin: 0;
    color: var(--primary);
    display: flex;
    align-items: center;
}

.word-count {
    font-size: 0.875rem;
    color: var(--muted-color);
}

.language-card.selected {
    border: 2px solid var(--primary);
    background: var(--primary-focus);
}

.hero-logo {
    max-width: 800px;
    width: 180%;
    max-height: 400px;
    height: 220px;
    object-fit: contain;
    margin-bottom: 0.5rem;
    margin-top: 1.5rem;
    transform: scale(2.5);
    transform-origin: center;
}

/* Results grouping by word length */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.length-group {
    margin-top: 1rem;
}

.length-header {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary);
    color: white;
    font-weight: 600;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.length-title {
    font-size: 1.1rem;
}

.length-count {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: normal;
}

.length-group .results-table {
    margin: 0;
    border: none;
}

.length-group .results-table th {
    background: transparent;
    color: var(--color);
    padding: 0.25rem 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: bold;
    border: none;
}

.length-group .results-table td {
    padding: 0.5rem 1rem;
}

.length-group .results-table tbody tr:last-child td {
    border-bottom: none;
}
