/* LOOT DRILL — skóra odwzorowana z ekranu ekwipunku Arena Breakout: Infinite */
@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@400;500;600;700&family=Barlow:wght@400;500;600&display=swap');

:root {
  --bg:        #0a0a0b;
  --bg-2:      #121315;
  --win:       #1c1d1f;      /* okno kontenera */
  --win-head:  #2a2c2f;      /* pasek tytułu okna */
  --slot:      #141516;      /* kratka */
  --slot-line: #34373b;
  --panel-line:#3a3d42;
  --txt:       #e6e7e8;
  --txt-dim:   #93979c;
  --orange:    #e8622a;      /* akcent ABI */
  --orange-hi: #ff7c3f;
  --gold:      #ffcf7a;
  --red:       #cf3b2c;
  --green:     #7fbf3f;
  --cell:      52px;

  --r-common:    #26282b;  --r-common-b:    #4a4e53;
  --r-uncommon:  #22331f;  --r-uncommon-b:  #5d8c3a;
  --r-rare:      #182c3d;  --r-rare-b:      #3d7fb0;
  --r-epic:      #2c2040;  --r-epic-b:      #8259c0;
  --r-legendary: #3b2c10;  --r-legendary-b: #d9a238;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background:
    radial-gradient(1400px 700px at 50% 0%, #1a1c1f 0%, transparent 62%),
    var(--bg);
  color: var(--txt);
  font-family: 'Barlow', system-ui, sans-serif;
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, .cond { font-family: 'Barlow Condensed', 'Barlow', sans-serif; letter-spacing: .03em; }

.screen { position: fixed; inset: 0; display: none; }
.screen.on { display: flex; }
#screen-gate, #screen-start, #screen-end {
  align-items: center; justify-content: center; flex-direction: column; padding: 24px; overflow-y: auto;
}

/* ── Karty ekranów pobocznych ───────────────────────────────────── */
.card {
  background: linear-gradient(180deg, #212325, #17181a);
  border: 1px solid var(--panel-line);
  box-shadow: 0 24px 70px rgba(0,0,0,.7);
  padding: 26px 30px; width: min(780px, 96vw); position: relative;
}
.card::before {
  content: ''; position: absolute; left: 0; top: 0; width: 100%; height: 3px;
  background: linear-gradient(90deg, var(--orange), transparent 55%);
}
.logo { font-size: 44px; font-weight: 700; line-height: 1; }
.logo b { color: var(--orange); }
.tag { color: var(--txt-dim); font-size: 13px; letter-spacing: .22em; text-transform: uppercase; margin-top: 6px; }

label.field { display: block; margin: 16px 0 6px; font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--txt-dim); }
input[type=text], input[type=password] {
  width: 100%; background: #0e0f10; border: 1px solid var(--panel-line); color: var(--txt);
  padding: 11px 13px; font: 500 15px 'Barlow', sans-serif; outline: none;
}
input:focus { border-color: var(--orange); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: #2e3134; color: var(--txt); border: 1px solid #43474c; padding: 11px 22px; cursor: pointer;
  font: 600 15px 'Barlow Condensed', sans-serif; letter-spacing: .1em; text-transform: uppercase; transition: .12s;
}
.btn:hover { border-color: var(--orange); color: #fff; }
.btn.primary { background: linear-gradient(180deg, #ef6f33, #c74d17); border-color: #ff8a4d; color: #14100d; font-weight: 700; }
.btn.primary:hover { background: linear-gradient(180deg, #ff8a4d, #d85a1e); color: #120f0c; }
.btn.danger { background: #46201a; border-color: #7d2f22; color: #f0c8c0; }

.diffs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 8px; }
.diff { background: #17181a; border: 1px solid var(--panel-line); padding: 12px; cursor: pointer; }
.diff:hover { border-color: #565b61; }
.diff.sel { border-color: var(--orange); background: #241a14; }
.diff .dn { font: 700 19px 'Barlow Condensed'; letter-spacing: .08em; color: var(--orange); }
.diff .dd { font-size: 12px; color: var(--txt-dim); line-height: 1.45; margin-top: 4px; }

/* ── Ekran rajdu ────────────────────────────────────────────────── */
#screen-raid { flex-direction: column; }
.hud {
  display: flex; align-items: center; gap: 16px; padding: 6px 14px;
  background: linear-gradient(180deg, #232527, #131415); border-bottom: 1px solid var(--panel-line);
}
.hud .brand { font: 700 19px 'Barlow Condensed'; letter-spacing: .08em; }
.hud .brand b { color: var(--orange); }
.timer { font: 700 32px 'Barlow Condensed'; min-width: 108px; text-align: center; padding: 0 10px;
  border-left: 1px solid var(--panel-line); border-right: 1px solid var(--panel-line); }
.timer.warn { color: var(--gold); }
.timer.crit { color: var(--red); animation: pulse .7s infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.stat { display: flex; flex-direction: column; line-height: 1.1; }
.stat .k { font-size: 9.5px; letter-spacing: .16em; color: var(--txt-dim); text-transform: uppercase; }
.stat .v { font: 600 18px 'Barlow Condensed'; }
.stat .v.up { color: var(--green); }
.hud .spacer { flex: 1; }

/* ── Plansza: postać | okna pojemników | zwłoki (układ jak w ABI) ─ */
.board { flex: 1; display: grid; grid-template-columns: minmax(340px, 460px) minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px; padding: 8px; min-height: 0; }
.col { min-height: 0; display: flex; flex-direction: column; gap: 6px; overflow: auto; padding-right: 2px; }
.col::-webkit-scrollbar { width: 9px; height: 9px; }
.col::-webkit-scrollbar-track { background: #121314; }
.col::-webkit-scrollbar-thumb { background: #3a3d41; }
.col.char { background: linear-gradient(180deg, #1b1c1e, #141517); border: 1px solid var(--panel-line); padding: 0 8px 8px; }

.tabs { display: flex; gap: 2px; margin: 0 -8px 8px; padding: 6px 8px 0; position: sticky; top: 0; z-index: 3;
  background: linear-gradient(180deg, #1b1c1e, rgba(27,28,30,.85)); }
.tab { flex: 1; text-align: center; padding: 7px; background: #232527; border: 1px solid var(--panel-line);
  border-bottom: none; font: 600 13px 'Barlow Condensed'; letter-spacing: .14em; text-transform: uppercase;
  color: var(--txt-dim); cursor: pointer; }
.tab.on { background: var(--orange); color: #14100d; border-color: var(--orange); }

.char-top, .char-pockets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.char-mid { display: grid; grid-template-columns: auto minmax(120px, 190px) auto; gap: 10px;
  align-items: center; justify-content: center; margin-bottom: 8px; }
.char-mid .dcol { display: flex; flex-direction: column; gap: 8px; }
.char-mid .figure { position: relative; display: flex; align-items: center; justify-content: center; min-height: 190px; }
.char-mid .figure svg { width: 100%; max-width: 190px; height: auto; opacity: .55; color: #3d4248; }
.char-mid .figure { min-height: 250px; }
.char-guns { display: flex; flex-direction: column; gap: 8px; }
.eq-slot.wide { flex: 1 1 100%; }

.eq-slot { position: relative; }
.eq-slot .lbl { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--txt-dim);
  background: #232527; border: 1px solid var(--panel-line); border-bottom: none; padding: 3px 7px;
  display: flex; justify-content: space-between; gap: 8px; }
.eq-slot .lbl i { font-style: normal; color: #7d8288; }
.eq-slot .badge { position: absolute; top: 22px; right: 4px; z-index: 3;
  background: rgba(0,0,0,.65); border: 1px solid #55595e; color: var(--txt-dim);
  font: 600 10px 'Barlow Condensed'; padding: 0 5px; }

.char-foot { border-top: 1px solid var(--panel-line); margin: 6px -8px 0; padding: 8px 10px 2px;
  background: #17181a; position: sticky; bottom: 0; }
.char-foot .eqval { font: 600 14px 'Barlow Condensed'; letter-spacing: .1em; text-transform: uppercase; color: var(--txt-dim); }
.char-foot .eqval b { color: var(--gold); font-size: 21px; margin-left: 6px; letter-spacing: 0; }
.statline { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; font-size: 12.5px; }
.statline i { font-style: normal; color: var(--txt-dim); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; }

.health { padding: 4px 2px; }
.limb { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; margin-bottom: 9px; align-items: baseline; }
.limb span { font: 600 13px 'Barlow Condensed'; letter-spacing: .08em; text-transform: uppercase; color: var(--txt-dim); }
.limb i { font-style: normal; font: 600 13px 'Barlow Condensed'; color: var(--txt); }
.limb i.over { color: var(--red); }
.limb .hbar { grid-column: 1 / -1; height: 7px; background: #0e0f10; border: 1px solid var(--panel-line); }
.limb .hbar b { display: block; height: 100%; background: var(--green); }
.limb.tot span { color: var(--gold); }

/* zakładki ciał */
.body-tabs { display: flex; gap: 4px; flex-wrap: wrap; position: sticky; top: 0; z-index: 3;
  background: var(--bg); padding-bottom: 4px; }
.body-tab { display: flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer;
  background: #1c1d1f; border: 1px solid var(--panel-line);
  font: 600 13px 'Barlow Condensed'; letter-spacing: .06em; }
.body-tab .ico { width: 14px; height: 14px; color: var(--red); display: block; }
.body-tab .ico svg { width: 100%; height: 100%; }
.body-tab:hover { border-color: #565b61; }
.body-tab.active { border-color: var(--orange); background: #241a14; color: #fff; }
.body-tab.empty { opacity: .45; }
.body-tab.empty .ico { color: #4c5340; }
.loot-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px; background: var(--win-head);
  border: 1px solid var(--panel-line); font: 600 14px 'Barlow Condensed'; letter-spacing: .1em; text-transform: uppercase; }
.loot-head .sub { color: var(--txt-dim); font-size: 11px; letter-spacing: .06em; font-weight: 400; }
.loot-head .sub:last-child { margin-left: auto; }
.loot-body, .char-body { display: block; }

/* okno pojemnika */
.panel { background: var(--win); border: 1px solid var(--panel-line); }
.panel > h3 {
  font: 600 13px 'Barlow Condensed'; letter-spacing: .14em; text-transform: uppercase;
  padding: 6px 9px; background: var(--win-head); border-bottom: 1px solid var(--panel-line);
  display: flex; gap: 8px; align-items: center; color: var(--txt);
}
.panel > h3::before { content: ''; width: 3px; height: 12px; background: var(--orange); flex: none; }
.panel > h3 .sub { color: var(--txt-dim); font-size: 11px; letter-spacing: .06em; font-weight: 400;
  text-transform: none; }
.panel .body { padding: 7px; }
.panel.win { margin-bottom: 8px; }
.panel.win > h3 { gap: 6px; }
.wbtn { background: #2e3134; border: 1px solid #45494e; color: var(--txt-dim); cursor: pointer;
  font: 600 10.5px 'Barlow Condensed'; letter-spacing: .1em; text-transform: uppercase; padding: 3px 8px; }
.wbtn:hover { border-color: var(--orange); color: #fff; }
.panel.win > h3 .sub + .wbtn { margin-left: 0; }
.panel.win > h3 .wbtn:first-of-type { margin-left: auto; }

/* karta przedmiotu pod kursorem */
.tip { position: fixed; z-index: 900; pointer-events: none; min-width: 210px; max-width: 300px;
  background: #17181a; border: 1px solid var(--panel-line); box-shadow: 0 16px 40px rgba(0,0,0,.7); padding: 8px 10px; }
.tip-h { font: 700 15px 'Barlow Condensed'; letter-spacing: .04em; color: #fff; margin-bottom: 5px;
  border-bottom: 1px solid var(--panel-line); padding-bottom: 4px; }
.tip-r { display: flex; justify-content: space-between; gap: 14px; font-size: 12px; padding: 1px 0; color: var(--txt-dim); }
.tip-r b { color: var(--txt); font-weight: 600; }
.tip-n { margin-top: 5px; font-size: 11px; color: #8a8f95; font-style: italic; }

/* ── Siatki i przedmioty ────────────────────────────────────────── */
.grid-wrap { margin-bottom: 0; }
.cont-wrap > .grid-wrap, .cont-rig > .grid-wrap { margin-bottom: 0; }
.grid-label { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--txt-dim); margin-bottom: 3px; }
.grid {
  position: relative; background: var(--slot); border: 1px solid var(--panel-line);
  background-image:
    linear-gradient(to right, rgba(120,128,136,.22) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(120,128,136,.22) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  box-shadow: inset 0 0 24px rgba(0,0,0,.5);
}
/* układy pojemników — komory stykają się, tak jak w grze */
.cont-one, .cont-row { display: flex; align-items: flex-start; }
.cont-col { display: flex; flex-direction: column; align-items: flex-start; }
.cont-row > .grid-wrap + .grid-wrap > .grid { border-left-color: #5c636a; margin-left: -1px; }
.cont-col > .grid-wrap + .grid-wrap > .grid { border-top-color: #5c636a; margin-top: -1px; }
.cont-rig { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 4px; }
.cont-wrap { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px; }
.grids-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* kieszenie: cztery osobne pola */
.grid.pockets { background-image:
    linear-gradient(to right, var(--panel-line) 2px, transparent 2px),
    linear-gradient(to bottom, var(--panel-line) 2px, transparent 2px);
  background-size: var(--cell) var(--cell); background-color: #141516; }

/* slot sprzętu: jedno pole bez kratek, z przygaszonym piktogramem */
.grid.slot { background-image: none; background: #141516; box-shadow: inset 0 0 20px rgba(0,0,0,.55); }
.slot-ghost { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #6a6f75; opacity: .18; pointer-events: none; }
.slot-ghost svg { width: 44%; height: 44%; }

.item {
  position: absolute; border: 1px solid var(--r-common-b);
  background: linear-gradient(180deg, rgba(0,0,0,.25), var(--r-common));
  overflow: hidden; cursor: grab; touch-action: none;
}
.item:hover { box-shadow: inset 0 0 0 1px var(--orange), 0 0 14px rgba(232,98,42,.35); z-index: 5; }
.item.uncommon  { background: linear-gradient(180deg, rgba(0,0,0,.28), var(--r-uncommon));  border-color: var(--r-uncommon-b); }
.item.rare      { background: linear-gradient(180deg, rgba(0,0,0,.28), var(--r-rare));      border-color: var(--r-rare-b); }
.item.epic      { background: linear-gradient(180deg, rgba(0,0,0,.28), var(--r-epic));      border-color: var(--r-epic-b); }
.item.legendary { background: linear-gradient(180deg, rgba(0,0,0,.30), var(--r-legendary)); border-color: var(--r-legendary-b); }
.item img.ph {
  position: absolute; inset: 3px; width: calc(100% - 6px); height: calc(100% - 6px);
  object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.65));
}
.item .gl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  opacity: .3; pointer-events: none; }
.item .gl svg { width: 55%; height: 55%; }
.item .nm {
  position: absolute; top: 0; left: 0; right: 0; padding: 1px 3px;
  font: 500 10px 'Barlow Condensed'; line-height: 1.1; color: #f2f3f4;
  text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.item .nm.one { font-size: 8.5px; -webkit-line-clamp: 1; padding: 1px 2px; }
.item .cnt { position: absolute; bottom: 0; left: 0; padding: 0 3px; font: 600 10.5px 'Barlow Condensed';
  color: #cfd3d7; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; }
.item .pr {
  position: absolute; bottom: 0; right: 0; padding: 0 3px;
  font: 600 10.5px 'Barlow Condensed'; color: var(--gold);
  text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none;
}
.item.dragging { opacity: .25; }

#ghost { position: fixed; pointer-events: none; z-index: 999; opacity: .95; box-shadow: 0 12px 28px rgba(0,0,0,.7); }
.cell-hint { position: absolute; pointer-events: none; z-index: 4; border: 2px solid; }
.cell-hint.ok  { border-color: var(--green); background: rgba(127,191,63,.18); }
.cell-hint.bad { border-color: var(--red);   background: rgba(207,59,44,.18); }

/* ── Podsumowanie ───────────────────────────────────────────────── */
.sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 18px 0; }
.sum .box { background: #17181a; border: 1px solid var(--panel-line); padding: 12px 14px; }
.sum .box .k { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--txt-dim); }
.sum .box .v { font: 700 26px 'Barlow Condensed'; margin-top: 2px; }
.sum .box .v.good { color: var(--green); } .sum .box .v.bad { color: var(--red); } .sum .box .v.gold { color: var(--gold); }
.bar { height: 10px; background: #0e0f10; border: 1px solid var(--panel-line); margin-top: 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #7fbf3f, var(--orange)); }

table.rank { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
table.rank th { font: 600 11px 'Barlow Condensed'; letter-spacing: .14em; text-transform: uppercase;
  color: var(--txt-dim); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--panel-line); }
table.rank td { padding: 6px 8px; border-bottom: 1px solid #232527; }
table.rank tr.me td { color: var(--orange-hi); background: #241a14; }

.toast-wrap { position: fixed; bottom: 14px; left: 50%; transform: translateX(-50%); z-index: 500;
  display: flex; flex-direction: column; gap: 5px; align-items: center; pointer-events: none; }
.toast { background: #232527; border: 1px solid #4a4e53; border-left: 3px solid var(--orange);
  padding: 6px 14px; font: 600 13.5px 'Barlow Condensed'; letter-spacing: .05em; animation: fadein .18s; }
.toast.bad { border-left-color: var(--red); color: #f0b8ae; }
.toast.good { border-left-color: var(--green); color: #d3ecab; }
@keyframes fadein { from { opacity: 0; transform: translateY(8px); } }

.hint { font-size: 12.5px; color: var(--txt-dim); line-height: 1.6; }
kbd { background: #0e0f10; border: 1px solid #4a4e53; padding: 1px 6px; font: 600 12px 'Barlow Condensed'; color: var(--txt); }

@media (max-width: 1400px) {
  .board { grid-template-columns: minmax(300px, 380px) 1fr; }
  .col.loot { grid-column: 1 / -1; }
}
@media (max-width: 860px) {
  .board { grid-template-columns: 1fr; }
  .col.loot { grid-column: auto; }
  .timer { font-size: 25px; min-width: 84px; }
}
