/* Lekkie widoki publiczne na Bootstrap 5 @see protected/views/layouts/public_search.php */

:root {
    --ps-ink: #2b3138;
    --ps-muted: #6b7480;
    --ps-line: #e0e4e8;
    --ps-bg: #f2f4f6;
    --ps-accent: #ff7a00;
    --ps-link: #00a0e3;
}

.ps-body {
    font-family: 'Roboto Condensed', system-ui, sans-serif;
    background: var(--ps-bg);
    color: var(--ps-ink);
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.ps-shell {
    max-width: 620px;
    margin: 0 auto;
    padding: 0 12px;
    min-width: 0;
}

.ps-main {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ps-nav,
.ps-race,
.ps-fixed {
    flex: none;
}

.ps-app {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.ps-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 12px 0 20px;
}

.ps-fixed {
    padding-top: 2px;
}

.ps-notice {
    background: #fff;
    border: 1px solid var(--ps-line);
    border-left: 6px solid var(--ps-accent);
    border-radius: 6px;
    padding: 16px 16px 14px;
}

.ps-notice-title {
    font-family: 'Teko', sans-serif;
    font-size: 24px;
    line-height: 24px;
    text-transform: uppercase;
}

.ps-notice p {
    margin: 6px 0 0;
    font-size: 14px;
    color: var(--ps-muted);
}

.ps-nav {
    background: #fff;
    border-bottom: 1px solid var(--ps-line);
    padding: 8px 0;
}

.ps-nav-brand img {
    max-height: 34px;
}

.ps-nav-link {
    color: var(--ps-ink);
    text-decoration: none;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ps-nav-link:hover {
    color: var(--ps-accent);
}

.ps-nav-flag {
    display: flex;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.ps-nav-flag img {
    height: 16px;
    border-radius: 2px;
}

.ps-footer {
    flex-shrink: 0;
    background: #fff;
    border-top: 1px solid var(--ps-line);
    padding: 14px 0;
    font-size: 12.5px;
    color: var(--ps-muted);
}

.ps-footer .ps-shell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: space-between;
}

.ps-footer a {
    color: var(--ps-muted);
}

.ps-race {
    background: #fff;
    border-bottom: 1px solid var(--ps-line);
    padding: 12px 0 10px;
}

.ps-race .ps-shell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ps-race-body {
    flex: 1;
    min-width: 0;
}

.ps-race .ps-pill {
    flex: none;
    align-self: center;
    margin-left: auto;
}

.ps-race-logo {
    max-height: 48px;
    max-width: 80px;
    border-radius: 3px;
}

.ps-race-name {
    font-family: 'Teko', sans-serif;
    font-size: 27px;
    line-height: 27px;
    text-transform: uppercase;
    overflow-wrap: anywhere;
}

.ps-race-meta {
    font-size: 13px;
    color: var(--ps-muted);
    overflow-wrap: anywhere;
}

.ps-pill {
    display: inline-block;
    font-size: 11px;
    line-height: 18px;
    padding: 0 8px;
    border-radius: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
}

.ps-pill-live {
    background: #ffe9d6;
    color: #b4530a;
}

.ps-pill-final {
    background: #e2f3e5;
    color: #1f7a33;
}

.ps-pill-soon {
    background: #e7ecf1;
    color: #4a5561;
}

.ps-searchbox {
    background: #fff;
    border: 1px solid #d9dee3;
    border-radius: 6px;
    padding: 10px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
}

.ps-searchbox label {
    font-size: 13px;
    color: #5a636d;
    margin-bottom: 4px;
    display: block;
}

.ps-searchbox input {
    width: 100%;
    height: 52px;
    font-size: 20px;
    padding: 6px 12px;
    border: 2px solid #c9d0d7;
    border-radius: 4px;
}

.ps-searchbox input:focus {
    border-color: var(--ps-link);
    outline: none;
}

.ps-status {
    font-size: 12px;
    color: var(--ps-muted);
    margin: 10px 2px 6px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    min-height: 18px;
}

.ps-busy {
    opacity: .45;
    transition: opacity .15s;
}

.ps-group {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #8b939c;
    margin: 14px 2px 6px;
    border-bottom: 1px solid var(--ps-line);
    padding-bottom: 3px;
}

.ps-hit {
    display: block;
    background: #fff;
    border: 1px solid var(--ps-line);
    border-left: 4px solid #cfd5da;
    border-radius: 5px;
    padding: 10px 12px;
    margin-bottom: 8px;
    color: var(--ps-ink);
    text-decoration: none;
}

.ps-hit:hover,
.ps-hit:focus {
    color: var(--ps-ink);
    border-color: var(--ps-link);
    border-left-color: var(--ps-link);
}

.ps-hit-finished { border-left-color: #2e9e4b; }
.ps-hit-progress { border-left-color: var(--ps-accent); }
.ps-hit-dnf { border-left-color: #9aa2aa; }
.ps-hit-out { border-left-color: #c0392b; }

.ps-hit-race {
    font-size: 12px;
    color: #8b939c;
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px dashed #eef1f3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-hit-top {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.ps-bib {
    font-family: 'Teko', sans-serif;
    font-size: 22px;
    line-height: 22px;
    background: var(--ps-ink);
    color: #fff;
    border-radius: 3px;
    padding: 1px 7px 0;
}

.ps-who {
    font-size: 17px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
}

.ps-who-hidden {
    font-weight: 400;
    font-style: italic;
    text-transform: none;
    color: var(--ps-muted);
}

.ps-time {
    font-family: 'Teko', sans-serif;
    font-size: 25px;
    line-height: 25px;
    white-space: nowrap;
}

.ps-hit-bot {
    display: flex;
    gap: 10px;
    font-size: 12.5px;
    color: var(--ps-muted);
    margin-top: 3px;
    flex-wrap: wrap;
}

.ps-hit-bot b {
    color: var(--ps-ink);
}

.ps-chev {
    color: #b6bdc4;
    font-size: 12px;
    margin-left: auto;
}

.ps-state {
    font-size: 12px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
}

.ps-state-track {
    background: #fff2d6;
    color: #8a5d00;
}

.ps-state-out {
    background: #f8e3e3;
    color: #a62a2a;
}

.ps-empty {
    overflow-wrap: anywhere;
    background: #fff;
    border: 1px dashed #cdd3d9;
    border-radius: 6px;
    padding: 18px 14px;
    text-align: center;
    color: var(--ps-muted);
}

.ps-empty strong {
    color: var(--ps-ink);
}

.ps-empty ul {
    text-align: left;
    display: inline-block;
    margin: 8px 0 0;
    padding-left: 18px;
    font-size: 13px;
}

.ps-links {
    margin-top: 18px;
    display: flex;
    gap: 8px;
}

.ps-links a {
    flex: 1;
    text-align: center;
    padding: 12px 6px;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
}

.ps-btn-solid {
    background: var(--ps-ink);
    color: #fff;
}

.ps-btn-solid:hover,
.ps-btn-solid:focus {
    color: #fff;
}

.ps-btn-ghost {
    background: #fff;
    color: var(--ps-ink);
    border: 1px solid #cdd3d9;
}

.ps-btn-ghost:hover,
.ps-btn-ghost:focus {
    color: var(--ps-ink);
}

[x-cloak] {
    display: none !important;
}

.ps-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

@media (min-width: 576px) {
    .ps-modal {
        align-items: center;
    }
}

.ps-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 26, 32, .55);
}

.ps-modal-card {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 480px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 24px rgba(20, 30, 40, .22);
}

@media (min-width: 576px) {
    .ps-modal-card {
        border-radius: 8px;
        margin: 0 12px;
    }
}

.ps-modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: none;
    border: 0;
    font-size: 28px;
    line-height: 28px;
    color: #b6bdc4;
}

.ps-modal-toast {
    margin-top: 10px;
    text-align: center;
    font-size: 13px;
    color: #1f7a33;
}

.ps-modal-card > div[x-ref] {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.ps-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    border-left: 6px solid #cfd5da;
}

.ps-card-stale { border-left-color: #9aa2aa; }

.ps-card-stale .ps-card-who {
    font-family: 'Teko', sans-serif;
    font-size: 26px;
    line-height: 26px;
    font-weight: 400;
    max-height: none;
}

.ps-stale-text {
    margin: 12px 0 0;
    font-size: 14px;
    color: var(--ps-muted);
}

.ps-card-finished { border-left-color: #2e9e4b; }
.ps-card-progress { border-left-color: var(--ps-accent); }
.ps-card-dnf { border-left-color: #9aa2aa; }
.ps-card-out { border-left-color: #c0392b; }

.ps-card-header {
    flex: none;
    padding: 16px 40px 10px 14px;
    border-bottom: 2px solid var(--ps-ink);
    background: #fff;
}

.ps-card-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 14px 16px;
    overscroll-behavior: contain;
}

.ps-card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ps-card-who {
    --ps-who-line: 23px;
    font-size: 21px;
    font-weight: 700;
    text-transform: uppercase;
    line-height: var(--ps-who-line);
    margin-top: 4px;
    max-height: calc(5.5 * var(--ps-who-line));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.ps-card-member {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-card-state {
    flex: none;
    background: #eef1f4;
    color: #5a636d;
}

.ps-card-finished .ps-card-state { background: #e2f3e5; color: #1f7a33; }
.ps-card-progress .ps-card-state { background: #fff2d6; color: #8a5d00; }
.ps-card-dnf .ps-card-state { background: #eef1f4; color: #5a636d; }
.ps-card-out .ps-card-state { background: #f8e3e3; color: #a62a2a; }

.ps-card-race {
    font-size: 12.5px;
    color: var(--ps-muted);
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-sheet {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.ps-sheet tr:nth-child(odd) {
    background: #f7f9fa;
}

.ps-sheet th {
    text-align: left;
    font-weight: 400;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: #8b939c;
    padding: 8px 8px 8px 6px;
    width: 52%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-sheet td {
    text-align: right;
    padding: 8px 6px 8px 0;
    font-family: 'Teko', sans-serif;
    font-size: 24px;
    line-height: 24px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ps-sheet td small {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 12px;
    color: #8b939c;
}

.ps-sheet-lead th {
    color: var(--ps-ink);
    font-weight: 700;
}

.ps-sheet-lead td {
    font-size: 32px;
    line-height: 30px;
}

.ps-card-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: #9aa2aa;
    margin: 16px 0 8px;
}

.ps-legs {
    --ps-leg-row: 22px;
    --ps-leg-center: 11px;
    --ps-leg-mark: 14px;
}

.ps-leg {
    display: flex;
    gap: 10px;
    min-width: 0;
}

.ps-leg-mark {
    position: relative;
    flex: none;
    width: var(--ps-leg-mark);
}

.ps-leg-mark:before {
    content: '';
    position: absolute;
    left: calc((var(--ps-leg-mark) - 2px) / 2);
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e0e4e8;
}

.ps-leg:first-child .ps-leg-mark:before {
    top: var(--ps-leg-center);
}

.ps-leg:last-child .ps-leg-mark:before {
    bottom: calc(100% - var(--ps-leg-center));
}

.ps-leg-dot {
    position: absolute;
    left: calc((var(--ps-leg-mark) - 14px) / 2);
    top: var(--ps-leg-center);
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #cfd5da;
}

.ps-leg-body {
    flex: 1;
    min-width: 0;
    padding-bottom: 14px;
}

.ps-leg-highlight .ps-leg-body {
    background: #fff3d6;
    border-left: 3px solid var(--ps-accent);
    border-radius: 0 4px 4px 0;
    margin-bottom: 14px;
    padding: 6px 10px;
}

.ps-leg-highlight .ps-leg-dot {
    border-color: var(--ps-accent);
    background: var(--ps-accent);
    box-shadow: 0 0 0 4px rgba(255, 122, 0, .18);
}

.ps-leg:last-child .ps-leg-body {
    padding-bottom: 0;
}

.ps-leg-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: var(--ps-leg-row);
    min-width: 0;
}

.ps-leg-name {
    font-size: 15px;
    font-weight: 700;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ps-leg-time {
    flex: none;
    font-family: 'Teko', sans-serif;
    font-size: 22px;
}

.ps-leg-meta {
    font-size: 12px;
    color: #8b939c;
    line-height: 16px;
}

.ps-leg-meta b {
    color: var(--ps-ink);
    font-weight: 400;
}

.ps-leg-transition {
    --ps-leg-row: 18px;
    --ps-leg-center: 9px;
}

.ps-leg-transition .ps-leg-body {
    padding-bottom: 8px;
    color: #9aa2aa;
}

.ps-leg-transition .ps-leg-name {
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.ps-leg-transition .ps-leg-time {
    font-size: 16px;
    color: #9aa2aa;
}

.ps-leg-transition .ps-leg-dot {
    left: calc((var(--ps-leg-mark) - 8px) / 2);
    width: 8px;
    height: 8px;
    border-width: 2px;
}

.ps-legs-disciplines {
    --ps-leg-mark: 22px;
}

.ps-leg-icon {
    position: absolute;
    left: 0;
    top: var(--ps-leg-center);
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--ps-leg-mark);
    height: var(--ps-leg-mark);
    border-radius: 50%;
    background: #fff;
}

.ps-leg-icon img {
    display: block;
    width: 16px;
    height: 16px;
}

.ps-leg-place {
    flex: none;
    font-family: 'Teko', sans-serif;
    font-size: 15px;
    line-height: 15px;
    padding: 2px 7px;
    border-radius: 10px;
    background: #eef1f4;
    color: #5a636d;
}

.ps-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 18px;
}

.ps-card-actions > * {
    flex: 1;
    min-width: 0;
    text-align: center;
    padding: 11px 6px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
}

.ps-card-actions .ps-btn-ghost {
    border: 1px solid #cdd3d9;
}

.ps-card-actions button:disabled {
    background: #f2f4f6;
    border-color: #e0e4e8;
    color: #b6bdc4;
    cursor: not-allowed;
}

.ps-sponsors {
    flex-shrink: 0;
    border-top: 1px solid var(--ps-line);
    overflow: hidden;
    padding: 8px 0;

    background: repeating-linear-gradient(
        90deg,
        #f4f6f8 0,
        #e6eaee 220px,
        #f4f6f8 440px
    );
}

.ps-sponsors-track {
    display: flex;
    align-items: stretch;
    width: max-content;
    animation: ps-sponsors-scroll var(--ps-sponsors-duration, 20s) linear infinite;
}

.ps-sponsors.is-hovered .ps-sponsors-track,
.ps-sponsors:has(:focus-visible) .ps-sponsors-track,
.ps-sponsors.is-paused .ps-sponsors-track {
    animation-play-state: paused;
}

@keyframes ps-sponsors-scroll {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(calc(-1 * var(--ps-sponsors-width, 100%)), 0, 0);
    }
}

.ps-sponsors-copy {
    display: flex;
    align-items: stretch;
    flex: none;
}

.ps-sponsor-group {
    flex: none;
    padding: 0 18px;
    border-right: 1px solid #dde2e7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
}

.ps-sponsor-group-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #8b939c;
    text-align: center;
    white-space: nowrap;
}

.ps-sponsor-group-logos {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-sponsor {
    flex: none;
    width: 110px;
    height: 44px;
    margin: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ps-sponsor {
    text-decoration: none;
}

.ps-sponsor:focus-visible {
    outline: 2px solid var(--ps-link);
    outline-offset: 2px;
    border-radius: 3px;
}

.ps-sponsor img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 1px rgba(20, 30, 40, .5));
}

@media (prefers-reduced-motion: reduce) {
    .ps-sponsors-track { animation: none; }
    .ps-sponsors { overflow-x: auto; }
}
