/*
 * duels.css
 * Public Duels page (duels.php). Colour tokens (--pp-*) come from pp-navbar.css.
 */

:root {
    --dl-ink: #0a1714;
    --dl-felt-deep: #0d4a32;
    --dl-cream-2: #ece3cf;
    --dl-red: #c62828;
    --dl-line: rgba(10, 23, 20, .1);
    --dl-pad: clamp(16px, 4vw, 40px);
}

body { background: var(--dl-ink); font-family: 'Poppins', sans-serif; }

.dl-wrap { max-width: 1100px; margin: 0 auto; }
.dl-sec { padding: clamp(48px, 8vw, 88px) var(--dl-pad); }
.dl-sec-dark { background: var(--dl-ink); color: var(--pp-cream); }
.dl-sec-cream { background: var(--pp-cream); color: var(--dl-ink); }
.dl-sec[hidden] { display: none; }

.dl-h2 {
    font-family: 'Bebas Neue', sans-serif;
    font-weight: 400;
    font-size: clamp(2.2rem, 8vw, 3.4rem);
    line-height: .95;
    margin: 0 0 8px;
}
.dl-h2-gap { margin-top: 48px; }
.dl-h3 { font-size: 1rem; font-weight: 600; margin: 0 0 14px; display: flex; gap: 10px; align-items: center; }
.dl-h3 i { color: var(--pp-gold); }
.dl-sub { color: rgba(10, 23, 20, .65); margin: 0 0 28px; }

/* ---------- buttons ---------- */
.dl-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    min-height: 52px; padding: 0 26px;
    border-radius: 999px; border: 2px solid transparent;
    font: inherit; font-weight: 600; font-size: 1rem;
    text-decoration: none; cursor: pointer;
    transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.dl-btn:focus-visible { outline: 3px solid var(--pp-gold-light); outline-offset: 3px; }
.dl-btn:disabled { opacity: .6; cursor: wait; }
.dl-btn-gold { background: var(--pp-gold); color: var(--dl-ink); box-shadow: 0 5px 0 #a9822f; }
.dl-btn-gold:hover { background: var(--pp-gold-light); color: var(--dl-ink); transform: translateY(-1px); }
.dl-btn-gold:active { transform: translateY(3px); box-shadow: 0 2px 0 #a9822f; }
.dl-btn-ghost { background: transparent; color: inherit; border-color: currentColor; opacity: .85; }
.dl-btn-ghost:hover { opacity: 1; color: inherit; }
.dl-btn-danger { background: transparent; color: #ff8a80; border-color: rgba(255, 138, 128, .5); }
.dl-btn-sm { min-height: 40px; padding: 0 16px; font-size: .85rem; box-shadow: none; }

/* ---------- hero ---------- */
.dl-hero {
    padding: 112px var(--dl-pad) 56px;
    color: var(--pp-cream);
    background:
        radial-gradient(ellipse 70% 60% at 85% 10%, rgba(198, 40, 40, .25), transparent 60%),
        radial-gradient(ellipse 70% 60% at 10% 100%, rgba(20, 112, 74, .5), transparent 70%),
        var(--dl-ink);
}
.dl-eyebrow { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--pp-gold); margin-bottom: 12px; }
.dl-title {
    font-family: 'Bebas Neue', sans-serif; font-weight: 400;
    font-size: clamp(3.2rem, 14vw, 6rem); line-height: .9; margin: 0 0 18px;
}
.dl-title span { color: var(--pp-gold); }
.dl-lead { max-width: 34em; color: rgba(245, 239, 225, .78); line-height: 1.65; margin: 0 0 26px; }
.dl-lead b { color: var(--pp-gold-light); }
.dl-hero-ctas { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 520px) { .dl-hero-ctas { flex-direction: row; } }

/* ---------- form ---------- */
.dl-form {
    background: #fff;
    border: 1px solid var(--dl-line);
    border-radius: 24px;
    padding: clamp(18px, 4vw, 32px);
    display: grid;
    gap: 22px;
    box-shadow: 0 20px 50px rgba(10, 23, 20, .08);
}
.dl-label { display: block; font-size: .8rem; font-weight: 600; color: rgba(10, 23, 20, .7); margin-bottom: 6px; }
.dl-label small { font-weight: 400; color: rgba(10, 23, 20, .5); }
.dl-form input[type="text"], .dl-form input[type="tel"], .dl-form input[type="number"],
.dl-form input[type="date"], .dl-form input[type="time"], .dl-form select, .dl-form textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;                 /* 16px: no iOS zoom */
    padding: 12px 14px;
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid rgba(10, 23, 20, .16);
    background: var(--pp-cream);
    color: var(--dl-ink);
}
.dl-form input:focus, .dl-form select:focus, .dl-form textarea:focus {
    outline: none; border-color: var(--pp-felt); box-shadow: 0 0 0 3px rgba(20, 112, 74, .2);
}

.dl-vs { display: grid; gap: 12px; align-items: start; }
@media (min-width: 760px) { .dl-vs { grid-template-columns: 1fr auto 1fr; } }
.dl-vs-badge {
    justify-self: center;
    width: 52px; height: 52px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--dl-ink); color: var(--pp-gold);
    font-family: 'Bebas Neue', sans-serif; font-size: 1.5rem;
    box-shadow: 0 0 0 5px rgba(224, 182, 89, .2);
}
@media (min-width: 760px) { .dl-vs-badge { margin-top: 30px; } }
.dl-slot { position: relative; min-width: 0; }
.dl-search { position: relative; }
.dl-search[hidden] { display: none; }
.dl-search > i { position: absolute; left: 14px; top: 16px; color: rgba(10, 23, 20, .4); }
.dl-search input { padding-left: 40px !important; }
.dl-results {
    display: none;
    position: absolute; left: 0; right: 0; top: calc(100% + 6px);
    z-index: 20;
    background: #fff;
    border: 1px solid var(--dl-line);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(10, 23, 20, .18);
    max-height: 340px; overflow-y: auto;
    padding: 6px;
}
.dl-results.open { display: block; }
.dl-result {
    width: 100%;
    display: flex; align-items: center; gap: 12px;
    padding: 10px; min-height: 52px;
    border: none; background: transparent; border-radius: 10px;
    text-align: left; font: inherit; color: var(--dl-ink); cursor: pointer;
}
.dl-result:hover:not([disabled]), .dl-result:focus-visible { background: var(--pp-cream); outline: none; }
.dl-result[disabled] { opacity: .5; cursor: not-allowed; }
.dl-result span { display: flex; flex-direction: column; min-width: 0; }
.dl-result b { font-size: .95rem; font-weight: 600; }
.dl-result small { font-size: .78rem; color: rgba(10, 23, 20, .55); }
.dl-result-none { padding: 14px; font-size: .9rem; color: rgba(10, 23, 20, .55); }

.dl-picked {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 16px;
    background: var(--dl-ink);
    color: var(--pp-cream);
    border: 2px solid var(--pp-gold);
}
.dl-picked[hidden] { display: none; }
.dl-picked .dl-av { grid-row: 1 / 3; }
.dl-picked b { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-picked small { grid-column: 2; font-size: .78rem; color: rgba(245, 239, 225, .6); }
.dl-change {
    grid-column: 3; grid-row: 1 / 3;
    min-height: 40px; padding: 0 14px; border-radius: 999px;
    border: 1px solid rgba(245, 239, 225, .3); background: transparent; color: var(--pp-cream);
    font: inherit; font-size: .8rem; cursor: pointer;
}

.dl-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .dl-grid { grid-template-columns: repeat(4, 1fr); } }
.dl-full { grid-column: 1 / -1; }
.dl-field { min-width: 0; }
.dl-field[hidden] { display: none; }

.dl-seg { display: flex; border-radius: 12px; background: var(--pp-cream); padding: 4px; border: 1px solid rgba(10, 23, 20, .16); }
.dl-seg label { flex: 1; margin: 0; }
.dl-seg input { position: absolute; opacity: 0; pointer-events: none; }
.dl-seg span { display: grid; place-items: center; min-height: 38px; border-radius: 9px; font-size: .88rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.dl-seg input:checked + span { background: var(--dl-ink); color: var(--pp-gold); }
.dl-seg input:focus-visible + span { outline: 2px solid var(--pp-felt); }

.dl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.dl-chips button {
    min-height: 44px; padding: 0 18px; border-radius: 999px;
    border: 1px solid rgba(10, 23, 20, .18); background: #fff;
    font: inherit; font-weight: 600; cursor: pointer;
}
.dl-chips button.is-on { background: var(--dl-ink); color: var(--pp-gold); border-color: var(--dl-ink); }
.dl-hint { font-size: .82rem; color: rgba(10, 23, 20, .6); margin: 8px 0 0; }

.dl-pay { display: grid; gap: 12px; padding-top: 4px; border-top: 1px dashed var(--dl-line); }
.dl-pay > .dl-label { margin-top: 18px; margin-bottom: 0; }
.dl-pay-opts { display: grid; gap: 10px; }
@media (min-width: 560px) { .dl-pay-opts { grid-template-columns: 1fr 1fr; } }
.dl-pay-opt { margin: 0; cursor: pointer; }
.dl-pay-opt input { position: absolute; opacity: 0; pointer-events: none; }
.dl-pay-opt > span {
    display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center;
    padding: 14px; min-height: 64px;
    border: 2px solid rgba(10, 23, 20, .12); border-radius: 14px;
}
.dl-pay-opt i { grid-row: 1 / 3; font-size: 1.3rem; color: var(--pp-felt); width: 28px; text-align: center; }
.dl-pay-opt b { font-size: .95rem; }
.dl-pay-opt small { font-size: .78rem; color: rgba(10, 23, 20, .55); }
.dl-pay-opt input:checked + span { border-color: var(--pp-felt); background: rgba(20, 112, 74, .06); }
.dl-pay-opt input:focus-visible + span { outline: 3px solid rgba(20, 112, 74, .3); }

.dl-note { display: flex; gap: 10px; align-items: flex-start; font-size: .85rem; line-height: 1.5; margin: 0; padding: 12px 14px; border-radius: 12px; }
.dl-note i { margin-top: 3px; }
.dl-note-ok { background: rgba(20, 112, 74, .08); color: #0b5a38; }
.dl-note-warn { background: rgba(198, 40, 40, .07); color: #8e1f1f; }
.dl-note a { color: inherit; font-weight: 600; }

.dl-summary:empty { display: none; }
.dl-summary {
    padding: 16px; border-radius: 16px;
    background: var(--dl-ink); color: var(--pp-cream);
    display: grid; gap: 8px; text-align: center;
}
.dl-sum-vs { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dl-sum-vs span { font-family: 'Bebas Neue', sans-serif; color: var(--pp-gold); font-size: 1.3rem; }
.dl-sum-meta { font-size: .85rem; color: rgba(245, 239, 225, .7); }
.dl-sum-prize b { color: var(--pp-gold); }

.dl-error { padding: 12px 14px; border-radius: 12px; background: #fdecea; color: #8e1f1f; font-weight: 500; }
.dl-error[hidden] { display: none; }
.dl-submit { width: 100%; }

/* ---------- avatars ---------- */
.dl-av {
    position: relative; flex-shrink: 0;
    width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
    display: grid; place-items: center;
    background: var(--pp-felt); color: #fff;
    font-weight: 700; font-size: .85rem;
}
.dl-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dl-av i { font-style: normal; }
.dl-av-sm { width: 34px; height: 34px; font-size: .75rem; }
.dl-av-lg { width: 52px; height: 52px; font-size: 1rem; }

/* ---------- cards / lists ---------- */
.dl-list { display: grid; gap: 14px; }
.dl-board { grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 760px) { .dl-board { grid-template-columns: 1fr 1fr; } }
.dl-mine-grid { display: grid; gap: 32px; margin-top: 20px; }
@media (min-width: 900px) { .dl-mine-grid { grid-template-columns: 1fr 1fr; } }
.dl-empty { padding: 22px; border-radius: 16px; border: 1px dashed rgba(245, 239, 225, .2); color: rgba(245, 239, 225, .6); font-size: .9rem; }
.dl-empty a { color: var(--pp-gold); }
.dl-empty i { color: var(--pp-gold); margin-right: 6px; }

.dl-card {
    padding: 16px;
    border-radius: 18px;
    background: var(--pp-dark-2, #1b2e2a);
    border: 1px solid rgba(245, 239, 225, .08);
    color: var(--pp-cream);
    display: grid; gap: 12px;
    min-width: 0;
}
.dl-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.dl-prize { font-family: 'Bebas Neue', sans-serif; font-size: 1.6rem; color: var(--pp-gold); line-height: 1; }
.dl-chip { font-size: .7rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.dl-chip-wait { background: rgba(224, 182, 89, .15); color: var(--pp-gold-light); }
.dl-chip-on { background: var(--dl-red); color: #fff; }
.dl-chip-done { background: rgba(31, 144, 97, .25); color: #7fe0b0; }
.dl-chip-off { background: rgba(245, 239, 225, .08); color: rgba(245, 239, 225, .55); }

.dl-card-vs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.dl-pl {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    color: var(--pp-cream); text-decoration: none; text-align: center; min-width: 0;
}
.dl-pl:hover { color: var(--pp-gold-light); }
.dl-pl b { font-size: .88rem; font-weight: 600; overflow-wrap: anywhere; }
.dl-pl.is-win b { color: var(--pp-gold); }
.dl-pl.is-win .dl-av { box-shadow: 0 0 0 3px var(--pp-gold); }
.dl-vs-sm { font-family: 'Bebas Neue', sans-serif; font-size: 1.3rem; color: rgba(245, 239, 225, .45); }
.dl-score { font-family: 'Bebas Neue', sans-serif; font-size: 1.8rem; color: var(--pp-cream); white-space: nowrap; }
.dl-ok { color: #7fe0b0; }
.dl-no { color: #ff8a80; }
.dl-wait { color: rgba(245, 239, 225, .45); }
.dl-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: rgba(245, 239, 225, .62); }
.dl-card-meta i { color: var(--pp-gold); margin-right: 5px; }
.dl-card-meta a.dl-arena-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(245, 239, 225, .3); text-underline-offset: 3px; }
.dl-card-meta a.dl-arena-link:hover { color: var(--pp-gold); text-decoration-color: currentColor; }
.dl-card-msg { margin: 0; font-size: .85rem; font-style: italic; color: rgba(245, 239, 225, .75); }
.dl-card-note { margin: 0; font-size: .8rem; color: rgba(245, 239, 225, .6); }
.dl-card-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.dl-card-actions .dl-btn { flex: 1; }

/* ---------- rules ---------- */
.dl-rules ol { counter-reset: r; list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 14px; }
.dl-rules li {
    counter-increment: r;
    position: relative;
    padding: 18px 18px 18px 64px;
    background: #fff; border-radius: 16px; border: 1px solid var(--dl-line);
    line-height: 1.6; color: rgba(10, 23, 20, .75);
}
.dl-rules li::before {
    content: counter(r);
    position: absolute; left: 16px; top: 16px;
    width: 34px; height: 34px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--dl-ink); color: var(--pp-gold); font-weight: 700;
}
.dl-rules b { color: var(--dl-ink); }

/* ---------- payment dialog ---------- */
.dl-modal {
    position: fixed; inset: 0; z-index: 2000;
    display: grid; place-items: center;
    padding: 16px;
    background: rgba(5, 10, 9, .7);
    backdrop-filter: blur(4px);
}
.dl-modal[hidden] { display: none; }
.dl-modal-card {
    width: min(420px, 100%);
    background: #fff; color: var(--dl-ink);
    border-radius: 24px; padding: 32px 24px 24px;
    text-align: center;
    display: grid; gap: 10px; justify-items: center;
}
.dl-modal-card h3 { margin: 0; font-weight: 700; }
.dl-modal-card p { margin: 0 0 10px; color: rgba(10, 23, 20, .7); line-height: 1.55; }
.dl-modal-icon { font-size: 2.6rem; color: var(--pp-felt); }
.dl-modal-icon.is-ok { color: #1f9061; }
.dl-modal-icon.is-fail { color: var(--dl-red); }
.dl-modal-card .dl-btn { width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .dl-modal-icon i { animation: none !important; }
}
