* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Xpat Charity Party 2026 — Bonfire Night: night navy + light cards */
    --ink: #f7f3ee;
    --muted: #9aa8c0;
    --ember: #ff7a2f;
    --ember-hot: #ff4d1a;
    --amber: #ffc857;
    --navy: #0a1020;
    --navy-mid: #121a30;
    --line: rgba(255, 200, 87, 0.22);
    --card: linear-gradient(165deg, #ffffff 0%, #f7f2ea 55%, #f0e8dc 100%);
    --card-ink: #1a1624;
    --card-muted: #6b6474;
    --danger: #e04b4b;
    --ok: #2f8f62;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    color: var(--ink);
    font-family: Outfit, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    background-color: var(--navy);
    background-image:
        radial-gradient(ellipse 62% 44% at 50% -6%, rgba(255, 90, 30, 0.42), transparent 60%),
        radial-gradient(ellipse 40% 32% at 100% 12%, rgba(255, 200, 87, 0.18), transparent 68%),
        radial-gradient(ellipse 44% 36% at -8% 88%, rgba(40, 70, 160, 0.28), transparent 70%),
        linear-gradient(180deg, #141c34 0%, #0a1020 48%, #060810 100%);
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: 0;
    background: none;
}

.wrap {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 24px 72px;
}

@media (min-width: 1100px) {
    .wrap {
        padding-left: 40px;
        padding-right: 40px;
    }
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.mark {
    display: block;
    font-family: Fraunces, Georgia, serif;
    font-size: 15px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--amber);
}

.sub {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.count {
    color: var(--muted);
    font-size: 14px;
    letter-spacing: 0.04em;
}

.intro {
    max-width: 640px;
    margin: 28px 0 32px;
}

.intro h1 {
    font-family: Fraunces, Georgia, serif;
    font-weight: 560;
    font-size: clamp(40px, 6vw, 68px);
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.intro p {
    margin-top: 14px;
    color: var(--muted);
    font-size: 17px;
}

.lots {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.lot {
    --d: 0ms;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    text-align: left;
    padding: 22px 20px 20px;
    border-radius: 22px;
    color: var(--card-ink);
    background: var(--card);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        0 22px 48px rgba(0, 0, 0, 0.42),
        0 2px 0 rgba(255, 255, 255, 0.7) inset,
        0 0 0 1px rgba(255, 122, 47, 0.18);
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    opacity: 0;
    transform: translateY(28px) scale(0.97);
}

.lot.is-animating {
    animation: lotReveal 1.45s cubic-bezier(0.33, 0.05, 0.2, 1) both;
    animation-delay: var(--d);
}

.lot.is-in {
    opacity: 1;
    transform: none;
    animation: none;
    transition:
        transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
        border-color 0.3s ease,
        box-shadow 0.35s ease;
}

.lot.is-in .lot-veil,
.lot.is-in .lot-loader {
    display: none;
}

/* Soft continuous fade: ghost early, then brighten as the veil finishes. */
@keyframes lotReveal {
    0% {
        opacity: 0;
        transform: translateY(22px) scale(0.97);
    }
    14% {
        opacity: 0.3;
        transform: translateY(8px) scale(0.99);
    }
    68% {
        opacity: 0.36;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.lot-veil {
    pointer-events: none;
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 20px;
    border-radius: inherit;
    background:
        linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, 0.5) 50%, transparent 62%),
        linear-gradient(180deg, #fbf8f3 0%, #f0e8dc 100%);
    background-size: 220% 100%, 100% 100%;
    background-position: 120% 0, 0 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(0);
    opacity: 1;
}

.lot.is-animating .lot-veil {
    animation:
        lotUnveil 1.45s cubic-bezier(0.25, 0.8, 0.25, 1) both,
        lotSkelShine 1.45s ease-in-out both;
    animation-delay: var(--d), var(--d);
}

@keyframes lotUnveil {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    10% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(105%);
        opacity: 0.9;
    }
}

@keyframes lotSkelShine {
    0% {
        background-position: 120% 0, 0 0;
    }
    100% {
        background-position: -50% 0, 0 0;
    }
}

.lot-skel {
    display: block;
    border-radius: 10px;
    background: rgba(26, 22, 36, 0.08);
    box-shadow: inset 0 0 0 1px rgba(26, 22, 36, 0.04);
}

.lot-skel-line {
    width: 42%;
    height: 14px;
}

.lot-skel-title {
    width: 88%;
    height: 22px;
    margin-top: 4px;
}

.lot-skel-block {
    width: 100%;
    height: 52px;
    border-radius: 14px;
}

.lot-skel-block.is-wide {
    height: 72px;
}

.lot-skel-cta {
    width: 100%;
    height: 46px;
    margin-top: auto;
    border-radius: 999px;
    background: rgba(255, 122, 47, 0.16);
}

.lot-loader {
    pointer-events: none;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    opacity: 0;
    visibility: hidden;
}

.lot.is-animating .lot-top {
    z-index: 7;
}

.lot.is-animating .lot-loader {
    visibility: visible;
    animation: lotLoaderFade 1.45s ease both;
    animation-delay: var(--d);
}

.lot-loader span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #c45a1a;
    box-shadow: 0 1px 4px rgba(196, 90, 26, 0.3);
    animation: lotDotPulse 0.95s ease-in-out infinite;
}

.lot-loader span:nth-child(2) {
    animation-delay: 0.16s;
}

.lot-loader span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes lotDotPulse {
    0%,
    80%,
    100% {
        transform: translateY(0) scale(0.82);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-5px) scale(1);
        opacity: 1;
    }
}

@keyframes lotLoaderFade {
    0%,
    78% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

.lot-glow {
    pointer-events: none;
    position: absolute;
    inset: -40% -20% auto;
    height: 70%;
    background: radial-gradient(ellipse at 50% 0%, rgba(255, 122, 47, 0.22), transparent 65%);
    opacity: 0.7;
    z-index: 0;
    transition: opacity 0.35s ease, transform 0.45s ease;
}

.lot > *:not(.lot-glow):not(.lot-veil) {
    position: relative;
    z-index: 1;
}

.lot.is-in:hover,
.lot.is-in:focus-visible,
.lot.is-in.is-touch {
    transform: translateY(-8px) scale(1.02);
    border-color: #fff;
    box-shadow:
        0 32px 60px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 122, 47, 0.35),
        0 0 36px rgba(255, 90, 30, 0.2);
    outline: none;
}

.lot.is-in:hover .lot-glow,
.lot.is-in:focus-visible .lot-glow,
.lot.is-in.is-touch .lot-glow {
    opacity: 1;
    transform: scale(1.08);
}

.lot-top,
.lot-meta,
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.lot-index {
    flex: 0 0 auto;
    font-family: Fraunces, Georgia, serif;
    color: #c45a1a;
    font-size: 18px;
}

.pill {
    flex: 0 0 auto;
    align-self: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(47, 143, 98, 0.18);
    color: #1f6b45;
    border: 1px solid rgba(47, 143, 98, 0.35);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.pill.is-quiet {
    background: rgba(26, 22, 36, 0.06);
    color: var(--card-muted);
    border-color: transparent;
    font-weight: 600;
}

.lot-name {
    font-family: Fraunces, Georgia, serif;
    font-size: 22px;
    font-weight: 560;
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--card-ink);
}

.lot-meta {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: auto;
    padding-top: 8px;
    justify-content: initial;
}

.lot-meta div {
    min-width: 0;
}

.lot-meta dt,
.stat dt,
.field span,
.history h2,
.helper {
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lot-meta dd {
    margin-top: 4px;
    font-size: 15px;
    font-weight: 600;
}

.meta-value {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #e8e1d6;
    border: 1px solid rgba(26, 22, 36, 0.1);
}

.meta-value dt {
    flex: 0 0 auto;
    color: var(--card-muted);
}

.meta-value dd {
    margin-top: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(18px, 2.2vw, 24px);
    font-weight: 650;
    letter-spacing: -0.02em;
    text-align: right;
    color: var(--card-ink);
    font-variant-numeric: tabular-nums;
}

.meta-bid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 10px;
    border-radius: 14px;
    background: linear-gradient(145deg, #fff3e6, #ffe0c4);
    border: 1px solid rgba(255, 122, 47, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.meta-bid-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.meta-bid dt {
    flex: 0 0 auto;
    color: #9a3f10;
    font-weight: 600;
}

.meta-bid dd {
    margin-top: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(20px, 2.6vw, 28px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.03em;
    text-align: right;
    color: #c45a1a;
    font-variant-numeric: tabular-nums;
}

.bid-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bid-progress-track {
    flex: 1 1 auto;
    height: 6px;
    border-radius: 999px;
    background: rgba(196, 90, 26, 0.16);
    overflow: hidden;
}

.bid-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff7a2f, #c45a1a);
    box-shadow: none;
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.bid-progress-label {
    flex: 0 0 auto;
    min-width: 2.75em;
    color: #9a3f10;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.lot-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 46px;
    margin-top: 4px;
    padding: 0 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff9a4a 0%, var(--ember) 42%, var(--ember-hot) 100%);
    color: #1a0e08;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    box-shadow: 0 12px 28px rgba(255, 77, 26, 0.4);
    opacity: 0;
    transform: translateY(12px) scale(0.96);
    pointer-events: none;
    transition:
        opacity 0.28s ease,
        transform 0.32s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.28s ease;
}

.lot.is-in:hover .lot-go,
.lot.is-in:focus-visible .lot-go,
.lot.is-in.is-touch .lot-go {
    opacity: 1;
    transform: translateY(0) scale(1);
}

@media (hover: none) {
    .lot-go {
        opacity: 1;
        transform: none;
    }
}

.modal,
.response-modal {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
    background: rgba(6, 8, 16, 0.78);
}

.modal.is-open,
.response-modal.is-open {
    display: flex;
}

.response-modal {
    z-index: 30;
    align-items: center;
}

.dialog,
.response-content {
    width: min(680px, 100%);
    max-height: min(92vh, 900px);
    padding: 28px 22px 22px;
    border-radius: 24px;
    background: #faf7f2;
    color: #16141f;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

.dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

.dialog-body {
    overflow: auto;
    min-height: 0;
    padding: 28px 22px 22px;
}

.response-content {
    width: min(420px, 100%);
    max-height: none;
    text-align: center;
}

.modalClose {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #efe8de;
    color: #16141f;
    font-size: 22px;
    line-height: 1;
}

.modal-name {
    padding-right: 42px;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(26px, 4vw, 34px);
    line-height: 1.15;
    letter-spacing: -0.03em;
}

.stat-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    gap: 10px;
    margin: 18px 0 8px;
    padding: 0;
    border: 0;
    justify-content: initial;
}

.stat {
    padding: 12px 14px;
    border-radius: 14px;
    background: #f3ece4;
    border: 1px solid #e6ddd2;
}

.stat dd,
.leader {
    margin-top: 4px;
    font-weight: 600;
    font-size: 16px;
}

.stat-value {
    background: #fff;
    border-color: #dccfbf;
}

.stat-value dd,
.stat-bid dd {
    word-break: normal;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.stat-value dd {
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(18px, 2.4vw, 22px);
    font-weight: 650;
    letter-spacing: -0.02em;
    color: #16141f;
}

.stat-bid {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: linear-gradient(145deg, #fff0e4, #ffe0c8);
    border-color: rgba(255, 122, 47, 0.45);
    box-shadow: 0 0 0 1px rgba(255, 122, 47, 0.12);
}

.stat-bid .meta-bid-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-bid dt {
    color: #c45a1a;
    font-weight: 600;
}

.stat-bid dd {
    margin-top: 0;
    font-family: Fraunces, Georgia, serif;
    font-size: clamp(20px, 3vw, 28px);
    font-weight: 650;
    line-height: 1.15;
    letter-spacing: -0.03em;
    color: #c45a1a;
}

.stat-bid .bid-progress-track {
    background: rgba(196, 90, 26, 0.16);
}

.stat-bid .bid-progress-fill {
    background: linear-gradient(90deg, #ff7a2f, #c45a1a);
    box-shadow: none;
}

.stat-bid .bid-progress-label {
    color: #c45a1a;
}

.leader {
    margin: 12px 0 4px;
    color: #c45a1a;
}

.bid-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.field {
    display: grid;
    gap: 6px;
}

.field input {
    width: 100%;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid #e0d6ca;
    border-radius: 12px;
    background: #fff;
    color: #16141f;
    font-size: 16px;
}

.field input:focus {
    outline: 2px solid rgba(255, 122, 47, 0.4);
    border-color: var(--ember);
}

.bid-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
}

.step,
.submit,
.okayBtn {
    min-height: 48px;
    padding: 0 16px;
    border-radius: 12px;
    background: #16141f;
    color: #faf7f2;
    font-weight: 600;
}

.step {
    background: #ffe8d4;
    color: #9a3f10;
    white-space: nowrap;
}

.submit {
    background: linear-gradient(180deg, #ff9a4a, var(--ember-hot));
    color: #1a0e08;
}

.submit:disabled {
    opacity: 0.6;
    cursor: wait;
}

.helper {
    letter-spacing: 0.02em;
    text-transform: none;
    font-size: 13px;
}

.history {
    margin-top: 22px;
}

.history h2 {
    font-family: Fraunces, Georgia, serif;
    font-size: 22px;
    letter-spacing: 0;
    text-transform: none;
    color: #16141f;
}

.history-table {
    width: 100%;
    margin-top: 10px;
    border-collapse: collapse;
}

.history-table th,
.history-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid #e6ddd2;
    font-size: 14px;
    vertical-align: top;
}

.history-table th:nth-child(2),
.history-table td:nth-child(2),
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    text-align: right;
    white-space: nowrap;
}

.history-table th {
    color: #7a7168;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.empty {
    color: #7a7168;
    text-align: center;
}

.response-modal.is-error .response-content {
    background: #fde8e6;
}

.response-modal.is-success .response-content {
    background: #e5f6ec;
}

.response-text {
    font-size: 18px;
    font-weight: 600;
}

.okayBtn {
    margin-top: 16px;
    min-width: 96px;
}

@media (max-width: 640px) {
    .stat-row {
        grid-template-columns: 1fr;
    }

    .lots {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 720px) {
    .modal {
        align-items: center;
    }

    .dialog-body,
    .response-content {
        padding: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .lot.is-animating {
        animation-duration: 1s;
    }

    .lot.is-animating .lot-veil {
        animation-duration: 1s, 1s;
    }

    .lot-go {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
