/* ===== COMPLETE FIXED CSS FOR CONNECTIONS GAME ===== */

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
    background: linear-gradient(135deg, #fff 0%, #fff 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ===== LOADING OVERLAY ===== */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a5fb4, #0db561);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

#loadingOverlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loader-ring {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top: 6px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loader-text {
    color: #fff;
    font-size: 20px;
    font-weight: 300;
    letter-spacing: 4px;
    animation: pulse 1.5s ease-in-out infinite;
}

.loader-dots {
    display: flex;
    gap: 12px;
}

.loader-dots span {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ===== WELCOME SCREEN ===== */
#welcomeOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9998;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#welcomeOverlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.welcome-modal {
    background: #ffffff;
    border-radius: 24px;
    padding: 50px 60px;
    max-width: 560px;
    width: 90%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.6s cubic-bezier(0.22, 1, 0.36, 1);
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translateY(40px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.welcome-icon {
    font-size: 64px;
    margin-bottom: 10px;
    display: block;
}

.welcome-title {
    font-size: 38px;
    font-weight: 800;
    background: linear-gradient(135deg, #1a5fb4, #0db561);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.welcome-subtitle {
    color: #666;
    font-size: 16px;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 30px;
    text-align: left;
}

.feature-item {
    background: #f8f9fa;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: all 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.feature-item i {
    font-size: 20px;
    color: #1a5fb4;
    min-width: 24px;
}

.feature-item span {
    font-size: 14px;
    color: #333;
    font-weight: 500;
}

.start-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #1a5fb4, #0db561);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(26, 95, 180, 0.35);
}

.start-btn:active {
    transform: translateY(0);
}

.start-btn i {
    font-size: 20px;
}

/* ===== GAME CONTAINER ===== */
.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-sizing: border-box;
    padding-top: 0px;
    width: 100%;
    max-width: 100%;
}

/* ===== GAME WRAPPER ===== */
.game-wrapper {
    width: 100%;
    max-width: 840px;
    background: #ffffff;
    border-radius: 24px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.game-wrapper:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.12);
}

/* ===== LOGO ===== */
.logo {
    text-align: center;
    margin-bottom: 20px;
}

.logo-text {
    font-family: 'Segoe UI', 'Arial Rounded MT Bold', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a5fb4, #0db561);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    margin: 0;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 1rem;
    color: #888;
    margin-top: 4px;
    letter-spacing: 4px;
    text-transform: uppercase;
    font-weight: 300;
}

/* ===== MENU BAR ===== */
.menu-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 16px;
    border: 1px solid #e8e8e8;
    justify-content: center;
}

.menu-btn {
    padding: 8px 18px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.menu-btn:hover {
    background: #f0f2f5;
    border-color: #1a5fb4;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.menu-btn:active {
    transform: translateY(0);
}

.menu-btn i {
    font-size: 16px;
    color: #1a5fb4;
}

.menu-btn.primary {
    background: linear-gradient(135deg, #1a5fb4, #0db561);
    border-color: transparent;
    color: #fff;
}

.menu-btn.primary i {
    color: #fff;
}

.menu-btn.primary:hover {
    box-shadow: 0 8px 25px rgba(26, 95, 180, 0.3);
}

.menu-btn .badge {
    background: rgba(0, 0, 0, 0.08);
    padding: 0 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.menu-btn.primary .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ===== GAME AREA ===== */
.game-area {
    background: #fafafa;
    border-radius: 16px;
    padding: 20px;
    min-height: 400px;
    border: 2px solid #e8e8e8;
    position: relative;
    width: 100%;
    overflow: hidden;
}

#root {
    min-height: 350px;
    width: 100%;
    overflow: hidden;
}

.game-area .placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
    color: #999;
}

.game-area .placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    color: #ddd;
}

/* ===== GAME BOARD ===== */
.game-board {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 1em;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0 5px;
}

/* ===== GAME ITEMS ===== */
.game-item {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    color: #000;
    font-weight: 700;
    border: none;
    text-transform: uppercase;
    height: 50px;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
    cursor: pointer;
    background-color: #D3E3FD;
    transition: background-color 0.3s ease;
    padding: 0 5px;
    text-align: center;
    word-break: break-word;
    box-sizing: border-box;
    min-height: 50px;
    line-height: 1.2;
}

.game-item.selected {
    background-color: #5a594e;
    color: #fff;
}

.game-item.matched {
    background-color: #0db561;
    color: #fff;
    cursor: default;
    opacity: 0.85;
}

.game-item.wrong {
    background-color: #e74c3c;
    color: #fff;
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

/* ===== GAME GROUP ===== */
.game-group {
    display: flex;
    max-width: 600px;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1em;
    width: 100%;
    box-sizing: border-box;
    background-color: rgb(251, 212, 0);
    padding-bottom: 20px;
    margin-bottom: 0;
    border-radius: 8px;
}

.group-name {
    font-size: 1.2em;
    font-weight: bold;
}

.group-members {
    font-size: 1em;
}

/* ===== HEADER ===== */
h1 {
    text-align: center;
}

.game-header {
    display: flex;
    align-items: center;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
}

.game-header h1 {
    font-size: 3em;
    font-weight: bold;
    margin-bottom: 0.5em;
}

.game-header p {
    font-size: 18px;
    line-height: 30px;
    margin: 0 auto 10px;
    max-width: 100%;
    text-align: center;
    width: 600px;
}

.message {
    margin-top: 10px;
    margin-bottom: 15px;
}

/* ===== BUTTONS ===== */
.btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
    max-width: 600px;
}

.game-btn {
    width: 100%;
    height: 40px;
    border: 1px solid #c9cddf;
    border-radius: 5px;
    background-color: transparent;
    color: black;
    font-size: 1em;
    margin: 0.5em auto;
    cursor: pointer;
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
    padding: 0 20px;
    box-sizing: border-box;
    gap:10;
}

.game-btn:hover {
    border: 1px solid #222;
}

.submit-btn {
    background: #0B4A8E;
    border: none;
    color: #fff;
}

.submit-btn:hover {
    background: #be7ae1;
    border: none;
}

.game-attempts {
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding: 12px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
    font-size: 14px;
}

.stat-item i {
    color: #1a5fb4;
    font-size: 16px;
}

.stat-item .stat-value {
    color: #1a5fb4;
    font-weight: 700;
    font-size: 16px;
}

/* ===== DIFFICULTY ===== */
.difficulty-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.difficulty-wrapper label {
    font-size: 20px;
    margin-right: 10px;
}

.difficulty-wrapper button {
    padding: 10px 20px;
    font-size: 16px;
    background-color: #ddd;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    color: #000;
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
}

.difficulty-wrapper button:hover {
    background-color: #bbb;
}

.difficulty-wrapper .selected {
    background-color: #aaa;
    color: white;
}

/* ===== MODAL ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #ffffff;
    padding: 35px 40px;
    border-radius: 20px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #1a5fb4;
    padding-bottom: 12px;
}

.modal-title {
    font-size: 1.8rem;
    color: #1a5fb4;
    margin: 0;
    font-weight: 700;
}

.modal-title i {
    margin-right: 10px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: all 0.2s ease;
    line-height: 1;
}

.close-btn:hover {
    color: #333;
    transform: rotate(90deg);
}

.modal-body {
    line-height: 1.7;
    color: #444;
}

.modal-body h3 {
    color: #1a5fb4;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.modal-body h3:first-child {
    margin-top: 0;
}

.modal-body ul {
    padding-left: 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-body .highlight {
    background: #f0f7ff;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #1a5fb4;
    margin: 10px 0;
}

/* ===== CONTENT ===== */
.content {
    padding: 0 15px;
    margin-top: 20px;
    width: 100%;
    max-width: 600px;
    box-sizing: border-box;
}

.links {
    text-align: center;
    width: 70%;
    margin: 0 auto;
    margin-bottom: 50px;
}

h3.for-content {
    margin-top: 40px;
}

.top-g {
    width: 100%;
    max-width: 600px;
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.top-g .game-time {
    font-weight: 700;
}

.share span {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-block;
    margin: 2px;
}

img {
    max-width: 100%;
}

img.ill {
    border: 1px solid #ebebeb;
    box-shadow: 1px 6px 9px rgba(0, 0, 0, 0.1);
}

code {
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
}

/* ===== PAGE CONTENT ===== */
.page-content {
    width: 100%;
    background: #f3eff9;
    border: 2px dashed blue;
    box-sizing: border-box;
}

.inner-wrapper {
    width: 840px;
    margin: 0 auto;
    max-width: 100%;
    box-sizing: border-box;
    padding: 40px 20px;
}

.footer .inner-wrapper {
    padding: 20px 0;
}

/* ===== FOOTER ===== */
.footer {
    max-width: 100%;
    padding: 15px;
    margin: 0 auto;
    text-align: center;
    box-sizing: border-box;
}

.contact {
    font-size: 14px;
    color: #786a6a;
    margin-top: 30px;
    width: 600px;
    max-width: 100%;
}

.disclaimer {
    font-size: 14px;
    color: #786a6a;
    margin-top: 30px;
    width: 600px;
    max-width: 100%;
}

/* ===== TOP BAR ===== */
.top-bar {
    border-bottom: 1px solid #ebebeb;
}

.top-bar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 630px;
    max-width: 100%;
    margin: 0 auto;
    height: 50px;
    padding: 0 15px;
    box-sizing: border-box;
}

.element,
.element-middle a {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #000;
    font-size: 13px;
}

#lang-switch,
#help-button {
    border: none;
    background: none;
    cursor: pointer;
    background: #d7e8f0;
    font-weight: bold;
    padding: 7px 15px;
    color: #000;
}

.element-middle {
    font-weight: bold;
}

.element-middle img {
    display: block;
    margin: 0 auto;
    height: 30px;
    margin-right: 10px;
}

.download-app {
    margin-top: 20px;
}

.archive-wrapper {
    margin-top: 15px;
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
}

.archive-wrapper select {
    height: 40px;
    padding: 0 10px;
    font-family: 'Segoe UI', 'Montserrat', 'Open Sans', sans-serif;
    border-radius: 10px;
    outline: none !important;
}

/* ===== SCROLLBAR ===== */
.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #1a5fb4;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #0db561;
}

/* ======================================== */
/* ===== RESPONSIVE FIXES ===== */
/* ======================================== */

/* ===== DESKTOP (600px+) ===== */
@media (min-width: 600px) {
    .game-board {
        grid-template-columns: repeat(4, 1fr);
        width: 600px;
    }

    .game-item {
        width: 100%;
        min-width: auto;
        height: 70px;
        font-size: 15px;
    }

    .btn-wrapper {
        flex-direction: row;
        max-width: 600px;
    }

    .game-btn {
        width: 160px;
    }
}

/* ===== TABLET & MOBILE LANDSCAPE (600px - 768px) ===== */
@media (max-width: 768px) {
    .game-wrapper {
        padding: 10px;
    }

    .game-board {
        gap: 5px;
        padding: 0 5px;
    }

    .game-item {
        height: 65px;
        font-size: 14px;
        min-height: 65px;
        padding: 0 4px;
    }

    .game-header h1 {
        font-size: 2em;
    }

    .game-header p {
        font-size: 16px;
        line-height: 26px;
        width: 100%;
        padding: 0 10px;
    }

    .welcome-modal {
        padding: 30px 24px;
    }

    .welcome-title {
        font-size: 28px;
    }

    .logo-text {
        font-size: 2.5rem;
    }

    .menu-bar {
        gap: 6px;
        padding: 10px 12px;
    }

    .menu-btn {
        font-size: 13px;
        padding: 6px 14px;
    }

    .menu-btn span {
        display: none;
    }

    .menu-btn i {
        font-size: 18px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .stats-bar {
        flex-wrap: wrap;
        gap: 15px;
    }

    .modal-content {
        padding: 25px 20px;
    }

    .modal-title {
        font-size: 1.4rem;
    }

    .game-area {
        min-height: 300px;
        padding: 12px;
    }

    .inner-wrapper {
        padding: 30px 15px;
    }
}

/* ===== MOBILE PORTRAIT (400px - 600px) ===== */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .game-container {
        padding-left: 5px;
        padding-right: 5px;
    }

    .game-wrapper {
        padding: 12px;
    }

    .game-header {
        max-width: 100%;
    }

    .game-header h1 {
        font-size: 2em;
    }

    .game-header p {
        font-size: 15px;
        line-height: 24px;
        width: 100%;
        padding: 0 5px;
    }

    .game-board {
        gap: 6px;
        padding: 0 3px;
    }

    .game-item {
        height: 60px;
        font-size: 13px;
        min-height: 60px;
        padding: 0 3px;
        border-radius: 4px;
    }

    .game-item.size-8 {
        font-size: 12px;
    }

    .game-item.size-more {
        font-size: 11px;
    }

    .game-group {
        padding-bottom: 15px;
        border-radius: 6px;
    }

    .btn-wrapper {
        flex-direction: column;
        width: 100%;
        max-width: 100%;
        padding: 0 5px;
    }

    .game-btn {
        width: 100%;
        max-width: 300px;
        height: 45px;
        font-size: 0.9em;
        margin: 5px 0;
    }

    .logo-text {
        font-size: 2rem;
    }

    .menu-btn {
        padding: 8px 12px;
    }

    .welcome-modal {
        padding: 24px 18px;
    }

    .top-g {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 5px;
    }

    .inner-wrapper {
        padding: 20px 10px;
    }

    .content {
        padding: 0 10px;
    }

    .contact {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .disclaimer {
        width: 100%;
        padding: 0 10px;
        box-sizing: border-box;
    }

    .difficulty-wrapper {
        gap: 5px;
    }

    .difficulty-wrapper label {
        font-size: 16px;
    }

    .difficulty-wrapper button {
        padding: 8px 15px;
        font-size: 14px;
    }
}

/* ===== SMALL PHONES (350px - 400px) ===== */
@media (max-width: 400px) {
    body {
        padding: 5px;
    }

    .game-container {
        padding: 5px;
    }

    .game-wrapper {
        padding: 10px;
    }

    .game-header h1 {
        font-size: 1.6em;
    }

    .game-header p {
        font-size: 13px;
        line-height: 20px;
    }

    .game-board {
        gap: 5px;
        padding: 0 2px;
    }

    .game-item {
        height: 50px;
        font-size: 11px;
        min-height: 50px;
        padding: 0 2px;
        border-radius: 3px;
        font-weight: 600;
    }

    .game-item.size-8 {
        font-size: 10px;
    }

    .game-item.size-more {
        font-size: 9px;
    }

    .game-group {
        padding-bottom: 12px;
        border-radius: 5px;
    }

    .game-btn {
        height: 40px;
        font-size: 0.8em;
        max-width: 100%;
    }

    .logo-text {
        font-size: 1.8rem;
    }

    .inner-wrapper {
        padding: 15px 8px;
    }

    .content {
        padding: 0 8px;
    }

    .top-g {
        flex-direction: column;
        align-items: center;
        font-size: 13px;
    }

    .difficulty-wrapper label {
        font-size: 14px;
    }

    .difficulty-wrapper button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .top-bar .container {
        height: 40px;
        font-size: 12px;
    }

    .element,
    .element-middle a {
        font-size: 11px;
    }

    #lang-switch,
    #help-button {
        padding: 5px 10px;
        font-size: 11px;
    }

    .element-middle img {
        height: 24px;
    }
}

/* ===== EXTRA SMALL PHONES (< 350px) ===== */
@media (max-width: 350px) {
    .game-board {
        gap: 4px;
        padding: 0 2px;
    }

    .game-item {
        height: 42px;
        font-size: 9px;
        min-height: 42px;
        padding: 0 2px;
        border-radius: 3px;
    }

    .game-header h1 {
        font-size: 1.3em;
    }

    .game-header p {
        font-size: 12px;
        line-height: 18px;
    }

    .game-btn {
        height: 36px;
        font-size: 0.7em;
    }

    .inner-wrapper {
        padding: 10px 5px;
    }
}

/* ===== TOUCH FRIENDLY ===== */
@media (hover: none) and (pointer: coarse) {
    .game-item {
        min-height: 60px;
    }

    .game-item:hover {
        transform: none;
    }

    .game-item:active:not(.matched):not(.wrong) {
        transform: scale(0.95);
        opacity: 0.8;
    }

    .game-btn {
        min-height: 44px;
    }
}

@media (max-width: 600px) and (hover: none) {
    .game-item {
        min-height: 55px;
    }
}

@media (max-width: 400px) and (hover: none) {
    .game-item {
        min-height: 48px;
    }
}

