/* =========================================================================
   Auktionshaus (auction.js): Eintrittskarte, Markt-Karten, Pet-Karten,
   Tausch-Ansicht, Verkaufs-Dialoge.
   ========================================================================= */

#page-ah .ah-hint { color: var(--text-dim); font-size: .88rem; margin: 0 0 12px; }
#page-ah .panel { margin-top: 14px; }
.ah-modal .ah-hint { color: var(--text-dim); font-size: .84rem; margin: 10px 0 0; }

/* ---------- Eintrittskarte ---------- */
.ah-gate { display: flex; gap: 16px; padding: 18px; margin-bottom: 16px; border-radius: 18px;
           background: linear-gradient(135deg, rgba(245,166,35,.12), rgba(168,85,247,.08)); border: 1px dashed rgba(245,166,35,.5); }
.ah-gate-ico { font-size: 2.4rem; animation: ahTicket 3s ease-in-out infinite; }
@keyframes ahTicket { 50% { transform: rotate(-8deg) translateY(-3px); } }
.ah-gate-txt { flex: 1; min-width: 0; }
.ah-gate-txt > b { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-bright); display: block; }
.ah-gate-txt > small { color: var(--text-dim); display: block; margin-bottom: 12px; }
.ah-checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ah-check { display: flex; gap: 8px; padding: 10px; border-radius: 12px; background: var(--bg-slot); border: 1px solid var(--line); }
.ah-check > div { flex: 1; min-width: 0; }
.ah-check b { font-size: .85rem; display: block; }
.ah-check small { color: var(--text-dim); font-size: .76rem; }
.ah-check.ok { border-color: rgba(52,224,127,.4); }
.ah-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 5px 0 3px; }
.ah-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--gold), var(--green)); transition: width .8s var(--ease); }
.ah-check.ok .ah-bar i { background: var(--green); }

/* ---------- Kopfleiste + Reiter ---------- */
.ah-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.ah-strip > div { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center;
                  padding: 12px 14px; border-radius: 14px; background: var(--bg-panel); border: 1px solid var(--line); }
.ah-strip span { grid-row: span 2; font-size: 1.5rem; }
.ah-strip b { font-family: var(--font-display); font-size: 1.2rem; color: var(--text-bright); }
.ah-strip small { color: var(--text-dim); font-size: .75rem; }
.ah-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.ah-tabs .chip-toggle { position: relative; }
.ah-dot { font-style: normal; display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700; animation: ahPing 1.6s ease-in-out infinite; }
@keyframes ahPing { 50% { box-shadow: 0 0 0 5px rgba(255,77,106,.2); } }
.ah-tools { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.ah-search { max-width: 240px; }
.ah-view { animation: ahIn .3s var(--ease); }
@keyframes ahIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Markt-Karten ---------- */
.ah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.ah-card { --rc: var(--r-common); position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ico txt qty" "price price price" "foot foot foot";
           gap: 8px 12px; align-items: center; padding: 14px; border-radius: 16px; background: var(--bg-panel); border: 1px solid var(--line);
           overflow: hidden; transition: transform .2s var(--ease), border-color .2s; }
.ah-card::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--rc); box-shadow: 0 0 14px var(--rc); }
.ah-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rc) 50%, transparent); }
.ah-card.mine { border-style: dashed; }
.r-junk { --rc: var(--r-junk); } .r-common { --rc: var(--r-common); } .r-rare { --rc: var(--r-rare); }
.r-epic { --rc: var(--r-epic); } .r-legendary { --rc: var(--r-legendary); } .r-built { --rc: var(--cyan); }
.ah-ico { grid-area: ico; width: 46px; height: 46px; display: grid; place-items: center; font-size: 1.6rem; border-radius: 12px;
          background: color-mix(in srgb, var(--rc, var(--cyan)) 14%, transparent); border: 1px solid color-mix(in srgb, var(--rc, var(--cyan)) 35%, transparent); flex: none; }
.ah-ico.big { width: 64px; height: 64px; font-size: 2.2rem; }
.ah-txt { grid-area: txt; min-width: 0; }
.ah-txt b { display: block; color: var(--text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-txt small { color: var(--text-dim); font-size: .78rem; }
.ah-qty { grid-area: qty; text-align: right; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--rc); }
.ah-qty small { display: block; font-size: .68rem; color: var(--text-dim); font-family: var(--font-body); font-weight: 400; }
.ah-price { grid-area: price; padding: 8px 10px; border-radius: 10px; background: var(--bg-slot); }
.ah-price b { color: var(--gold); font-family: var(--font-display); font-size: 1.1rem; }
.ah-price small { display: block; color: var(--text-dim); font-size: .74rem; }
.ah-price .g, .ah-m-sum .g, .ah-delta.g { color: var(--green); }
.ah-price .r, .ah-m-sum .r, .ah-delta.r { color: var(--red); }
.ah-foot { grid-area: foot; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ah-foot small { color: var(--text-dim); font-size: .76rem; }

/* ---------- Pets ---------- */
.ah-pets { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.ah-pet { --rc: var(--r-common); position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 14px;
          border-radius: 18px; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--rc) 18%, transparent), transparent 70%), var(--bg-panel);
          border: 1px solid color-mix(in srgb, var(--rc) 35%, var(--line)); overflow: hidden; transition: transform .2s var(--ease); }
.ah-pet:hover { transform: translateY(-3px); }
.ah-pet.shiny::after { content: ''; position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.18) 50%, transparent 65%);
                       background-size: 250% 100%; animation: ahShine 3.2s linear infinite; pointer-events: none; }
@keyframes ahShine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.ah-pet.mine { border-style: dashed; }
.ah-pet.dim, .ah-row.dim { opacity: .55; }
.ah-art { width: 110px; height: 110px; filter: drop-shadow(0 8px 14px rgba(0,0,0,.45)); }
.ah-art svg { width: 100%; height: 100%; display: block; }
.ah-art.sm { width: 72px; height: 72px; }
.ah-art.xs { width: 40px; height: 40px; flex: none; }
.ah-art.lg { width: 160px; height: 160px; margin: 0 auto; }
.ah-pet-txt b { display: block; color: var(--text-bright); }
.ah-pet-txt small { display: block; color: var(--text-dim); font-size: .78rem; }
.ah-pet-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--line); }
.ah-pet-foot b { color: var(--gold); font-family: var(--font-display); font-size: 1.1rem; }
.ah-pet-foot small { color: var(--text-dim); font-size: .76rem; }
.ah-shiny { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap;
             background: linear-gradient(90deg, #ffd27a, #ff9bd2); color: #241a00; box-shadow: 0 0 12px rgba(255,210,122,.5); }
.ah-stars { color: var(--gold); letter-spacing: 1px; }
.ah-stars i { font-style: normal; color: rgba(255,255,255,.18); }

/* ---------- Listen ---------- */
.ah-list { display: flex; flex-direction: column; gap: 8px; }
.ah-row { --rc: var(--line-strong); display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg-panel); border: 1px solid var(--line); }
.ah-row .ah-ico { width: 40px; height: 40px; font-size: 1.3rem; }
.ah-row .ah-txt { flex: 1; }
.ah-row.rev { opacity: .5; }
.ah-delta { font-family: var(--font-display); font-weight: 700; white-space: nowrap; }

/* ---------- Tausch ---------- */
.ah-swap { padding: 14px; border-radius: 16px; background: var(--bg-panel); border: 1px solid var(--line); }
.ah-swap.in { border-color: rgba(47,224,228,.5); box-shadow: 0 0 22px -10px var(--cyan); }
.ah-sw-top { display: flex; justify-content: space-between; gap: 8px; }
.ah-sw-top small { color: var(--text-dim); }
.ah-sw-pets { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin: 10px 0; text-align: center; }
.ah-sw-pets > div { display: flex; flex-direction: column; align-items: center; }
.ah-sw-pets b { font-size: .9rem; }
.ah-sw-pets small { color: var(--text-dim); font-size: .76rem; }
.ah-sw-arrow { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-size: 1.5rem; color: var(--cyan);
                background: rgba(47,224,228,.1); border: 1px solid rgba(47,224,228,.35); animation: ahSwap 2.4s ease-in-out infinite; }
@keyframes ahSwap { 50% { transform: rotate(180deg); box-shadow: 0 0 18px rgba(47,224,228,.35); } }
.ah-sw-lbl { font-style: normal; font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-dim); }
.ah-sw-foot { display: flex; align-items: center; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.ah-sw-foot small { margin-right: auto; color: var(--text-dim); }
.ah-sw-who { display: flex; gap: 8px; }
.ah-sw-who .input { flex: 1; }
.ah-sw-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.ah-sw-h { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); margin-bottom: 6px; }
.ah-sw-pick { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; }
.ah-sw-opt { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-slot);
             color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.ah-sw-opt span { display: flex; flex-direction: column; font-size: .88rem; min-width: 0; }
.ah-sw-opt small { color: var(--text-dim); font-size: .74rem; }
.ah-sw-opt:hover:not(:disabled) { border-color: var(--line-strong); }
.ah-sw-opt.on { border-color: var(--cyan); background: rgba(47,224,228,.1); }
.ah-sw-opt:disabled { opacity: .45; cursor: not-allowed; }
.ah-sw-sum { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 12px; border-radius: 14px; background: var(--bg-slot); }
.ah-sw-sum > div { flex: 1; min-width: 160px; }
.ah-sw-sum b { color: var(--gold); }
.ah-sw-sum small { display: block; color: var(--text-dim); font-size: .76rem; }

/* ---------- Dialoge ---------- */
.ah-modal { min-width: min(440px, 86vw); }
.ah-m-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.ah-m-head h2 { margin: 0; }
.ah-m-head small { color: var(--text-dim); }
.ah-modal .fl { display: block; margin-top: 10px; }
.ah-qrow { display: flex; gap: 8px; }
.ah-qrow .input { flex: 1; }
.ah-range { width: 100%; margin-top: 8px; accent-color: var(--gold); }
.ah-m-sum { display: flex; flex-direction: column; gap: 4px; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--bg-slot); border: 1px solid var(--line); }
.ah-m-sum > div { display: flex; justify-content: space-between; gap: 10px; }
.ah-m-sum b { font-family: var(--font-display); font-size: 1.05rem; }
.ah-m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.ah-m-pet { text-align: center; }

@media (max-width: 760px) {
    .ah-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ah-checks { grid-template-columns: 1fr; }
    .ah-gate { flex-direction: column; gap: 6px; }
    .ah-sw-cols { grid-template-columns: 1fr; }
    .ah-search { max-width: none; flex: 1 1 100%; }
    .ah-strip { gap: 8px; }
    .ah-strip > div { padding: 8px 10px; }
    .ah-strip span { font-size: 1.15rem; }
    .ah-strip b { font-size: 1.05rem; }
    .ah-strip small { font-size: .7rem; }
    .ah-art { width: 90px; height: 90px; }
}
@media (max-width: 420px) {
    .ah-grid, .ah-pets { grid-template-columns: 1fr; }
    .ah-row { flex-wrap: wrap; }
    .ah-row .ah-txt { flex-basis: calc(100% - 56px); }
    .ah-row > .btn { margin-left: auto; }
    .ah-m-actions { flex-direction: column-reverse; }
    .ah-m-actions .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .ah-gate-ico, .ah-dot, .ah-pet.shiny::after, .ah-sw-arrow, .ah-view { animation: none; }
}
