:root{
  --bg0:#070A12;
  --bg1:#0B1022;
  --panel:rgba(255,255,255,.06);
  --panel2:rgba(255,255,255,.08);
  --stroke:rgba(255,255,255,.12);
  --text:#EAF0FF;
  --muted:rgba(234,240,255,.72);
  --muted2:rgba(234,240,255,.52);
  --brand:#7C5CFF;
  --brand2:#31D0FF;
  --ok:#55D6A4;
  --warn:#FFCA61;
  --danger:#FF5C7A;
  --shadow: 0 24px 80px rgba(0,0,0,.55);
  --radius: 18px;
  --radius2: 14px;
  --max: 1120px;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(124,92,255,.35), transparent 60%),
    radial-gradient(900px 600px at 80% 0%, rgba(49,208,255,.22), transparent 55%),
    radial-gradient(900px 600px at 55% 105%, rgba(85,214,164,.12), transparent 55%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
}

.container{
  width:min(var(--max), calc(100% - 40px));
  margin-inline:auto;
}

.skip-link{
  position:absolute;
  left:-999px;
  top:10px;
  background:var(--panel);
  border:1px solid var(--stroke);
  padding:10px 12px;
  border-radius:10px;
  color:var(--text);
  text-decoration:none;
}
.skip-link:focus{ left:12px; z-index:9999; }

.header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(7,10,18,.62);
  backdrop-filter: blur(12px);
  border-bottom:1px solid rgba(255,255,255,.08);
}
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width: 260px;
}
.brand__mark{
  width:44px; height:44px;
  border-radius:14px;
  display:grid; place-items:center;
  background:
    radial-gradient(120% 120% at 30% 20%, rgba(255,255,255,.18), transparent 55%),
    linear-gradient(135deg, rgba(124,92,255,.95), rgba(49,208,255,.9));
  box-shadow: 0 18px 40px rgba(124,92,255,.25);
  font-weight:800;
}
.brand__name{ font-weight:800; letter-spacing:.2px; }
.brand__tagline{ font-size:12px; color:var(--muted2); }
.brand__avatar{
  width:32px;
  height:32px;
  border-radius: 999px;
  object-fit: cover;
  border:1px solid rgba(255,255,255,.25);
  margin-left: 10px;
  background:#020617;
}

.nav{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
  justify-content:flex-end;
}
.nav__link{
  color:var(--muted);
  text-decoration:none;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid transparent;
}
.nav__link:hover{
  color:var(--text);
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.08);
}
.nav__link--icon{ display:inline-flex; align-items:center; justify-content:center; padding:6px 10px; }
.nav__link--icon .nav__icon{ display:block; object-fit:contain; filter:saturate(0.45); transition:filter 0.2s; }
.nav__link--icon:hover .nav__icon,.nav__link--icon:focus .nav__icon,.nav__link--icon:active .nav__icon{ filter:saturate(1); }
.nav__link--profile{
  border-color: rgba(124,92,255,.45);
  background: rgba(124,92,255,.14);
  color: var(--text);
  font-weight: 600;
}
.nav__button{
  appearance:none;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:var(--text);
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
  font-weight:600;
}
.nav__button:hover{ background:rgba(255,255,255,.08); }
.nav__button--primary{
  border-color:rgba(124,92,255,.55);
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(135deg, rgba(124,92,255,.95), rgba(49,208,255,.75));
}

.hero{
  padding:44px 0 30px;
}
.hero__grid{
  display:grid;
  grid-template-columns: 1.3fr .9fr;
  gap:22px;
  align-items:start;
}
.badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 10px;
  border-radius:999px;
  background:rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  color:var(--muted);
  margin:0 0 12px;
  width:fit-content;
}
.hero__title{
  margin:0 0 12px;
  font-size: clamp(30px, 3.2vw, 46px);
  line-height:1.08;
  letter-spacing:-.5px;
}
.hero__lead{
  margin:0 0 18px;
  color:var(--muted);
  font-size: 16px;
  line-height:1.55;
}
.hero__actions{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}

.btn{
  display:inline-flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  text-decoration:none;
  cursor:pointer;
  font-weight:700;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:var(--text);
}
.btn:hover{ background:rgba(255,255,255,.09); }
.btn--primary{
  border-color:rgba(124,92,255,.55);
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(255,255,255,.14), transparent 60%),
    linear-gradient(135deg, rgba(124,92,255,.95), rgba(49,208,255,.75));
}
.btn--ghost{
  background:rgba(255,255,255,.02);
}
.btn--full{ width:100%; }

.quick-login{
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.035));
  border:1px solid rgba(255,255,255,.12);
  box-shadow: var(--shadow);
  padding:18px;
}
.quick-login__title{
  margin:0 0 6px;
  font-size:16px;
}
.quick-login__hint{
  margin:0 0 14px;
  color:var(--muted2);
  font-size:13px;
}

.form{ display:grid; gap:12px; }
.field{ display:grid; gap:7px; }
.field__label{ font-size:12px; color:var(--muted); }
.field__input{
  width:100%;
  padding:12px 12px;
  border-radius:14px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(0,0,0,.22);
  color:var(--text);
  outline:none;
}
select.field__input{
  appearance:none;
  -webkit-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23aaa' fill='none' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:right 12px center;
  padding-right:32px;
}
select.field__input option,
.deck-filter-select option,
.deck-sort-bar select option,
.reward-form select option{
  background:#1e1e2e;
  color:#e0e0e0;
}
.field__input:focus{
  border-color: rgba(49,208,255,.55);
  box-shadow: 0 0 0 3px rgba(49,208,255,.18);
}
.form__row{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}
.form__meta{
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.link{
  color:rgba(49,208,255,.95);
  text-decoration:none;
}
.link:hover{ text-decoration:underline; }
.form__status{
  margin:2px 0 0;
  color:var(--muted2);
  min-height: 18px;
  font-size: 12px;
}
.form__status--ok{ color: rgba(85,214,164,.95); }
.form__status--bad{ color: rgba(255,92,122,.95); }

.section{
  padding:42px 0;
}
.section--muted{
  background: rgba(255,255,255,.02);
  border-top:1px solid rgba(255,255,255,.06);
  border-bottom:1px solid rgba(255,255,255,.06);
}
.section__title{
  margin:0 0 10px;
  font-size: 22px;
  letter-spacing:-.2px;
}
.section__lead{
  margin:0 0 18px;
  color:var(--muted);
  line-height:1.55;
}
.section__text{
  margin:0;
  color:var(--muted);
  line-height:1.7;
}

.cards{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.card{
  padding:16px;
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
}
.card__title{ margin:0 0 8px; font-size:15px; }
.card__text{ margin:0; color:var(--muted); line-height:1.6; font-size: 13px; }

.avatar-frame-btn{
  display:flex; flex-direction:column; align-items:center; gap:6px;
  padding:10px 14px; border-radius:10px; border:1px solid var(--stroke);
  background:var(--panel); color:var(--text); cursor:pointer; font-size:12px;
  transition:border-color .2s, background .2s;
}
.avatar-frame-btn:hover{ background:var(--panel2); border-color:rgba(255,255,255,.2); }
.avatar-frame-btn--current{ border-color:var(--brand); background:rgba(124,92,255,.15); }

/* Avatar + ramka w profilu — ramka wychodzi poza avatara jak w lobby */
.profile-avatar__lead{
  margin-bottom:24px;
}
.profile-avatar-block{
  display:flex; justify-content:center; margin-bottom:24px;
  padding: 35px;
}
.profile-avatar-wrap{
  position:relative; width:120px; height:120px; flex-shrink:0; overflow:visible;
}
.profile-avatar__img{
  position:absolute; inset:0; width:100%; height:100%;
  object-fit:cover; border-radius:20px; background:#111827;
  border:1px solid rgba(255,255,255,.08); display:block;
}
.profile-avatar__frame{
  position:absolute; inset:-24px;
  width:calc(100% + 48px); height:calc(100% + 48px);
  object-fit:contain; pointer-events:none; z-index:1;
}
.profile-avatar-form{
  margin-top:0;
}


.two-col{
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:18px;
  align-items:start;
}
.credentials-two-col{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
  align-items:start;
}
.avatar-options-layout{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
  align-items:start;
}
.avatar-options-left{
  display:flex;
  flex-direction:column;
  gap:0;
}
.avatar-options-right{
  min-width:0;
}
.stats{
  display:grid;
  gap:10px;
}
.stat{
  padding:16px;
  border-radius: var(--radius2);
  background: rgba(255,255,255,.04);
  border:1px solid rgba(255,255,255,.10);
}
.stat__value{
  font-weight:800;
  font-size: 22px;
  letter-spacing:-.3px;
}
.stat__label{
  color:var(--muted2);
  font-size: 12px;
  margin-top:6px;
}

.media-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.media{
  overflow:hidden;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.media__thumb{
  height:120px;
  background:
    radial-gradient(80% 110% at 20% 20%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(135deg, rgba(124,92,255,.55), rgba(49,208,255,.25));
}
.media__thumb--alt{
  background:
    radial-gradient(80% 110% at 20% 20%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(135deg, rgba(85,214,164,.35), rgba(124,92,255,.25));
}
.media__thumb--alt2{
  background:
    radial-gradient(80% 110% at 20% 20%, rgba(255,255,255,.14), transparent 55%),
    linear-gradient(135deg, rgba(255,202,97,.28), rgba(49,208,255,.22));
}
.media__meta{ padding:14px; }
.media__title{ font-weight:700; margin:0 0 6px; }
.media__desc{ color:var(--muted); font-size: 13px; line-height:1.6; }

.section--news{
  padding-bottom: 62px;
}
.news__header{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 14px;
}
.news-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap:12px;
}
.news{
  padding:16px;
  border-radius: var(--radius2);
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.news__tag{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  font-size:12px;
  background: rgba(124,92,255,.16);
  border:1px solid rgba(124,92,255,.35);
  color: rgba(234,240,255,.9);
  margin-bottom:10px;
}
.news__title{ margin:0 0 8px; font-size:15px; }
.news__text{ margin:0 0 14px; color:var(--muted); font-size: 13px; line-height:1.6; }
.news__time{ color:var(--muted2); font-size: 12px; }

.footer{
  border-top:1px solid rgba(255,255,255,.08);
  padding:22px 0 38px;
  background: rgba(0,0,0,.12);
}
.footer__inner{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
  flex-wrap:wrap;
}
.footer__brand{ font-weight:800; }
.footer__copy{ color:var(--muted2); font-size: 12px; margin-top: 6px; }
.footer__right{ display:flex; gap:12px; flex-wrap:wrap; }

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.lightbox{
  position:fixed;
  inset:0;
  display:none;
  z-index:9999;
}
.lightbox[data-open="true"]{ display:block; }
.lightbox__backdrop{
  position:absolute;
  inset:0;
  background: rgba(0,0,0,.62);
  backdrop-filter: blur(6px);
  cursor: pointer;
}
.lightbox__panel{
  position:relative;
  width:min(560px, calc(100% - 28px));
  margin: min(10vh, 90px) auto 0;
  border-radius: 22px;
  border:1px solid rgba(255,255,255,.14);
  background:
    radial-gradient(120% 120% at 30% 0%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(180deg, rgba(14,18,34,.96), rgba(10,12,24,.92));
  box-shadow: var(--shadow);
}
.lightbox__top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:14px 14px 10px;
  border-bottom:1px solid rgba(255,255,255,.08);
}
.lightbox__tabs{
  display:flex;
  gap:8px;
  padding:4px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
}
.tab{
  appearance:none;
  border:1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding:10px 12px;
  border-radius: 12px;
  cursor:pointer;
  font-weight:700;
}
.tab[aria-selected="true"]{
  color: var(--text);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}

/* Zakładki na stronie (np. Moje talie) */
.page-tabs-wrap {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.04);
  width: fit-content;
}
.page-tab {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 10px 16px;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1rem;
}
.page-tab:hover {
  color: var(--text);
  background: rgba(255,255,255,.06);
}
.page-tab[aria-selected="true"] {
  color: var(--text);
  border-color: rgba(255,255,255,.12);
  background: rgba(255,255,255,.08);
}
.page-tab-panel[hidden] {
  display: none !important;
}

.icon-btn{
  width:40px;
  height:40px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  font-size: 22px;
  line-height: 1;
}
.icon-btn:hover{ background: rgba(255,255,255,.08); }

.lightbox__body{ padding:16px; }
.auth{
  display:grid;
  gap:12px;
}
.auth__links{
  display:flex;
  justify-content:center;
  margin-top: 2px;
}
.two-up{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:10px;
}

@media (max-width: 900px){
  .hero__grid{ grid-template-columns: 1fr; }
  .brand{ min-width: unset; }
}
@media (max-width: 740px){
  .cards{ grid-template-columns: 1fr; }
  .media-grid{ grid-template-columns: 1fr; }
  .news-grid{ grid-template-columns: 1fr; }
  .two-col{ grid-template-columns: 1fr; }
  .credentials-two-col{ grid-template-columns: 1fr; }
  .avatar-options-layout{ grid-template-columns: 1fr; }
  .form__row{ grid-template-columns: 1fr; }
  .two-up{ grid-template-columns: 1fr; }
}

.card-preview{
  position: relative;
  width: min(340px, 100%);
  aspect-ratio: 744 / 1039;
  margin-inline: auto;
  overflow: hidden;
  background:#0a0a0a;
  font-family: "Lato Condensed", "Lato", sans-serif;
}
.card-preview__image-wrap{
  position:absolute;
  inset:0;
}
.card-preview__image-wrap img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
/* Siła karty – lewy górny róg, numer wyśrodkowany */
.card-preview__strength{
  position:absolute;
  top:3%;
  left:8.5%;
  width:14%;
  aspect-ratio: 1;
  display:flex;
  align-items:center;
  justify-content:center;
  color:#fff;
  font-weight:900;
  font-size:clamp(18px, 6.2vw, 36px);
  line-height:1;
  letter-spacing:-0.02em;
}
.card-preview__name{
  position:absolute;
  left:5%;
  right:5%;
  bottom:23%;
  text-align:center;
  font-weight:900;
  font-size:clamp(8px, 2.1vw, 14px);
  letter-spacing:.05em;
  text-transform:uppercase;
  color:#fff;
  line-height:1.15;
}
.card-preview__description{
  position:absolute;
  left:7%;
  right:7%;
  top:78%;
  bottom:10%;
  font-size:clamp(6px, 1.5vw, 10px);
  line-height:1.3;
  color:rgba(255,255,255,.95);
  text-align:center;
  overflow-y:auto;
  overflow-x:hidden;
}
.card-preview__flavor{
  position:absolute;
  left:5%;
  right:5%;
  bottom:5%;
  font-size:clamp(5px, 1.2vw, 8px);
  font-style:italic;
  color:rgba(255,255,255,.85);
  text-align:center;
  line-height:1.25;
}

/* Tabela w panelu admina */
.table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
.table th,
.table td{
  padding:10px 12px;
  text-align:left;
  border-bottom:1px solid rgba(255,255,255,.1);
}
.table th{
  color:var(--muted);
  font-weight:600;
}
.table tbody tr:hover{
  background:rgba(255,255,255,.03);
}

/* Lightbox wyniku zapisu karty */
.card-result-message{
  margin:0 0 16px;
  padding:14px 16px;
  border-radius:12px;
  font-weight:600;
}
.card-result-message--ok{
  background:rgba(85,214,164,.2);
  border:1px solid rgba(85,214,164,.5);
  color:var(--ok);
}
.card-result-message--bad{
  background:rgba(255,92,122,.15);
  border:1px solid rgba(255,92,122,.45);
  color:var(--danger);
}

/* Siatka kart w taliach (admin + moje talie) */
.deck-cards-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.deck-card-cell{
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.04);
}
.deck-card-cell__img{
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.deck-card-cell__name{
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  width: 100%;
}
.deck-card-cell__strength{
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.deck-card-cell__actions{
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
  align-items: center;
}
.deck-card-cell__actions .btn{
  min-width: 26px;
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.2;
}
.deck-card-cell__actions [data-count]{
  font-size: 12px;
  font-weight: 700;
  min-width: 1.2em;
  margin: 0 1px;
}
.deck-card-cell__actions .deck-preview-btn{
  min-width: 28px;
  padding: 2px 4px;
  font-size: 1rem;
}
.deck-sort-bar{
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Budowniczy talii – układ 2 kolumny (lista kart | wybrane karty) */
.deck-builder-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 16px;
  align-items: start;
}
@media (max-width: 900px) {
  .deck-builder-row { grid-template-columns: 1fr; }
}
.deck-builder-left,
.deck-builder-right {
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 16px;
}
.deck-builder-left h2,
.deck-builder-right h2 {
  margin: 0 0 12px;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #6dff8a;
}
.deck-builder-right__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}
.deck-builder-right__count {
  font-weight: 700;
  color: var(--muted);
}
.deck-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
  align-items: center;
}
.deck-filter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}
.deck-filter-select {
  max-width: 140px;
  padding: 6px 10px;
  font-size: 13px;
  background:rgba(0,0,0,.22);
  color:var(--text);
  border:1px solid rgba(255,255,255,.14);
  border-radius:8px;
}
.deck-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 12px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.deck-add-card-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.08);
}
.deck-add-card-cell__img-wrap {
  position: relative;
  display: inline-block;
}
.deck-add-card-cell__img {
  width: 72px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.deck-add-card-cell__strength {
  position: absolute;
  top: 2px;
  left: 2px;
  min-width: 18px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: rgba(0,0,0,.75);
  color: #fff;
  border-radius: 4px;
  line-height: 1;
}
.deck-add-card-cell__name {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.deck-add-card-cell__own {
  font-size: 10px;
  color: var(--muted);
}
.deck-add-card-cell__add {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}
.deck-add-card-cell__qty {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.deck-add-card-cell__qty .btn {
  min-width: 28px;
  padding: 4px 6px;
  font-size: 14px;
  line-height: 1;
}
.deck-add-card-cell__qty input {
  width: 36px;
  text-align: center;
  padding: 4px 2px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.2);
  background: rgba(0,0,0,.3);
  color: inherit;
}
.deck-selected-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  max-height: 320px;
  overflow-y: auto;
}
.deck-selected-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 6px;
  background: rgba(0,0,0,.25);
  border-radius: 8px;
  font-size: 13px;
}
.deck-selected-item__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deck-selected-item__qty {
  color: var(--muted);
  font-size: 12px;
}
.deck-selected-item__preview {
  padding: 4px 8px;
  font-size: 1rem;
  cursor: pointer;
  background: transparent;
  border: none;
  color: inherit;
  border-radius: 6px;
}
.deck-selected-item__preview:hover {
  background: rgba(255,255,255,.15);
}
.deck-save-row {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,.15);
}
.deck-save-row .field__label {
  margin-bottom: 4px;
}
.deck-save-row .field__input {
  margin-bottom: 12px;
}

/* Edycja talii – tytuł i kolor tła */
.deck-edit-title {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6dff8a;
  margin-bottom: 0.5rem;
}
.deck-edit-save-note {
  margin-top: 0;
  margin-bottom: 0.75rem;
  color: rgba(255,255,255,0.85);
}
.deck-preview-icon {
  font-size: 1.1em;
  vertical-align: middle;
}
.deck-preview-btn {
  min-width: 32px;
  padding: 4px 6px;
}
.deck-background-row .field__label {
  display: block;
  margin-bottom: 2px;
}
.deck-color-palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(32px, 1fr));
  gap: 6px;
  max-width: 320px;
  margin-bottom: 4px;
}
.deck-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  padding: 0;
  background: var(--swatch-color, #1a1a2e);
  transition: transform 0.15s, border-color 0.15s;
}
.deck-color-swatch:hover {
  transform: scale(1.08);
  border-color: rgba(255,255,255,0.6);
}
.deck-color-swatch.selected,
.deck-color-swatch--selected {
  border-color: #6dff8a;
  box-shadow: 0 0 0 2px rgba(109,255,138,0.4);
}
.deck-color-swatch[data-color=""] {
  background: linear-gradient(135deg, rgba(255,255,255,0.1), rgba(255,255,255,0.05));
}
.deck-sort-bar label{ font-size: 13px; color: var(--muted); }
.deck-sort-bar select{ padding: 6px 10px; border-radius: 8px; font-size: 13px; background:rgba(0,0,0,.22); color:var(--text); border:1px solid rgba(255,255,255,.14); }

.deck-edit-title {
  color: #6dff8a;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}
.deck-edit-save-note { font-size: 13px; color: var(--muted); }
.deck-preview-icon { cursor: pointer; opacity: 0.9; }
.deck-background-row .field__label { display: block; margin-bottom: 2px; }
.deck-color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}
.deck-color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 2px solid rgba(255,255,255,.3);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.deck-color-swatch:hover { transform: scale(1.1); box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.deck-color-swatch.deck-color-swatch--selected { border-color: #6dff8a; box-shadow: 0 0 0 2px rgba(109,255,138,.4); }
.deck-card-cell .deck-preview-btn {
  padding: 2px 4px;
  min-width: 28px;
  font-size: 1rem;
  line-height: 1;
  border-radius: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  cursor: pointer;
  color: inherit;
  vertical-align: middle;
}
.deck-card-cell .deck-preview-btn:hover { background: rgba(255,255,255,.2); }

/* ===================== Messages / Inbox ===================== */
.nav__badge{
  display:inline-flex;align-items:center;justify-content:center;
  min-width:18px;height:18px;padding:0 5px;
  border-radius:999px;font-size:11px;font-weight:700;line-height:1;
  background:var(--danger);color:#fff;margin-left:4px;vertical-align:middle;
}
.message-filters{
  display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px;
}
.message-filters__btn{
  padding:7px 16px;border-radius:10px;border:1px solid var(--stroke);
  background:var(--panel);color:var(--text);cursor:pointer;font-size:13px;
  transition:background .15s,border-color .15s;
}
.message-filters__btn:hover{background:var(--panel2);}
.message-filters__btn--active{background:var(--brand);border-color:var(--brand);color:#fff;}

.message-list{ display:flex;flex-direction:column;gap:8px;margin-bottom:18px; }

.message-tile{
  background:var(--panel);border:1px solid var(--stroke);border-radius:var(--radius2);
  padding:14px 18px;transition:background .15s,border-color .15s;
}
.message-tile:hover{background:var(--panel2);border-color:rgba(255,255,255,.18);}
.message-tile--system,.message-tile--admin{
  background:rgba(85,214,164,.10);border-color:rgba(85,214,164,.25);
}
.message-tile--system:hover,.message-tile--admin:hover{
  background:rgba(85,214,164,.16);border-color:rgba(85,214,164,.35);
}
.message-tile--unread .message-tile__subject{font-weight:700;}

.message-tile__head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;cursor:pointer;}
.message-tile__sender{font-size:13px;color:var(--muted);flex-shrink:0;}
.message-tile__subject{font-size:14px;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.message-tile__date{font-size:12px;color:var(--muted2);flex-shrink:0;}
.message-tile__badge{
  font-size:10px;font-weight:700;padding:2px 7px;border-radius:6px;
  background:var(--danger);color:#fff;text-transform:uppercase;
}

.message-tile__body{
  display:none;margin-top:12px;padding-top:12px;border-top:1px solid var(--stroke);
  font-size:13px;line-height:1.6;color:var(--muted);
}
.message-tile--open .message-tile__body{display:block;}
.message-tile__actions{display:flex;gap:8px;margin-top:12px;}

.message-pagination{
  display:flex;justify-content:center;align-items:center;gap:8px;margin-top:16px;
}
.message-pagination__btn{
  padding:6px 14px;border-radius:8px;border:1px solid var(--stroke);
  background:var(--panel);color:var(--text);cursor:pointer;font-size:13px;
  transition:background .15s;
}
.message-pagination__btn:hover{background:var(--panel2);}
.message-pagination__btn:disabled{opacity:.35;cursor:not-allowed;}
.message-pagination__info{font-size:13px;color:var(--muted);}

.btn--small{
  padding:6px 14px;border-radius:8px;font-size:12px;
  border:1px solid var(--stroke);background:var(--panel);color:var(--text);cursor:pointer;
  transition:background .15s;
}
.btn--small:hover{background:var(--panel2);}
.btn--danger{border-color:rgba(255,92,122,.4);color:var(--danger);}
.btn--danger:hover{background:rgba(255,92,122,.12);}
.btn--brand{border-color:var(--brand);color:#fff;background:var(--brand);}
.btn--brand:hover{background:rgba(124,92,255,.8);}

.new-message-form{
  display:none;background:var(--panel);border:1px solid var(--stroke);
  border-radius:var(--radius);padding:20px;margin-bottom:20px;
}
.new-message-form--open{display:block;}
.new-message-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px;margin-top:12px;}
.new-message-form label:first-child{margin-top:0;}
.new-message-form input,.new-message-form textarea{
  width:100%;padding:8px 12px;border-radius:8px;border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);color:var(--text);font-size:13px;font-family:inherit;
}
.new-message-form textarea{resize:vertical;min-height:80px;}
.new-message-form__actions{display:flex;gap:8px;margin-top:14px;}

.reply-form{
  margin-top:10px;display:flex;gap:8px;align-items:flex-start;
}
.reply-form textarea{
  flex:1;min-height:50px;padding:8px 10px;border-radius:8px;
  border:1px solid var(--stroke);background:rgba(255,255,255,.06);
  color:var(--text);font-size:13px;font-family:inherit;resize:vertical;
}

/* ===================== Admin sub-navigation ===================== */
.admin-subnav{
  display:flex;gap:6px;flex-wrap:wrap;margin-bottom:20px;
}
.admin-subnav__link{
  padding:7px 16px;border-radius:10px;border:1px solid var(--stroke);
  background:var(--panel);color:var(--text);text-decoration:none;font-size:13px;
  transition:background .15s,border-color .15s;
}
.admin-subnav__link:hover{background:var(--panel2);}
.admin-subnav__link--active{background:var(--brand);border-color:var(--brand);color:#fff;}

/* ===================== Admin Messages (Quill) ===================== */
.admin-msg-form{
  background:var(--panel);border:1px solid var(--stroke);border-radius:var(--radius);
  padding:20px;margin-bottom:24px;
}
.admin-msg-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px;margin-top:14px;}
.admin-msg-form label:first-child{margin-top:0;}
.admin-msg-form input[type="text"]{
  width:100%;padding:8px 12px;border-radius:8px;border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);color:var(--text);font-size:13px;font-family:inherit;
}
.admin-msg-form .ql-toolbar{border-color:var(--stroke)!important;border-radius:8px 8px 0 0;}
.admin-msg-form .ql-container{
  border-color:var(--stroke)!important;border-radius:0 0 8px 8px;
  background:rgba(255,255,255,.04);color:var(--text);min-height:140px;font-size:13px;
}
.admin-msg-form .ql-editor{min-height:120px;}
.admin-msg-form .ql-snow .ql-stroke{stroke:var(--muted);}
.admin-msg-form .ql-snow .ql-fill{fill:var(--muted);}
.admin-msg-form .ql-snow .ql-picker-label{color:var(--muted);}

.admin-msg-form__row{display:flex;align-items:center;gap:10px;margin-top:14px;}
.admin-msg-form__row label{margin:0;flex-shrink:0;}
.admin-msg-form__radio{display:flex;gap:14px;align-items:center;}
.admin-msg-form__radio label{display:flex;align-items:center;gap:5px;cursor:pointer;margin:0;}

.admin-msg-history{margin-top:24px;}
.admin-msg-history__item{
  background:var(--panel);border:1px solid var(--stroke);border-radius:var(--radius2);
  padding:12px 16px;margin-bottom:8px;
}
.admin-msg-history__meta{font-size:12px;color:var(--muted2);margin-bottom:4px;}
.admin-msg-history__subject{font-size:14px;font-weight:600;margin-bottom:4px;}
.admin-msg-history__body{font-size:13px;color:var(--muted);line-height:1.5;}

/* ===================== Admin Rewards ===================== */
.reward-form{
  background:var(--panel);border:1px solid var(--stroke);border-radius:var(--radius);
  padding:20px;margin-bottom:24px;
}
.reward-form label{display:block;font-size:13px;color:var(--muted);margin-bottom:4px;margin-top:14px;}
.reward-form label:first-child{margin-top:0;}
.reward-form input[type="text"],.reward-form input[type="number"],.reward-form select{
  padding:8px 12px;border-radius:8px;border:1px solid var(--stroke);
  background:rgba(255,255,255,.06);color:var(--text);font-size:13px;font-family:inherit;
}
.reward-form input[type="text"],.reward-form input[type="number"]{width:100%;}
.reward-form select{width:100%;max-width:320px;}

.reward-type-checks{display:flex;gap:16px;margin-top:8px;}
.reward-type-checks label{display:flex;align-items:center;gap:6px;cursor:pointer;font-size:13px;color:var(--text);}

.reward-card-rows{display:flex;flex-direction:column;gap:8px;margin-top:10px;}
.reward-card-row{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  background:rgba(255,255,255,.03);border:1px solid var(--stroke);
  border-radius:10px;padding:8px 12px;
}
.reward-card-row select{flex:1;min-width:180px;}
.reward-card-row input[type="number"]{width:70px;text-align:center;}
.reward-card-row .btn--small{flex-shrink:0;}

.autocomplete-wrap{position:relative;}
.autocomplete-list{
  position:absolute;left:0;right:0;top:100%;z-index:20;
  background:var(--bg1);border:1px solid var(--stroke);border-radius:8px;
  max-height:180px;overflow-y:auto;margin-top:2px;
}
.autocomplete-list__item{
  padding:7px 12px;font-size:13px;cursor:pointer;
  transition:background .12s;
}
.autocomplete-list__item:hover{background:var(--panel2);}

.toast{
  position:fixed;bottom:20px;left:50%;transform:translateX(-50%);z-index:9999;
  padding:12px 24px;border-radius:10px;font-size:14px;font-weight:600;
  color:#fff;box-shadow:0 4px 20px rgba(0,0,0,.35);pointer-events:none;
  animation:toastIn .3s ease-out;
}
.toast--ok{background:var(--ok);}
.toast--err{background:var(--danger);}
@keyframes toastIn{from{opacity:0;transform:translateX(-50%) translateY(10px);}to{opacity:1;transform:translateX(-50%) translateY(0);}}
