/* Additional responsive layer kept separate according to the planned structure. */
@media (max-width: 900px) {
    .topbar {
        gap: 12px;
    }

    .topbar-actions {
        margin-left: 0;
    }
}

@media (max-width: 760px) {
    .calendar-toolbar {
        flex-wrap: wrap;
    }

    .calendar-toolbar strong {
        width: 100%;
        text-align: center;
        order: -1;
    }

    .calendar-tabs {
        width: 100%;
    }

    .calendar-tabs a {
        flex: 1;
        text-align: center;
    }

    .data-table th,
    .data-table td {
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .page {
        padding: 12px;
    }

    .calendar-grid-month {
        font-size: 11px;
    }

    .event {
        padding: 5px;
        font-size: 11px;
    }
}

/* Mobile viewport fit fixes: keep the application inside the device width. */
html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

img,
video,
canvas,
svg {
    max-width: 100%;
}

.app-shell,
.page,
.panel,
.dashboard-grid,
.calendar-layout,
.calendar-main,
.selected-tournament,
.news-card,
.news-body,
.player-card-profile,
.public-player-card {
    min-width: 0;
    max-width: 100%;
}

.calendar-grid,
.calendar-grid-month,
.calendar-grid-week,
.calendar-grid-day {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.calendar-grid-month,
.calendar-grid-week {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-grid-week .day-name,
.calendar-grid-week .calendar-day,
.calendar-grid-month .day-name,
.calendar-grid-month .calendar-day {
    min-width: 0;
}

.event {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.event span,
.event small,
.month-tournament-card strong,
.month-tournament-card small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 760px) {
    .page {
        width: 100%;
        padding: 10px;
    }

    .dashboard-grid,
    .calendar-layout,
    .detail-layout {
        width: 100%;
        grid-template-columns: minmax(0, 1fr);
    }

    .panel-news,
    .panel-calendar,
    .wide-panel,
    .detail-main,
    .detail-side,
    .login-card {
        padding: 12px;
    }

    .calendar-grid-month,
    .calendar-grid-week {
        grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
        font-size: 11px;
    }

    .calendar-day {
        min-height: 66px;
        padding: 4px 3px;
    }

    .calendar-grid-week .calendar-day {
        min-height: 86px;
        padding: 4px 3px;
    }

    .calendar-day-number {
        min-width: 20px;
        height: 20px;
        font-size: 12px;
    }

    .calendar-day-create {
        gap: 2px;
        padding-right: 1px;
    }

    .calendar-create-plus {
        width: 14px;
        height: 14px;
        font-size: 10px;
    }

    .event,
    .calendar-grid-week .event {
        margin-top: 3px;
        padding: 3px 2px;
        border-radius: 6px;
        font-size: 9px;
        line-height: 1.15;
    }

    .event small,
    .calendar-grid-week .event small {
        font-size: 8px;
        line-height: 1.1;
    }

    .month-tournament-card {
        padding: 9px;
    }
}

@media (max-width: 420px) {
    .topbar {
        padding: 8px 10px;
    }

    .topbar-actions {
        width: 100%;
        justify-content: space-between;
    }

    .admin-badge {
        max-width: 54vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .calendar-tabs a,
    .calendar-nav-button {
        padding: 7px 8px;
        min-height: 34px;
        font-size: 13px;
    }

    .calendar-toolbar {
        gap: 6px;
    }

    .calendar-grid-month,
    .calendar-grid-week {
        font-size: 10px;
    }

    .day-name {
        padding: 6px 2px;
    }

    .calendar-day {
        min-height: 60px;
    }

    .calendar-grid-week .calendar-day {
        min-height: 78px;
    }
}

@media (max-width: 360px) {
    .page {
        padding: 8px;
    }

    .panel-news,
    .panel-calendar,
    .wide-panel,
    .detail-main,
    .detail-side,
    .login-card {
        padding: 10px;
    }

    .calendar-tabs a,
    .calendar-nav-button {
        padding-left: 6px;
        padding-right: 6px;
    }

    .calendar-grid-month,
    .calendar-grid-week {
        font-size: 9px;
    }

    .event,
    .calendar-grid-week .event {
        font-size: 8px;
    }
}

/* === Modern UI v2 responsive overrides === */
@media (max-width: 1120px) {
    /* The sidebar becomes an overlay in this range, so the application must
       use a single grid track. Keeping the old zero-width sidebar track made
       the backdrop consume the content track and pushed .app-main into the
       zero-width column between 761 and 1120 px. */
    .app-shell-modern {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .app-shell-modern > .app-main {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100%;
        min-width: 0;
    }

    .app-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 300px);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .app-shell-modern.is-sidebar-open .app-sidebar {
        transform: translateX(0);
    }

    .mobile-menu-backdrop {
        position: fixed;
        inset: 0;
        z-index: 110;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(2, 8, 18, 0.62);
        backdrop-filter: blur(3px);
        transition: opacity 180ms ease;
    }

    .app-shell-modern.is-sidebar-open .mobile-menu-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-menu-button {
        display: inline-grid !important;
        place-items: center;
        flex: 0 0 42px;
        width: 42px;
        height: 42px;
        padding: 8px;
        border: 1px solid var(--ui-panel-border);
        border-radius: 14px;
        background: rgba(255, 255, 255, 0.65);
    }

    html[data-theme="dark"] .mobile-menu-button {
        background: rgba(28, 44, 73, 0.88);
    }

    .mobile-menu-button span {
        width: 20px;
        margin: 2px 0;
        background: var(--ui-text) !important;
    }

    .app-shell-modern .topbar {
        align-items: flex-start;
    }
}

@media (max-width: 900px) {
    .app-shell-modern .topbar {
        min-height: 68px;
        padding: 12px 14px 8px;
        gap: 10px;
    }

    .topbar-title strong {
        font-size: 24px;
    }

    .topbar-title span {
        font-size: 10px;
    }

    .app-shell-modern .page {
        padding: 10px 14px 18px;
    }

    .dashboard-grid,
    .detail-layout,
    .league-ui-layout,
    .league-fixture-layout,
    .calendar-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .section-header {
        align-items: stretch;
        flex-direction: column;
    }

    .section-actions,
    .topbar-actions {
        justify-content: flex-start !important;
    }

    .league-ui-hero {
        grid-template-columns: minmax(0, 1fr) !important;
        padding: 22px !important;
    }
}

@media (max-width: 680px) {
    .topbar-title {
        flex: 1 1 100%;
        order: 2;
    }

    .app-shell-modern .topbar-actions {
        width: 100%;
        order: 3;
    }

    .app-shell-modern .topbar-actions .admin-badge {
        max-width: 100%;
    }

    .lang-dropdown,
    .theme-toggle,
    .app-shell-modern .topbar-actions .btn-outline {
        flex: 1 1 auto;
    }

    .wide-panel,
    .panel-news,
    .panel-calendar,
    .detail-main,
    .detail-side,
    .login-card,
    .auth-card {
        padding: 14px !important;
        border-radius: 20px !important;
    }

    .section-header h1,
    .detail-title h1,
    .auth-card h1,
    .player-management-heading h1 {
        font-size: 28px;
    }

    .filters-row,
    .form-grid.two-columns,
    .form-grid.three-columns,
    .smtp-template-grid,
    .player-card-main-grid,
    .player-sport-card-grid,
    .public-visibility-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .btn,
    button.btn,
    a.btn,
    .select-control,
    input,
    select {
        min-height: 42px;
    }

    .tabs,
    .league-ui-tabs,
    .calendar-tabs {
        gap: 6px;
        padding: 6px;
    }

    .tabs a,
    .tabs button,
    .league-ui-tabs button,
    .calendar-tabs a,
    .calendar-tabs button {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .app-sidebar {
        width: min(88vw, 300px);
        padding: 16px 14px 22px;
    }

    .app-sidebar .brand-text {
        font-size: 17px;
    }

    .app-shell-modern .topbar {
        padding-left: 10px;
        padding-right: 10px;
    }

    .app-shell-modern .page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .topbar-title strong {
        font-size: 22px;
    }

    .app-shell-modern .topbar-actions {
        gap: 7px;
    }

    .lang-dropdown-toggle,
    .theme-toggle,
    .app-shell-modern .topbar-actions .btn-outline {
        padding-left: 10px;
        padding-right: 10px;
        font-size: 13px;
    }
}

/* === v12 - scoped news boldness, readable calendar side list and mobile-first usability === */
/* Keep the stronger bold effect where it was requested: in news text/editor only. */
body,
input,
select,
textarea,
.news-body,
.data-table td,
.form-field span,
.hint,
.muted,
.muted-text,
.meta {
    font-weight: 400 !important;
}

strong,
b,
.fw-bold,
.text-bold {
    font-weight: 700 !important;
}

h1,
h2,
h3,
h4,
.section-header h1,
.subsection-header h2,
.topbar-title strong,
.card-title,
.news-card h2,
.detail-title,
.player-card-header h1 {
    font-weight: 700 !important;
}

.btn,
.badge,
.admin-badge,
.data-table th,
.table-wrap th,
.editor-toolbar button,
.editor-format-select {
    font-weight: 700 !important;
}

.news-content,
.news-editor {
    font-weight: 400 !important;
}

.news-content strong,
.news-content b,
.news-editor strong,
.news-editor b,
.news-content .fw-bold,
.news-editor .fw-bold {
    font-weight: 1000 !important;
    text-shadow: 0 0 .01px currentColor;
}

.news-content h2,
.news-content h3,
.news-content h4,
.news-editor h2,
.news-editor h3,
.news-editor h4 {
    font-weight: 800 !important;
}

/* Desktop/tablet calendar side list: do not cross out or squeeze tournament names. */
.calendar-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
}

.selected-tournament h2 {
    margin: 0 0 14px !important;
    line-height: 1.25;
}

.month-tournament-list {
    min-width: 0;
}

.month-tournament-card {
    min-width: 0;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 10px;
    overflow: hidden;
}

.month-tournament-card .dot {
    margin-top: .35em;
}

.month-tournament-card strong,
.month-tournament-card small {
    min-width: 0;
    max-width: 100%;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
    word-break: normal;
    line-height: 1.35;
}

.month-tournament-card-finished strong {
    text-decoration: none !important;
}

.month-tournament-card-finished {
    opacity: .92;
}

@media (max-width: 1120px) {
    .calendar-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

@media (max-width: 760px) {
    :root {
        --ui-page-pad: 12px;
    }

    html,
    body {
        overflow-x: hidden;
    }

    body,
    button,
    input,
    select,
    textarea,
    .btn {
        font-size: 15px !important;
    }

    .app-shell-modern {
        display: block !important;
        min-width: 0;
    }

    .app-main,
    .page {
        width: 100%;
        min-width: 0;
    }

    .app-shell-modern .topbar {
        position: sticky;
        top: 0;
        min-height: auto !important;
        padding: calc(10px + env(safe-area-inset-top)) 12px 10px !important;
        gap: 8px !important;
        align-items: center !important;
        flex-wrap: wrap;
    }

    .mobile-menu-button {
        order: 1;
        flex: 0 0 42px;
    }

    .topbar-title {
        order: 2;
        flex: 1 1 calc(100% - 54px) !important;
        min-width: 0;
    }

    .topbar-title span {
        display: none !important;
    }

    .topbar-title strong {
        margin: 0 !important;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: clamp(20px, 7vw, 28px) !important;
        line-height: 1.15;
    }

    .app-shell-modern .topbar-actions {
        order: 3;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
        width: 100%;
        gap: 7px !important;
        margin-left: 0 !important;
    }

    .lang-dropdown,
    .theme-toggle,
    .app-shell-modern .topbar-actions .btn-outline,
    .app-shell-modern .topbar-actions .admin-badge {
        width: 100%;
        min-width: 0;
    }

    .lang-dropdown-toggle,
    .theme-toggle,
    .app-shell-modern .topbar-actions .btn-outline,
    .app-shell-modern .topbar-actions .admin-badge {
        justify-content: center;
        min-height: 40px;
        padding-left: 8px !important;
        padding-right: 8px !important;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px !important;
    }

    .lang-dropdown-menu {
        left: 0;
        right: auto;
        min-width: min(260px, 92vw);
    }

    .app-shell-modern .page {
        padding: 12px 10px 20px !important;
    }

    .dashboard-grid,
    .detail-layout,
    .league-ui-layout,
    .league-fixture-layout,
    .calendar-layout,
    .form-grid.two-columns,
    .form-grid.three-columns,
    .teams-dashboard,
    .teams-insight-grid,
    .profile-info-grid,
    .public-visibility-grid,
    .player-card-main-grid,
    .player-card-facts,
    .player-sport-card-grid,
    .player-medal-grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .panel-news,
    .panel-calendar,
    .wide-panel,
    .detail-main,
    .detail-side,
    .login-card,
    .auth-card,
    .news-form-panel,
    .teams-overview-panel {
        width: 100%;
        max-width: 100%;
        padding: 14px !important;
        border-radius: 20px !important;
        overflow: hidden;
    }

    .section-header,
    .calendar-header,
    .subsection-header,
    .player-search,
    .detail-title,
    .bracket-section-heading,
    .league-fixture-round-summary,
    .team-card-header,
    .profile-summary-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }

    .section-header h1,
    .detail-title h1,
    .auth-card h1,
    .panel h1,
    .wide-panel h1 {
        font-size: clamp(24px, 8vw, 32px) !important;
        line-height: 1.12;
    }

    .section-actions,
    .form-actions,
    .filters-row,
    .players-bulk-actions,
    .matches-control-form,
    .matches-bulk-actions,
    .groups-control-form,
    .bracket-control-row,
    .bracket-control-form,
    .bracket-bulk-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        width: 100%;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .section-actions .btn,
    .form-actions .btn,
    .filters-row .btn,
    .players-bulk-actions .btn,
    .matches-control-form .btn,
    .matches-bulk-actions .btn,
    .groups-control-form .btn,
    .bracket-control-row .btn,
    .bracket-control-form .btn,
    .bracket-bulk-actions .btn,
    .side-action {
        width: 100%;
    }

    input,
    select,
    textarea,
    .select-control,
    .country-picker-trigger,
    .editor-format-select {
        width: 100%;
        max-width: 100%;
        min-height: 44px;
    }

    .inline-filter {
        display: block !important;
        width: 100%;
    }

    .inline-filter .select-control {
        width: 100%;
    }

    .news-card {
        display: block !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .news-card h2 {
        font-size: clamp(20px, 6vw, 26px) !important;
        line-height: 1.18;
        overflow-wrap: anywhere;
    }

    .news-content,
    .news-body,
    .detail-description {
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: normal;
        line-height: 1.62;
    }

    .news-content table,
    .news-editor table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        white-space: nowrap;
    }

    .news-content img,
    .news-editor img {
        max-width: 100% !important;
        height: auto !important;
    }

    .calendar-header .calendar-tabs {
        width: 100%;
    }

    .calendar-tabs {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        padding: 6px;
        border-radius: 16px;
    }

    .calendar-tabs a,
    .calendar-tabs button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-height: 38px;
        padding: 8px 6px !important;
        border-radius: 12px;
        text-align: center;
    }

    .calendar-toolbar {
        display: grid !important;
        grid-template-columns: 42px minmax(0, 1fr) 42px;
        gap: 8px !important;
        align-items: center;
        margin-bottom: 12px !important;
    }

    .calendar-toolbar strong {
        width: auto !important;
        order: 0 !important;
        text-align: center;
        line-height: 1.25;
    }

    .calendar-toolbar .calendar-today-button {
        grid-column: 1 / -1;
        width: 100%;
    }

    .calendar-main,
    .selected-tournament {
        min-width: 0;
        width: 100%;
    }

    .calendar-grid,
    .calendar-grid-month,
    .calendar-grid-week,
    .calendar-grid-day {
        display: block !important;
        border: 0 !important;
        border-radius: 0 !important;
        overflow: visible !important;
    }

    .calendar-grid-month .day-name,
    .calendar-grid-week .day-name {
        display: none !important;
    }

    .calendar-grid-month .calendar-day {
        display: none;
    }

    .calendar-grid-month .calendar-day.has-events,
    .calendar-grid-month .calendar-day.is-today,
    .calendar-grid-month .calendar-day.has-create-action,
    .calendar-grid-week .calendar-day,
    .calendar-grid-day .calendar-day {
        position: relative;
        display: block !important;
        min-height: auto !important;
        margin: 0 0 10px;
        padding: 42px 12px 12px !important;
        border: 1px solid var(--ui-panel-border, var(--border));
        border-radius: 16px;
        background: var(--ui-panel-solid, #fff);
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
    }

    .calendar-grid-month .calendar-day::before,
    .calendar-grid-week .calendar-day::before,
    .calendar-grid-day .calendar-day::before {
        content: attr(data-date-label);
        position: absolute;
        top: 12px;
        left: 12px;
        color: var(--ui-text, var(--text));
        font-size: 13px;
        font-weight: 800;
        line-height: 1;
    }

    .calendar-day-number {
        display: none !important;
    }

    .calendar-day-create {
        position: absolute;
        top: 8px;
        right: 10px;
        min-height: 28px;
        padding: 4px !important;
    }

    .calendar-create-plus {
        width: 24px !important;
        height: 24px !important;
        opacity: 1 !important;
        transform: none !important;
        font-size: 14px !important;
    }

    .calendar-day.is-today {
        outline-offset: 0;
    }

    .event,
    .calendar-grid-week .event {
        margin-top: 8px !important;
        padding: 9px 10px !important;
        border-radius: 12px !important;
        font-size: 12px !important;
        line-height: 1.35 !important;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
    }

    .event span,
    .event small {
        display: block;
        white-space: normal !important;
        overflow: visible !important;
        text-overflow: clip !important;
        overflow-wrap: anywhere;
    }

    .event small,
    .calendar-grid-week .event small {
        font-size: 11px !important;
        line-height: 1.25 !important;
    }

    .legend {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        gap: 8px !important;
        margin-top: 12px !important;
    }

    .selected-tournament {
        border-left: 0 !important;
        padding-left: 0 !important;
    }

    .month-tournament-card {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    .month-tournament-card strong {
        font-size: 14px;
        line-height: 1.3;
    }

    .month-tournament-card small {
        font-size: 12px;
    }

    .table-wrap,
    .group-table-wrap,
    .league-fixtures-table-wrap,
    .player-match-history-wrap {
        width: 100%;
        max-width: 100%;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 6px;
    }

    .data-table,
    .group-table,
    .result-list-table,
    .players-table,
    .matches-table,
    .league-fixtures-overview-table,
    .league-standings-table,
    .player-match-history-table {
        min-width: 680px;
    }

    .table-wrap::after,
    .league-fixtures-table-wrap::after,
    .player-match-history-wrap::after {
        content: "";
        display: block;
        width: 1px;
        height: 1px;
    }

    .tabs,
    .league-ui-tabs {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px !important;
    }

    .tabs a,
    .league-ui-tabs button {
        flex: 0 0 auto;
    }

    .editor-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch !important;
        gap: 8px !important;
    }

    .editor-toolbar-group {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
        gap: 6px !important;
        padding: 6px !important;
    }

    .editor-toolbar button {
        width: 100%;
        min-height: 40px;
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .news-editor {
        min-height: 220px !important;
        padding: 14px !important;
        font-size: 16px !important;
    }

    .player-photo-field,
    .profile-summary-card,
    .photo-cropper {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .photo-cropper-stage {
        width: 100% !important;
        height: auto !important;
        aspect-ratio: 1 / 1;
    }
}

@media (max-width: 460px) {
    .app-shell-modern .topbar-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .theme-toggle-text {
        display: none;
    }

    .calendar-tabs a,
    .calendar-tabs button,
    .calendar-nav-button {
        font-size: 12px !important;
    }

    .data-table,
    .group-table,
    .result-list-table,
    .players-table,
    .matches-table,
    .league-fixtures-overview-table,
    .league-standings-table,
    .player-match-history-table {
        min-width: 620px;
    }
}

/* === v13 - karta hrace: odehrane zapasy musi mit vlastni horizontalni posuvnik === */
.player-public-card-page,
.player-public-card-page .public-player-card,
.player-public-card-page .player-card-profile,
.player-public-card-page .player-card-section,
.player-public-card-page .player-card-subsection {
    min-width: 0 !important;
}

.player-public-card-page,
.player-public-card-page .public-player-card,
.player-public-card-page .player-card-profile.public-player-card,
.player-public-card-page .player-match-history-section {
    overflow: visible !important;
}

.player-public-card-page .player-match-history-wrap {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-gutter: stable both-edges;
    padding-bottom: 10px !important;
}

.player-public-card-page .player-match-history-table {
    width: max-content !important;
    min-width: 760px !important;
    max-width: none !important;
}

.player-public-card-page .player-match-history-table th,
.player-public-card-page .player-match-history-table td {
    white-space: nowrap !important;
}

.player-public-card-page .player-match-history-table td:nth-child(2),
.player-public-card-page .player-match-history-table td:nth-child(3),
.player-public-card-page .player-match-history-table td:nth-child(4) {
    min-width: 180px !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
}

.player-public-card-page .player-match-history-wrap::-webkit-scrollbar {
    height: 10px;
}

.player-public-card-page .player-match-history-wrap::-webkit-scrollbar-track {
    background: rgba(148, 163, 184, 0.18);
    border-radius: 999px;
}

.player-public-card-page .player-match-history-wrap::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.70);
    border-radius: 999px;
}

@media (max-width: 760px) {
    .player-public-card-page .player-match-history-wrap {
        margin-left: -2px !important;
        margin-right: -2px !important;
    }

    .player-public-card-page .player-match-history-table {
        min-width: 680px !important;
    }
}

@media (max-width: 460px) {
    .player-public-card-page .player-match-history-table {
        min-width: 640px !important;
    }
}


/* === v15 - news editor persistent color palette and readable calendar month list === */
.editor-toolbar {
    position: relative;
}

.editor-toolbar button[data-command="foreColor"].has-selected-color {
    color: var(--editor-selected-color) !important;
    border-color: var(--editor-selected-color) !important;
    box-shadow: inset 0 -3px 0 var(--editor-selected-color);
}

.editor-color-popover {
    position: absolute;
    left: 10px;
    top: calc(100% + 8px);
    z-index: 1500;
    width: min(270px, calc(100vw - 32px));
    padding: 10px;
    border: 1px solid var(--border-color, #d7e1ef);
    border-radius: 14px;
    background: var(--surface, #ffffff);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.20);
}

.editor-color-popover[hidden] {
    display: none !important;
}

.editor-color-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.editor-color-swatch {
    width: 30px;
    height: 30px;
    min-height: 30px !important;
    padding: 0 !important;
    border-radius: 999px !important;
    border: 2px solid rgba(148, 163, 184, 0.75) !important;
    background: var(--swatch-color) !important;
    cursor: pointer;
}

.editor-color-swatch:hover,
.editor-color-swatch:focus-visible {
    transform: translateY(-1px);
    border-color: var(--blue, #0f6cbd) !important;
    box-shadow: 0 0 0 3px rgba(15, 108, 189, 0.16);
}

.editor-color-custom-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #d7e1ef);
    color: var(--text, #1f2937);
    font-size: 13px;
    font-weight: 800;
}

.editor-color-custom {
    width: 44px;
    height: 34px;
    padding: 2px;
    border: 1px solid var(--border-color, #d7e1ef);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
}

html[data-theme="dark"] .editor-color-popover {
    background: #0f172a;
    border-color: #334155;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .editor-color-custom-wrap {
    color: #e5e7eb;
    border-top-color: #334155;
}

/* Calendar summary is rendered above the calendar so important events are visible first. */
.panel-calendar .calendar-layout-main-only,
.panel-calendar .calendar-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
}

.panel-calendar .calendar-tournament-summary,
.panel-calendar .selected-tournament {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 0 18px !important;
    padding: 18px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

.panel-calendar .calendar-tournament-summary {
    border-color: rgba(15, 108, 189, 0.30) !important;
    background:
        linear-gradient(135deg, rgba(15, 108, 189, 0.09), rgba(46, 204, 113, 0.07)),
        var(--surface, #ffffff) !important;
    box-shadow: 0 14px 34px rgba(15, 108, 189, 0.10) !important;
}

.calendar-summary-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.panel-calendar .calendar-summary-heading h2 {
    margin: 0 !important;
}

.calendar-summary-count {
    display: inline-grid;
    place-items: center;
    min-width: 34px;
    height: 34px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--blue, #0f6cbd);
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 8px 18px rgba(15, 108, 189, 0.22);
}

html[data-theme="dark"] .panel-calendar .calendar-tournament-summary {
    border-color: rgba(96, 165, 250, 0.34) !important;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(16, 185, 129, 0.08)),
        #111827 !important;
}

.news-card .card-actions {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.news-card .news-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 8px 14px;
    border: 1px solid rgba(15, 108, 189, 0.42);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(15, 108, 189, 0.10), rgba(56, 189, 248, 0.08));
    color: var(--blue, #0f6cbd) !important;
    font-weight: 850;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 7px 16px rgba(15, 108, 189, 0.10);
    transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.news-card .news-edit-link:hover,
.news-card .news-edit-link:focus-visible {
    transform: translateY(-1px);
    border-color: var(--blue, #0f6cbd);
    background: var(--blue-soft, #eaf3ff);
    box-shadow: 0 10px 22px rgba(15, 108, 189, 0.18);
}

html[data-theme="dark"] .news-card .news-edit-link {
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(37, 99, 235, 0.16);
    color: #93c5fd !important;
}

html[data-theme="dark"] .news-card .news-edit-link:hover,
html[data-theme="dark"] .news-card .news-edit-link:focus-visible {
    border-color: #60a5fa;
    background: rgba(37, 99, 235, 0.28);
    color: #dbeafe !important;
}

.panel-calendar .calendar-tournament-summary h2,
.panel-calendar .selected-tournament h2,
.panel-calendar .month-tournaments-title {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 0 14px !important;
    padding: 0 !important;
    color: var(--text, #1f2937) !important;
    font-size: clamp(22px, 2.1vw, 30px) !important;
    line-height: 1.18 !important;
    letter-spacing: -0.035em !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
}

.panel-calendar .month-tournament-list {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
}

.panel-calendar .month-tournament-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    align-items: flex-start !important;
}

.panel-calendar .month-tournament-card strong,
.panel-calendar .month-tournament-card small {
    display: block !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
}

.panel-calendar .month-tournament-card-finished strong {
    text-decoration: none !important;
}

@media (max-width: 760px) {
    .editor-color-popover {
        left: 0;
        width: min(260px, calc(100vw - 24px));
    }

    .panel-calendar .calendar-tournament-summary,
    .panel-calendar .selected-tournament {
        padding: 14px !important;
    }

    .panel-calendar .calendar-tournament-summary h2,
    .panel-calendar .selected-tournament h2 {
        font-size: 22px !important;
    }

    .panel-calendar .month-tournament-list {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}

/* === v16 - better color picker confirmation and visible saved colors === */
.editor-toolbar .editor-color-swatch,
html[data-theme="dark"] .editor-toolbar .editor-color-swatch {
    appearance: none !important;
    -webkit-appearance: none !important;
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 10px !important;
    background: var(--swatch-color) !important;
    background-color: var(--swatch-color) !important;
    color: transparent !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.55),
        0 0 0 1px rgba(15, 23, 42, 0.32) !important;
    overflow: hidden !important;
}

.editor-toolbar .editor-color-swatch[data-editor-color="#ffffff"],
html[data-theme="dark"] .editor-toolbar .editor-color-swatch[data-editor-color="#ffffff"] {
    background:
        linear-gradient(45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(-45deg, #e5e7eb 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #e5e7eb 75%),
        linear-gradient(-45deg, transparent 75%, #e5e7eb 75%),
        #ffffff !important;
    background-size: 12px 12px !important;
    background-position: 0 0, 0 6px, 6px -6px, -6px 0 !important;
}

.editor-toolbar .editor-color-swatch:hover,
.editor-toolbar .editor-color-swatch:focus-visible,
html[data-theme="dark"] .editor-toolbar .editor-color-swatch:hover,
html[data-theme="dark"] .editor-toolbar .editor-color-swatch:focus-visible {
    border-color: #60a5fa !important;
    background-color: var(--swatch-color) !important;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.65),
        0 0 0 3px rgba(96, 165, 250, 0.28) !important;
}

.editor-color-custom-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.editor-toolbar .editor-color-apply,
html[data-theme="dark"] .editor-toolbar .editor-color-apply {
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 10px !important;
    border: 1px solid var(--custom-picker-color, #2563eb) !important;
    background: rgba(37, 99, 235, 0.10) !important;
    color: var(--text, #0f172a) !important;
    font-weight: 850 !important;
    cursor: pointer !important;
    box-shadow: inset 0 -3px 0 var(--custom-picker-color, #2563eb) !important;
}

html[data-theme="dark"] .editor-toolbar .editor-color-apply {
    background: rgba(37, 99, 235, 0.18) !important;
    color: #f8fafc !important;
}

.editor-toolbar .editor-color-apply:hover,
html[data-theme="dark"] .editor-toolbar .editor-color-apply:hover {
    border-color: var(--custom-picker-color, #2563eb) !important;
    background: rgba(37, 99, 235, 0.20) !important;
}

.editor-color-hint {
    margin-top: 8px;
    color: var(--muted, #64748b);
    font-size: 12px;
    line-height: 1.35;
}

html[data-theme="dark"] .editor-color-hint {
    color: #cbd5e1;
}

/* === v17 - Word-style text color control in the news editor === */
.editor-color-control {
    position: relative;
    display: inline-flex;
    align-items: stretch;
    flex: 0 0 auto;
}

.editor-toolbar .editor-color-control .editor-color-main,
.editor-toolbar .editor-color-control .editor-color-toggle {
    min-width: 0 !important;
    min-height: 36px !important;
    height: 36px;
    margin: 0 !important;
}

.editor-toolbar .editor-color-control .editor-color-main {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    padding: 2px 7px 6px !important;
    border-radius: 10px 0 0 10px !important;
    border-right-width: 0 !important;
    color: var(--text, #1f2937) !important;
}

.editor-color-letter {
    display: block;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.editor-color-line {
    position: absolute;
    left: 7px;
    right: 7px;
    bottom: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--editor-selected-color, #d13438);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.16);
}

.editor-toolbar .editor-color-control .editor-color-toggle {
    width: 24px;
    padding: 0 4px !important;
    border-radius: 0 10px 10px 0 !important;
    font-size: 11px;
    line-height: 1;
}

.editor-toolbar .editor-color-control .editor-color-main:hover,
.editor-toolbar .editor-color-control .editor-color-toggle:hover,
.editor-toolbar .editor-color-control .editor-color-toggle[aria-expanded="true"] {
    z-index: 1;
}

.editor-color-control .editor-color-popover {
    left: 0 !important;
    top: calc(100% + 8px) !important;
    width: min(318px, calc(100vw - 28px)) !important;
    padding: 12px !important;
}

.editor-color-section + .editor-color-section {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color, #d7e1ef);
}

.editor-color-section-label {
    margin-bottom: 7px;
    color: var(--muted, #64748b);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.editor-color-control .editor-color-swatches {
    grid-template-columns: repeat(10, 24px) !important;
    gap: 6px !important;
}

.editor-toolbar .editor-color-control .editor-color-swatch,
html[data-theme="dark"] .editor-toolbar .editor-color-control .editor-color-swatch {
    position: relative;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    border-radius: 5px !important;
}

.editor-toolbar .editor-color-control .editor-color-swatch.is-active,
html[data-theme="dark"] .editor-toolbar .editor-color-control .editor-color-swatch.is-active {
    outline: 2px solid var(--blue, #0f6cbd) !important;
    outline-offset: 2px;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.65),
        0 0 0 1px rgba(15, 23, 42, 0.36) !important;
}

.editor-color-control .editor-color-custom-wrap {
    align-items: center;
}

.editor-color-control .editor-color-custom {
    width: 46px;
    height: 36px;
}

.editor-color-control .editor-color-hint {
    max-width: 280px;
}

html[data-theme="dark"] .editor-color-section + .editor-color-section {
    border-top-color: #334155;
}

html[data-theme="dark"] .editor-color-section-label {
    color: #cbd5e1;
}

html[data-theme="dark"] .editor-toolbar .editor-color-control .editor-color-main {
    color: #e5e7eb !important;
}

@media (max-width: 460px) {
    .editor-color-control .editor-color-popover {
        left: -96px !important;
        width: min(304px, calc(100vw - 20px)) !important;
    }

    .editor-color-control .editor-color-swatches {
        grid-template-columns: repeat(10, 22px) !important;
        gap: 5px !important;
    }

    .editor-toolbar .editor-color-control .editor-color-swatch,
    html[data-theme="dark"] .editor-toolbar .editor-color-control .editor-color-swatch {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
        min-height: 22px !important;
    }
}

/* === v18 - visual table picker in the news editor === */
.editor-table-control {
    position: relative;
    display: inline-flex;
    min-width: 0;
    flex: 0 0 auto;
}

.editor-table-control > .editor-table-toggle {
    width: 100%;
    white-space: nowrap;
}

.editor-table-popover {
    position: absolute;
    z-index: 70;
    top: calc(100% + 8px);
    left: 0;
    width: min(330px, calc(100vw - 28px));
    padding: 14px;
    border: 1px solid var(--border-color, #d7e1ef);
    border-radius: 14px;
    background: var(--surface, #ffffff);
    color: var(--text, #1f2937);
    box-shadow: 0 18px 46px rgba(15, 23, 42, 0.22);
    text-align: left;
}

.editor-table-header,
.editor-table-size {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.editor-table-header > strong {
    font-size: 14px;
    font-weight: 900;
}

.editor-toolbar .editor-table-close {
    display: inline-grid !important;
    place-items: center;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    padding: 0 !important;
    border-radius: 8px !important;
    font-size: 20px;
    line-height: 1;
}

.editor-table-hint {
    margin-top: 4px;
    color: var(--muted, #64748b);
    font-size: 12px;
    line-height: 1.4;
}

.editor-table-size {
    margin-top: 12px;
    font-size: 13px;
}

.editor-table-size strong {
    color: var(--blue, #0f6cbd);
    font-size: 15px;
}

.editor-table-grid {
    display: grid;
    grid-template-columns: repeat(8, 27px);
    gap: 5px;
    width: max-content;
    margin: 10px auto 0;
}

.editor-toolbar .editor-table-cell,
html[data-theme="dark"] .editor-toolbar .editor-table-cell {
    display: block !important;
    width: 27px !important;
    min-width: 27px !important;
    height: 27px !important;
    min-height: 27px !important;
    padding: 0 !important;
    border: 1px solid #b9c7d8 !important;
    border-radius: 5px !important;
    background: #ffffff !important;
    box-shadow: none !important;
}

.editor-toolbar .editor-table-cell.is-active,
.editor-toolbar .editor-table-cell:hover,
.editor-toolbar .editor-table-cell:focus-visible,
html[data-theme="dark"] .editor-toolbar .editor-table-cell.is-active,
html[data-theme="dark"] .editor-toolbar .editor-table-cell:hover,
html[data-theme="dark"] .editor-toolbar .editor-table-cell:focus-visible {
    border-color: var(--blue, #0f6cbd) !important;
    background: var(--blue-soft, #eaf3ff) !important;
}

.editor-toolbar .editor-table-cell:focus-visible {
    outline: 2px solid var(--blue, #0f6cbd) !important;
    outline-offset: 1px;
}

.editor-table-custom-title {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color, #d7e1ef);
    color: var(--muted, #64748b);
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.editor-table-custom {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    margin-top: 8px;
}

.editor-table-custom label {
    display: grid;
    gap: 4px;
    min-width: 0;
    color: var(--muted, #64748b);
    font-size: 11px;
    font-weight: 750;
}

.editor-table-custom input {
    width: 100%;
    min-width: 0;
    height: 36px;
    padding: 0 8px;
    border: 1px solid var(--border-color, #d7e1ef);
    border-radius: 9px;
    background: var(--surface, #ffffff);
    color: var(--text, #1f2937);
    font: inherit;
    font-size: 13px;
}

.editor-table-multiply {
    align-self: end;
    display: grid;
    place-items: center;
    height: 36px;
    color: var(--muted, #64748b);
    font-weight: 900;
}

.editor-toolbar .editor-table-insert {
    min-height: 36px !important;
    height: 36px;
    padding: 0 12px !important;
    border-color: var(--blue, #0f6cbd) !important;
    background: var(--blue, #0f6cbd) !important;
    color: #ffffff !important;
    font-weight: 850 !important;
}

.editor-toolbar .editor-table-insert:hover,
.editor-toolbar .editor-table-insert:focus-visible {
    background: var(--blue-dark, #084c8d) !important;
    color: #ffffff !important;
}

html[data-theme="dark"] .editor-table-popover {
    border-color: #334155;
    background: #111827;
    color: #e5e7eb;
    box-shadow: 0 20px 52px rgba(0, 0, 0, 0.46);
}

html[data-theme="dark"] .editor-table-hint,
html[data-theme="dark"] .editor-table-custom-title,
html[data-theme="dark"] .editor-table-custom label,
html[data-theme="dark"] .editor-table-multiply {
    color: #cbd5e1;
}

html[data-theme="dark"] .editor-table-custom-title {
    border-top-color: #334155;
}

html[data-theme="dark"] .editor-table-custom input {
    border-color: #475569;
    background: #0b1220;
    color: #f8fafc;
}

html[data-theme="dark"] .editor-toolbar .editor-table-cell {
    border-color: #475569 !important;
    background: #0b1220 !important;
}

@media (max-width: 760px) {
    .editor-table-control {
        width: 100%;
    }
}

@media (max-width: 460px) {
    .editor-table-popover {
        left: -72px;
        width: min(304px, calc(100vw - 20px));
        padding: 12px;
    }

    .editor-table-grid {
        grid-template-columns: repeat(8, 25px);
        gap: 4px;
    }

    .editor-toolbar .editor-table-cell,
    html[data-theme="dark"] .editor-toolbar .editor-table-cell {
        width: 25px !important;
        min-width: 25px !important;
        height: 25px !important;
        min-height: 25px !important;
    }

    .editor-table-custom {
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    }

    .editor-toolbar .editor-table-insert {
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* === v18 - tablet layout bridge (761-1200 px) ===
   The modern desktop rules reintroduced a two-column dashboard after the
   original 1120 px breakpoint. On tablet-sized viewports this squeezed the
   news and calendar panels into unusably narrow columns. Keep phones on the
   existing mobile layout, but make the intermediate range a stable one-column
   workspace. */
@media (min-width: 761px) and (max-width: 1200px) {
    :root {
        --ui-page-pad: clamp(16px, 2.4vw, 26px);
    }

    .app-main,
    .app-shell-modern .page,
    .dashboard-grid,
    .dashboard-grid > *,
    .detail-layout,
    .detail-layout > *,
    .league-ui-layout,
    .league-ui-layout > *,
    .league-fixture-layout,
    .league-fixture-layout > *,
    .calendar-layout,
    .calendar-layout > * {
        min-width: 0 !important;
        max-width: 100%;
    }

    .dashboard-grid,
    .detail-layout,
    .league-ui-layout,
    .league-fixture-layout,
    .calendar-layout {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .dashboard-grid {
        gap: 20px !important;
    }

    .panel-news,
    .panel-calendar {
        width: 100%;
        overflow: hidden;
    }

    /* The news filter/action row must not reserve a thin text column. */
    .dashboard-grid .panel-news > .section-header {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) !important;
        align-items: start !important;
        gap: 14px !important;
    }

    .dashboard-grid .panel-news > .section-header > * {
        min-width: 0;
        max-width: 100%;
    }

    .dashboard-grid .panel-news > .section-header > .btn {
        justify-self: start;
    }

    .dashboard-grid .panel-news .admin-hint {
        width: 100%;
        max-width: 60ch;
        line-height: 1.5;
    }

    .dashboard-grid .inline-filter,
    .dashboard-grid .inline-filter .select-control {
        max-width: 100%;
    }

    /* Calendar content remains full width instead of forcing an intrinsic
       side column that can push the page outside the viewport. */
    .panel-calendar .calendar-layout,
    .panel-calendar .calendar-layout-main-only,
    .panel-calendar .calendar-main,
    .panel-calendar .calendar-tournament-summary,
    .panel-calendar .selected-tournament {
        width: 100%;
        min-width: 0 !important;
        max-width: 100%;
    }

    .panel-calendar .calendar-tournament-summary,
    .panel-calendar .selected-tournament {
        border-left: 0 !important;
        padding-left: 0 !important;
    }

    .calendar-grid,
    .calendar-grid-month,
    .calendar-grid-week,
    .calendar-grid-day {
        min-width: 0 !important;
        max-width: 100%;
    }

    .news-card,
    .news-body,
    .news-content,
    .calendar-day,
    .month-tournament-card {
        min-width: 0 !important;
        max-width: 100%;
        overflow-wrap: anywhere;
    }
}

/* Tablet header: keep the page title readable and move account controls to a
   dedicated row. This avoids the narrow vertical stack visible around
   800-1100 px while leaving the phone layout unchanged. */
@media (min-width: 761px) and (max-width: 1120px) {
    .app-shell-modern .topbar {
        flex-wrap: wrap !important;
        align-items: center !important;
        gap: 10px 14px !important;
    }

    .mobile-menu-button {
        order: 1;
    }

    .topbar-title {
        order: 2;
        flex: 1 1 280px;
        min-width: 0;
    }

    .app-shell-modern .topbar-actions {
        order: 3;
        display: flex !important;
        flex: 1 1 100%;
        width: 100%;
        margin-left: 0 !important;
        justify-content: flex-end !important;
        align-items: center;
        flex-wrap: wrap;
    }

    .app-shell-modern .topbar-actions > * {
        flex: 0 1 auto;
        min-width: 0;
    }
}
