/*
 * ZAGINIONY BISKUP — System designu
 * Motyw: Polska lat 60. / Wes Anderson
 * Ciepla, papierowa paleta — pastele z pocztowki zakopiańskiej,
 * teczki śledcze, taśma klejąca, pieczątki, maszyna do pisania
 */

/* ── ZMIENNE ────────────────────────────────────────────────────────────── */
:root {
  --brass:        #c4756e;      /* dusty rose / coral — akcenty */
  --brass-light:  #3a2a1a;      /* warm brown — glowny tekst */
  --brass-dark:   #a85a54;      /* deeper coral */
  --copper:       #c4756e;      /* dusty rose — primary CTA */
  --iron:         #eee8d5;      /* aged paper cream */
  --iron-mid:     #e4dcc8;      /* darker aged paper */
  --iron-light:   #3a5a3a;      /* pine green */
  --parchment:    #3a2a1a;      /* warm brown text */
  --parchment-dark: #5a4a3a;    /* medium brown secondary */
  --ether-blue:   #7a9ab5;      /* soft sky blue (muted) */
  --ether-glow:   #b8d4e3;      /* light sky blue — from zakopane */
  --smoke:        #7a6a5a;      /* warm taupe for muted text */
  --danger:       #b34a44;      /* PRL red */
  --success:      #3a5a3a;      /* pine green */
  --success-light: #4a6a4a;     /* lighter pine */
  --warning:      #c4a035;      /* mustard */
  --bg-card:      rgba(253,249,237,0.94);
  --sky:          #b8d4e3;      /* soft sky blue */
  --tape:         #d4c9a8;      /* masking tape color */
  --stamp-red:    #b34a44;      /* red ink stamp */
  --paper-white:  #faf6ec;      /* off-white paper */
  --paper-shadow: rgba(58,42,26,0.1);
}

/* ── RESET & BASE ───────────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background-color: #d5cbb8;
  color: var(--parchment);
  font-family: 'Lora', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    linear-gradient(180deg,
      #8a9a7a 0%,
      #b5ad96 25%,
      #d5cbb8 50%,
      var(--iron) 100%
    );
  background-attachment: fixed;
}

/* ── TLO — TEKSTURA + WATERMARK ─────────────────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    /* aged paper grain */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E"),
    /* subtle dot pattern like old Polish wallpaper */
    radial-gradient(circle, rgba(58,42,26,0.035) 1px, transparent 1px);
  background-size: 200px 200px, 12px 12px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 900px);
  height: min(90vw, 900px);
  background-image: url('/akta.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0.03;
  pointer-events: none;
  z-index: 0;
  filter: grayscale(1);
}

/* ── KONTENER ───────────────────────────────────────────────────────────── */
.container {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 36px 20px 80px;
}

/* ── NAGLOWEK CENTROWANY (login, generator) ─────────────────────────────── */
.header-centered {
  text-align: center;
  margin-bottom: 40px;
}

.header-logo {
  display: inline-block;
  width: 120px;
  height: 120px;
  margin-bottom: 20px;
  animation: gentle-float 4s ease-in-out infinite;
}

.header-logo img { width: 100%; height: 100%; }

@keyframes gentle-float {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-6px); }
  100% { transform: translateY(0); }
}

/* ── NAGLOWEK NAWIGACYJNY (profil, admin, zadania) ──────────────────────── */
.header-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo-small {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  animation: gentle-float-small 4s ease-in-out infinite;
}

@keyframes gentle-float-small {
  0%   { transform: translateY(0); }
  50%  { transform: translateY(-3px); }
  100% { transform: translateY(0); }
}

.header-title-block h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  font-weight: 900;
  color: var(--brass-light);
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.header-title-block .sub {
  font-style: italic;
  color: var(--smoke);
  font-size: 0.82rem;
  margin-top: 3px;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* ── TYTUL ──────────────────────────────────────────────────────────────── */
h1.page-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.6rem, 5vw, 2.4rem);
  font-weight: 900;
  color: var(--brass-light);
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 6px;
}

.header-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 16px auto;
  max-width: 360px;
}

.header-divider::before,
.header-divider::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--copper), transparent);
  opacity: 0.35;
}

.header-divider span { color: var(--copper); font-size: 1rem; }

.header-sub {
  font-style: italic;
  color: var(--smoke);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* ── PANEL ──────────────────────────────────────────────────────────────── */
.panel {
  background: var(--paper-white);
  border: none;
  padding: 28px 28px 24px;
  margin-bottom: 18px;
  position: relative;
  box-shadow:
    2px 3px 0 rgba(58,42,26,0.06),
    4px 6px 16px rgba(58,42,26,0.08);
  /* slight rotation for hand-pinned feel */
  transform: rotate(-0.15deg);
}

/* "tape" decoration on top */
.panel::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(0.5deg);
  width: 80px;
  height: 18px;
  background: var(--tape);
  opacity: 0.6;
  z-index: 2;
  box-shadow: 0 1px 2px rgba(58,42,26,0.1);
  /* semi-transparent tape look */
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.3) 20%,
    rgba(255,255,255,0.3) 80%,
    transparent 100%
  );
}

/* inner paper edge line */
.panel::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid rgba(58,42,26,0.04);
  pointer-events: none;
}

.panel-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(58,42,26,0.15);
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

/* "POUFNE" stamp decoration */
.panel-title::before {
  content: 'POUFNE';
  font-family: 'Playfair Display', serif;
  font-size: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: var(--stamp-red);
  border: 2px solid var(--stamp-red);
  padding: 2px 7px;
  opacity: 0.25;
  transform: rotate(-4deg);
  flex-shrink: 0;
  line-height: 1.4;
}

/* ── POLA FORMULARZA ────────────────────────────────────────────────────── */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  font-family: 'Playfair Display', serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--copper);
  margin-bottom: 8px;
}

label .note {
  font-family: 'Lora', serif;
  font-style: italic;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.78rem;
  color: var(--smoke);
  margin-left: 6px;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
textarea,
select {
  width: 100%;
  background: rgba(255,255,255,0.75);
  border: 1px solid rgba(58,42,26,0.18);
  border-bottom-width: 2px;
  color: var(--parchment);
  padding: 11px 14px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.92rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.02em;
  appearance: none;
  -webkit-appearance: none;
}

textarea {
  resize: vertical;
  min-height: 100px;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.9rem;
  line-height: 1.6;
}

select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c4756e' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

input:focus, textarea:focus, select:focus {
  border-color: var(--copper);
  box-shadow: 0 0 0 2px rgba(196,117,110,0.12);
}

input::placeholder, textarea::placeholder {
  color: var(--smoke);
  opacity: 0.6;
  font-style: italic;
}

input[type="text"].kod-input {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
  border-style: dashed;
}

/* ── STATUS ─────────────────────────────────────────────────────────────── */
.status {
  background: rgba(250,246,236,0.85);
  border: 1px solid rgba(58,42,26,0.12);
  border-left: 3px solid var(--ether-blue);
  padding: 12px 16px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.78rem;
  display: none;
  margin-bottom: 16px;
  line-height: 2;
}

.status.show { display: block; }

.sline { display: flex; gap: 8px; align-items: baseline; }
.sline::before { content: '>'; color: var(--copper); flex-shrink: 0; font-weight: 700; }
.sline.ok    { color: var(--success); }
.sline.err   { color: var(--danger); }
.sline.info  { color: var(--ether-blue); }
.sline.warn  { color: var(--warning); }

/* ── PRZYCISKI ──────────────────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 14px 20px;
  background: var(--copper);
  border: 2px solid var(--brass-dark);
  color: #faf6ec;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow:
    2px 2px 0 rgba(58,42,26,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  margin-top: 4px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* backwards-compat alias */
.btn-generate {
  width: 100%;
  padding: 15px 20px;
  background: var(--copper);
  border: 2px solid var(--brass-dark);
  color: #faf6ec;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow:
    2px 2px 0 rgba(58,42,26,0.15),
    inset 0 1px 0 rgba(255,255,255,0.15);
  margin-top: 4px;
}

.btn-primary:hover:not(:disabled),
.btn-generate:hover:not(:disabled) {
  background: var(--brass-dark);
  border-color: #8a4a42;
  box-shadow:
    1px 1px 0 rgba(58,42,26,0.2),
    inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translate(1px, 1px);
}

.btn-primary:disabled,
.btn-generate:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary .shine,
.btn-generate .shine {
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.btn-primary:hover .shine,
.btn-generate:hover .shine { left: 100%; }

.btn-secondary {
  padding: 10px 18px;
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.2);
  border-bottom-width: 2px;
  color: var(--parchment);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 1px 1px 0 rgba(58,42,26,0.06);
}

.btn-secondary:hover {
  background: var(--iron);
  border-color: var(--copper);
  color: var(--parchment);
  box-shadow: none;
  transform: translate(1px, 1px);
}

.btn-secondary.primary-action {
  border-color: var(--copper);
  background: rgba(196,117,110,0.06);
}

.btn-danger {
  padding: 9px 16px;
  background: transparent;
  border: 1px solid rgba(179,74,68,0.3);
  color: var(--danger);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-danger:hover {
  background: rgba(179,74,68,0.08);
  border-color: var(--danger);
}

.btn-logout {
  padding: 9px 18px;
  background: transparent;
  border: 1px solid rgba(58,42,26,0.2);
  color: var(--smoke);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-logout:hover {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(179,74,68,0.05);
}

.btn-row { display: flex; gap: 10px; }

/* ── LOADING ─────────────────────────────────────────────────────────────── */
.loading { text-align: center; padding: 36px 0; display: none; }
.loading.show { display: block; }

.loading-gear {
  width: 72px;
  height: 72px;
  display: inline-block;
  margin-bottom: 16px;
  animation: gentle-pulse 1.8s ease-in-out infinite;
}

.loading-gear img { width: 100%; height: 100%; }

@keyframes gentle-pulse {
  0%   { transform: scale(1);    opacity: 0.7; }
  50%  { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1);    opacity: 0.7; }
}

.loading-main { font-style: italic; color: var(--parchment-dark); font-size: 1rem; margin-bottom: 6px; }

.loading-step {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  color: var(--smoke);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.progress {
  width: 180px;
  height: 3px;
  background: rgba(58,42,26,0.1);
  margin: 14px auto 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--copper);
  animation: prog 2.2s ease-in-out infinite;
}

@keyframes prog {
  0%   { width: 0%;  margin-left: 0%; }
  40%  { width: 55%; margin-left: 15%; }
  100% { width: 0%;  margin-left: 100%; }
}

/* Full-screen loading */
.loading-screen {
  text-align: center;
  padding: 80px 20px;
}

.loading-screen .loading-logo {
  width: 80px; height: 80px;
  display: inline-block;
  margin-bottom: 20px;
  animation: gentle-pulse 2s ease-in-out infinite;
}

.loading-screen p {
  font-style: italic;
  color: var(--smoke);
  font-size: 1rem;
}

/* ── WYNIK GENEROWANIA ───────────────────────────────────────────────────── */
.result { display: none; animation: rise 0.5s ease; }
.result.show { display: block; }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.result-img-wrap { text-align: center; margin-bottom: 20px; }

.result-img {
  max-width: 100%;
  max-height: 500px;
  border: 6px solid var(--paper-white);
  display: block;
  margin: 0 auto;
  box-shadow:
    0 2px 4px rgba(58,42,26,0.15),
    0 8px 24px rgba(58,42,26,0.1);
  /* polaroid feel */
  padding: 0;
  background: var(--paper-white);
}

.result-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  font-weight: 900;
  color: var(--brass-light);
  text-align: center;
  margin-bottom: 4px;
}

.result-class {
  font-style: italic;
  text-align: center;
  color: var(--smoke);
  margin-bottom: 22px;
  font-size: 1rem;
}

/* ── KLASY ───────────────────────────────────────────────────────────────── */
.classes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.class-card {
  border: 1px solid rgba(58,42,26,0.1);
  padding: 14px 10px 12px;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--paper-white);
  position: relative;
  text-align: center;
  user-select: none;
  box-shadow: 1px 2px 0 rgba(58,42,26,0.05);
}

.class-card:hover {
  border-color: var(--copper);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 2px 4px 8px rgba(58,42,26,0.1);
}

.class-card.selected {
  border-color: var(--copper);
  background: rgba(196,117,110,0.08);
  box-shadow:
    0 0 0 2px rgba(196,117,110,0.2),
    2px 3px 8px rgba(58,42,26,0.08);
}

.class-card.selected::after {
  content: '';
  position: absolute;
  top: 6px; right: 8px;
  color: var(--copper);
  font-size: 0.75rem;
  font-family: sans-serif;
}

.class-emoji { font-size: 1.6rem; display: block; margin-bottom: 7px; }

.class-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--brass-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.3;
}

.class-desc {
  font-style: italic;
  font-size: 0.72rem;
  color: var(--smoke);
  line-height: 1.35;
}

/* ── UPLOAD ──────────────────────────────────────────────────────────────── */
.upload-zone {
  border: 2px dashed rgba(58,42,26,0.22);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(250,246,236,0.5);
  position: relative;
  overflow: hidden;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--copper);
  background: rgba(250,246,236,0.8);
}

.upload-zone.has-photo {
  border-style: solid;
  border-color: rgba(58,42,26,0.18);
  padding: 14px;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-icon { font-size: 2.2rem; display: block; opacity: 0.5; margin-bottom: 10px; }
.upload-label { font-style: italic; color: var(--smoke); font-size: 0.95rem; }
.upload-formats {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  color: var(--smoke);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

#preview {
  max-width: 100%;
  max-height: 260px;
  display: none;
  margin: 0 auto;
  box-shadow: 0 4px 16px rgba(58,42,26,0.12);
  border: 4px solid var(--paper-white);
}

/* ── PROFIL ──────────────────────────────────────────────────────────────── */
.profil-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.avatar-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border: 6px solid var(--paper-white);
  display: block;
  box-shadow:
    0 2px 4px rgba(58,42,26,0.12),
    0 6px 20px rgba(58,42,26,0.08);
  margin-bottom: 16px;
  background: var(--iron-mid);
  /* polaroid frame */
  padding: 0;
}

.avatar-placeholder {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 2px dashed rgba(58,42,26,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250,246,236,0.5);
  margin-bottom: 16px;
}

.avatar-placeholder img { width: 60%; opacity: 0.12; }

.char-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--brass-light);
  line-height: 1.2;
  margin-bottom: 6px;
}

.char-class {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.68rem;
  color: var(--iron-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(58,90,58,0.08);
  border: 1px solid rgba(58,90,58,0.2);
  padding: 4px 10px;
  margin-bottom: 12px;
}

.char-meta {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  color: var(--smoke);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.9;
}

/* ── STATYSTYKI ──────────────────────────────────────────────────────────── */
.stat-row { margin-bottom: 14px; }
.stat-row:last-child { margin-bottom: 0; }

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.stat-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.63rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--copper);
}

.stat-value {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.82rem;
  color: var(--parchment-dark);
  min-width: 28px;
  text-align: right;
}

.stat-bar-track {
  height: 6px;
  background: rgba(58,42,26,0.06);
  border: 1px solid rgba(58,42,26,0.08);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--iron-light), var(--copper));
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  width: 0%;
}

/* ── ZEBATKI ─────────────────────────────────────────────────────────────── */
.zebatki-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 16px 0 8px;
}

.zebatki-hero-coin {
  width: 77px;
  height: 77px;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 6px rgba(58,42,26,0.2));
  animation: zb-rot 22s linear infinite;
  opacity: 0.92;
}

@keyframes zb-rot {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.zebatki-info { text-align: left; }

.zebatki-number {
  font-family: 'Playfair Display', serif;
  font-size: 4.4rem;
  font-weight: 900;
  color: var(--brass-light);
  line-height: 1;
}

.zebatki-label-block { text-align: left; }

.zebatki-label {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.68rem;
  color: var(--smoke);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
}

.zebatki-sublabel {
  font-style: italic;
  font-size: 0.78rem;
  color: var(--smoke);
  margin-top: 2px;
}

/* ── IKONA ZEBATKI (waluta) ──────────────────────────────────────────────── */
.icon-zb {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  flex-shrink: 0;
}

/* ── ARKANOMECHANIKA (mechanizmy jednorazowe) ───────────────────────────── */
.mechanizmy-lista {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mechanizm {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.08);
  border-left: 3px solid var(--ether-blue);
  padding: 12px 14px;
  transition: all 0.15s;
  position: relative;
  box-shadow: 1px 2px 0 rgba(58,42,26,0.04);
}

.mechanizm:hover {
  border-color: rgba(58,42,26,0.15);
  border-left-color: var(--ether-blue);
  background: #fff;
  box-shadow: 2px 3px 8px rgba(58,42,26,0.08);
}

.mechanizm.uzyta {
  opacity: 0.4;
  filter: grayscale(0.7);
  border-left-color: rgba(58,42,26,0.12);
}

.mechanizm-emoji {
  font-size: 2.2rem;
  text-align: center;
  line-height: 1;
}

.mechanizm.uzyta .mechanizm-emoji { filter: none; }

.mechanizm-body { min-width: 0; }

.mechanizm-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brass-light);
  letter-spacing: 0.04em;
  margin-bottom: 3px;
}

.mechanizm-opis {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.72rem;
  color: var(--smoke);
  line-height: 1.4;
}

.mechanizm-efekt {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.6rem;
  color: var(--iron-light);
  margin-top: 3px;
}

.mechanizm-status {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.55rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.mechanizm-status.gotowy {
  color: var(--ether-blue);
  border: 1px solid rgba(122,154,181,0.35);
  background: rgba(184,212,227,0.12);
}

.mechanizm-status.aktywowano {
  color: var(--smoke);
  border: 1px solid rgba(58,42,26,0.15);
  background: rgba(58,42,26,0.04);
}

/* Stare klasy (zachowane dla kompatybilnosci) */
.odznaki-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.odznaka {
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.08);
  padding: 14px 8px 12px;
  text-align: center;
  transition: all 0.15s;
  position: relative;
  box-shadow: 1px 2px 0 rgba(58,42,26,0.04);
}

.odznaka:hover {
  border-color: var(--copper);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 2px 4px 8px rgba(58,42,26,0.1);
}

.odznaka.uzyta { opacity: 0.45; filter: grayscale(0.6); }

.odznaka-emoji { font-size: 1.9rem; display: block; margin-bottom: 8px; }

.odznaka-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--brass-light);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
  line-height: 1.3;
}

.odznaka-opis {
  font-style: italic;
  font-size: 0.68rem;
  color: var(--smoke);
  line-height: 1.3;
}

.odznaka-akcja-badge {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.58rem;
  color: var(--iron-light);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(58,90,58,0.08);
  border: 1px solid rgba(58,90,58,0.2);
  padding: 2px 6px;
  display: inline-block;
  margin-top: 5px;
}

/* ── PRZEDMIOTY ──────────────────────────────────────────────────────────── */
#przedmioty-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.przedmiot {
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s;
  overflow: hidden;
  box-shadow: 1px 2px 0 rgba(58,42,26,0.04);
  /* polaroid / case-file card feel */
  position: relative;
}

.przedmiot:hover {
  border-color: var(--copper);
  transform: translateY(-2px);
  box-shadow: 2px 4px 10px rgba(58,42,26,0.1);
}

.przedmiot-icon {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  background: rgba(228,220,200,0.4);
  border-bottom: 1px solid rgba(58,42,26,0.06);
  overflow: hidden;
}

.przedmiot-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }

.przedmiot-info { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }

.przedmiot-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--brass-light);
  line-height: 1.3;
}

.przedmiot-opis {
  font-family: 'Lora', serif;
  font-style: italic;
  font-size: 0.68rem;
  color: var(--smoke);
  line-height: 1.4;
  flex: 1;
}

.przedmiot-efekt {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.6rem;
  color: var(--iron-light);
  letter-spacing: 0.04em;
  margin-top: 2px;
}

@media (max-width: 500px) {
  #przedmioty-container { grid-template-columns: 1fr 1fr; }
}

/* ── EMPTY STATE ─────────────────────────────────────────────────────────── */
.empty-state {
  font-style: italic;
  color: var(--smoke);
  font-size: 0.88rem;
  text-align: center;
  padding: 20px 0;
  opacity: 0.7;
}

/* ── ZADANIA ─────────────────────────────────────────────────────────────── */
.zadania-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.zadanie-card {
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.08);
  padding: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
  box-shadow: 2px 3px 0 rgba(58,42,26,0.05);
  /* slight tilt for pinned-to-board look */
  transform: rotate(0.3deg);
}

.zadanie-card:nth-child(even) {
  transform: rotate(-0.2deg);
}

.zadanie-card:hover {
  border-color: var(--copper);
  transform: rotate(0deg) translateY(-2px);
  box-shadow: 3px 5px 12px rgba(58,42,26,0.1);
}

.zadanie-card.zaliczone {
  border-color: rgba(58,90,58,0.35);
  background: rgba(58,90,58,0.04);
}

.zadanie-card.oddane {
  border-color: rgba(122,154,181,0.4);
}

.zadanie-card.odrzucone {
  border-color: rgba(179,74,68,0.3);
}

.zadanie-trudnosc {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 3px 8px;
  display: inline-block;
  align-self: flex-start;
}

.trudnosc-proba     { color: var(--success);  background: rgba(58,90,58,0.08);   border: 1px solid rgba(58,90,58,0.2); }
.trudnosc-wyzwanie  { color: var(--warning);  background: rgba(196,160,53,0.08); border: 1px solid rgba(196,160,53,0.2); }
.trudnosc-tajemnica { color: var(--danger);   background: rgba(179,74,68,0.08);  border: 1px solid rgba(179,74,68,0.2); }

.zadanie-tytul {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brass-light);
  letter-spacing: 0.03em;
  line-height: 1.3;
}

.zadanie-opis {
  font-style: italic;
  font-size: 0.88rem;
  color: var(--parchment-dark);
  line-height: 1.6;
  flex: 1;
}

.zadanie-nagroda {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.7rem;
  color: var(--copper);
  letter-spacing: 0.04em;
  border-top: 1px dashed rgba(58,42,26,0.12);
  padding-top: 10px;
}

.zadanie-status-info {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.72rem;
  text-align: center;
  padding: 8px;
  letter-spacing: 0.06em;
}

.zadanie-status-info.zaliczone { color: var(--success); }
.zadanie-status-info.oddane    { color: var(--ether-blue); }
.zadanie-status-info.odrzucone { color: var(--danger); }

/* ── ADMIN PANEL ─────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 2px solid rgba(58,42,26,0.12);
}

/* file-folder tab bar */
.admin-tab {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--smoke);
  padding: 10px 18px 9px;
  cursor: pointer;
  border: 1px solid transparent;
  border-bottom: none;
  transition: all 0.15s;
  background: rgba(228,220,200,0.4);
  position: relative;
  bottom: -2px;
  margin-right: 2px;
  /* tab shape — rounded top */
  border-radius: 4px 4px 0 0;
}

.admin-tab:hover { color: var(--copper); background: rgba(228,220,200,0.7); }

.admin-tab.active {
  color: var(--brass-light);
  border-color: rgba(58,42,26,0.12);
  background: var(--paper-white);
  border-bottom-color: var(--paper-white);
  font-weight: 700;
}

.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background: var(--danger);
  color: white;
  font-size: 0.6rem;
  font-family: sans-serif;
  font-weight: 700;
  border-radius: 50%;
  margin-left: 5px;
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* Gracz w liscie admin */
.gracz-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(58,42,26,0.06);
  cursor: pointer;
  transition: background 0.1s;
}

.gracz-row:last-child { border-bottom: none; }
.gracz-row:hover { background: rgba(196,117,110,0.04); }

.gracz-mini-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 3px solid var(--paper-white);
  background: var(--iron-mid);
  box-shadow: 1px 1px 3px rgba(58,42,26,0.1);
}

.gracz-info-name {
  font-family: 'Playfair Display', serif;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--parchment);
  margin-bottom: 2px;
}

.gracz-info-meta {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  color: var(--smoke);
  letter-spacing: 0.05em;
}

.gracz-zebatki {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--copper);
  text-align: right;
}

.gracz-zebatki-label {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.55rem;
  color: var(--smoke);
  letter-spacing: 0.1em;
  text-align: right;
  text-transform: uppercase;
}

/* Weryfikacja zadan */
.zgloszenie-row {
  padding: 16px 0;
  border-bottom: 1px solid rgba(58,42,26,0.06);
}

.zgloszenie-row:last-child { border-bottom: none; }

.zgloszenie-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 8px;
}

.zgloszenie-meta {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  color: var(--smoke);
  letter-spacing: 0.05em;
}

.zgloszenie-odpowiedz {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.85rem;
  color: var(--parchment);
  background: rgba(250,246,236,0.7);
  border: 1px dashed rgba(58,42,26,0.15);
  padding: 8px 12px;
  margin: 8px 0;
  letter-spacing: 0.03em;
}

.zgloszenie-actions { display: flex; gap: 8px; }

/* Kalendarz zadan */
.kalendarz-day {
  display: flex;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(58,42,26,0.06);
  align-items: flex-start;
}

.kalendarz-day:last-child { border-bottom: none; }

.kalendarz-data {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.65rem;
  color: var(--smoke);
  letter-spacing: 0.08em;
  min-width: 80px;
  padding-top: 3px;
  text-transform: uppercase;
}

.kalendarz-zadania { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.kalendarz-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: 'Playfair Display', serif;
  font-size: 0.72rem;
  color: var(--parchment-dark);
}

/* ── STAT BADGE ──────────────────────────────────────────────────────────── */
.stat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  padding: 3px 8px;
  background: rgba(196,117,110,0.08);
  border: 1px solid rgba(196,117,110,0.2);
  color: var(--copper);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin: 2px;
}

/* ── MODAL ───────────────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(58,42,26,0.35);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.12);
  padding: 28px 30px;
  max-width: 560px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    3px 4px 0 rgba(58,42,26,0.08),
    6px 10px 30px rgba(58,42,26,0.15);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brass-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(58,42,26,0.15);
}

.modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: transparent;
  border: none;
  color: var(--smoke);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  line-height: 1;
}

.modal-close:hover { color: var(--danger); }

/* ── AI GENERATOR ────────────────────────────────────────────────────────── */
.ai-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.6rem;
  color: var(--iron-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: rgba(58,90,58,0.08);
  border: 1px solid rgba(58,90,58,0.2);
  padding: 3px 8px;
  margin-left: 8px;
}

/* ── HISTORIA ────────────────────────────────────────────────────────────── */
.historia-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid rgba(58,42,26,0.05);
  font-size: 0.82rem;
}

.historia-row:last-child { border-bottom: none; }

.historia-data {
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  color: var(--smoke);
  min-width: 80px;
  padding-top: 2px;
}

.historia-opis { color: var(--parchment-dark); line-height: 1.4; }
.historia-wartosc { font-family: 'Source Code Pro', monospace; font-size: 0.75rem; color: var(--copper); white-space: nowrap; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .zadania-grid { grid-template-columns: 1fr; }
  .profil-grid  { grid-template-columns: 1fr; }
  .classes-grid { grid-template-columns: repeat(2, 1fr); }
  .odznaki-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-tabs   { flex-wrap: wrap; }
  .panel { padding: 18px 16px; }
  .zebatki-number { font-size: 2.8rem; }
  .btn-row { flex-direction: column; }
  .header-title-block h1 { font-size: 1.1rem; }
}

/* ── MODAL (ZADANIA) ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(58,42,26,0.4);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-panel {
  background: var(--paper-white);
  border: 1px solid rgba(58,42,26,0.1);
  padding: 28px 28px 24px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow:
    3px 4px 0 rgba(58,42,26,0.08),
    6px 10px 30px rgba(58,42,26,0.15);
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.show .modal-panel {
  transform: translateY(0);
}

/* tape on top of modal panel */
.modal-panel::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(-0.5deg);
  width: 90px;
  height: 18px;
  background: var(--tape);
  opacity: 0.55;
  z-index: 2;
  background-image: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255,255,255,0.3) 20%,
    rgba(255,255,255,0.3) 80%,
    transparent 100%
  );
}

.modal-panel::after {
  content: '';
  position: absolute;
  top: 8px; left: 8px; right: 8px; bottom: 8px;
  border: 1px solid rgba(58,42,26,0.04);
  pointer-events: none;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--smoke);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 2;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--danger);
}

.modal-content-area {
  margin-top: 10px;
  margin-bottom: 24px;
  line-height: 1.7;
  color: var(--parchment);
  font-size: 1.05rem;
}

/* Formowanie tekstu z tagami wewnatrz zadania (zdjecia, odstepy) */
.modal-content-area img {
  max-width: 100%;
  height: auto;
  border: 4px solid var(--paper-white);
  box-shadow: 1px 2px 6px rgba(58,42,26,0.12);
  margin: 16px 0;
  display: block;
}

.modal-content-area p {
  margin-bottom: 16px;
}

.modal-content-area blockquote {
  border-left: 3px solid var(--copper);
  padding-left: 14px;
  margin: 16px 0;
  font-style: italic;
  color: var(--smoke);
}

/* ── RADIO WIDGET ──────────────────────────────────────────────────────── */
.radio-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 100;
  width: 280px;
  font-family: 'Source Code Pro', monospace;
  transition: all 0.3s ease;
}

.radio-widget.minimized { width: auto; }

.radio-body {
  background: linear-gradient(145deg, #4a3828 0%, #3a2a1a 40%, #2a1e14 100%);
  border: 2px solid rgba(196,160,53,0.35);
  border-radius: 8px;
  padding: 14px;
  box-shadow:
    0 4px 20px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.05);
  color: #d4c9a8;
}

.radio-widget.minimized .radio-body {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
}

.radio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(196,160,53,0.15);
}

.radio-widget.minimized .radio-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.radio-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(196,160,53,0.7);
}

.radio-brand .radio-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #444;
  transition: background 0.3s;
}

.radio-brand .radio-dot.on { background: #6b8e23; box-shadow: 0 0 6px rgba(107,142,35,0.5); }

.radio-toggle {
  background: none; border: none; color: rgba(196,160,53,0.5);
  cursor: pointer; font-size: 0.7rem; padding: 2px 4px;
  transition: color 0.2s;
}
.radio-toggle:hover { color: rgba(196,160,53,0.9); }

.radio-display {
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(196,160,53,0.12);
  border-radius: 4px;
  padding: 8px 10px;
  margin-bottom: 10px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radio-widget.minimized .radio-display,
.radio-widget.minimized .radio-controls,
.radio-widget.minimized .radio-playlist { display: none; }

.radio-song-title {
  font-size: 0.72rem;
  color: #b8d4a0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  letter-spacing: 0.03em;
}

.radio-song-title.off { color: #666; }

.radio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.radio-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(196,160,53,0.2);
  color: #d4c9a8;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.radio-btn:hover {
  background: rgba(196,160,53,0.12);
  border-color: rgba(196,160,53,0.4);
}

.radio-btn.play-btn {
  width: 40px; height: 40px;
  font-size: 0.9rem;
  border-color: rgba(196,160,53,0.3);
}

.radio-volume {
  display: flex; align-items: center; gap: 6px;
  margin-left: 8px;
}

.radio-volume input[type="range"] {
  width: 50px; height: 3px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(196,160,53,0.2);
  border-radius: 2px;
  outline: none;
}

.radio-volume input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: rgba(196,160,53,0.6);
  cursor: pointer;
}

.radio-playlist {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.radio-playlist.open { max-height: 200px; overflow-y: auto; }

.radio-playlist-btn {
  text-align: center;
  margin-bottom: 6px;
}

.radio-playlist-btn button {
  background: none; border: none;
  color: rgba(196,160,53,0.4);
  font-size: 0.6rem;
  cursor: pointer;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: 'Source Code Pro', monospace;
}
.radio-playlist-btn button:hover { color: rgba(196,160,53,0.8); }

.radio-track {
  padding: 5px 8px;
  font-size: 0.65rem;
  color: #999;
  cursor: pointer;
  border-radius: 3px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.radio-track:hover { background: rgba(255,255,255,0.04); color: #ccc; }
.radio-track.active { color: #b8d4a0; background: rgba(107,142,35,0.1); }
.radio-track .track-num { color: rgba(196,160,53,0.4); min-width: 14px; }

@media (max-width: 600px) {
  .radio-widget { width: 240px; bottom: 12px; right: 12px; }
  .radio-widget.minimized { width: auto; }
}

.btn-narrate {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(58,90,58,0.25);
  color: var(--iron-light);
  font-family: 'Source Code Pro', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-narrate:hover {
  background: rgba(58,90,58,0.06);
  border-color: var(--iron-light);
}

.btn-narrate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── SPENDING DASHBOARD ─────────────────────────────────────────────────── */
.spending-bar {
  height: 8px;
  background: rgba(58,42,26,0.06);
  border: 1px solid rgba(58,42,26,0.1);
  overflow: hidden;
  margin: 8px 0;
}

.spending-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  transition: width 0.5s ease;
}

.spending-service {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-family: 'Source Code Pro', monospace;
  font-size: 0.7rem;
  border-bottom: 1px solid rgba(58,42,26,0.05);
}

.spending-service:last-child { border-bottom: none; }
