/*
 * Poolbaas mobiele schaal v1
 * Vergroot leesbaarheid, bediening en klikvlakken op telefoons.
 * Desktop blijft ongemoeid.
 */

@media (max-width: 820px) {
    :root {
        --pb-mobile-text: 17px;
        --pb-mobile-small: 14px;
        --pb-mobile-label: 15px;
        --pb-mobile-control: 52px;
        --pb-mobile-tap: 48px;
        --pb-mobile-card-padding: 18px;
        --pb-mobile-page-gutter: 15px;
        --pb-mobile-radius: 18px;
    }

    html {
        font-size: var(--pb-mobile-text);
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
    }

    body {
        min-width: 0;
        font-size: var(--pb-mobile-text);
        line-height: 1.5;
        letter-spacing: 0;
    }

    body,
    button,
    input,
    select,
    textarea {
        font-family: inherit;
    }

    main {
        min-width: 0;
    }

    h1,
    .page-title,
    .pb-page-title,
    .pcp-hero h1 {
        font-size: clamp(30px, 8.2vw, 38px) !important;
        line-height: 1.08 !important;
        letter-spacing: -0.035em;
    }

    h2,
    .section-title,
    .pb-section-title,
    .pcp-section-head h2 {
        font-size: clamp(23px, 6.3vw, 29px) !important;
        line-height: 1.14 !important;
        letter-spacing: -0.025em;
    }

    h3 {
        font-size: clamp(19px, 5.2vw, 23px);
        line-height: 1.2;
    }

    p,
    li,
    dd,
    dt,
    label,
    summary,
    figcaption {
        font-size: max(1rem, 16px);
    }

    small,
    .small,
    .muted,
    .meta,
    [class*="__meta"],
    [class*="-meta"] {
        font-size: var(--pb-mobile-small);
        line-height: 1.4;
    }

    button,
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    button,
    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select {
        min-height: var(--pb-mobile-control);
        border-radius: 13px;
    }

    textarea {
        min-height: 120px;
        border-radius: 13px;
        padding: 13px 14px;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
    select {
        padding: 0 14px;
    }

    button,
    .button,
    .btn,
    [class*="button"],
    [class*="btn-"],
    a[role="button"] {
        min-height: var(--pb-mobile-tap);
        padding: 12px 17px;
        font-size: 16px;
        line-height: 1.2;
    }

    input[type="checkbox"],
    input[type="radio"] {
        width: 22px;
        height: 22px;
    }

    a,
    button,
    input,
    select,
    textarea,
    summary {
        touch-action: manipulation;
    }

    table {
        font-size: 15px;
    }

    th,
    td {
        padding: 12px 10px;
    }

    .container,
    .pb-container,
    .page-container,
    .content-container,
    .pcp-page {
        padding-left: var(--pb-mobile-page-gutter);
        padding-right: var(--pb-mobile-page-gutter);
    }

    .card,
    .panel,
    .tile,
    .pb-card,
    .pb-panel,
    [class$="-card"],
    [class$="__card"] {
        border-radius: var(--pb-mobile-radius);
    }

    .card,
    .panel,
    .pb-card,
    .pb-panel {
        padding: var(--pb-mobile-card-padding);
    }

    .badge,
    .pill,
    .chip,
    [class*="-badge"],
    [class*="-pill"],
    [class*="-chip"] {
        min-height: 28px;
        padding: 5px 9px;
        font-size: 13px;
        line-height: 1.2;
    }

    /* Topbar en hoofdnavigatie */
    .pb-topbar,
    .topbar,
    .site-header,
    header[role="banner"] {
        min-height: 62px;
    }

    .pb-topbar a,
    .pb-topbar button,
    .topbar a,
    .topbar button,
    .site-header a,
    .site-header button {
        min-width: 44px;
        min-height: 44px;
    }

    nav a,
    nav button {
        font-size: 15px;
    }

    .pb-bottom-nav,
    .bottom-nav,
    [class*="bottom-nav"],
    [class*="mobile-nav"] {
        min-height: calc(72px + env(safe-area-inset-bottom));
        padding-bottom: env(safe-area-inset-bottom);
    }

    .pb-bottom-nav a,
    .bottom-nav a,
    [class*="bottom-nav"] a,
    [class*="mobile-nav"] a {
        min-width: 58px;
        min-height: 58px;
        padding: 8px 7px;
        font-size: 12px;
        line-height: 1.15;
    }

    .pb-bottom-nav svg,
    .bottom-nav svg,
    [class*="bottom-nav"] svg,
    [class*="mobile-nav"] svg {
        width: 24px;
        height: 24px;
    }

    /* Meldingen, modals en lege statussen */
    .flash,
    .alert,
    .notice,
    .toast,
    [class*="flash"],
    [class*="alert"],
    [class*="notice"] {
        padding: 14px 16px;
        font-size: 15px;
        line-height: 1.4;
        border-radius: 14px;
    }

    dialog,
    .modal,
    [class*="modal__content"],
    [class*="dialog__content"] {
        width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 20px;
    }

    /* Generieke Poolbaas-arena's */
    .pb-arena-card,
    .pb-match-card,
    .pb-fixture-card,
    .pb-ranking-card,
    .pb-stat-card,
    .pb-home-card {
        padding: 18px;
    }

    .pb-arena-card strong,
    .pb-match-card strong,
    .pb-fixture-card strong,
    .pb-ranking-card strong,
    .pb-stat-card strong,
    .pb-home-card strong {
        font-size: 17px;
    }

    /* Huidige PCP-voorspellenstijl */
    .pcp-page {
        padding-top: 14px;
        padding-bottom: calc(108px + env(safe-area-inset-bottom));
    }

    .pcp-hero {
        gap: 15px;
        padding: 21px 18px !important;
        border-radius: 20px;
    }

    .pcp-kicker,
    .pcp-section-head span,
    .pcp-match-meta span,
    .pcp-deadline span {
        font-size: 13px !important;
        letter-spacing: 0.08em;
    }

    .pcp-hero p {
        margin-top: 9px;
        font-size: 17px !important;
        line-height: 1.45;
    }

    .pcp-hero__progress {
        min-width: 94px;
        padding: 12px;
        border-radius: 16px;
    }

    .pcp-hero__progress strong {
        font-size: 31px;
        line-height: 1;
    }

    .pcp-season-note {
        gap: 13px;
        padding: 16px;
        border-radius: 17px;
    }

    .pcp-season-note__icon {
        flex: 0 0 44px;
        width: 44px;
        height: 44px;
        font-size: 19px;
    }

    .pcp-season-note strong {
        font-size: 17px;
    }

    .pcp-season-note p {
        font-size: 15px;
        line-height: 1.4;
    }

    .pcp-nav {
        gap: 7px;
        margin: 14px 0;
        padding: 6px;
        overflow-x: auto;
        scrollbar-width: none;
        border-radius: 16px;
    }

    .pcp-nav::-webkit-scrollbar {
        display: none;
    }

    .pcp-nav a {
        flex: 0 0 auto;
        min-height: 46px;
        padding: 12px 14px;
        font-size: 15px !important;
        white-space: nowrap;
        border-radius: 11px;
    }

    .pcp-round {
        padding: 16px;
        border-radius: 17px;
    }

    .pcp-round label {
        gap: 3px;
    }

    .pcp-round label > span {
        font-size: 13px;
    }

    .pcp-round label > strong {
        font-size: 18px;
    }

    .pcp-round select {
        width: 100%;
        margin-top: 12px;
        font-size: 16px !important;
    }

    .pcp-deadline {
        gap: 12px;
        padding: 16px;
        border-radius: 17px;
    }

    .pcp-deadline strong {
        font-size: 18px;
        line-height: 1.25;
    }

    .pcp-deadline small {
        font-size: 14px;
    }

    .pcp-deadline a {
        min-height: 44px;
        padding: 10px 13px;
        font-size: 14px;
        border-radius: 11px;
    }

    .pcp-section-head {
        gap: 12px;
        margin: 20px 0 12px;
    }

    .pcp-section-head > strong {
        font-size: 20px;
    }

    .pcp-quick-progress {
        height: 12px !important;
        margin-bottom: 16px !important;
    }

    .pcp-match-card {
        border-radius: 20px !important;
    }

    .pcp-match-summary {
        padding: 17px !important;
    }

    .pcp-match-top {
        gap: 10px;
    }

    .pcp-match-meta strong {
        font-size: 16px;
    }

    .pcp-match-status span {
        min-height: 28px;
        padding: 6px 9px;
        font-size: 13px;
    }

    .pcp-match-date {
        margin-top: 15px;
    }

    .pcp-match-date strong {
        font-size: 17px;
    }

    .pcp-match-date small {
        font-size: 14px;
    }

    .pcp-match-teams {
        gap: 10px;
        margin-top: 20px;
    }

    .pcp-team {
        min-width: 0;
        gap: 9px;
    }

    .pcp-team__badge {
        width: 58px !important;
        height: 58px !important;
        flex-basis: 58px !important;
        padding: 7px;
        border-radius: 16px !important;
    }

    .pcp-team__badge img {
        max-width: 44px;
        max-height: 44px;
        object-fit: contain;
    }

    .pcp-team__badge span {
        font-size: 18px;
    }

    .pcp-team__name strong {
        font-size: 17px !important;
        line-height: 1.15;
        overflow-wrap: anywhere;
    }

    .pcp-team__name small {
        font-size: 13px;
    }

    .pcp-match-score {
        min-width: 52px;
    }

    .pcp-match-score strong {
        font-size: 18px;
    }

    .pcp-match-score small {
        font-size: 12px;
        line-height: 1.2;
    }

    .pcp-score-form,
    .pcp-quick-panel .pcp-score-form {
        padding: 18px 16px calc(18px + env(safe-area-inset-bottom)) !important;
    }

    .pcp-score-inputs {
        gap: 12px;
    }

    .pcp-score-inputs input,
    .pcp-score-input {
        width: 70px !important;
        min-width: 70px;
        height: 64px !important;
        min-height: 64px;
        padding: 0 !important;
        font-size: 29px !important;
        font-weight: 900;
        text-align: center;
        border-radius: 15px !important;
    }

    .pcp-score-inputs .pcp-score-separator,
    .pcp-score-separator {
        font-size: 25px;
        font-weight: 900;
    }

    .pcp-score-presets {
        gap: 8px !important;
        margin-top: 14px;
    }

    .pcp-score-presets button {
        min-height: 48px !important;
        padding: 9px 5px !important;
        font-size: 15px !important;
        border-radius: 12px !important;
    }

    .pcp-save-button {
        min-height: 58px !important;
        margin-top: 15px;
        font-size: 17px !important;
        font-weight: 850;
        border-radius: 14px !important;
    }

    .pcp-save-hint,
    .pcp-form-hint {
        font-size: 14px;
        line-height: 1.4;
    }

    /* Klassementen, kantoor en dashboard */
    .ranking-row,
    .standings-row,
    .participant-row,
    [class*="ranking-row"],
    [class*="standings-row"],
    [class*="participant-row"] {
        min-height: 58px;
        padding-top: 11px;
        padding-bottom: 11px;
    }

    .ranking-row strong,
    .standings-row strong,
    .participant-row strong,
    [class*="ranking-row"] strong,
    [class*="standings-row"] strong,
    [class*="participant-row"] strong {
        font-size: 16px;
    }

    .stat-value,
    [class*="stat__value"],
    [class*="metric__value"] {
        font-size: clamp(25px, 7vw, 34px);
        line-height: 1;
    }

    /* Voorkom dat vaste balken inhoud bedekken */
    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Iets ruimer op kleine tablets, zonder desktop te veranderen. */
@media (min-width: 821px) and (max-width: 1024px) {
    html {
        font-size: 16.5px;
    }

    button,
    input,
    select {
        min-height: 46px;
    }
}

/* Respecteer gebruikers die minder animatie willen. */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
