/*
 * DG KOF XV Hub 1.27.9 — Mobile First Global / Stage 7
 * Accessibility + touch UX normalization.
 * Visual configuration is intentionally preserved; these rules address
 * interaction, focus, readable states, touch targets and small viewports.
 */

/* Keyboard focus must remain visible even when a theme/plugin resets outlines. */
.dgkof-hub :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkof-directory :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkof-profile :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkof-account-box :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkofh-player-area :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkofh-notification-center :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkofh-admin :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible,
.dgkofh-bracket :where(a,button,input,select,textarea,summary,[tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 3px solid currentColor !important;
    outline-offset: 3px !important;
}

/* Never let generic theme rules make native controls too small to operate. */
.dgkof-hub :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkof-directory :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkof-profile :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkof-account-box :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkofh-player-area :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkofh-notification-center :where(button,[type="button"],[type="submit"],[type="reset"],a),
.dgkofh-admin :where(button,[type="button"],[type="submit"],[type="reset"],a) {
    min-height: 44px;
}

.dgkof-hub :where(input,select,textarea),
.dgkof-directory :where(input,select,textarea),
.dgkof-profile :where(input,select,textarea),
.dgkof-account-box :where(input,select,textarea),
.dgkofh-player-area :where(input,select,textarea),
.dgkofh-notification-center :where(input,select,textarea),
.dgkofh-admin :where(input,select,textarea) {
    min-height: 44px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Do not force icons/badges themselves to 44px; their clickable parent is handled above. */
.dgkof-hub :where(.dashicons,.dgkof-icon,.dgkof-badge),
.dgkof-directory :where(.dashicons,.dgkof-icon,.dgkof-badge) { min-height: 0; }

/* Disabled controls must remain visually and semantically distinguishable. */
.dgkof-hub :where(button,a,input,select,textarea)[aria-disabled="true"],
.dgkof-hub :where(button,input,select,textarea):disabled,
.dgkof-directory :where(button,a,input,select,textarea)[aria-disabled="true"],
.dgkof-directory :where(button,input,select,textarea):disabled,
.dgkofh-admin :where(button,a,input,select,textarea)[aria-disabled="true"],
.dgkofh-admin :where(button,input,select,textarea):disabled {
    cursor: not-allowed;
}

/* Dialogs/modals: viewport-safe without changing their internal visual design. */
.dgkof-hub [role="dialog"],
.dgkof-directory [role="dialog"],
.dgkof-profile [role="dialog"],
.dgkofh-player-area [role="dialog"],
.dgkofh-challenge-dialog,
.dgkof-wallet-modal-inner,
.dgkofh-notification-center {
    max-width: min(100%, calc(100vw - 24px));
    max-height: min(90dvh, calc(100dvh - 24px));
    box-sizing: border-box;
}

/* Zoom/reflow support: no horizontal page scrolling should be created by text. */
.dgkof-hub :where(p,h1,h2,h3,h4,h5,h6,li,label,legend,dt,dd),
.dgkof-directory :where(p,h1,h2,h3,h4,h5,h6,li,label,legend,dt,dd),
.dgkof-profile :where(p,h1,h2,h3,h4,h5,h6,li,label,legend,dt,dd),
.dgkof-account-box :where(p,h1,h2,h3,h4,h5,h6,li,label,legend,dt,dd),
.dgkofh-player-area :where(p,h1,h2,h3,h4,h5,h6,li,label,legend,dt,dd) {
    max-width: 100%;
}

/* Only technical strings are allowed to break anywhere. */
.dgkof-hub :where(code,pre,.dgkof-code,.dgkof-id,.dgkof-url),
.dgkof-directory :where(code,pre,.dgkof-code,.dgkof-id,.dgkof-url),
.dgkof-profile :where(code,pre,.dgkof-code,.dgkof-id,.dgkof-url) {
    overflow-wrap: anywhere;
}

/* Respect reduced-motion at the global plugin layer. */
@media (prefers-reduced-motion: reduce) {
    .dgkof-hub *, .dgkof-directory *, .dgkof-profile *, .dgkof-account-box *,
    .dgkofh-player-area *, .dgkofh-notification-center *, .dgkofh-admin * {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* 200% zoom / narrow reflow: controls and action rows stack rather than shrink. */
@media (max-width: 480px) {
    .dgkof-hub :where(.dgkof-actions,.dgkof-toolbar,.dgkof-form-actions),
    .dgkof-directory :where(.dgkof-actions,.dgkof-toolbar,.dgkof-form-actions),
    .dgkof-profile :where(.dgkof-actions,.dgkof-toolbar,.dgkof-form-actions),
    .dgkofh-player-area :where(.dgkof-actions,.dgkof-toolbar,.dgkof-form-actions) {
        flex-wrap: wrap;
    }

    .dgkof-hub :where(.dgkof-actions > button,.dgkof-actions > a,.dgkof-form-actions > button,.dgkof-form-actions > a),
    .dgkof-directory :where(.dgkof-actions > button,.dgkof-actions > a,.dgkof-form-actions > button,.dgkof-form-actions > a),
    .dgkof-profile :where(.dgkof-actions > button,.dgkof-actions > a,.dgkof-form-actions > button,.dgkof-form-actions > a) {
        max-width: 100%;
    }
}

/* Touch devices: remove hover-only assumptions. */
@media (hover: none) and (pointer: coarse) {
    .dgkof-hub a:hover, .dgkof-directory a:hover, .dgkof-profile a:hover,
    .dgkof-account-box a:hover, .dgkofh-player-area a:hover { text-decoration-thickness: initial; }
}

/* Admin screens inherit the same interaction rules without restyling WordPress globally. */
.dgkofh-admin :where(.button,.button-primary,.button-secondary) { min-height: 44px; }
