html {
    font-size: 12px;
    overflow-x: hidden;
}

/* Belt-and-suspenders against any element briefly overflowing the viewport width (a focus
   animation, a modal opening, a stray wide element) making the whole page horizontally
   scrollable/"wobbly" on mobile - it should feel fixed in place like an app. */
body {
    overflow-x: hidden;
}

:root {
    --app-stable-height: 100svh;
}

.info-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 40px;
}

.info-hero {
    padding: 28px 30px;
    border: 1px solid rgba(18, 63, 117, 0.12);
    border-radius: 28px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(235, 243, 252, 0.9));
    box-shadow: 0 18px 42px rgba(15, 42, 74, 0.08);
}

.info-eyebrow {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(20, 78, 140, 0.1);
    color: #144e8c;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.info-title {
    margin: 14px 0 10px;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.08;
    font-weight: 700;
}

.info-description {
    margin: 0;
    max-width: 780px;
    color: #3f5167;
    font-size: 1.05rem;
    line-height: 1.65;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.info-card {
    padding: 24px 24px 22px;
    border: 1px solid rgba(18, 63, 117, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 34px rgba(15, 42, 74, 0.07);
}

.info-card-accent {
    background: linear-gradient(160deg, rgba(253, 250, 238, 0.98), rgba(248, 243, 220, 0.92));
}

.info-card-title {
    margin: 0 0 16px;
    font-size: 1.05rem;
    font-weight: 700;
}

.info-list {
    margin: 0;
    padding-left: 18px;
}

.info-list li {
    margin-bottom: 12px;
    color: #33465d;
    font-size: 0.96rem;
    line-height: 1.65;
}

.info-list-tight li {
    margin-bottom: 10px;
}

html[data-theme='dark'] .info-hero {
    border-color: rgba(131, 179, 232, 0.16);
    background: linear-gradient(145deg, rgba(20, 29, 44, 0.94), rgba(18, 39, 67, 0.9));
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .info-eyebrow {
    background: rgba(120, 179, 250, 0.16);
    color: #9fc8ff;
}

html[data-theme='dark'] .info-description,
html[data-theme='dark'] .info-list li {
    color: #c3d0df;
}

html[data-theme='dark'] .info-card {
    border-color: rgba(131, 179, 232, 0.16);
    background: rgba(17, 24, 37, 0.92);
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.26);
}

html[data-theme='dark'] .info-card-accent {
    background: linear-gradient(160deg, rgba(54, 44, 20, 0.94), rgba(39, 33, 18, 0.92));
}

@media (max-width: 900px) {
    .info-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .info-page {
        padding-inline: 14px;
    }

    .info-hero,
    .info-card {
        padding: 20px 18px;
        border-radius: 20px;
    }
}

@font-face {
    font-family: 'HafferSQ Light';
    src: url('../fonts/HafferSQ-Light.ttf');
}

:root {
    --theme-body-text: #d4d4d4;
    --theme-body-bg: linear-gradient(180deg, #1e1e1e 0%, #1e1e1e 100%);
    --theme-nav-bg: rgba(37, 37, 38, 0.96);
    --theme-nav-border: rgba(63, 63, 70, 0.92);
    --theme-nav-shadow: 0 10px 28px rgba(0, 0, 0, 0.32);
    --theme-surface-1: #252526;
    --theme-surface-2: #2d2d30;
    --theme-surface-3: rgba(255, 255, 255, 0.04);
    --theme-surface-4: rgba(255, 255, 255, 0.08);
    --theme-panel: rgba(37, 37, 38, 0.94);
    --theme-text-strong: #d4d4d4;
    --theme-text-muted: rgba(212, 212, 212, 0.74);
    --theme-text-inverse: #1e1e1e;
    --theme-accent: #569cd6;
    --theme-accent-strong: #4f8ec4;
    --theme-accent-soft: rgba(86, 156, 214, 0.18);
    --theme-danger: #d95d5d;
    --theme-border: rgba(63, 63, 70, 0.92);
    --theme-border-strong: rgba(86, 156, 214, 0.38);
    --theme-input-bg: rgba(45, 45, 48, 0.96);
    --theme-menu-bg: rgba(37, 37, 38, 0.98);
    --audio-bar-bg-top: color-mix(in srgb, var(--theme-nav-bg) 94%, transparent);
    --audio-bar-bg-bottom: color-mix(in srgb, var(--theme-panel) 96%, transparent);
    --audio-bar-border: var(--theme-border);
    --audio-bar-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    --audio-button-bg-top: color-mix(in srgb, var(--theme-surface-1) 96%, #243248 4%);
    --audio-button-bg-bottom: color-mix(in srgb, var(--theme-surface-2) 96%, #101726 4%);
    --audio-button-border: var(--theme-border);
    --audio-button-text: var(--theme-text-strong);
    --audio-button-hover-border: var(--theme-border-strong);
    --audio-mute-bg-top: color-mix(in srgb, var(--theme-accent) 92%, white 8%);
    --audio-mute-bg-bottom: color-mix(in srgb, var(--theme-accent-strong) 92%, black 8%);
    --audio-mute-text: #ffffff;
    --audio-call-bg-top: #24c58d;
    --audio-call-bg-bottom: #15906a;
    --audio-call-text: #08110a;
    --audio-hangup-bg-top: #ff8080;
    --audio-hangup-bg-bottom: #d73a3a;
    --audio-hangup-text: #ffffff;
    --game-bg: #1e1e1e;
    --game-panel: #252526;
    --game-panel-soft: #2d2d30;
    --game-slot-bg: #3e3e42;
    --game-text: #d4d4d4;
    --game-accent: #569cd6;
    --game-accent-hover: #4f8ec4;
    --game-border: #569cd6;
    --game-border-hover: #4f8ec4;
    --game-line: #d4d4d4;
    --game-input-bg: #2d2d30;
    --game-shadow: 0 0 0 1px rgba(86, 156, 214, 0.14), 0 12px 26px rgba(0, 0, 0, 0.3);
    --game-shadow-strong: 0 0 0 1px rgba(86, 156, 214, 0.22), 0 16px 32px rgba(0, 0, 0, 0.34);
    --game-radius-xs: 8px;
    --game-radius-sm: 10px;
    --game-radius-md: 14px;
    --game-radius-lg: 18px;
    --game-radius-pill: 999px;
    --game-font-xs: 0.75rem;
    --game-font-sm: 0.85rem;
    --game-font-md: 1rem;
    --game-font-lg: 1.2rem;
    --game-font-xl: 1.45rem;
    --game-space-panel: 18px;
    --game-space-button: 15px;
    --game-space-stack: 14px;
    --home-choice-beginner-color: #4fbf78;
    --home-choice-pro-color: #e0a13c;
}

html[data-theme="light"],
body[data-theme="light"] {
    --theme-body-text: #1e1e1e;
    --theme-body-bg: linear-gradient(180deg, #f3f3f3 0%, #f3f3f3 100%);
    --theme-nav-bg: rgba(243, 243, 243, 0.96);
    --theme-nav-border: rgba(204, 206, 219, 0.96);
    --theme-nav-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --theme-surface-1: #ffffff;
    --theme-surface-2: #f3f3f3;
    --theme-surface-3: rgba(30, 30, 30, 0.03);
    --theme-surface-4: rgba(30, 30, 30, 0.06);
    --theme-panel: rgba(255, 255, 255, 0.97);
    --theme-text-strong: #1e1e1e;
    --theme-text-muted: rgba(30, 30, 30, 0.68);
    --theme-text-inverse: #ffffff;
    --theme-accent: #005fb8;
    --theme-accent-strong: #004e98;
    --theme-accent-soft: rgba(0, 95, 184, 0.12);
    --theme-danger: #c84d4d;
    --theme-border: rgba(212, 214, 225, 0.96);
    --theme-border-strong: rgba(0, 95, 184, 0.28);
    --theme-input-bg: rgba(255, 255, 255, 0.98);
    --theme-menu-bg: rgba(250, 250, 250, 0.98);
    --audio-bar-bg-top: rgba(255, 255, 255, 0.92);
    --audio-bar-bg-bottom: rgba(235, 243, 251, 0.96);
    --audio-bar-border: rgba(23, 37, 58, 0.12);
    --audio-bar-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    --audio-button-bg-top: #ffffff;
    --audio-button-bg-bottom: #e7eef8;
    --audio-button-border: rgba(23, 37, 58, 0.12);
    --audio-button-text: #17253a;
    --audio-button-hover-border: rgba(0, 95, 184, 0.28);
    --audio-mute-bg-top: #3d8bff;
    --audio-mute-bg-bottom: #1f6fda;
    --audio-mute-text: #ffffff;
    --audio-call-bg-top: #24c58d;
    --audio-call-bg-bottom: #15906a;
    --audio-call-text: #08110a;
    --audio-hangup-bg-top: #ff8b8b;
    --audio-hangup-bg-bottom: #d74d4d;
    --audio-hangup-text: #ffffff;
    --game-bg: #f3f3f3;
    --game-panel: #ffffff;
    --game-panel-soft: #f3f3f3;
    --game-slot-bg: #e5e5e5;
    --game-text: #1e1e1e;
    --game-accent: #005fb8;
    --game-accent-hover: #004e98;
    --game-border: #005fb8;
    --game-border-hover: #004e98;
    --game-line: #1e1e1e;
    --game-input-bg: #ffffff;
    --game-shadow: 0 0 0 1px rgba(0, 95, 184, 0.08), 0 10px 24px rgba(0, 0, 0, 0.08);
    --game-shadow-strong: 0 0 0 1px rgba(0, 95, 184, 0.14), 0 14px 30px rgba(0, 0, 0, 0.12);
    --home-choice-beginner-color: #1f8a4c;
    --home-choice-pro-color: #b5790a;
}

body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    padding-top: 80px;
    padding-bottom: 100px;
    background: var(--theme-body-bg);
    background-attachment: fixed;
    color: var(--theme-body-text);
    transition: background 0.25s ease, color 0.25s ease;
}

body.app-dialog-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.app-nav {
    --nav-inline-padding: clamp(6px, 1vw, 14px);
    display: grid;
    grid-template-columns: 40px 170px 1fr auto;
    align-items: center;
    gap: 12px;
    background-color: var(--theme-nav-bg);
    border-bottom: 1px solid var(--theme-nav-border);
    padding-top: 15px;
    padding-right: max(0px, calc(var(--nav-inline-padding) - 6px));
    padding-bottom: 15px;
    padding-left: var(--nav-inline-padding);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--theme-nav-shadow);
    backdrop-filter: blur(10px);
    box-sizing: border-box;
    height: 72px;
}

.home-link {
    width: 170px;
    min-width: 170px;
    max-width: 170px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--theme-accent);
    text-decoration: none;
    text-shadow: 0 0 10px color-mix(in srgb, var(--theme-accent) 75%, transparent);
    transition: color 0.3s ease;
    margin-left: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-link:hover {
    color: var(--theme-accent-strong);
}

.home-link-logo {
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
}

.home-link-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-menu {
    position: absolute;
    top: 68px;
    left: var(--nav-inline-padding);
    min-width: 200px;
    max-width: min(260px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    padding: 10px;
    border-radius: 16px;
    background: var(--theme-menu-bg);
    border: 1px solid var(--theme-border-strong);
    box-shadow: var(--theme-nav-shadow);
    z-index: 1100;
}

.nav-menu.hidden {
    display: none;
}

.nav-menu-link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--theme-text-strong);
    text-decoration: none;
    white-space: nowrap;
}

.nav-menu-link:hover {
    background-color: var(--theme-accent-soft);
    color: var(--theme-accent);
}

.nav-menu-app-link {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.nav-menu-icon {
    width: 32px;
    min-width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-accent);
}

.nav-menu-divider {
    height: 1px;
    margin: 6px 2px;
    background: var(--theme-border-strong);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 10px;
    justify-self: end;
}

.nav-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-surface-3);
    color: var(--theme-text-strong);
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.nav-share-button {
    flex: 0 0 40px;
}

.nav-favicon-icon {
    width: 24px;
    height: 24px;
    display: block;
}

#urlGlobal[hidden] {
    display: none !important;
}

.nav-icon-button:hover {
    background: var(--theme-accent-soft);
    border-color: var(--theme-border-strong);
    color: var(--theme-accent);
}

.zoll-icon {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.zoll-sign-face {
    fill: #ffffff;
    stroke: #d3222a;
    stroke-width: 2.4;
}

.zoll-sign-fence {
    fill: none;
    stroke: #111111;
}

.app-switcher {
    position: relative;
    flex: 0 0 40px;
}

.app-switcher-button {
    width: 40px;
    height: 40px;
}

.app-switcher.open .app-switcher-button {
    background: var(--theme-accent-soft);
    border-color: var(--theme-border-strong);
    color: var(--theme-accent);
}

.app-switcher-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    min-width: 220px;
    max-width: min(280px, calc(100vw - 24px));
    padding: 8px;
    border: 1px solid var(--theme-border-strong);
    border-radius: 14px;
    background: var(--theme-menu-bg);
    background-clip: padding-box;
    box-shadow: var(--theme-nav-shadow);
    overflow: hidden;
}

.app-switcher.open .app-switcher-menu {
    display: block;
}

.app-switcher-scroll {
    display: grid;
    gap: 4px;
    max-height: min(360px, calc(100vh - 96px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--theme-border) var(--theme-menu-bg);
    scrollbar-width: thin;
}

.app-switcher-link {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--theme-text-strong);
    text-decoration: none;
}

.app-switcher-link:hover,
.app-switcher-link:focus-visible {
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
    text-decoration: none;
}

.app-switcher-icon {
    width: 34px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-accent);
}

.app-switcher-zoll-icon .zoll-icon {
    width: 26px;
    height: 26px;
}

.app-switcher-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: .95rem;
    font-weight: 700;
}

.app-switcher-scroll::-webkit-scrollbar {
    width: 10px;
}

.app-switcher-scroll::-webkit-scrollbar-track {
    background: var(--theme-menu-bg);
    margin: 8px 0;
}

.app-switcher-scroll::-webkit-scrollbar-thumb {
    background-color: var(--theme-border);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

.nav-profile-button {
    width: auto;
    min-width: 44px;
    padding: 0 10px 0 8px;
    gap: 6px;
    border-radius: 14px;
    max-width: 170px;
    justify-content: flex-start;
}

.nav-profile-text {
    font-size: 0.9rem;
    max-width: 112px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-profile-button .mdi {
    flex: 0 0 auto;
}

.settings-modal[hidden] {
    display: none !important;
}

.settings-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: calc(74px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 12px max(12px, env(safe-area-inset-left));
    box-sizing: border-box;
}

.settings-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(2px);
}

.settings-modal-card {
    position: relative;
    width: min(320px, calc(100vw - 24px));
    border: 1px solid var(--theme-border-strong);
    border-radius: 18px;
    background: var(--theme-menu-bg);
    box-shadow: var(--theme-nav-shadow);
    color: var(--theme-text-strong);
    overflow: hidden;
}

.settings-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 10px 16px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 72%, transparent);
}

.settings-modal-title {
    font-size: 1rem;
    font-weight: 800;
}

.settings-close-button {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 10px;
    box-shadow: none;
}

.settings-list {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.settings-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    user-select: none;
}

.settings-row:hover {
    background: var(--theme-accent-soft);
}

.settings-row-icon {
    color: var(--theme-accent);
    line-height: 1;
    text-align: center;
}

.settings-row-text {
    min-width: 0;
}

.settings-row-title {
    display: block;
    font-size: .96rem;
    font-weight: 700;
    line-height: 1.2;
}

.settings-switch-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.settings-switch {
    position: relative;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-text-muted) 28%, var(--theme-surface-2));
    border: 1px solid var(--theme-border);
    transition: background .18s ease, border-color .18s ease;
}

.settings-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--theme-text-strong);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .28);
    transition: transform .18s ease, background .18s ease;
}

.settings-switch-input:checked + .settings-switch {
    background: var(--theme-accent);
    border-color: var(--theme-accent);
}

.settings-switch-input:checked + .settings-switch::after {
    transform: translateX(20px);
    background: var(--theme-text-inverse);
}

.desktop-custom-picker {
    display: inline-flex !important;
}

.language-dropdown {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--theme-text-strong);
    cursor: pointer;
    border-radius: 12px;
    background-color: var(--theme-surface-3);
    min-width: 0;
    text-align: center;
    transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    margin-right: 0;
    border: 1px solid var(--theme-border);
    box-sizing: border-box;
    white-space: nowrap;
}

#selected-language {
    display: inline-block;
    width: auto;
    padding: 0;
    margin: 0;
    line-height: 1.1;
}

.selected-language-flag {
    flex: 0 0 auto;
    width: 1.55em;
    aspect-ratio: 4/3;
}

.language-dropdown #selected-language {
    display: none;
}

/* hover:hover guards this to real pointer devices - on touch, :hover can stick after a tap
   until the next tap elsewhere, which would otherwise leave the button visibly enlarged. */
@media (hover: hover) and (pointer: fine) {
    .language-dropdown:hover {
        background-color: var(--theme-accent);
        color: var(--theme-text-inverse);
        transform: scale(1.05);
    }
}

.language-dropdown.open {
    background-color: var(--theme-accent);
    color: var(--theme-text-inverse);
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--theme-menu-bg);
    min-width: 180px;
    width: max-content;
    max-width: min(240px, calc(100vw - 24px));
    z-index: 1100;
    top: calc(100% + 10px);
    right: 0;
    border-radius: 12px;
    border: 2px solid var(--theme-accent);
    background-clip: padding-box;
    text-align: left;
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: var(--game-shadow);
    overflow: hidden;
}

.dropdown-content-scroll {
    max-height: min(420px, calc(100vh - 96px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--theme-border) var(--theme-menu-bg);
    scrollbar-width: thin;
}

.language-dropdown.open .dropdown-content {
    display: block;
}

.dropdown-content-scroll a {
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--theme-text-strong);
    font-size: 1em;
    line-height: 1.2;
    transition: background 0.3s ease, color 0.3s ease;
}

.language-dropdown-flag {
    flex: 0 0 auto;
    width: 1.3em;
    aspect-ratio: 4/3;
}

.dropdown-content-scroll a:hover {
    background-color: var(--theme-accent);
    color: var(--theme-text-inverse);
}

.dropdown-content-scroll::-webkit-scrollbar {
    width: 10px;
}

.dropdown-content-scroll::-webkit-scrollbar-track {
    background: var(--theme-menu-bg);
    margin: 8px 0;
}

.dropdown-content-scroll::-webkit-scrollbar-thumb {
    background-color: var(--theme-border);
    border: 3px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

@media (hover: none) and (pointer: coarse), (max-height: 520px) {
    .app-switcher .app-switcher-menu {
        position: fixed;
        top: calc(72px + max(6px, env(safe-area-inset-top)));
        right: max(8px, env(safe-area-inset-right));
        max-width: min(280px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    }

    .app-switcher .app-switcher-scroll {
        max-height: calc(var(--app-stable-height) - 86px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }

    .language-dropdown .dropdown-content {
        position: fixed;
        top: calc(72px + max(6px, env(safe-area-inset-top)));
        right: max(8px, env(safe-area-inset-right));
        max-width: min(240px, calc(100vw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    }

    .language-dropdown .dropdown-content-scroll {
        max-height: calc(var(--app-stable-height) - 86px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        -webkit-overflow-scrolling: touch;
    }
}

.background {
    background: var(--game-bg);
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-bottom: 20px;
}

.home-background {
    display: block;
    justify-content: flex-start;
    align-items: stretch;
    text-align: left;
    padding: 24px 16px 56px;
    box-sizing: border-box;
}

.home-page {
    width: min(1200px, 100%);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
    box-sizing: border-box;
}

.home-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: stretch;
}

.home-hero-copy,
.home-hero-art,
.home-card,
.home-feature-card {
    border: 1px solid color-mix(in srgb, var(--theme-border) 86%, transparent);
    border-radius: 22px;
    background: color-mix(in srgb, var(--theme-panel) 96%, transparent);
    box-shadow: var(--game-shadow-strong);
}

.home-hero-copy {
    padding: 12px 18px;
    text-align: center;
}

.home-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-hero-tagline {
    margin: 0;
    color: var(--theme-accent);
    font-weight: 700;
    letter-spacing: 0.01em;
    font-size: clamp(1.1rem, 2.2vw, 1.45rem);
    line-height: 1.25;
}

.home-hero h1 {
    margin: 10px 0 0;
    font-size: clamp(1.6rem, 3.4vw, 2.3rem);
    line-height: 1.15;
}

.home-hero-note {
    margin: 10px auto 0;
    max-width: 780px;
    color: var(--theme-text-muted);
    font-size: 1rem;
    line-height: 1.55;
}

.home-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 18px;
}

.home-pill {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
    background: color-mix(in srgb, var(--theme-surface-2) 92%, transparent);
    color: var(--theme-text-strong);
    font-size: 0.86rem;
    font-weight: 600;
}

.home-hero-art {
    padding: 18px;
    display: grid;
    grid-template-rows: minmax(0, 1.35fr) minmax(0, 0.85fr);
    gap: 14px;
}

.home-preview {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
    background: color-mix(in srgb, var(--theme-surface-2) 90%, transparent);
    min-height: 0;
}

.home-preview-large {
    aspect-ratio: 4 / 3;
}

.home-preview-small {
    aspect-ratio: 16 / 9;
}

.home-theme-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    padding: 18px;
    box-sizing: border-box;
}

.home-theme-image-light {
    display: none;
}

html[data-theme='light'] .home-theme-image-dark {
    display: none;
}

html[data-theme='light'] .home-theme-image-light {
    display: block;
}

.home-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.home-section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 12px;
    padding: 0 4px;
}

.home-section-head h2 {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.2;
}

.home-grid {
    display: grid;
    gap: 16px;
}

.home-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.home-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-grid-five {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.home-card {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-puzzle-actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* Plain row - icon in its frame (.home-card-art), text beside it - same as the
   Chess link right above it, not its own bordered/backgrounded card like
   .home-card-button used to be. */
.home-card-row-button {
    appearance: none;
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    background: none;
    border: none;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    transition: transform 0.16s ease;
}

.home-card-row-button:hover {
    transform: translateY(-2px);
}

.home-card-banner {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.home-card-art {
    width: 84px;
    height: 84px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
    background: color-mix(in srgb, var(--theme-surface-2) 92%, transparent);
}

.home-card-art img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    box-sizing: border-box;
}

.home-card-art-theme {
    background: var(--theme-surface-2);
}

.home-card-art img.home-puzzle-random-image {
    object-fit: cover;
    padding: 0;
}

.home-card-copy {
    min-width: 0;
}

.home-card-copy h3,
.home-feature-body h3 {
    margin: 0;
    font-size: 1.18rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.home-card-kicker {
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--theme-accent-soft);
    color: var(--theme-accent);
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-card-subtitle,
.home-feature-note {
    margin: 6px 0 0;
    color: var(--theme-text-muted);
    font-size: 1.18rem;
    line-height: 1.45;
}

.home-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    gap: 10px;
}

/* Must match the >760px breakpoint where .home-grid-five actually has 2+ explicit
   columns (see the max-width:760px override below, which collapses it to a single
   column). Spanning 2 columns while only 1 exists forces CSS Grid to fabricate an
   implicit second column sized purely by its own content - producing a lopsided
   narrow/wide split and overlapping card titles in the 521-760px range. */
@media (min-width: 761px) {
    .home-grid-five > .home-card:last-child {
        grid-column: span 2;
    }
}

.home-choice-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 90px;
    padding: 12px 10px;
    border: 1px solid color-mix(in srgb, var(--theme-border) 84%, transparent);
    border-radius: 16px;
    background: linear-gradient(180deg, var(--theme-surface-1), var(--theme-surface-2));
    color: var(--theme-text-strong);
    cursor: pointer;
    text-decoration: none;
    box-shadow: none;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.home-choice-btn:hover {
    transform: translateY(-1px);
    border-color: var(--theme-border-strong);
    background: color-mix(in srgb, var(--theme-accent-soft) 82%, var(--theme-surface-2));
}

.home-choice-icon {
    font-size: 1.3rem;
    line-height: 1;
    color: var(--theme-accent, currentColor);
}

.home-choice-icon-beginner {
    color: var(--home-choice-beginner-color);
}

.home-choice-icon-pro {
    color: var(--home-choice-pro-color);
}

.home-choice-count {
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.home-choice-label {
    font-size: 0.95rem;
    line-height: 1.1;
    text-align: center;
}

.home-feature-card {
    padding: 0;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.home-feature-button {
    width: 100%;
    cursor: pointer;
    appearance: none;
}

.home-feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--theme-border-strong);
}

.home-feature-media {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 76%, transparent);
    background: color-mix(in srgb, var(--theme-surface-2) 92%, transparent);
}

.home-feature-media .home-theme-image {
    padding: 22px;
    max-height: 260px;
}

.home-feature-body {
    padding: 18px;
}

.home-feature-body h3 {
    margin-top: 6px;
}

.home-feature-note {
    margin-top: 8px;
}

.home-card-link {
    text-decoration: none;
    color: inherit;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.home-card-link:hover {
    transform: translateY(-2px);
    border-color: var(--theme-border-strong);
}

.video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.video-container {
    position: absolute;
    inset: 5%;
}

.video-container video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-close {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    font-size: 32px;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
}

.menu-container {
    background-color: var(--game-panel);
    border-radius: 25px;
    box-shadow: var(--game-shadow-strong);
    margin: 30px;
}

.menu-container h1 {
    font-size: 3em;
    color: var(--game-accent);
    text-shadow: 0 0 10px color-mix(in srgb, var(--game-accent) 75%, transparent);
    margin: 30px;
}

.menu-container p {
    font-size: 1.5em;
    color: var(--game-text);
}

.start-btn {
    padding: 10px;
    font-size: 1.2em;
    background-color: var(--theme-surface-2);
    color: var(--theme-text-strong);
    border: none;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    box-shadow: var(--game-shadow);
    width: auto;
}

/* hover:hover guards this to real pointer devices - on touch, :hover can stick after a tap
   until the next tap elsewhere, which would otherwise leave the button visibly enlarged. */
@media (hover: hover) and (pointer: fine) {
    .start-btn:hover {
        background-color: var(--theme-accent-strong);
        transform: scale(1.05);
    }
}

@media (max-width: 1100px) {
    .home-hero {
        grid-template-columns: 1fr;
    }

    .home-grid-three,
    .home-grid-five {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .home-background {
        padding: 12px 10px 28px;
    }

    .home-page {
        gap: 12px;
    }

    .home-hero-copy,
    .home-card,
    .home-feature-body {
        padding: 14px;
    }

    .home-hero-copy,
    .home-card,
    .home-feature-body {
        border-radius: 18px;
    }

    .home-hero {
        gap: 12px;
    }

    .home-hero-copy {
        padding-top: 14px;
        padding-bottom: 12px;
        padding-inline: 12px;
    }

    .home-hero-note {
        margin-top: 10px;
        font-size: 0.95rem;
    }

    .home-grid-three,
    .home-grid-two,
    .home-grid-five {
        grid-template-columns: 1fr;
    }

    .home-card {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .home-section {
        gap: 10px;
    }

    .home-section-head h2 {
        font-size: 1.12rem;
    }

    .home-card-banner {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 10px;
    }

    .home-card-art {
        width: 44px;
        height: 44px;
        border-radius: 10px;
    }

    .home-card-art img {
        padding: 5px;
    }

    .home-card-copy {
        padding-left: 6px;
        display: flex;
        align-items: baseline;
        gap: 6px;
        flex-wrap: wrap;
    }

    /* Game name and player-count subtitle share one line ("TABLIC 2/4") instead of
       stacking - the count buttons below already spell out "2 Players" / "4 Players"
       in full, so the header only needs to name the game. */
    .home-card-subtitle {
        margin-top: 0;
    }

    .home-choice-grid {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .home-choice-btn {
        flex: 1 1 0;
        min-width: 90px;
    }

    .home-feature-media {
        min-height: 140px;
    }

    .home-feature-media .home-theme-image,
    .home-theme-image {
        padding: 10px;
    }

    .home-card-copy h3,
    .home-feature-body h3 {
        margin-top: 6px;
        font-size: 1.08rem;
    }

    .home-card-subtitle,
    .home-feature-note {
        margin-top: 4px;
        font-size: 1.2rem;
    }

    .home-choice-btn {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        text-align: center;
        gap: 6px;
        min-height: 36px;
        padding: 8px 12px;
        border-radius: 11px;
        white-space: nowrap;
    }

    .home-choice-count {
        display: inline;
        text-align: center;
        font-size: 0.86rem;
        text-transform: uppercase;
    }

    .home-choice-label {
        display: inline;
        font-size: 0.86rem;
        text-transform: uppercase;
    }

    /* Buttons with a label (the solo Beginner/Pro bot buttons) need their own line
       each - forcing them onto the same row as the count (like the label-less
       2/3/4-player buttons) overflows and clips the count text. */
    .home-choice-btn:has(.home-choice-label) {
        flex-direction: column;
        white-space: normal;
    }

    .home-puzzle-actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .home-hero h1 {
        font-size: 1.8rem;
    }

    .home-hero-copy {
        padding-top: 6px;
        padding-bottom: 10px;
        padding-inline: 10px;
    }

    .home-hero-note {
        line-height: 1.45;
    }

    .home-choice-btn {
        min-height: 36px;
    }

    .home-card-copy {
        padding-left: 8px;
    }

    .home-choice-btn {
        min-height: 36px;
        padding: 8px 12px;
    }
}

.start-action-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.start-chat-launch {
    width: 48px;
    min-width: 48px;
    padding: 0;
}

.input-field {
    width: 90%;
    max-width: 126px;
    padding: 10px 15px;
    margin-top: 20px;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: var(--game-text);
    background-color: var(--game-input-bg);
    border: 2px solid var(--game-border);
    border-radius: 10px;
    box-shadow: var(--game-shadow);
    outline: none;
    transition: border 0.3s ease, box-shadow 0.3s ease;
}

/* No transform:scale here on purpose - growing the field on focus visibly shifts/"wobbles"
   the login form on mobile (the field and everything around it briefly resizes). The border
   + glow give the same "focused" feedback without moving anything. */
.input-field:focus {
    border: 2px solid var(--game-border-hover);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--game-border-hover) 30%, transparent);
}

/* Target score input (Tablic/Zandar/Sedmice "Spiel bis" field) - reuses
   .input-field's border/focus-glow so it reads as editable the same way the
   name field does, just narrower since it only ever holds 2-3 digits. */
.target-score-row {
    display: flex;
    justify-content: center;
}

.target-score-input {
    width: 80px;
    max-width: 80px;
    text-align: center;
    margin-top: 4px;
    margin-bottom: 12px;
}

.target-score-hint {
    margin-top: -4px;
    margin-bottom: 16px;
    font-size: 0.85em;
    color: var(--theme-text-muted, var(--game-text));
    opacity: 0.85;
}

.menu-button {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    background-color: var(--theme-surface-3);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    border: 1px solid var(--theme-border);
    padding: 0;
}

.menu-button:hover {
    background-color: var(--theme-accent-soft);
    border-color: var(--theme-border-strong);
}

.menu-button-line {
    width: 18px;
    height: 2px;
    background-color: var(--theme-text-strong);
    border-radius: 1px;
    margin: 2px 0;
}

.image-card {
    width: 60%;
    max-width: 400px;
    border-radius: 3%;
    overflow: hidden;
    background: #000;
}

.image-card img {
    width: 100%;
    height: auto;
    display: block;
}

.share-container {
    background: var(--theme-panel);
    padding: 28px 24px 10px;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgb(0 0 0 / 0.12);
    max-width: 380px;
    width: 100%;
    box-sizing: border-box;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    margin-bottom: 16px;
    background-color: var(--theme-surface-3);
    border-radius: 12px;
    border: 1.5px solid var(--theme-border);
    color: var(--theme-text-strong);
    font-weight: 500;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    box-sizing: border-box;
    width: auto;
    max-width: 100%;
}

.share-button:hover,
.share-button:focus {
    background-color: var(--theme-surface-4);
    border-color: var(--theme-border-strong);
    color: var(--theme-text-strong);
}

.share-button img {
    width: 28px;
    height: 28px;
    filter: none;
}

#audioBar {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    height: 52px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 10px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--audio-bar-bg-top), var(--audio-bar-bg-bottom));
    color: var(--theme-text-strong);
    border: 1px solid var(--audio-bar-border);
    box-shadow: var(--audio-bar-shadow);
    z-index: 10040;
    justify-content: center;
}

#status {
    flex: 1 1 auto;
    min-width: 0;
    font: 13px/1.2 system-ui,-apple-system,Segoe UI,Roboto,Arial;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    margin-right: auto;
}

#audioBar button {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    height: 36px;
    min-width: 36px;
    padding: 0 10px;
    border: 1px solid var(--audio-button-border);
    border-radius: 10px;
    font: 12px/1 system-ui,-apple-system,Segoe UI,Roboto,Arial;
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    background: linear-gradient(180deg, var(--audio-button-bg-top), var(--audio-button-bg-bottom));
    color: var(--audio-button-text);
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.audio-button-text {
    margin-left: 6px;
}

#audioBar button:hover:not(:disabled) {
    transform: translateY(-1px);
    border-color: var(--audio-button-hover-border);
}

.tablic-name-with-presence {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.tablic-name-text {
    display: inline-block;
}

.tablic-presence-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: #9aa0a6;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tablic-presence-dot.is-online {
    background: #32c16c;
}

.tablic-presence-dot.is-recent {
    background: #f1c84a;
}

.tablic-presence-dot.is-offline {
    background: #9aa0a6;
}

.game-table-name-presence .tablic-presence-dot {
    width: 12px;
    height: 12px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 0 2px rgba(0, 0, 0, 0.08);
}

/* "vs Computer" opponent: a plain online/offline dot would look identical to a real
   human being online, giving no actual visual distinction between the two. Shown
   instead of the presence dot whenever the seat is the bot - same accent-colored
   desktop icon already used for the profile history list's bot rows
   (.profile-connection-bot-icon) and the "1 Player" menu buttons, for one consistent
   "this is the computer" visual language across the whole site. */
.tablic-presence-bot-icon {
    font-size: 14px;
    line-height: 1;
    flex: 0 0 auto;
    color: var(--theme-accent, currentColor);
}

.game-table-name-presence .tablic-presence-bot-icon {
    font-size: 16px;
}

#muteBtn {
    background: linear-gradient(180deg, var(--audio-mute-bg-top), var(--audio-mute-bg-bottom));
    color: var(--audio-mute-text);
}

#callBtn {
    background: linear-gradient(180deg, var(--audio-call-bg-top), var(--audio-call-bg-bottom));
    color: var(--audio-call-text);
    font-weight: 600;
}

#callBtn.hangup {
    background: linear-gradient(180deg, var(--audio-hangup-bg-top), var(--audio-hangup-bg-bottom));
    color: var(--audio-hangup-text);
}

#muteBtn:disabled,
#callBtn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#jitsiWrap {
    position: fixed;
    width: 2px;
    height: 2px;
    left: 0;
    top: 0;
    opacity: 0.01;
    pointer-events: none;
    overflow: hidden;
}

.game-chat-dock[hidden] {
    display: none;
}

.game-chat-panel[hidden] {
    display: none;
}

.game-confirm-modal[hidden] {
    display: none;
}

.game-chat-dock {
    position: fixed;
    right: 12px;
    bottom: 88px;
    z-index: 10039;
    display: grid;
    justify-items: end;
    gap: 10px;
}

.game-chat-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.game-floating-action,
.game-chat-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    background: linear-gradient(180deg, var(--theme-surface-1), var(--theme-surface-2));
    color: var(--theme-text-strong);
    box-shadow: var(--audio-bar-shadow);
    cursor: pointer;
    position: relative;
}

.game-floating-action {
    display: none;
}

.game-floating-action-continue {
    background: linear-gradient(180deg, #2f9d63, #1f7348);
    color: #ffffff;
    border-color: rgba(90, 214, 145, 0.48);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(90, 214, 145, 0.14);
}

.game-floating-action-new {
    background: linear-gradient(180deg, #d95d5d, #a83f3f);
    color: #ffffff;
    border-color: rgba(255, 128, 128, 0.5);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 128, 128, 0.14);
}

.game-floating-action:disabled {
    background: linear-gradient(180deg, var(--theme-surface-1), var(--theme-surface-2));
    color: var(--theme-text-muted);
    border-color: var(--theme-border);
    box-shadow: var(--audio-bar-shadow);
    opacity: 0.62;
    cursor: default;
    filter: none;
}

html[data-theme="light"] .game-floating-action-continue,
body[data-theme="light"] .game-floating-action-continue {
    background: linear-gradient(180deg, #22844b, #176738);
    color: #ffffff;
    border-color: rgba(20, 116, 63, 0.32);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(20, 116, 63, 0.08);
}

html[data-theme="light"] .game-floating-action-new,
body[data-theme="light"] .game-floating-action-new {
    background: linear-gradient(180deg, #c84d4d, #9f3535);
    color: #ffffff;
    border-color: rgba(157, 53, 53, 0.3);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(157, 53, 53, 0.08);
}

html[data-theme="light"] .game-floating-action:disabled,
body[data-theme="light"] .game-floating-action:disabled {
    background: linear-gradient(180deg, #ffffff, #e7eef8);
    color: rgba(23, 37, 58, 0.48);
    border-color: rgba(23, 37, 58, 0.12);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.game-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    transition: opacity 160ms ease;
}

.game-confirm-modal.is-visible {
    opacity: 1;
}

.game-confirm-modal .game-confirm-card {
    transform: scale(0.94);
    transition: transform 160ms ease;
}

.game-confirm-modal.is-visible .game-confirm-card {
    transform: scale(1);
}

.game-confirm-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 22, 0.72);
    backdrop-filter: blur(6px);
}

.game-confirm-card {
    position: relative;
    width: min(420px, 100%);
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--theme-panel) 97%, transparent);
    color: var(--theme-text-strong);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    padding: 24px 18px 16px;
    text-align: center;
}

.game-confirm-close {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    background: color-mix(in srgb, var(--theme-surface-2) 94%, transparent);
    color: var(--theme-text-strong);
    cursor: pointer;
}

.game-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--theme-danger) 16%, var(--theme-surface-2));
    color: var(--theme-danger);
}

.game-confirm-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.game-confirm-text {
    color: var(--theme-text-muted);
    font-size: 1rem;
    line-height: 1.45;
    margin: 0 auto 18px;
    max-width: 34rem;
}

.game-confirm-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.game-rules-floating-button {
    position: fixed;
    left: 12px;
    bottom: 88px;
    z-index: 10039;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid var(--theme-border);
    background: color-mix(in srgb, var(--theme-surface-2) 92%, transparent);
    color: var(--theme-text-strong);
    font-size: 1.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.game-rules-floating-button:hover {
    border-color: var(--theme-border-strong);
}

@media (max-width: 900px) {
    .game-rules-floating-button {
        left: max(12px, env(safe-area-inset-left));
        bottom: calc(88px + env(safe-area-inset-bottom));
    }
}

.game-confirm-card-wide {
    width: min(560px, 100%);
    text-align: left;
}

.game-confirm-card-wide .game-confirm-title {
    text-align: center;
}

.game-rules-steps {
    margin: 0;
    padding: 0 0 0 22px;
    color: var(--theme-text-strong);
    font-size: 0.98rem;
    line-height: 1.5;
}

.game-rules-steps li {
    margin-bottom: 14px;
}

.game-rules-steps li:last-child {
    margin-bottom: 0;
}

.game-rules-example {
    margin-top: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--theme-accent-soft) 82%, var(--theme-surface-2));
    border: 1px solid color-mix(in srgb, var(--theme-accent) 24%, var(--theme-border));
    color: var(--theme-text-muted);
    font-size: 0.92rem;
}

.game-rules-feedback-note {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--theme-border);
    color: var(--theme-text-muted);
    font-size: 0.98rem;
    line-height: 1.45;
}

.game-rules-feedback-link {
    color: var(--theme-accent);
    font-weight: 700;
    text-decoration: underline;
}

.game-confirm-button {
    min-height: 42px;
    border: 1px solid var(--theme-border);
    border-radius: 8px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 100ms ease;
}

.game-confirm-button:active {
    transform: scale(0.95);
    transition-duration: 80ms;
}

.game-confirm-button-secondary {
    background: linear-gradient(180deg, var(--theme-surface-1), var(--theme-surface-2));
    color: var(--theme-text-strong);
}

.game-confirm-button-danger {
    background: linear-gradient(180deg, #d95d5d, #a83f3f);
    color: #ffffff;
    border-color: rgba(255, 128, 128, 0.5);
}

.developer-modal[hidden] {
    display: none;
}

.developer-modal {
    position: fixed;
    inset: 0;
    z-index: 10030;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.developer-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 12, 22, 0.72);
    backdrop-filter: blur(6px);
}

.developer-modal-card {
    position: relative;
    width: min(380px, 100%);
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 28px 18px 22px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-panel) 97%, transparent);
    color: var(--theme-text-strong);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    text-align: center;
}

.developer-modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
}

.developer-logo {
    width: 112px;
    height: 112px;
    margin-bottom: 8px;
    border-radius: 24px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.22);
}

.developer-title {
    font-size: 1.35rem;
    font-weight: 800;
}

.developer-label {
    color: var(--theme-text-muted);
    font-size: .82rem;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.developer-name {
    font-size: 1.25rem;
    font-weight: 800;
}

.developer-location {
    color: var(--theme-text-muted);
    font-size: .95rem;
    font-weight: 700;
}

.developer-email {
    color: var(--theme-accent);
    font-weight: 700;
    text-decoration: none;
}

.developer-email:hover,
.developer-email:focus-visible {
    text-decoration: underline;
}

html[data-theme="light"] .game-confirm-button-danger,
body[data-theme="light"] .game-confirm-button-danger {
    background: linear-gradient(180deg, #c84d4d, #9f3535);
    border-color: rgba(157, 53, 53, 0.3);
}

.game-floating-action:not(:disabled):hover,
.game-chat-toggle:hover {
    transform: translateY(-1px);
    border-color: var(--theme-border-strong);
}

.game-chat-toggle-inline {
    min-width: 48px;
    width: auto;
    padding: 0 12px;
    gap: 8px;
}

#audioBar .game-chat-toggle-inline {
    height: 36px;
    border-radius: 10px;
}

.game-chat-toggle-text {
    display: none;
}

#audioBar .game-chat-toggle-text {
    display: inline;
}

.game-chat-unread {
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--theme-danger);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -4px;
    right: -4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.game-chat-panel {
    width: min(360px, calc(100vw - 24px));
    max-height: min(360px, calc(var(--app-stable-height) - 176px));
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid var(--theme-border);
    background: color-mix(in srgb, var(--theme-panel) 96%, transparent);
    box-shadow: var(--audio-bar-shadow);
    backdrop-filter: blur(10px);
}

.game-chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.game-chat-title-wrap {
    min-width: 0;
}

.game-chat-title {
    color: var(--theme-text-strong);
    font-size: 1rem;
    font-weight: 800;
}

.game-chat-subtitle {
    color: var(--theme-text-muted);
    font-size: 0.76rem;
    margin-top: 2px;
}

.game-chat-close {
    width: 36px;
    height: 36px;
}

.game-chat-messages {
    min-height: 0;
    overflow-y: auto;
    display: grid;
    gap: 8px;
    padding-right: 4px;
}

.game-chat-empty {
    display: none;
    color: var(--theme-text-muted);
    font-size: 0.88rem;
}

.game-chat-message {
    max-width: 90%;
    display: grid;
    gap: 3px;
    padding: 8px 10px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--theme-surface-2) 95%, white 5%);
    border: 1px solid var(--theme-border);
}

.game-chat-message-own {
    justify-self: end;
    background: color-mix(in srgb, var(--theme-accent-soft) 88%, var(--theme-surface-2));
    border-color: color-mix(in srgb, var(--theme-accent) 34%, var(--theme-border));
}

.game-chat-message-meta {
    color: var(--theme-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

.game-chat-message-text {
    color: var(--theme-text-strong);
    font-size: 0.92rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.game-chat-status {
    min-height: 18px;
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

.game-chat-emoji-wrap {
    position: relative;
}

.game-chat-emoji-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-surface-2) 96%, white 4%);
    color: var(--theme-text-strong);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.game-chat-emoji-panel[hidden] {
    display: none;
}

.game-chat-emoji-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    display: grid;
    grid-template-columns: repeat(3, 32px);
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-panel) 98%, transparent);
    box-shadow: var(--audio-bar-shadow);
    z-index: 2;
}

.game-chat-emoji-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--theme-surface-2) 96%, white 4%);
    color: var(--theme-text-strong);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.game-chat-emoji-btn:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
    background: color-mix(in srgb, var(--theme-accent-soft) 85%, var(--theme-surface-2));
}

.game-chat-compose {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.game-chat-input {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--theme-border);
    background: var(--theme-input-bg);
    color: var(--theme-text-strong);
    box-sizing: border-box;
}

.game-chat-send {
    min-width: 84px;
    font-size: 0.95rem;
}

.profile-modal[hidden] {
    display: none;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 12px;
    box-sizing: border-box;
    -webkit-overflow-scrolling: touch;
    height: var(--app-stable-height);
    overscroll-behavior: contain;
}

.profile-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.64);
}

.profile-modal-card {
    position: relative;
    width: min(460px, calc(100vw - 24px));
    margin: 64px auto 24px;
    background-color: color-mix(in srgb, var(--theme-surface-1) 96%, white 4%);
    background-image: none;
    border: 1px solid var(--theme-border);
    border-radius: 18px;
    box-shadow: var(--game-shadow-strong);
    padding: 20px;
    box-sizing: border-box;
    opacity: 1;
    display: flex;
    flex-direction: column;
    overflow: visible;
    overscroll-behavior: contain;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-modal-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--theme-text-strong);
}

.profile-modal-subtitle {
    margin-top: 6px;
    color: var(--theme-text-muted);
    font-size: 0.98rem;
    line-height: 1.35;
}

.profile-close-button {
    flex: 0 0 auto;
}

.profile-modal-body {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-height: 0;
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 4px;
}

.profile-top-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 42%);
    gap: 12px;
    align-items: end;
}

.profile-top-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.profile-top-field-id {
    align-self: stretch;
}

.profile-current-game-id {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-accent-soft) 82%, var(--theme-surface-2));
    border: 1px solid color-mix(in srgb, var(--theme-accent) 24%, var(--theme-border));
    color: var(--theme-text-strong);
    font-size: 0.98rem;
    font-weight: 800;
    overflow-wrap: anywhere;
    box-sizing: border-box;
}

.profile-meta-group {
    display: grid;
    gap: 8px;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 4px;
}

.profile-stat-card {
    display: grid;
    gap: 4px;
    padding: 13px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-surface-3) 92%, transparent), color-mix(in srgb, var(--theme-surface-3) 70%, transparent));
    border: 1px solid var(--theme-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.profile-stat-card-accent {
    border-color: color-mix(in srgb, var(--theme-accent) 32%, var(--theme-border));
    background: linear-gradient(180deg, color-mix(in srgb, var(--theme-accent-soft) 82%, var(--theme-surface-3)), color-mix(in srgb, var(--theme-surface-3) 88%, transparent));
}

.profile-stat-card-wide {
    grid-column: 1 / -1;
    gap: 3px;
}

.profile-stat-card-hidden {
    display: none;
}

.profile-stat-label {
    font-size: 0.86rem;
    color: var(--theme-text-muted);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.profile-stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--theme-text-strong);
    overflow-wrap: anywhere;
    line-height: 1.2;
}

.profile-stat-meta {
    font-size: 0.86rem;
    color: var(--theme-text-muted);
}

.profile-field-label {
    font-size: 0.95rem;
    color: var(--theme-text-muted);
    margin-bottom: -4px;
}

.profile-input {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
}

.profile-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    padding: 9px 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-border) 68%, transparent);
}

.profile-meta-row-featured {
    padding: 12px 14px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--theme-accent-soft) 82%, var(--theme-surface-2));
    border: 1px solid color-mix(in srgb, var(--theme-accent) 30%, var(--theme-border));
    border-bottom-color: color-mix(in srgb, var(--theme-accent) 30%, var(--theme-border));
    margin-bottom: 4px;
}

.profile-meta-row-technical {
    opacity: 0.88;
}

.profile-meta-row-hidden {
    display: none;
}

.profile-meta-group .profile-meta-row:last-child {
    border-bottom: 0;
}

.profile-meta-label {
    color: var(--theme-text-muted);
    font-size: 0.92rem;
}

.profile-meta-value {
    color: var(--theme-text-strong);
    text-align: right;
    overflow-wrap: anywhere;
    font-size: 0.92rem;
}

.profile-meta-value-strong {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: 0.03em;
}

.profile-meta-value-technical {
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 0.84rem;
    color: var(--theme-text-muted);
}

.profile-status {
    min-height: 0;
    color: var(--theme-text-muted);
    font-size: 0.95rem;
    padding-top: 0;
}

.profile-connections-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 4px;
    min-height: 0;
    flex: 0 0 auto;
}

.profile-connections-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.profile-connections-title {
    font-size: 0.95rem;
    color: var(--theme-text-muted);
}

.profile-connections-note {
    color: var(--theme-text-muted);
    font-size: 0.82rem;
    line-height: 1.3;
}

.profile-connections-empty {
    color: var(--theme-text-muted);
    font-size: 0.92rem;
    padding: 10px 0 2px;
}

.profile-connections-list {
    display: grid;
    align-content: start;
    grid-auto-rows: max-content;
    gap: 8px;
    min-height: 0;
    max-height: none;
    flex: 0 0 auto;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.profile-connection-card {
    display: grid;
    gap: 6px;
    padding: 10px 12px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--theme-surface-3) 96%, white 4%);
    border: 1px solid var(--theme-border);
}

.profile-connection-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
}

.profile-connection-line {
    color: var(--theme-text-strong);
    font-size: 0.92rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    line-height: 1.28;
}

.profile-connection-summary {
    color: var(--theme-text-muted);
    display: inline-block;
    font-size: 0.84rem;
    font-weight: 600;
    margin-left: 6px;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.profile-connection-meta {
    color: var(--theme-text-muted);
    font-size: 0.8rem;
}

.profile-connection-id {
    color: var(--theme-accent);
    font-weight: 700;
}

.profile-connection-players {
    display: inline;
}

.profile-connection-player {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.profile-connection-presence {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    flex: 0 0 9px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
    transform: translateY(0.5px);
}

.profile-connection-presence.is-online {
    background: #39c36f;
    box-shadow: 0 0 0 3px color-mix(in srgb, #39c36f 18%, transparent), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.profile-connection-bot-icon {
    font-size: 14px;
    line-height: 1;
    color: var(--theme-accent, currentColor);
}

.profile-connection-presence.is-recent {
    background: #d8a629;
    box-shadow: 0 0 0 3px color-mix(in srgb, #d8a629 16%, transparent), inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.profile-connection-presence.is-offline {
    background: color-mix(in srgb, var(--theme-text-muted) 60%, var(--theme-surface-2));
}

.profile-connection-live {
    display: inline-flex;
    align-items: center;
    margin-left: 7px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    background: color-mix(in srgb, #2f9d63 20%, var(--theme-surface-2));
    border: 1px solid color-mix(in srgb, #2f9d63 46%, var(--theme-border));
    color: color-mix(in srgb, #2f9d63 88%, var(--theme-text-strong));
    vertical-align: middle;
}

.profile-game-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    margin-right: 5px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border: 1px solid color-mix(in srgb, var(--theme-border) 80%, transparent);
    background: color-mix(in srgb, var(--theme-surface-2) 96%, white 4%);
    color: var(--theme-text-strong);
    vertical-align: middle;
}

.profile-game-badge-zandar {
    background: color-mix(in srgb, #c86a3d 18%, var(--theme-surface-2));
    border-color: color-mix(in srgb, #c86a3d 42%, var(--theme-border));
}

.profile-game-badge-tablic {
    background: color-mix(in srgb, #2f8f6b 18%, var(--theme-surface-2));
    border-color: color-mix(in srgb, #2f8f6b 42%, var(--theme-border));
}

.profile-game-badge-tac {
    background: color-mix(in srgb, #356ec9 18%, var(--theme-surface-2));
    border-color: color-mix(in srgb, #356ec9 42%, var(--theme-border));
}

.profile-game-badge-sedmice {
    background: color-mix(in srgb, #9457d1 18%, var(--theme-surface-2));
    border-color: color-mix(in srgb, #9457d1 42%, var(--theme-border));
}

.profile-connection-actions {
    display: flex;
    gap: 5px;
    justify-content: flex-end;
}

.profile-connection-icon-btn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    border: 1px solid var(--theme-border);
    background: color-mix(in srgb, var(--theme-surface-2) 96%, white 4%);
    color: var(--theme-text-strong);
    cursor: pointer;
    transition: transform 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.profile-connection-icon-btn-open {
    background: color-mix(in srgb, var(--theme-accent-soft) 85%, var(--theme-surface-2));
    border-color: color-mix(in srgb, var(--theme-accent) 42%, var(--theme-border));
    color: var(--theme-text-strong);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.profile-connection-icon-btn:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--theme-accent) 35%, var(--theme-border));
}

.profile-connection-icon-btn-open:hover {
    border-color: color-mix(in srgb, var(--theme-accent) 62%, var(--theme-border));
    background: color-mix(in srgb, var(--theme-accent-soft) 94%, var(--theme-surface-2));
}

.profile-connection-icon-btn .mdi {
    font-size: 1.12rem;
}

.profile-connection-icon-btn-delete {
    color: color-mix(in srgb, #d94b4b 82%, var(--theme-text-strong));
}

.profile-connection-icon-btn-delete:hover {
    border-color: color-mix(in srgb, #d94b4b 48%, var(--theme-border));
}

.profile-connection-icon-btn-delete-all {
    width: auto;
    min-width: 40px;
    padding: 0 10px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.profile-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 0;
    flex-wrap: wrap;
    flex: 0 0 auto;
    z-index: 1;
    padding-top: 0;
    background: transparent;
    border-top: 0;
}

.profile-modal-actions .start-btn {
    min-width: 110px;
}

@media (max-width: 768px) {
    .app-nav {
        --nav-inline-padding: 12px;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 12px var(--nav-inline-padding);
        gap: 6px;
    }

    .home-link {
        width: auto;
        min-width: 0;
        max-width: none;
        margin-left: 0;
    }

    .nav-actions {
        gap: 6px;
        padding-left: 0;
        border-left: 0;
    }

    #urlGlobal[hidden] {
        display: none !important;
    }

    .language-dropdown {
        margin-right: 0;
        min-width: 0;
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 1rem;
    }

    .nav-profile-button {
        padding: 0;
        width: 40px;
        min-width: 40px;
        border-radius: 12px;
        justify-content: center;
    }

    .nav-profile-text {
        display: none;
    }

    .profile-modal-card {
        margin-top: 0;
        padding: 16px;
        max-height: calc(var(--app-stable-height) - 24px);
    }

    .profile-connections-list {
        min-height: 250px;
        max-height: min(40dvh, calc(var(--app-stable-height) - 320px));
    }

    .game-chat-dock {
        left: auto;
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(88px + env(safe-area-inset-bottom));
        width: min(360px, calc(100vw - 24px));
        justify-items: end;
    }

    .game-chat-actions {
        justify-self: end;
    }

    .game-chat-toggle {
        width: 48px;
        justify-self: end;
    }

    #audioBar .game-chat-toggle-inline {
        width: auto;
        min-width: 48px;
        max-width: 92px;
        padding: 0 10px;
        flex: 0 0 auto;
    }

    #audioBar {
        left: 8px;
        right: 8px;
        bottom: 8px;
        height: 52px;
        gap: 6px;
        padding: 6px 8px;
        flex-wrap: nowrap;
        box-sizing: border-box;
    }

    #status {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: auto;
        text-align: left;
    }

    #audioBar button {
        min-width: 36px;
        max-width: 100%;
        padding: 0 8px;
    }

    #muteBtn {
        width: auto;
        min-width: 40px;
        max-width: 88px;
    }

    #callBtn {
        width: auto;
        min-width: 40px;
        max-width: 104px;
    }

    #audioBar .audio-button-text,
    #audioBar .game-chat-toggle-text {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .game-chat-panel {
        width: 100%;
        max-height: min(340px, calc(var(--app-stable-height) - 170px));
    }

    .game-chat-message {
        max-width: 100%;
    }

    .profile-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-meta-value {
        text-align: left;
    }

    .profile-modal-actions {
        justify-content: stretch;
    }

    .profile-modal-actions .start-btn {
        width: 100%;
    }

    .profile-connection-top {
        grid-template-columns: 1fr;
    }

    .profile-connection-actions {
        justify-content: flex-start;
    }

    .input-field,
    .profile-input,
    .game-chat-input {
        font-size: 16px !important;
    }
}

@media (max-width: 520px) {
    .app-nav {
        --nav-inline-padding: 8px;
        padding: 12px var(--nav-inline-padding);
        gap: 6px;
    }

    .nav-actions {
        gap: 4px;
    }

    .language-dropdown {
        width: 40px;
        padding: 0;
        font-size: 1rem;
    }
}

@media (max-width: 380px) {
    #muteBtn .audio-button-text {
        display: none;
    }

    #muteBtn {
        width: 40px;
        padding: 0;
    }
}
