/* Czcionki hostowane lokalnie (bez Google Fonts — prywatność odwiedzających) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/inter-latin-ext-400-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/inter-latin-ext-500-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/inter-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/inter-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/inter-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/inter-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url(fonts/inter-latin-900-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 900; font-display: swap; src: url(fonts/inter-latin-ext-900-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/fraunces-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/fraunces-latin-ext-600-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/fraunces-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 700; font-display: swap; src: url(fonts/fraunces-latin-ext-700-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/fraunces-latin-800-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 800; font-display: swap; src: url(fonts/fraunces-latin-ext-800-normal.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 700; font-display: swap; src: url(fonts/fraunces-latin-700-italic.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 700; font-display: swap; src: url(fonts/fraunces-latin-ext-700-italic.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #0b0b0b;
  --bg-2: #151515;
  --bg-3: #1f1f1f;
  --line: #2c2c2c;
  --text: #f4f4f4;
  --muted: #8d8d8d;
  --accent: #ff3b30;
  --ok: #34c759;
  --radius: 14px;
  --card-w: 200px;
  --font: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 20px 64px; outline: none; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  background: rgba(11, 11, 11, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 900; letter-spacing: -0.02em; font-size: 18px; }
.brand-mark { position: relative; width: 28px; height: 28px; }
.brand-mark i { position: absolute; width: 16px; height: 22px; border-radius: 3px; top: 3px; border: 1.5px solid #fff; }
.brand-mark i:nth-child(1) { left: 0; background: #fff; transform: rotate(-14deg); }
.brand-mark i:nth-child(2) { left: 6px; background: #000; transform: rotate(2deg); }
.brand-mark i:nth-child(3) { left: 12px; background: #fff; transform: rotate(16deg); }
.nav { display: flex; align-items: center; gap: 18px; }
.nav a[data-nav] { text-decoration: none; color: var(--muted); font-weight: 700; }
.nav a[data-nav].active, .nav a[data-nav]:hover { color: var(--text); }

.banner { background: #2a1d00; color: #ffd27a; border-bottom: 1px solid #4a3500; padding: 8px 24px; font-size: 13px; text-align: center; }

/* ---------- Buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-3);
  font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .12s ease, background .12s ease, border-color .12s ease;
}
.btn:hover { border-color: #555; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-white { background: #fff; color: #000; border-color: #fff; }
.btn-white:hover { background: #e6e6e6; }
.btn-black { background: #000; color: #fff; border-color: #444; }
.btn-ghost { background: transparent; }
.btn-danger { color: #ff6b62; }
.btn-danger:hover { border-color: #ff6b62; }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 50%; }

.input, .textarea, .select {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg-2);
  outline: none; transition: border-color .12s;
}
.input:focus, .textarea:focus, .select:focus { border-color: #777; }
.textarea { resize: vertical; min-height: 90px; }
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: center; padding: 30px 0 50px; }
.hero h1 { font-size: clamp(48px, 8vw, 96px); line-height: .92; letter-spacing: -0.045em; font-weight: 900; margin: 0 0 22px; }
.hero h1 span { display: block; }
.hero p { color: #bdbdbd; font-size: 17px; max-width: 46ch; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-fan { position: relative; height: 360px; }
.hero-fan .card { position: absolute; left: 50%; top: 50%; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.hero-fan .card:nth-child(1) { transform: translate(-95%, -48%) rotate(-12deg); }
.hero-fan .card:nth-child(2) { transform: translate(-50%, -54%) rotate(1deg); z-index: 2; }
.hero-fan .card:nth-child(3) { transform: translate(-5%, -46%) rotate(13deg); }
.hero-fan:hover .card:nth-child(1) { transform: translate(-112%, -50%) rotate(-16deg); }
.hero-fan:hover .card:nth-child(3) { transform: translate(12%, -48%) rotate(17deg); }

/* ---------- Cards ---------- */
.card {
  position: relative;
  width: var(--card-w); aspect-ratio: 63 / 88;
  border-radius: 12px; padding: 18px 16px 34px;
  font-weight: 800; font-size: 17px; line-height: 1.22; letter-spacing: -0.01em;
  display: flex; flex-direction: column;
  box-shadow: 0 10px 30px rgba(0,0,0,.45);
  overflow: hidden; word-wrap: break-word; hyphens: auto;
  user-select: none;
}
.card.black { background: #000; color: #fff; border: 1.5px solid #3a3a3a; }
.card.white { background: #fff; color: #000; border: 1.5px solid #d8d8d8; }
.card .card-text { flex: 1; overflow: hidden; white-space: pre-wrap; }
.card .blank { display: inline-block; min-width: 3.2em; border-bottom: 2px solid currentColor; transform: translateY(-3px); }
.card .filled { background: #fff; color: #000; padding: 0 4px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.card-foot {
  position: absolute; left: 14px; right: 14px; bottom: 11px;
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .01em;
}
.card-foot .mini { display: flex; align-items: center; gap: 5px; opacity: .9; }
.card-foot .mini::before {
  content: ""; width: 9px; height: 11px; border-radius: 2px; border: 1.2px solid currentColor;
  box-shadow: 3px -1px 0 -1.2px currentColor; transform: rotate(-8deg);
}
.pick { display: inline-flex; align-items: center; gap: 4px; font-weight: 900; font-size: 10px; }
.pick b { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #fff; color: #000; font-size: 10px; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 18px; }
.card-grid .card { width: 100%; font-size: 15px; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
.card-item { position: relative; }
.card-item .card { cursor: text; transition: transform .15s ease; }
.card-item:hover .card { transform: translateY(-3px); }
.card-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; opacity: 0; transition: opacity .12s; z-index: 2; }
.card-item:hover .card-tools, .card-item:focus-within .card-tools { opacity: 1; }
.card-tools button {
  width: 28px; height: 28px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(128,128,128,.25); font-size: 13px; display: grid; place-items: center;
}
.card.black + .card-tools button, .card-item.is-black .card-tools button { color: #fff; }
.card-item.is-white .card-tools button { color: #000; }
.card-tools button:hover { background: var(--accent); color: #fff; }
.card-edit {
  width: 100%; flex: 1; border: 0; outline: none; resize: none; background: transparent;
  font: inherit; color: inherit; line-height: inherit; padding: 0;
}

@media (hover: none) { .card-tools { opacity: 1; } }

/* ---------- Deck tiles (home) ---------- */
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 10px 0 18px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 28px; letter-spacing: -0.03em; font-weight: 900; }
.deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.deck-tile {
  position: relative; display: block; text-decoration: none;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px; min-height: 210px; overflow: hidden;
  transition: transform .15s ease, border-color .15s ease;
}
.deck-tile:hover { transform: translateY(-4px); border-color: #4a4a4a; }
.deck-tile h3 { margin: 0 0 6px; font-size: 21px; font-weight: 900; letter-spacing: -0.02em; max-width: 70%; }
.deck-tile p { margin: 0; color: var(--muted); font-size: 13px; max-width: 64%; }
.deck-tile .meta { position: absolute; left: 20px; bottom: 18px; display: flex; gap: 10px; font-size: 12px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); }
.chip i { width: 9px; height: 12px; border-radius: 2px; display: inline-block; }
.chip i.b { background: #000; border: 1px solid #fff; }
.chip i.w { background: #fff; }
.deck-tile .stack { position: absolute; right: -18px; top: 26px; width: 110px; height: 150px; }
.deck-tile .stack span { position: absolute; inset: 0; border-radius: 10px; }
.deck-tile .stack span:nth-child(1) { background: #fff; transform: rotate(14deg) translate(10px, 6px); }
.deck-tile .stack span:nth-child(2) { background: #000; border: 1.5px solid #444; transform: rotate(4deg); padding: 12px; font-size: 10px; font-weight: 800; color: #fff; overflow: hidden; line-height: 1.25; }
.deck-tile:hover .stack span:nth-child(1) { transform: rotate(20deg) translate(16px, 4px); }
.deck-new { display: grid; place-items: center; text-align: center; border-style: dashed; color: var(--muted); font-weight: 800; font-size: 18px; }
.deck-new:hover { color: var(--text); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 18px; }

/* ---------- Editor ---------- */
.editor-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; margin-bottom: 18px; }
.deck-name {
  width: 100%; background: transparent; border: 0; outline: none;
  font-size: clamp(30px, 5vw, 48px); font-weight: 900; letter-spacing: -0.04em; padding: 0; margin: 0;
}
.deck-name::placeholder { color: #444; }
.deck-sub { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; margin-top: 10px; }
.deck-sub .input { background: transparent; }
.editor-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; max-width: 560px; }
.save-state { font-size: 12px; color: var(--muted); font-weight: 600; min-height: 18px; text-align: right; margin-top: 8px; }
.save-state.ok { color: var(--ok); }
.save-state.err { color: var(--accent); }

.editor-layout { display: grid; grid-template-columns: 1fr 340px; gap: 26px; align-items: start; }
.tabs { display: flex; gap: 6px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; width: fit-content; }
.tab { padding: 8px 14px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; font-weight: 800; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.tab.active { background: var(--text); color: #000; }
.tab.active[data-color="black"] { background: #000; color: #fff; box-shadow: inset 0 0 0 1px #555; }
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 16px 0; flex-wrap: wrap; }
.toolbar .input { max-width: 240px; }

.composer { display: flex; gap: 16px; align-items: stretch; margin-bottom: 22px; flex-wrap: wrap; }
.composer .card { width: 190px; cursor: text; }
.composer-side { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 10px; justify-content: flex-end; }
.hint { font-size: 12px; color: var(--muted); }
kbd { font-family: inherit; font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg-3); }

.panel { background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.panel + .panel { margin-top: 16px; }
.panel h3 { margin: 0 0 4px; font-size: 18px; font-weight: 900; letter-spacing: -0.02em; display: flex; align-items: center; gap: 8px; }
.panel .lead { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.panel .row { display: flex; gap: 8px; align-items: center; }
.panel .stack-y { display: grid; gap: 12px; }
.ai-badge { font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 6px; background: linear-gradient(90deg, #ff3b30, #ff9f0a); color: #000; letter-spacing: .04em; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input { flex: 1; accent-color: #fff; }
.range-row output { width: 26px; text-align: right; font-weight: 800; }
.suggestions { display: grid; gap: 10px; margin-top: 14px; max-height: 560px; overflow: auto; padding-right: 4px; }
.suggestion {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center;
  padding: 12px; border-radius: 12px; font-weight: 800; font-size: 14px; line-height: 1.25;
  animation: pop .25s ease both;
}
.suggestion.black { background: #000; border: 1px solid #3a3a3a; }
.suggestion.white { background: #fff; color: #000; }
.suggestion .acts { display: flex; gap: 4px; }
.suggestion button { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; font-weight: 900; background: rgba(128,128,128,.22); color: inherit; }
.suggestion button.yes:hover { background: var(--ok); color: #000; }
.suggestion button.no:hover { background: var(--accent); color: #fff; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Play ---------- */
.play-wrap { display: grid; gap: 28px; }
.play-table { display: grid; grid-template-columns: auto 1fr; gap: 40px; align-items: start; }
.play-table .card.black { --card-w: 290px; font-size: 24px; }
.play-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.play-hand .card { width: 100%; font-size: 15px; cursor: pointer; overflow: visible; transition: transform .15s ease, box-shadow .15s ease; }
.play-hand .card:hover { transform: translateY(-5px) rotate(-1deg); }
.play-hand .card.selected { transform: translateY(-10px); box-shadow: 0 0 0 4px var(--accent), 0 14px 30px rgba(0,0,0,.5); }
.play-hand .card .order { position: absolute; top: -10px; right: -10px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 13px; }
.deck-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.deck-picker label { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-weight: 700; font-size: 14px; }
.deck-picker input { accent-color: #fff; }
.deck-picker label:has(input:checked) { border-color: #fff; }

/* ---------- Modal & toasts ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; padding: 20px; animation: fade .15s ease; }
.modal { width: min(460px, 100%); background: var(--bg-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: grid; gap: 14px; }
.modal h3 { margin: 0; font-size: 20px; font-weight: 900; }
.modal p { margin: 0; color: #bbb; font-size: 14px; }
.modal .row { display: flex; gap: 8px; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; }
.toast { background: #fff; color: #000; font-weight: 700; padding: 10px 16px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.5); animation: pop .2s ease both; }
.toast.err { background: var(--accent); color: #fff; }

.footer { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 24px; border-top: 1px solid var(--line); font-size: 12px; }

/* ---------- Print ---------- */
.print-sheet { display: grid; grid-template-columns: repeat(auto-fill, 63mm); gap: 0; justify-content: center; }
.print-sheet .card { width: 63mm; border-radius: 0; box-shadow: none; font-size: 12.5pt; padding: 6mm 5mm 9mm; border: .2mm dashed #999; }
.print-sheet .card.black { border-color: #777; }
.print-sheet .card-foot { left: 5mm; right: 5mm; bottom: 4mm; font-size: 6.5pt; }

@media print {
  @page { size: A4; margin: 8mm; }
  body { background: #fff; }
  .topbar, .footer, .banner, .no-print, .toasts { display: none !important; }
  main { padding: 0; max-width: none; }
  .print-sheet .card { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .editor-layout { grid-template-columns: 1fr; }
  .editor-head { grid-template-columns: 1fr; }
  .editor-actions { justify-content: flex-start; max-width: none; }
  .save-state { text-align: left; }
  .hero { grid-template-columns: 1fr; }
  .hero-fan { height: 300px; --card-w: 170px; }
  .play-table { grid-template-columns: 1fr; justify-items: center; }
}
@media (max-width: 560px) {
  .topbar { padding: 12px 14px; }
  .brand-text { display: none; }
  .deck-sub { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-grid .card { font-size: 13px; padding: 12px 11px 28px; }
  .play-table .card.black { --card-w: 260px; font-size: 21px; }
  .play-hand { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Konta ---------- */
.userbox { display: flex; align-items: center; gap: 10px; }
.user-pill { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; font-weight: 700; font-size: 14px; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-2); }
.user-pill:hover { border-color: #555; }
.avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #000; font-weight: 900; font-size: 13px; }

.auth-wrap { display: grid; place-items: center; padding: 30px 0; }
.auth-card { display: grid; grid-template-columns: 240px 1fr; gap: 40px; align-items: center; background: var(--bg-2); border: 1px solid var(--line); border-radius: 24px; padding: 36px; width: min(780px, 100%); }
.auth-side { display: grid; place-items: center; }
.auth-side .card { transform: rotate(-6deg); --card-w: 210px; font-size: 19px; }
.auth-title { font-size: 34px; font-weight: 900; letter-spacing: -0.04em; margin: 18px 0 4px; }
.auth-form { display: grid; gap: 14px; }
.auth-form .btn { margin-top: 4px; }
.form-error { color: #ff6b62; font-size: 13px; font-weight: 700; min-height: 1px; }
.form-error:empty { display: none; }

.vis-toggle { display: flex; gap: 4px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.vis { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 800; font-size: 13px; padding: 7px 10px; border-radius: 8px; cursor: pointer; white-space: nowrap; }
.vis.active { background: var(--text); color: #000; }

.chip-pub { color: #7dd3a0; border-color: #24543a; }
.chip-priv { color: #c9c9c9; }
.chip-owner { color: #bdbdbd; font-weight: 700; }
h1.deck-name { line-height: 1.05; }

@media (max-width: 700px) {
  .auth-card { grid-template-columns: 1fr; padding: 24px; gap: 10px; }
  .auth-side { display: none; }
  .user-pill .uname { display: none; }
  .user-pill { padding: 3px; }
}

/* ---------- Języki ---------- */
.lang-select.compact { width: auto; padding: 6px 8px; font-size: 13px; font-weight: 700; background: transparent; border-color: transparent; color: var(--muted); cursor: pointer; }
.lang-select.compact:hover, .lang-select.compact:focus { border-color: var(--line); color: var(--text); }
.lang-select option, .select option { background: var(--bg-2); color: var(--text); }
.chip-lang { font-size: 10px; letter-spacing: .04em; color: var(--muted); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.deck-sub { grid-template-columns: 1fr auto auto; }
@media (max-width: 560px) { .nav { gap: 10px; } .deck-sub { grid-template-columns: 1fr; } }
.filters .input { width: 260px; }
@media (max-width: 560px) { .filters, .filters .input { width: 100%; } }

/* =========================================================
   Gra w pokojach
   ========================================================= */
.hub { max-width: 880px; margin: 0 auto; }
.hub-head { text-align: center; margin: 10px 0 28px; }
.hub-head h1 { font-size: clamp(36px, 6vw, 60px); font-weight: 900; letter-spacing: -0.045em; margin: 0 0 10px; }
.hub-head p { max-width: 56ch; margin: 0 auto; }
.hub-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.hub-card h3 { font-size: 22px; }
.code-input { font-size: 26px; font-weight: 900; letter-spacing: .3em; text-transform: uppercase; text-align: center; }

.room { display: grid; gap: 16px; }
.room-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.code-chip { display: inline-flex; gap: 8px; align-items: center; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; font-size: 14px; }
.code-chip b { letter-spacing: .18em; font-weight: 900; }
.code-chip:hover { border-color: #666; }
.phase-label { font-weight: 800; }
.countdown { font-variant-numeric: tabular-nums; font-weight: 900; padding: 4px 10px; border-radius: 8px; background: var(--bg-3); }
.countdown.urgent { background: var(--accent); color: #fff; animation: pulse 1s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }
.room-top-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.room-grid { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }
.room-side { display: grid; gap: 14px; position: sticky; top: 76px; }
.players-panel h3 { margin-bottom: 10px; }
.player-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.player { display: grid; grid-template-columns: 10px 1fr auto auto auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 9px; font-weight: 700; font-size: 14px; }
.player.me { background: var(--bg-3); }
.player .dot { width: 8px; height: 8px; border-radius: 50%; background: #444; }
.player .dot.on { background: var(--ok); }
.player .pname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.host-star { color: #ffd60a; }
.pstatus { color: var(--muted); font-size: 12px; }
.pscore { min-width: 26px; text-align: center; padding: 1px 7px; border-radius: 7px; background: #fff; color: #000; font-weight: 900; }
.pmenu { display: flex; gap: 2px; opacity: .35; }
.player:hover .pmenu { opacity: 1; }
.pmenu button { border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 4px; }
.pmenu button:hover { color: var(--text); }

.chat-panel { padding: 0; overflow: hidden; }
.chat-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 14px 18px; background: transparent; border: 0; cursor: pointer; font-weight: 900; font-size: 16px; text-align: left; }
.chat-head > span:first-child { flex: 1; }
.badge { background: var(--accent); color: #fff; font-size: 11px; border-radius: 999px; padding: 1px 7px; }
.chat-body { border-top: 1px solid var(--line); }
.chat-list { height: 240px; overflow-y: auto; padding: 10px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.chat-msg b { color: #ddd; }
.chat-msg.mine b { color: #9fd3ff; }
.chat-sys { color: var(--muted); font-size: 12px; font-style: italic; }
.chat-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }

.role-banner { padding: 12px 16px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-weight: 800; }
.role-banner.king { background: linear-gradient(90deg, #3a2a00, #1d1600); border-color: #6b5200; color: #ffd60a; }
.role-banner.rebel { background: linear-gradient(90deg, #3a0d08, #1a0806); border-color: #6b1d14; color: #ff8a7a; }
.role-banner.win { background: linear-gradient(90deg, #08331a, #06180d); border-color: #1f6b3d; color: #7ef0a8; }

.playing, .judging { display: grid; gap: 18px; }
.table-black { display: flex; justify-content: center; }
.table-black .card { --card-w: 260px; font-size: 21px; }
.waiting { text-align: center; padding: 10px; }
.big-ok { font-size: 26px; font-weight: 900; color: var(--ok); margin: 8px 0; }
.facedown-row { display: flex; justify-content: center; gap: 0; min-height: 110px; }
.facedown-row .card { --card-w: 80px; margin-left: -34px; transform: rotate(calc(var(--i, 0) * 1deg)); animation: drop .3s ease both; }
.facedown-row .card:first-child { margin-left: 0; }
.card.facedown { background: repeating-linear-gradient(45deg, #fff, #fff 8px, #ececec 8px, #ececec 16px); display: grid; place-items: center; padding: 0; }
.card.facedown span { font-size: 40px; font-weight: 900; color: #bbb; }
@keyframes drop { from { opacity: 0; transform: translateY(-20px); } }

.hand-wrap { display: grid; gap: 12px; }
.hand-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.hand .card { width: 100%; font-size: 14px; padding: 14px 13px 30px; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; overflow: visible; }
.hand .card:hover { transform: translateY(-4px); }
.hand .card.selected { transform: translateY(-8px); box-shadow: 0 0 0 4px var(--accent), 0 12px 26px rgba(0,0,0,.5); }
.hand .order { position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 900; }
.blank-card { border-style: dashed !important; }
.blank-card textarea { color: #000; font-weight: 800; }

.judge-top { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.judge-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.subs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.subs.multi { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.sub { position: relative; display: flex; gap: 8px; padding: 8px; border-radius: 16px; border: 2px solid transparent; transition: transform .12s, border-color .12s; animation: drop .3s ease both; }
.sub .card { flex: 1; width: auto; min-width: 0; font-size: 14px; padding: 14px 12px 30px; }
.sub.clickable { cursor: pointer; }
.sub.clickable:hover { transform: translateY(-3px); border-color: #555; }
.sub.chosen { border-color: #ffd60a; background: rgba(255, 214, 10, .08); }
.sub.winner { border-color: var(--ok); background: rgba(52, 199, 89, .1); }
.sub.mine:not(.winner) { opacity: .75; }
.sub-owner { position: absolute; left: 8px; right: 8px; bottom: -22px; text-align: center; font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subs { padding-bottom: 22px; row-gap: 34px; }

.react-bar { display: flex; flex-wrap: wrap; gap: 4px; }
.react-bar button { font-size: 20px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; transition: transform .1s; }
.react-bar button:hover { transform: scale(1.15); }
.float-react { position: fixed; bottom: 30px; z-index: 70; display: grid; justify-items: center; pointer-events: none; animation: floatUp 2.6s ease-out forwards; }
.float-react span { font-size: 42px; }
.float-react small { font-size: 11px; font-weight: 800; background: rgba(0,0,0,.6); padding: 1px 6px; border-radius: 6px; }
@keyframes floatUp { to { transform: translateY(-60vh) scale(1.3); opacity: 0; } }

.lobby { display: grid; gap: 16px; }
.invite { display: flex; justify-content: space-between; gap: 20px; align-items: center; }
.big-code { font-size: clamp(44px, 8vw, 72px); font-weight: 900; letter-spacing: .14em; line-height: 1; margin: 4px 0 10px; }
.qr { width: 150px; height: 150px; background: #fff; border-radius: 12px; padding: 8px; flex: none; }
.qr svg { width: 100%; height: 100%; }
.settings h4 { margin: 0; font-size: 15px; }
.mode-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 16px; }
.mode { text-align: left; display: grid; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; }
.mode span { color: var(--muted); font-size: 13px; }
.mode.active { border-color: #fff; background: var(--bg-3); }
.mode:disabled { cursor: default; }
.mode:disabled:not(.active) { opacity: .5; }
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.toggle-field { grid-column: span 2; }
.toggle { display: flex; gap: 10px; align-items: center; color: var(--text); font-weight: 600; padding: 10px 0; }
.toggle input { width: 18px; height: 18px; accent-color: #fff; }
.decks-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 10px; }
.deck-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.deck-chip { display: inline-flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 999px; background: var(--bg-3); border: 1px solid var(--line); font-weight: 700; font-size: 13px; }
.deck-chip small { color: var(--muted); }
.deck-chip button { border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.start-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; }
.start-btn { font-size: 18px; padding: 14px 28px; }
.ok-hint { color: var(--ok); font-weight: 700; }

.modal.picker { width: min(560px, 100%); max-height: 86vh; }
.picker-list { overflow-y: auto; max-height: 50vh; display: grid; gap: 6px; }
.picker-item { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; }
.picker-item.on { border-color: #fff; background: var(--bg-3); }
.picker-item input { accent-color: #fff; }
.picker-name { display: grid; font-weight: 700; }

.join-card { width: min(420px, 100%); display: grid; gap: 14px; }

.gameover { display: grid; gap: 30px; }
.podium { text-align: center; padding: 30px; border-radius: 22px; background: radial-gradient(circle at 50% 0%, #3a2a00, var(--bg-2) 70%); border: 1px solid #6b5200; }
.podium .crown { font-size: 64px; animation: pulse 1.6s infinite; }
.podium h2 { font-size: clamp(26px, 4vw, 40px); font-weight: 900; letter-spacing: -0.03em; margin: 6px 0 16px; }
.ranking { list-style: none; padding: 0; margin: 0 auto 20px; max-width: 320px; display: grid; gap: 6px; counter-reset: r; }
.ranking li { display: flex; justify-content: space-between; padding: 8px 14px; border-radius: 10px; background: var(--bg); font-weight: 700; counter-increment: r; }
.ranking li::before { content: counter(r) "."; color: var(--muted); margin-right: 10px; }
.ranking li span { flex: 1; text-align: left; }
.hall { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.hall-item { margin: 0; display: grid; gap: 8px; justify-items: center; }
.hall-item .card { width: 100%; font-size: 15px; aspect-ratio: auto; min-height: 170px; }
.hall-item figcaption { font-size: 12px; color: var(--muted); }

@media (max-width: 960px) {
  .room-grid { grid-template-columns: 1fr; }
  .room-side { position: static; grid-template-columns: 1fr 1fr; }
  .judge-top { grid-template-columns: 1fr; justify-items: center; }
  .judge-actions { align-items: center; }
}
@media (max-width: 700px) {
  .hub-grid, .mode-pick { grid-template-columns: 1fr; }
  .settings-grid { grid-template-columns: 1fr 1fr; }
  .room-side { grid-template-columns: 1fr; }
  .invite { flex-direction: column; text-align: center; }
  .table-black .card { --card-w: 230px; font-size: 18px; }
  .hand { grid-template-columns: repeat(2, 1fr); }
  .subs, .subs.multi { grid-template-columns: 1fr 1fr; }
  .subs.multi .sub { grid-column: span 2; }
  .phase-label { width: 100%; order: 5; }
}
@media (max-width: 700px) { .table-black .card { aspect-ratio: auto; min-height: 190px; } }

/* ---------- punktacja, mieszanie decków, własne karty ---------- */
.scoring { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.score-rule { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; }
.score-rule b { font-size: 15px; font-weight: 900; color: var(--ok); }
.score-rule.off { opacity: .4; text-decoration: line-through; }
.settings-grid .field small { font-weight: 600; }
.toggles { display: grid; gap: 2px; grid-column: span 3; }
.mixer { margin-top: 18px; }
.mixer-tools { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mixer-tools .input { flex: 1; min-width: 180px; }
.mixer-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; padding-right: 4px; }
.custom-card { border: 2px dashed #9a9a9a !important; background: #f6f6f6 !important; }
.custom-card .custom-label { font-weight: 900; }
.custom-card textarea { color: #000; font-weight: 800; }
.custom-card.selected { box-shadow: 0 0 0 4px var(--accent), 0 12px 26px rgba(0,0,0,.5); transform: translateY(-8px); }
.next-king { float: right; font-weight: 700; font-size: 13px; opacity: .75; }
@media (max-width: 700px) { .toggles { grid-column: span 2; } .next-king { float: none; display: block; } }

/* ---------- 18+, moderacja, jak grać, dostępność ---------- */
.chip-18 { background: #3b0a0a; border-color: #7a1a1a; color: #ff8a80; font-weight: 900; font-size: 11px; }
.mini-chip { padding: 1px 6px; margin-left: 6px; font-size: 10px; }
.nsfw-toggle { padding: 6px 0 0; font-size: 13px; color: var(--muted); }
.nsfw-toggle .chip-18 { display: inline-block; }
:focus-visible { outline: 3px solid #9fd3ff; outline-offset: 3px; }
.card[role="button"]:focus-visible, .sub[role="button"]:focus-visible { outline-offset: 4px; border-radius: 14px; }
.admin { display: grid; gap: 14px; }
.report-list { display: grid; gap: 12px; }
.report { display: grid; gap: 10px; }
.report-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.report-name { font-weight: 900; font-size: 18px; text-decoration: none; }
.report-items { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 4px; }
.how { max-width: 1000px; margin: 0 auto; }
.how-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.how-grid .panel p { margin: 0 0 10px; color: #cfcfcf; }
.how-step { display: grid; grid-template-columns: 34px 1fr; gap: 10px; margin-bottom: 12px; }
.how-step h4 { margin: 2px 0 2px; }
.how-step p { margin: 0; font-size: 14px; }
.how-n { width: 30px; height: 30px; border-radius: 50%; background: #fff; color: #000; font-weight: 900; display: grid; place-items: center; }
.how-cta { display: flex; gap: 12px; justify-content: center; margin-top: 26px; }
@media (max-width: 800px) { .how-grid { grid-template-columns: 1fr; } }
.pname.away { opacity: .55; }
.host-gone { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.danger-zone summary { cursor: pointer; color: #ff6b62; font-weight: 700; }
.danger-zone[open] summary { margin-bottom: 8px; }
.admin-tools { margin-bottom: 16px; }
.privacy ul { display: grid; gap: 8px; padding-left: 20px; color: #cfcfcf; }
.footer a { color: var(--muted); }

/* =========================================================
   MOTYW „KRÓLEWSKI” — własny styl kart, łagodny kontrast
   (nadpisuje wcześniejsze kolory; zmiana palety = tylko ten blok)
   ========================================================= */
:root {
  --bg: #121114;
  --bg-2: #1a191d;
  --bg-3: #242228;
  --line: #322f36;
  --text: #ece7df;
  --muted: #9a948c;
  --accent: #d9ad57;          /* złoto: zaznaczenia, wyróżnienia */
  --accent-ink: #2a2116;
  --danger: #e5655b;
  --ok: #6fcf97;
  --ivory: #f3ede2;
  --ivory-2: #e9e1d2;
  --ink: #24211d;
  --graphite: #1d1c21;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
}
body { background: radial-gradient(1200px 600px at 50% -200px, #1c1a20, var(--bg) 70%) fixed; }
.topbar { background: rgba(18, 17, 20, 0.86); }

/* ---------- karty ---------- */
.card {
  border-radius: 16px;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  font-optical-sizing: auto;
}
.card.black {
  background: radial-gradient(circle at 25% 0%, #2d2b33, var(--graphite) 62%);
  color: #f1ebe0;
  border: 1px solid #3d3944;
  box-shadow: inset 0 0 0 6px var(--graphite), inset 0 0 0 7px rgba(217, 173, 87, 0.35), 0 12px 30px rgba(0, 0, 0, 0.45);
}
.card.white {
  background: linear-gradient(170deg, #f8f3ea, var(--ivory-2));
  color: var(--ink);
  border: 1px solid #ddd3c2;
  box-shadow: inset 0 0 0 6px transparent, inset 0 0 0 7px rgba(36, 33, 29, 0.09), 0 12px 30px rgba(0, 0, 0, 0.4);
}
.card .blank { border-bottom-color: currentColor; }
.card.black .blank { border-bottom: 2px solid var(--accent); }
.card .filled { background: var(--ivory); color: var(--ink); border-radius: 5px; padding: 0 5px; }
.card-foot { font-family: var(--font); letter-spacing: 0.02em; opacity: 0.85; }
.card-foot .mini::before { content: "♛"; width: auto; height: auto; border: 0; box-shadow: none; transform: none; font-size: 11px; color: var(--accent); }
.card.white .card-foot .mini::before { color: #a07a2e; }
.pick b { background: var(--accent); color: var(--accent-ink); }
.card.facedown {
  background:
    radial-gradient(circle at 50% 50%, rgba(217,173,87,.25) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, #f6f0e5 0 9px, #ece3d3 9px 18px);
}
.card.facedown span { color: #b8902f; font-family: var(--serif); }

/* zaznaczenia w grze — złoto zamiast czerwieni */
.hand .card.selected, .custom-card.selected, .play-hand .card.selected { box-shadow: 0 0 0 3px var(--accent), 0 14px 30px rgba(0,0,0,.5); }
.hand .order, .play-hand .card .order { background: var(--accent); color: var(--accent-ink); }
.custom-card { border: 2px dashed #b9a57f !important; background: linear-gradient(170deg, #fbf8f2, #efe8db) !important; }
.sub.chosen { border-color: var(--accent); background: rgba(217, 173, 87, .08); }
.sub.winner { border-color: var(--ok); background: rgba(111, 207, 151, .08); }
.countdown.urgent { background: var(--danger); }

/* ---------- przyciski i drobiazgi ---------- */
.btn-white { background: var(--ivory); color: var(--ink); border-color: var(--ivory); }
.btn-white:hover { background: #fffaf1; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); }
.tab.active { background: var(--ivory); color: var(--ink); }
.tab.active[data-color="black"] { background: var(--graphite); color: var(--ivory); box-shadow: inset 0 0 0 1px rgba(217,173,87,.45); }
.pscore { background: var(--ivory); color: var(--ink); }
.avatar { background: var(--accent); color: var(--accent-ink); }
.vis.active, .mode.active { border-color: var(--accent); }
.vis.active { background: var(--ivory); color: var(--ink); }
.toast { background: var(--ivory); color: var(--ink); }
.toast.err { background: var(--danger); color: #fff; }
.how-n { background: var(--accent); color: var(--accent-ink); }
.score-rule b { color: var(--accent); }
:focus-visible { outline-color: var(--accent); }
.coffee { margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink) !important; font-weight: 800; text-decoration: none; }

/* ---------- logo ---------- */
.brand { gap: 10px; font-family: var(--serif); font-weight: 800; letter-spacing: 0; font-size: 20px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; }
.brand-mark svg { display: block; }

/* ---------- strona główna ---------- */
.hero-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.hero h1.hero-title { font-family: var(--serif); font-weight: 800; letter-spacing: -0.02em; font-size: clamp(44px, 7vw, 84px); line-height: 0.98; margin: 0 0 20px; }
.hero h1.hero-title em { font-style: italic; color: var(--accent); font-weight: 700; }
.hero-tag { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .12em; }

/* ---------- druk: oszczędzamy tusz ---------- */
@media print {
  .print-sheet .card.white { background: #fff; box-shadow: none; }
  .print-sheet .card.black { background: #151515; box-shadow: none; }
}
.print-sheet .card { box-shadow: none; }
.terms-sec h3 { font-family: var(--serif); font-size: 19px; margin: 18px 0 8px; }
.terms-sec:first-child h3 { margin-top: 0; }
.terms-sec ol { margin: 0; padding-left: 22px; display: grid; gap: 6px; color: #d6d0c6; font-size: 14px; line-height: 1.55; }

/* pasek postępu (tłumaczenie decka) */
.progress { height: 8px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; margin: 6px 0 14px; }
.progress > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #b8893a, #d9ad57); transition: width .3s ease; }
.ai-source { margin: -4px 0 10px; }
#own-ai h3 { display: flex; align-items: center; gap: 8px; }
