/* ═════════ Fake czy Fakt? – motyw „szkło” ═════════ */
:root {
  --bg: #0a0d1a;
  --text: #f4f6ff;
  --muted: rgba(235, 238, 255, .62);
  --faint: rgba(235, 238, 255, .38);

  --glass: rgba(255, 255, 255, .075);
  --glass-strong: rgba(255, 255, 255, .12);
  --glass-hover: rgba(255, 255, 255, .16);
  --edge: rgba(255, 255, 255, .16);
  --edge-strong: rgba(255, 255, 255, .28);
  --hi: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .04);
  --shadow: 0 18px 50px rgba(0, 0, 0, .38);
  --blur: blur(26px) saturate(170%);

  --fake: #ff5a6e;
  --fake-dim: rgba(255, 90, 110, .16);
  --real: #2fe0a0;
  --real-dim: rgba(47, 224, 160, .16);
  --accent: #ffd34d;
  --accent-dim: rgba(255, 211, 77, .14);

  --r-lg: 28px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* kolorowe, rozmyte plamy pod szkłem */
body::before, body::after {
  content: ""; position: fixed; z-index: -1; pointer-events: none; border-radius: 50%; filter: blur(80px);
}
body::before {
  width: 70vmax; height: 70vmax; left: -20vmax; top: -25vmax;
  background: radial-gradient(circle at 40% 40%, rgba(255, 90, 110, .55), rgba(170, 70, 255, .25) 55%, transparent 70%);
  animation: drift1 28s ease-in-out infinite alternate;
}
body::after {
  width: 75vmax; height: 75vmax; right: -25vmax; bottom: -30vmax;
  background: radial-gradient(circle at 60% 60%, rgba(47, 224, 160, .45), rgba(40, 120, 255, .3) 55%, transparent 70%);
  animation: drift2 32s ease-in-out infinite alternate;
}
@keyframes drift1 { to { transform: translate(10vmax, 8vmax) scale(1.1); } }
@keyframes drift2 { to { transform: translate(-8vmax, -10vmax) scale(1.05); } }

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
a { color: inherit; }

.app { max-width: 780px; margin: 0 auto; padding: 24px 16px 56px; }
.screen { animation: in .3s cubic-bezier(.2, .8, .2, 1); }
@keyframes in { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.still .screen, .still .stamp { animation: none; }

/* ── szkło: wspólna baza ── */
.panel, .mode-card, .online-box, .room-code-box, .turn-card, .inventory, .explain, .sent, .tip,
.result, .rank, .chip, .seg-btn, .input, .pu-details, .offer, .toast {
  background: var(--glass);
  border: 1px solid var(--edge);
  box-shadow: var(--hi);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

/* ── logo: FAK + ułamek E / czy / T ── */
.logo {
  font-family: "Bricolage Grotesque", Inter, sans-serif;
  font-weight: 800;
  font-size: clamp(64px, 17vw, 120px);
  line-height: 1;
  letter-spacing: -0.035em;
  display: inline-flex; align-items: center;
  margin: 28px 0 22px;
  user-select: none;
}
.logo-fak {
  background: linear-gradient(180deg, #fff 30%, rgba(255, 255, 255, .7));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 24px rgba(0, 0, 0, .35));
}
.logo-frac {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: .5em; line-height: .92; margin-left: .06em; letter-spacing: 0;
}
.frac-top { color: var(--fake); text-shadow: 0 0 24px rgba(255, 90, 110, .45); }
.frac-bot { color: var(--real); text-shadow: 0 0 24px rgba(47, 224, 160, .45); }
.frac-bar {
  display: flex; align-items: center; gap: .4em; width: 100%; min-width: 6.4em;
  font-family: Inter, sans-serif; font-size: .3em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: .25em 0 .3em;
}
.frac-bar::before, .frac-bar::after { content: ""; flex: 1; min-width: 1em; height: .28em; max-height: 4px; min-height: 2px; border-radius: 4px; background: rgba(255, 255, 255, .85); }
.logo-small { font-size: 38px; margin: 0 0 16px; cursor: pointer; }
.logo-small .frac-bar { font-size: 0; gap: 0; min-width: 24px; margin: 3px 0 4px; }
.logo-small .frac-bar::before, .logo-small .frac-bar::after { min-width: 0; height: 3px; }
.game-top .logo-small { margin: 0; }

.lead { font-size: 18px; color: rgba(240, 242, 255, .85); margin: 0 0 26px; max-width: 600px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center-text { text-align: center; margin-top: 10px; }
.t-fake { color: var(--fake); }
.t-real { color: var(--real); }
.h1 { font-family: "Bricolage Grotesque", Inter, sans-serif; font-size: 34px; margin: 0 0 20px; letter-spacing: -0.02em; line-height: 1.15; }
.h2 { font-size: 18px; margin: 0 0 6px; }

/* ── strona główna ── */
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-card {
  text-align: left; display: flex; flex-direction: column; gap: 8px;
  border-radius: var(--r-lg); padding: 24px; box-shadow: var(--hi), var(--shadow);
  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background .2s, border-color .2s;
}
.mode-card:hover { transform: translateY(-4px); background: var(--glass-hover); border-color: var(--edge-strong); }
.mode-icon {
  width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; font-size: 26px;
  background: var(--glass-strong); border: 1px solid var(--edge); box-shadow: var(--hi);
}
.mode-title { font-family: "Bricolage Grotesque", Inter, sans-serif; font-weight: 800; font-size: 28px; letter-spacing: -0.02em; }
.mode-desc { color: var(--muted); font-size: 15px; }
.howto { margin: 28px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; color: var(--muted); font-size: 15px; }
.howto b { color: var(--text); }

/* ── panele i formularze ── */
.panel { border-radius: 32px; padding: 26px; box-shadow: var(--hi), var(--shadow); }
.center { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.field { margin-bottom: 22px; }
.field-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 9px; display: block; }
.input {
  width: 100%; border-radius: 14px; color: var(--text); font: inherit; padding: 12px 15px;
  background: rgba(0, 0, 0, .18); transition: border-color .15s, background .15s;
}
.input::placeholder { color: var(--faint); }
.input:focus { border-color: var(--accent); outline: none; background: rgba(0, 0, 0, .25); }
.input-code { font-family: "Bricolage Grotesque", monospace; font-size: 28px; letter-spacing: .3em; text-align: center; text-transform: uppercase; margin-bottom: 10px; }

.names { display: grid; gap: 8px; margin-bottom: 10px; }
.name-row { display: flex; gap: 8px; align-items: center; }
.name-num { width: 26px; color: var(--faint); font-weight: 700; text-align: right; flex: none; }
.icon-btn { flex: none; width: 46px; height: 48px; border-radius: 14px; background: transparent; border: 1px solid var(--edge); color: var(--muted); transition: color .15s, border-color .15s; }
.icon-btn:hover { color: var(--fake); border-color: var(--fake); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg-2 { grid-template-columns: 1fr 1fr; }
.seg-btn {
  border-radius: 16px; padding: 11px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: background .15s, border-color .15s;
}
.seg-btn:not(:disabled):hover { background: var(--glass-hover); }
.seg-btn.on { border-color: rgba(255, 211, 77, .7); background: var(--accent-dim); box-shadow: var(--hi), 0 0 0 1px rgba(255, 211, 77, .5), 0 6px 20px rgba(255, 211, 77, .12); }
.seg-btn:disabled:not(.on) { opacity: .4; }
.seg-main { font-weight: 700; }
.seg-sub { font-size: 13px; color: var(--muted); text-align: center; }
.hint { margin: 8px 0 0; }

/* ── przyciski: pigułki ze szkła ── */
.btn {
  border: 1px solid transparent; border-radius: 999px; padding: 12px 22px; font-weight: 700;
  transition: transform .12s, filter .15s, background .15s, box-shadow .15s;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 6px 18px rgba(0, 0, 0, .25);
}
.btn:active { transform: scale(.97); }
.btn-primary { background: linear-gradient(180deg, #ffe07a, #ffc928); color: #241a00; }
.btn-ghost {
  background: var(--glass); border-color: var(--edge); color: var(--text);
  box-shadow: var(--hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.btn-ghost:hover { background: var(--glass-hover); border-color: var(--edge-strong); }
.btn-fake { background: linear-gradient(180deg, #ff7a8a, #f2445b); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .2); }
.btn-real { background: linear-gradient(180deg, #5af0bb, #1fc887); color: #00331f; }
.btn-primary:hover, .btn-fake:hover, .btn-real:hover { filter: brightness(1.07); }
.btn-small { padding: 8px 15px; font-size: 14px; }
.btn-big { padding: 20px 16px; font-size: 18px; border-radius: 22px; }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }

.actions { display: flex; gap: 10px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 24px; }
.actions .btn-ghost:first-child { margin-right: auto; }
.waiting { color: var(--muted); font-style: italic; }
.row-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ── online ── */
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.online-box { border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 10px; background: rgba(255, 255, 255, .05); }
.online-box p { margin: 0 0 auto; font-size: 14px; }
.room-code-box { text-align: center; border-radius: 24px; padding: 20px; margin-bottom: 22px; }
.room-code { font-family: "Bricolage Grotesque", monospace; font-weight: 800; font-size: 58px; letter-spacing: .18em; color: var(--accent); line-height: 1.1; margin-bottom: 12px; text-shadow: 0 0 30px rgba(255, 211, 77, .35); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border-radius: 999px; padding: 6px 14px; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.chip.me { border-color: rgba(255, 211, 77, .7); background: var(--accent-dim); }
.tag { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }

.spinner { width: 44px; height: 44px; border: 4px solid var(--edge); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; margin: 20px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── gra ── */
.game-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.progress-label { color: var(--muted); font-size: 15px; padding: 6px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--edge); }
.progress-label b { color: var(--text); }
.timer { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.timer-bar { flex: 1; height: 12px; border-radius: 99px; overflow: hidden; background: var(--glass); border: 1px solid var(--edge); }
.timer-fill { height: 100%; background: linear-gradient(90deg, #1fc887, #5af0bb); transform-origin: left; transition: transform .1s linear; border-radius: 99px; box-shadow: 0 0 14px rgba(47, 224, 160, .5); }
.timer-fill.low { background: linear-gradient(90deg, #f2445b, #ff7a8a); box-shadow: 0 0 14px rgba(255, 90, 110, .6); }
.timer-num { font-variant-numeric: tabular-nums; font-weight: 700; min-width: 44px; text-align: right; }
.turn-banner { margin-bottom: 12px; font-size: 18px; }

/* post: matowe, jasne szkło */
.post {
  position: relative; color: #151827; border-radius: var(--r-lg); padding: 20px 22px; margin-bottom: 18px; overflow: hidden;
  background: rgba(250, 251, 255, .9);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: inset 0 1px 0 #fff, var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: box-shadow .3s;
}
.post-real { box-shadow: inset 0 1px 0 #fff, 0 0 0 3px var(--real), 0 0 40px rgba(47, 224, 160, .35), var(--shadow); }
.post-fake { box-shadow: inset 0 1px 0 #fff, 0 0 0 3px var(--fake), 0 0 40px rgba(255, 90, 110, .35), var(--shadow); }
.post-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 20px; flex: none; }
.avatar-anon { background: linear-gradient(135deg, #e8ebf6, #cfd5ea); font-size: 22px; }
.post-author { font-weight: 700; }
.post-handle { color: #6b7190; font-size: 14px; word-break: break-all; }
.post-text, .post-fig { transition: filter .4s; }
.post.fog > .post-text, .post.fog > .post-fig, .post.fog > .post-img-empty { filter: blur(9px); }
.post-text { font-size: clamp(19px, 3.8vw, 24px); font-weight: 700; line-height: 1.35; margin: 0 0 14px; letter-spacing: -0.01em; }
.post-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: 18px; margin: 0 0 14px; background: #e3e6f0; }
.post-fig { margin: 0 0 14px; }
.post-fig .post-img { margin: 0; }
.img-credit { font-size: 11px; color: #7a809c; margin-top: 5px; line-height: 1.3; }
.post-img-empty { height: 160px; display: grid; place-items: center; border: 2px dashed #cdd2e4; background: linear-gradient(135deg, #f0f2fa, #e6e9f5); font-size: 32px; opacity: .85; }
.post-source { background: #edf0f8; border-radius: 14px; padding: 10px 12px; font-size: 14px; color: #3b4060; display: flex; gap: 8px; }
.source-btn { width: 100%; border: 1.5px dashed #b6bdd6; background: rgba(255, 255, 255, .7); font-weight: 700; color: #2b3150; justify-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
.source-btn:not(:disabled):hover { border-color: #6b7190; background: #fff; }
.source-btn:disabled { opacity: .6; cursor: default; }
.source-btn .cost { font-weight: 500; color: #8a6d00; }
.stamp {
  position: absolute; top: 18px; right: -6px; transform: rotate(8deg); z-index: 1;
  font-family: "Bricolage Grotesque", Inter, sans-serif; font-weight: 800; font-size: 26px; text-transform: uppercase;
  padding: 2px 16px; border: 4px solid; border-radius: 12px; background: rgba(250, 251, 255, .92);
  animation: stamp .35s cubic-bezier(.2, 1.6, .4, 1);
}
.stamp-real { color: #0a9e6a; border-color: #0a9e6a; }
.stamp-fake { color: #e23446; border-color: #e23446; }
@keyframes stamp { from { transform: rotate(8deg) scale(2); opacity: 0; } to { transform: rotate(8deg) scale(1); opacity: 1; } }

.big-answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sent { border-radius: 22px; padding: 18px; text-align: center; }

.explain { border-radius: 20px; padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--hi), inset 4px 0 0 var(--accent); }
.src-link { display: inline-block; margin-top: 8px; font-size: 14px; color: var(--accent); text-decoration: none; font-weight: 600; }
.src-link:hover { text-decoration: underline; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.result { display: grid; grid-template-columns: 26px 1fr auto 52px 56px; gap: 10px; align-items: center; border-radius: 16px; padding: 10px 14px; }
.result.me { border-color: rgba(255, 211, 77, .6); }
.result.ok .res-icon { color: var(--real); }
.result.bad .res-icon { color: var(--fake); }
.res-icon { font-weight: 800; }
.res-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-notes { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.res-choice { color: var(--muted); font-size: 14px; }
.res-points { text-align: right; font-weight: 700; color: var(--real); font-variant-numeric: tabular-nums; }
.result.bad .res-points { color: var(--muted); }
.res-total { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── tury (spotkanie) ── */
.turn-card { text-align: center; border-radius: 32px; padding: 30px 20px; margin-bottom: 16px; box-shadow: var(--hi), var(--shadow); }
.turn-name { font-family: "Bricolage Grotesque", Inter, sans-serif; font-weight: 800; font-size: clamp(42px, 11vw, 68px); line-height: 1.1; margin: 4px 0 8px; overflow-wrap: anywhere; letter-spacing: -0.02em; }
.turn-card .btn-big { margin-top: 8px; min-width: 240px; border-radius: 999px; }
.score-chips { margin-top: 14px; }
.score-chips b { font-variant-numeric: tabular-nums; }
.warn { background: var(--fake-dim); color: #ffc6cd; border: 1px solid rgba(255, 90, 110, .35); border-radius: 14px; padding: 8px 12px; margin: 4px auto 10px; max-width: 460px; font-weight: 600; }

/* ── podsumowanie ── */
.ranking { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.rank { display: grid; grid-template-columns: 40px 1fr auto 70px; gap: 12px; align-items: center; border-radius: 18px; padding: 12px 16px; }
.rank.first { background: linear-gradient(90deg, rgba(255, 211, 77, .2), var(--glass)); border-color: rgba(255, 211, 77, .55); }
.rank.me { box-shadow: var(--hi), 0 0 0 1px rgba(255, 211, 77, .5); }
.rank-pos { font-size: 22px; text-align: center; font-weight: 800; }
.rank-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-inv { font-size: 14px; margin-left: 4px; }
.rank-good { color: var(--muted); font-size: 14px; }
.rank-score { text-align: right; font-weight: 800; font-size: 20px; font-variant-numeric: tabular-nums; }
.stat-line { color: var(--muted); margin-bottom: 12px; }
.stat-line b { color: var(--text); }
.tip { border-radius: 18px; padding: 14px 16px; font-size: 15px; color: rgba(240, 242, 255, .85); }

/* ── power-upy ── */
.pu-details { margin-top: 10px; border-radius: 18px; padding: 12px 16px; }
.pu-details summary { cursor: pointer; font-weight: 700; }
.pu-details p { margin: 10px 0; }
.pu-h { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 14px 0 8px; }
.pu-infos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pu-info { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; background: rgba(255, 255, 255, .05); border: 1px solid var(--edge); border-radius: 14px; padding: 9px 11px; }
.pu-info.pu-pomoc { box-shadow: inset 3px 0 0 var(--real); }
.pu-info.pu-atak { box-shadow: inset 3px 0 0 var(--fake); }
.pu-info .pu-icon { font-size: 22px; line-height: 1.2; }

.inventory { margin-top: 16px; border-radius: 24px; padding: 14px; }
.inv-title { font-weight: 700; margin-bottom: 10px; }
.inv-empty { margin: 0; }
.pu-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; }
.pu {
  flex: none; width: 130px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--edge); border-radius: 18px; padding: 12px 8px;
  box-shadow: var(--hi), inset 0 -3px 0 var(--real);
  transition: transform .15s cubic-bezier(.2, .8, .2, 1), background .15s;
}
.pu.pu-atak { box-shadow: var(--hi), inset 0 -3px 0 var(--fake); }
.pu:not(:disabled):hover { transform: translateY(-3px); background: var(--glass-hover); }
.pu:disabled { opacity: .38; cursor: not-allowed; }
.pu .pu-icon { font-size: 28px; line-height: 1.2; }
.pu-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.pu-desc { font-size: 12px; color: var(--muted); line-height: 1.3; }
.pu-type { margin-top: 4px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--real); }
.pu-atak .pu-type { color: var(--fake); }
.targets { display: flex; flex-wrap: wrap; gap: 8px; }
.target-btn { display: flex; align-items: center; gap: 8px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tag-pill { font-size: 13px; font-weight: 700; padding: 4px 11px; border-radius: 999px; border: 1px solid transparent; }
.tag-pill.good { background: var(--real-dim); color: var(--real); border-color: rgba(47, 224, 160, .3); }
.tag-pill.bad { background: var(--fake-dim); color: var(--fake); border-color: rgba(255, 90, 110, .3); }
.chip-pu { font-size: 13px; color: var(--muted); }

.offer { border-radius: 24px; padding: 16px; margin-bottom: 16px; background: linear-gradient(135deg, rgba(255, 211, 77, .16), var(--glass)); border-color: rgba(255, 211, 77, .45); }
.offer-title { font-size: 17px; margin-bottom: 12px; }
.offer-title:last-child { margin-bottom: 0; }
.offer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pu-big { width: auto; padding: 16px 10px; }
.pu-big .pu-icon { font-size: 36px; }
.pu-big .pu-name { font-size: 16px; }
.pu-big .pu-desc { font-size: 13px; }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: rgba(20, 24, 40, .7); color: #fff; padding: 12px 20px; border-radius: 999px;
  transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); z-index: 10; box-shadow: var(--hi), var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── telefon ── */
@media (max-width: 600px) {
  .panel { padding: 20px 16px; border-radius: 26px; }
  .mode-grid, .online-grid, .pu-infos { grid-template-columns: 1fr; }
  .room-code { font-size: 44px; }
  .result { grid-template-columns: 22px 1fr 44px 50px; }
  .res-choice { display: none; }
  .rank { grid-template-columns: 32px 1fr 60px; }
  .rank-good { display: none; }
  .seg-sub { font-size: 12px; }
  .logo-small { font-size: 32px; }
  .progress-label { font-size: 13px; padding: 5px 11px; }
  .post { padding: 18px 16px; }
  .pu-big { flex-direction: row; flex-wrap: wrap; text-align: left; gap: 4px 10px; }
  .pu-big .pu-desc { flex-basis: 100%; }
}

/* ═════════ Układ „na cały ekran”: strona się nie przewija ═════════ */
html, body { height: 100%; overflow: hidden; }
body { min-height: 0; overscroll-behavior: none; }
.app {
  height: 100vh; height: 100dvh;
  padding: max(14px, env(safe-area-inset-top)) 16px max(14px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
}
.screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.screen > * { flex: none; }
/* panel ma naturalną wysokość, ale nie większą niż ekran; jest wyśrodkowany w pionie */
.screen.panel { flex: 0 1 auto; margin: auto 0; max-height: 100%; overflow: hidden; }
.screen.home { justify-content: center; }
.logo { flex: none; }

/* tylko ta część przewija się, gdy treści jest za dużo */
.scroll {
  flex: 0 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  margin: 0 -8px; padding: 2px 8px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent;
}
.scroll > :last-child { margin-bottom: 0; }
.actions { margin-top: 16px; }

/* gra: post zajmuje resztę miejsca, a zdjęcie kurczy się jako pierwsze */
.screen.game { overflow: hidden; }
/* post oddaje miejsce, kurcząc tylko zdjęcie (nagłówek, tekst i lupa mają stałą wysokość) */
.screen.game > .post { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin-bottom: 14px; }
.post > * { flex: none; }
.post > .post-fig, .post > .post-img-empty { flex: 0 1 34vh; }
.post-fig, .post-img-empty {
  flex: 0 1 34vh; min-height: 0; margin: 0 0 12px; overflow: hidden;
  display: flex; flex-direction: column; container-type: size;
}
.post-fig .post-img { flex: 1 1 auto; min-height: 0; height: 100%; max-height: none; margin: 0; }
.post-fig .img-credit { flex: none; }
.post-img-empty { height: auto; }
@container (max-height: 56px) { .post-img, .img-credit, .post-img-empty > span { display: none; } }
/* wyjaśnienie po odpowiedzi: maks. ~40% ekranu, dalej przewija się wewnątrz */
.screen.game > .reveal-area { flex: 0 0 auto; max-height: 40vh; max-height: 40dvh; }
.screen.game > .score-chips { flex: 0 1 auto; min-height: 0; overflow-y: auto; align-content: flex-start; }
.screen.game > .turn-card { flex: 0 1 auto; min-height: 0; overflow: hidden; }
.screen.game > .actions { margin-top: 12px; }

/* niskie ekrany (telefon, mały laptop) */
@media (max-height: 820px) {
  .app { padding-top: max(10px, env(safe-area-inset-top)); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
  .logo { font-size: clamp(54px, 14vw, 96px); margin: 8px 0 14px; }
  .logo-small { font-size: 30px; margin-bottom: 10px; }
  .h1 { font-size: 26px; margin-bottom: 12px; }
  .lead { font-size: 16px; margin-bottom: 16px; }
  .field { margin-bottom: 14px; }
  .panel { padding: 18px; }
  .mode-card { padding: 16px 18px; gap: 4px; }
  .mode-title { font-size: 23px; }
  .howto { margin-top: 16px; font-size: 14px; }
  .game-top { margin-bottom: 8px; }
  .turn-banner { margin-bottom: 6px; font-size: 16px; }
  .tag-row { margin-bottom: 8px; }
  .timer { margin-bottom: 10px; }
  .post { padding: 14px 16px; border-radius: 22px; }
  .post-head { margin-bottom: 8px; }
  .avatar { width: 36px; height: 36px; font-size: 17px; }
  .post-text { font-size: clamp(17px, 2.6vh, 21px); margin-bottom: 10px; }
  .post-source { padding: 8px 10px; font-size: 13px; }
  .btn-big { padding: 14px 12px; font-size: 16px; border-radius: 18px; }
  .inventory { margin-top: 10px; padding: 10px; border-radius: 18px; }
  .inv-title { margin-bottom: 6px; font-size: 14px; }
  .pu { width: 108px; padding: 8px 6px; border-radius: 14px; }
  .pu .pu-icon { font-size: 22px; }
  .pu-row .pu-desc { display: none; }
  .turn-card { padding: 18px 16px; margin-bottom: 10px; }
  .turn-name { font-size: clamp(36px, 9vw, 54px); }
  .explain { padding: 10px 14px; margin-bottom: 8px; font-size: 15px; }
  .result { padding: 8px 12px; }
  .rank { padding: 9px 14px; }
  .room-code-box { padding: 14px; margin-bottom: 14px; }
  .room-code { font-size: 44px; margin-bottom: 8px; }
  .actions { margin-top: 12px; }
}
@media (max-height: 620px) {
  .howto { display: none; }
  .lead { font-size: 15px; }
  .score-chips { display: none; }
}

/* telefon: przyciski odpowiedzi obok siebie, żeby oszczędzić wysokość */
@media (max-width: 600px) {
  .mode-grid { gap: 10px; }
  .mode-card { display: grid; grid-template-columns: 44px 1fr; column-gap: 14px; row-gap: 2px; align-items: center; padding: 14px 16px; }
  .mode-icon { grid-row: span 2; width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }
  .mode-title { font-size: 21px; line-height: 1.2; }
  .mode-desc { font-size: 13.5px; line-height: 1.35; }
  .big-answers { gap: 8px; }
  .big-answers .btn-big { font-size: 15px; padding: 14px 8px; }
  .offer-grid { grid-template-columns: 1fr; gap: 6px; }
  .pu-big { padding: 10px 12px; }
  .pu-big .pu-icon { font-size: 26px; }
}

/* przeglądarki bez backdrop-filter: mocniejsze tło zamiast rozmycia */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(30, 36, 60, .9); --glass-strong: rgba(40, 46, 72, .95); --glass-hover: rgba(48, 56, 86, .95); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
