/* Czytelny front kart: komplet zasad jest widoczny bez otwierania szczegółów. */
.hand {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  align-items: start;
  gap: .58rem;
}

.card {
  --card-accent: #58666e;
  --card-tint: #e0e5e5;
  min-height: 266px;
  height: auto;
  aspect-ratio: 5 / 7;
  padding: .5rem;
  justify-content: flex-start;
  gap: .3rem;
  color: #17242c;
  background: linear-gradient(150deg, #fffdf7, #efe4cf);
  border-color: #ffffffa8;
  text-shadow: none;
}

.card.red { --card-accent: #ad3038; --card-tint: #f4c8c8; }
.card.green { --card-accent: #187052; --card-tint: #c7eadb; }
.card.blue { --card-accent: #2b5f9b; --card-tint: #cadaee; }
.card.dual { --card-accent: #934337; --card-tint: #d9e5cf; }
.card.red, .card.green, .card.blue, .card.dual { background: linear-gradient(150deg, #fffdf7, #efe4cf); }

.card::before {
  opacity: 1;
  background: linear-gradient(135deg, var(--card-tint), transparent 32%, #3321080a);
}

.card::after { inset: 5px; border-color: #745e3333; }
.card-top, .card-heading, .card-meta-grid, .card-effect, .card-reminder, .card-play-hint { position: relative; z-index: 1; }

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem;
  min-height: 22px;
}

.faction-name {
  display: flex;
  align-items: center;
  gap: .35rem;
  color: #283740;
  font: 800 10px Arial, sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.card .faction-icon { width: 21px; height: 21px; flex-basis: 21px; font-size: 11px; }
.card-flags { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .22rem; }

.card-flags i {
  padding: .12rem .25rem;
  border: 1px solid color-mix(in srgb, var(--card-accent) 40%, #fff);
  border-radius: 99px;
  color: var(--card-accent);
  background: #fff9;
  font: 800 8px Arial, sans-serif;
  font-style: normal;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.card-flags .instant-flag { color: #563d87; border-color: #8c78b9; background: #eee7ff; }

.card-heading {
  min-height: 45px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px;
  align-items: center;
  gap: .35rem;
  padding: .3rem .4rem;
  border-radius: 7px;
  color: #fff;
  background: linear-gradient(115deg, color-mix(in srgb, var(--card-accent) 88%, #111), var(--card-accent));
  overflow: hidden;
  box-shadow: inset 0 1px #fff4, 0 3px 7px #24170d24;
}

.card-heading .title { font-size: 1.04rem; line-height: 1.08; text-shadow: 0 2px 2px #0005; }
.card-title-group { min-width: 0; display: grid; gap: .14rem; }
.card-title-group small { color: #fffbd9; font: 800 7px Arial, sans-serif; letter-spacing: .08em; }
.card-heading .art { width: 60px; height: 38px; margin: -.25rem; opacity: .7; filter: drop-shadow(0 3px 3px #0003); }
.card.dual .card-heading { background: linear-gradient(115deg, #a7353c 0 47%, #1d7657 53% 100%); }

.card-meta-grid {
  display: grid;
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  gap: .25rem;
}

.card-meta {
  min-width: 0;
  padding: .22rem .28rem;
  border: 1px solid #cdbb97;
  border-radius: 6px;
  color: #36434a;
  background: #fffaf0;
  display: grid;
  align-content: start;
  gap: .08rem;
}

.card-meta b { color: #5d543f; font: 900 7px Arial, sans-serif; letter-spacing: .08em; }
.card-meta b i { color: var(--card-accent); font-size: 10px; font-style: normal; }
.card-meta em { overflow-wrap: anywhere; color: #26343b; font: 900 8px/1.12 Arial, sans-serif; font-style: normal; }
.duration-meta { border-color: color-mix(in srgb, var(--card-accent) 35%, #cdbb97); background: color-mix(in srgb, var(--card-tint) 35%, #fffaf0); }

.card-reminder {
  display: grid;
  grid-template-columns: 17px minmax(0, 1fr);
  align-items: start;
  gap: .22rem;
  padding: .22rem .27rem;
  border: 1px dashed #af8c45;
  border-radius: 6px;
  color: #493c24;
  background: #fff5cf;
  font: 800 8px/1.2 Arial, sans-serif;
}
.card-reminder b { width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #8a6420; font-size: 10px; }

.card.token-card {
  border: 2px solid #efc54a;
  box-shadow: 0 0 0 2px #cfa12a, 0 8px 18px #0a111448;
}
.card.token-card.red { --card-accent: #ad3038; --card-tint: #f4c8c8; }
.card.token-card.green { --card-accent: #187052; --card-tint: #c7eadb; }
.card.token-card.blue { --card-accent: #2b5f9b; --card-tint: #cadaee; }
.card.token-card.dual { --card-accent: #934337; --card-tint: #d9e5cf; }
.card.token-card::after { border-color: #d5a82f; }
.card-flags .token-flag { color: #4d3508; border-color: #bd8d2d; background: #ffe59b; }

.card-rules::before {
  content: 'WARUNEK';
  align-self: center;
  color: #775927;
  font: 900 7px Arial, sans-serif;
  letter-spacing: .08em;
}

.card-effect { display: grid; gap: .22rem; flex: 1; }

.effect-row {
  display: grid;
  grid-template-columns: 51px minmax(0, 1fr);
  align-items: center;
  gap: .3rem;
  padding: .28rem;
  border: 1px solid #d4c4a6;
  border-left: 4px solid var(--card-accent);
  border-radius: 7px;
  background: #fffdf8;
  box-shadow: 0 2px 4px #33230f0c;
}

.effect-mark {
  min-height: 31px;
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  justify-items: center;
  padding: .18rem;
  border-radius: 5px;
  color: #fff;
  background: #4e5c64;
  font: 800 9px Arial, sans-serif;
}

.effect-mark i { font: 900 15px Arial, sans-serif; font-style: normal; }
.effect-mark b { font-size: 9px; line-height: 1; text-align: center; }
.effect-row.gain .effect-mark, .effect-row.restore .effect-mark { background: #1c7657; }
.effect-row.loss .effect-mark { background: #b5363d; }
.effect-row.limit .effect-mark, .effect-row.discard .effect-mark { background: #7a4e35; }
.effect-row.token .effect-mark { color: #312105; background: #dfb64c; }
.effect-row.block .effect-mark { background: #425f87; }
.effect-row.multiplier .effect-mark { background: #774c8f; }
.effect-row.pact .effect-mark { background: #456f72; }
.effect-row.copy .effect-mark, .effect-row.action .effect-mark { background: #536b88; }
.effect-copy { color: #27343a; font: 700 10.5px/1.28 Arial, sans-serif; }

.effect-combo { display: grid; gap: .16rem; }
.effect-combo .effect-row { grid-template-columns: 48px minmax(0, 1fr); padding: .22rem; }
.effect-combo .effect-mark { min-height: 28px; }
.combo-plus {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  justify-self: center;
  border: 2px solid #fff7d4;
  border-radius: 50%;
  color: #fff;
  background: #7b6130;
  box-shadow: 0 1px 4px #3b2a1238;
  font: 900 17px/1 Arial, sans-serif;
}

.card-variants { display: grid; gap: .08rem; }
.card-variant { display: grid; grid-template-columns: 47px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: .1rem .25rem; padding: .22rem; border: 1px solid #bda97e; border-radius: 6px; background: #fff9; }
.card-variant.is-unavailable {
  opacity: .38;
  filter: grayscale(1);
  border-style: dashed;
  background: #d8d8d3b8;
}
.card-variant.is-unavailable .variant-name { text-decoration: line-through; text-decoration-thickness: 1px; }
.variant-name { grid-column: 2; grid-row: 1; color: #202d34; font: 800 10px/1.25 Arial, sans-serif; }
.variant-target { grid-column: 2; display: inline-flex; align-items: center; gap: .15rem; color: #584b31; font: 900 7.5px Arial, sans-serif; letter-spacing: .03em; }
.variant-target i { color: var(--card-accent); font-size: 9px; font-style: normal; }
.card-variant .effect-row { display: contents; }
.card-variant .effect-mark { grid-column: 1; grid-row: 1 / span 2; min-height: 27px; }
.card-variant .effect-copy { display: none; }
.card-variant .card-rules { grid-column: 2; grid-row: auto; }

.or-divider {
  height: 22px;
  display: flex;
  align-items: center;
  gap: .25rem;
  color: #4d3a13;
  font: 900 10px Arial, sans-serif;
  letter-spacing: .1em;
}

.or-divider::before, .or-divider::after { content: ''; height: 2px; flex: 1; background: #a98434; }
.or-divider span {
  min-width: 42px;
  padding: .16rem .4rem;
  border: 2px solid #f8e4a4;
  border-radius: 99px;
  color: #fff;
  background: #76551c;
  box-shadow: 0 1px 4px #3b2a1233;
  text-align: center;
}

.card.many-variants { gap: .18rem; }
.card.many-variants .card-heading { min-height: 38px; padding-block: .2rem; }
.card.many-variants .card-heading .title { font-size: .93rem; }
.card.many-variants .card-heading .art { height: 31px; }
.card.many-variants .card-meta { padding: .14rem .2rem; }
.card.many-variants .card-meta em { font-size: 7.2px; }
.card.many-variants .card-variant { grid-template-columns: 39px minmax(0, 1fr); gap: .05rem .18rem; padding: .12rem .16rem; }
.card.many-variants .variant-name { font-size: 8.4px; line-height: 1.08; }
.card.many-variants .card-variant .effect-mark { min-height: 22px; padding: .1rem; }
.card.many-variants .effect-mark i { font-size: 12px; }
.card.many-variants .effect-mark b { font-size: 7.5px; }
.card.many-variants .or-divider { height: 13px; font-size: 7px; }
.card.many-variants .or-divider span { min-width: 33px; padding: .05rem .2rem; border-width: 1px; }
.card.many-variants .card-reminder { padding: .14rem .2rem; font-size: 7px; }
.card-rules { display: flex; flex-wrap: wrap; gap: .22rem; }

.rule-chip {
  display: inline-flex;
  align-items: center;
  gap: .14rem;
  padding: .12rem .22rem;
  border: 1px solid #c9b88e;
  border-radius: 5px;
  color: #4c4639;
  background: #f7edda;
  font: 700 8.5px/1.2 Arial, sans-serif;
}

.rule-chip i { min-width: 14px; color: #603331; text-align: center; font: 900 10px Arial, sans-serif; font-style: normal; }
.rule-chip.zone-black i { color: #111; }
.rule-chip.zone-grey i { color: #8b9292; }
.rule-chip.zone-white i { color: #fff; text-shadow: 0 0 1px #111, 0 0 1px #111; }
.rule-chip.cards i { color: #70452f; }

.card-play-hint {
  margin-top: auto;
  padding-top: .16rem;
  color: #6a665d;
  border-top: 1px solid #b9a78080;
  font: 700 8px Arial, sans-serif;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.card:hover:not(:disabled) { transform: translateY(-4px); box-shadow: 0 13px 21px #0b11184c; }
.card.selected { transform: translateY(-5px); }
.card:disabled { opacity: .66; filter: saturate(.5); }
.card:disabled .card-effect, .card:disabled .card-heading { opacity: .78; }
.symbol-help .legend { margin-top: .65rem; }
.symbol-help .icon { width: auto; min-width: 25px; padding: 0 .2rem; font-size: 9px; white-space: nowrap; }
.fast-forward {
  border-color: #d7b04e;
  border-left-color: var(--gold);
  background: linear-gradient(135deg, #fff1b9, #fffaf0);
}
.fast-forward p { margin: .35rem 0 .65rem; font: 13px/1.4 Arial, sans-serif; }

@media (max-width: 760px) {
  .hand { grid-template-columns: repeat(2, minmax(185px, 1fr)); overflow-x: auto; }
  .card { min-height: 259px; }
}

@media (max-width: 540px) {
  .hand { grid-template-columns: 1fr; overflow: visible; }
  .card { width: min(100%, 225px); min-height: 315px; justify-self: center; }
  .card-heading { grid-template-columns: minmax(0, 1fr) 66px; }
}

/* Stała półka kart gracza przy dolnej krawędzi ekranu. */
:root { --hand-dock-height: 356px; }
body:has(.hand-dock) .shell { padding-bottom: calc(var(--hand-dock-height) + 1.15rem); }

.hand-dock {
  position: fixed;
  z-index: 50;
  right: 0;
  bottom: 0;
  left: 0;
  height: var(--hand-dock-height);
  color: var(--cream);
  border-top: 1px solid #f0cf78a8;
  background: linear-gradient(180deg, #10232df5, #071219fc 72%);
  box-shadow: 0 -15px 35px #02080dbd, inset 0 1px #ffffff12;
  backdrop-filter: blur(12px);
}

.hand-dock::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.hand-dock-inner {
  width: min(100%, 1480px);
  height: 100%;
  margin: 0 auto;
  padding: .5rem 1.15rem .65rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.hand-dock .hand-title { margin: 0; }
.hand-dock .hand-title h3 { margin: 0; color: #fff8e8; font-size: 1rem; }
.hand-dock .hand-title .badge { color: #ffe69e; border-color: #d4aa4c80; background: #3a2a115c; }
.hand-count { margin-left: .3rem; color: var(--gold-light); font: 800 11px Arial, sans-serif; }
.hand-title-label { display: flex; align-items: center; gap: .42rem; }
.hand-help-popover { position: relative; z-index: 8; display: inline-grid; place-items: center; }
.hand-help-trigger {
  width: 18px;
  height: 18px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid #d8cba65c;
  border-radius: 50%;
  color: #d6cfbd;
  background: #ffffff0a;
  font: 700 10px/1 Arial, sans-serif;
  box-shadow: none;
  opacity: .72;
}
.hand-help-trigger:hover:not(:disabled), .hand-help-trigger:focus-visible {
  color: #ffe7a0;
  border-color: #d7b55fa8;
  background: #d7b55f14;
  filter: none;
  transform: none;
  box-shadow: 0 0 0 2px #ffe79c20;
  opacity: 1;
}
.hand-help-tooltip {
  position: absolute;
  left: 0;
  bottom: calc(100% + .55rem);
  width: min(430px, calc(100vw - 2rem));
  padding: .58rem .68rem;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  color: #182832;
  border: 1px solid #d6b45c;
  border-radius: 8px;
  background: #fff8e9;
  box-shadow: 0 10px 25px #0008;
  font: 700 11px/1.38 Arial, sans-serif;
  transform: translateY(5px);
  transition: opacity var(--micro-duration, .2s) ease, transform var(--micro-duration, .2s) ease, visibility 0s linear var(--micro-duration, .2s);
}
.hand-help-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 7px;
  border: 6px solid transparent;
  border-top-color: #d6b45c;
}
.hand-help-popover:hover .hand-help-tooltip,
.hand-help-popover:focus-within .hand-help-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.hand-row-scroll {
  min-width: 0;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: .35rem .15rem .5rem;
  scroll-snap-type: x proximity;
  scrollbar-gutter: stable;
  scrollbar-color: #c89b3f #152c37;
  outline: none;
}

.hand-row-scroll:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); border-radius: 8px; }
.hand-dock .hand {
  width: max-content;
  min-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: .68rem;
  overflow: visible;
}

.hand-dock .card {
  width: 190px;
  min-width: 190px;
  height: 266px;
  min-height: 266px;
  flex: 0 0 190px;
  scroll-snap-align: start;
  justify-self: auto;
}

/* Pełny front karty mieści się w proporcji 5:7 bez przewijania. */
.hand-dock .card { padding: .36rem; gap: .16rem; }
.hand-dock .card-top { min-height: 18px; }
.hand-dock .faction-name { gap: .24rem; font-size: 9px; }
.hand-dock .card .faction-icon { width: 18px; height: 18px; flex-basis: 18px; font-size: 9px; }
.hand-dock .card-flags { gap: .12rem; }
.hand-dock .card-flags i { padding: .08rem .2rem; font-size: 7px; }
.hand-dock .card-heading {
  min-height: 39px;
  grid-template-columns: minmax(0, 1fr) 50px;
  gap: .22rem;
  padding: .22rem .3rem;
}
.hand-dock .card-heading .title { font-size: .94rem; }
.hand-dock .card-title-group { gap: .08rem; }
.hand-dock .card-title-group small { font-size: 6.5px; }
.hand-dock .card-heading .art { width: 50px; height: 32px; }
.hand-dock .card-meta-grid { gap: .16rem; }
.hand-dock .card-meta { padding: .13rem .18rem; gap: .03rem; }
.hand-dock .card-meta b { font-size: 6.3px; }
.hand-dock .card-meta b i { font-size: 8px; }
.hand-dock .card-meta em { font-size: 7.2px; line-height: 1.06; }
.hand-dock .card-effect { gap: .12rem; }
.hand-dock .effect-row {
  grid-template-columns: 43px minmax(0, 1fr);
  gap: .2rem;
  padding: .18rem;
  border-left-width: 3px;
}
.hand-dock .effect-mark { min-height: 25px; grid-template-columns: 15px 1fr; padding: .12rem; font-size: 8px; }
.hand-dock .effect-mark i { font-size: 12px; }
.hand-dock .effect-mark b { font-size: 7.5px; }
.hand-dock .effect-copy { font-size: 9.2px; line-height: 1.16; }
.hand-dock .effect-combo { gap: .08rem; }
.hand-dock .effect-combo .effect-row { grid-template-columns: 41px minmax(0, 1fr); padding: .16rem; }
.hand-dock .effect-combo .effect-mark { min-height: 23px; }
.hand-dock .combo-plus { width: 17px; height: 17px; font-size: 13px; }
.hand-dock .card-reminder {
  grid-template-columns: 14px minmax(0, 1fr);
  gap: .16rem;
  padding: .12rem .18rem;
  font-size: 7.2px;
  line-height: 1.12;
}
.hand-dock .card-reminder b { width: 13px; height: 13px; font-size: 8px; }
.hand-dock .availability-label { padding: .08rem .2rem; font-size: 6.5px; }
.hand-dock .card-rules::before { font-size: 6.3px; }
.hand-dock .rule-chip { padding: .08rem .16rem; font-size: 7.2px; line-height: 1.1; }
.hand-dock .rule-chip i { min-width: 11px; font-size: 8px; }
.hand-dock .card-variant { grid-template-columns: 41px minmax(0, 1fr); gap: .06rem .18rem; padding: .15rem .18rem; }
.hand-dock .variant-name { font-size: 8.8px; line-height: 1.12; }
.hand-dock .variant-target { font-size: 6.8px; }
.hand-dock .card-variant .effect-mark { min-height: 23px; }
.hand-dock .or-divider { height: 15px; font-size: 8px; }
.hand-dock .or-divider span { min-width: 36px; padding: .08rem .25rem; border-width: 1px; }
.hand-dock .card.many-variants { gap: .1rem; }
.hand-dock .card.many-variants .card-heading { min-height: 35px; }
.hand-dock .card.many-variants .card-heading .art { height: 27px; }
.hand-dock .card.many-variants .card-variant { grid-template-columns: 36px minmax(0, 1fr); padding: .08rem .12rem; }
.hand-dock .card.many-variants .variant-name { font-size: 7.8px; }
.hand-dock .card.many-variants .card-reminder { padding: .08rem .14rem; font-size: 6.7px; }

/* Doprecyzowanie jest informacją dodatkową: pokazuje się po podświetleniu karty. */
.card .card-reminder { display: none; }
.card:hover .card-reminder,
.card:focus-visible .card-reminder,
.card.selected .card-reminder,
.card.swap-selected .card-reminder { display: grid; }

@media (max-width: 760px) {
  :root { --hand-dock-height: 350px; }
  .hand-dock-inner { padding-inline: .7rem; }
  .hand-dock .hand-title { align-items: center; }
  .hand-dock .hand-title .badge { max-width: 48%; text-align: right; }
  .hand-dock .card { width: 190px; min-width: 190px; height: 266px; min-height: 266px; flex-basis: 190px; }
}

@media (max-height: 650px) {
  :root { --hand-dock-height: 320px; }
  .hand-dock-inner { grid-template-rows: auto minmax(0, 1fr); }
  .hand-row-scroll { overflow-y: auto; }
  .hand-dock .card { width: 190px; min-width: 190px; height: 266px; min-height: 266px; flex-basis: 190px; }
}

/* Audyt UI: dostępność, hierarchia stanu i wygodna obsługa decyzji. */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.player { min-width: 0; }
.player-head { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: .4rem; }
.player-identity { min-width: 0; display: flex; align-items: center; gap: .3rem; }
.player-identity b { min-width: 0; overflow-wrap: anywhere; font-size: .95rem; }
.player-identity small { padding: .08rem .24rem; border-radius: 99px; color: #66490e; background: #f6d77c; font: 800 8px Arial, sans-serif; }
.player-dot { width: 10px; height: 10px; flex: 0 0 10px; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px #26343a55; }
.player-badges { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: .2rem; }
.attack-badge { padding: .13rem .3rem; border: 1px solid #b72d34; border-radius: 99px; color: #fff; background: #a7232b; font: 900 8px Arial, sans-serif; letter-spacing: .04em; }
.player-metrics { position: relative; z-index: 1; display: grid; grid-template-columns: 1.25fr .85fr .75fr; gap: .3rem; margin-top: .48rem; }
.metric { min-width: 0; padding: .32rem .36rem; border: 1px solid #d7c5a0; border-radius: 7px; display: grid; align-content: center; background: #fffaf0c7; }
.metric small { color: #6f756f; font: 800 7.5px Arial, sans-serif; letter-spacing: .06em; }
.metric strong { color: #26363e; font: 800 12px Arial, sans-serif; white-space: nowrap; }
.metric strong.hand-metric-value { display: inline-flex; align-items: center; gap: .22rem; }
.hand-cards-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  overflow: visible;
  color: #355c70;
  filter: drop-shadow(0 1px 0 #fff) drop-shadow(0 1px 1px #0003);
}
.hand-cards-icon .hand-card-back,
.hand-cards-icon .hand-card-front,
.hand-cards-icon .hand-card-accent {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.hand-cards-icon .hand-card-back { opacity: .65; }
.hand-cards-icon .hand-card-accent { stroke: #a97b16; stroke-width: 1.35; }
.metric.popularity strong { color: #172a35; font-size: 1.35rem; line-height: 1; }
.metric em { color: #6f6250; font: 700 8px Arial, sans-serif; font-style: normal; }
.pact-status { padding: .35rem .42rem; border: 1px solid #a9c0cf; border-radius: 6px; overflow-wrap: anywhere; color: #24495d; background: #e8f3f7; }
.player.active .player-head::after { content: 'AKTYWNY'; position: absolute; top: -18px; left: 0; padding: .08rem .34rem; border-radius: 99px; color: #2a1d05; background: var(--gold-light); font: 900 8px Arial, sans-serif; letter-spacing: .06em; }
.player.targeted { animation-iteration-count: 3; }
.player.dead .player-metrics { opacity: .7; }

.pawn { transform: translateX(calc(-50% + var(--pawn-offset, 0px))); }
.pawn.moving { animation-name: pawn-land-offset; }
@keyframes pawn-land-offset {
  0% { transform: translateX(calc(-50% + var(--pawn-offset, 0px))) scale(.75); }
  65% { transform: translateX(calc(-50% + var(--pawn-offset, 0px))) scale(1.22); }
  100% { transform: translateX(calc(-50% + var(--pawn-offset, 0px))) scale(1); }
}

.hand-dock .card { animation: none; }
.hand-dock .card.new-card { animation: card-deal .42s cubic-bezier(.2,.85,.3,1.2) both; }
.hand-dock .card[data-card-draggable="true"] { cursor: grab; touch-action: pan-x; user-select: none; }
.hand-dock .card[data-card-draggable="true"]:active { cursor: grabbing; }
.hand-dock .card.drag-source { opacity: .42; transform: translateY(7px) scale(.96); filter: saturate(.6); }
.card-drag-ghost.card {
  position: fixed;
  z-index: 180;
  width: 172px;
  height: 228px;
  margin: 0;
  opacity: .9;
  pointer-events: none;
  transform: translate(-50%, -50%) rotate(2deg) scale(.82);
  box-shadow: 0 22px 38px #000a, 0 0 0 3px #ffe590;
  animation: none !important;
}
.card.playable { border-color: color-mix(in srgb, var(--card-accent) 64%, #fff); }
.card.playable:hover { border-color: #fff0a3; }
.hand-dock.has-selection .card:not(.selected):not(.swap-selected):hover { transform: none; border-color: color-mix(in srgb, var(--card-accent) 64%, #fff); box-shadow: 0 8px 16px #0a11142e; }
.card.unavailable { opacity: .64; filter: grayscale(.28) saturate(.65); }
.card.instant-card.playable { box-shadow: 0 0 0 2px #9a78cf, 0 8px 18px #0a111448; }
.card.token-card.playable, .card.token-card.playable:hover {
  border-color: #efc54a;
  box-shadow: 0 0 0 2px #cfa12a, 0 8px 18px #0a111448;
}
.hand-dock.has-selection .card.token-card:not(.selected):not(.swap-selected):hover {
  border-color: #efc54a;
  box-shadow: 0 0 0 2px #cfa12a, 0 8px 18px #0a111448;
}
.card.swap-selected { border-color: #ffe790; box-shadow: 0 0 0 4px #d19d31, 0 16px 26px #0007; transform: translateY(-5px); }
.hand-dock .card-play-hint { display: none; }
.availability-label { position: relative; z-index: 5; width: 100%; margin-top: auto; padding: .12rem .26rem; border: 1px solid #ffffff99; border-radius: 99px; color: #fff; background: #335b49; font: 900 7px Arial, sans-serif; letter-spacing: .07em; text-align: center; }
.unavailable .availability-label { color: #e2e3df; background: #5f6668; }
.instant-card .availability-label { background: #67488d; }
.swap-selected .availability-label { color: #2c1d04; background: #f3ca62; }
.selected .availability-label { color: #2c1d04; background: #ffe183; }

.selection-tray {
  position: fixed;
  z-index: 65;
  left: 50%;
  bottom: var(--hand-dock-height);
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - var(--hand-dock-height) - 24px);
  overflow: auto;
  padding: .78rem;
  border: 1px solid #e2bd5e;
  border-radius: 13px 13px 0 0;
  color: var(--ink);
  background: linear-gradient(145deg, #fffdf6f7, #eee1c8fa);
  box-shadow: 0 -12px 30px #02080da8, inset 0 1px #fff;
  transform: translateX(-50%);
  backdrop-filter: blur(10px);
}
.selection-tray > header { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.selection-tray header small { color: #826326; font: 900 8px Arial, sans-serif; letter-spacing: .12em; }
.selection-tray h3 { margin: .08rem 0; color: #172b36; font-size: 1.12rem; }
.tray-close { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; font-size: 1.3rem; }
.selection-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .4rem; }
.selection-summary .card-text { margin: .3rem 0; }
.copy-preview {
  display: grid;
  gap: .18rem;
  margin: .3rem 0;
  padding: .62rem .7rem;
  border: 1px solid #a987c8;
  border-left: 4px solid #704a98;
  border-radius: 7px;
  color: #332343;
  background: linear-gradient(135deg, #f1e8fb, #fffaf0);
  font: 12px/1.38 Arial, sans-serif;
}
.copy-preview b { color: #553177; font-size: 13px; }
.copy-preview span { color: #6e5a79; }
.copy-preview em { color: #26353d; font-style: normal; font-weight: 700; }
.copy-preview.unavailable-copy { border-color: #c98c87; border-left-color: #a53238; background: #ffe9e5; }
.decision-block { margin-top: .35rem; }
.decision-block > b { color: #5e4a24; font: 900 10px Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.selection-tray .choice-row { margin: .35rem 0; }
.selection-tray .mode-choice { min-width: 150px; display: grid; gap: .16rem; text-align: left; }
.selection-tray .mode-choice > span { font-weight: 800; }
.selection-tray .mode-choice.mode-unavailable:disabled {
  opacity: .58;
  filter: grayscale(1);
  border-style: dashed;
  color: #5d6263;
  background: linear-gradient(145deg, #e1e0dc, #c9cac8);
  box-shadow: none;
}
.selection-tray .mode-choice small { color: #6b3b3b; font: 700 9px/1.25 Arial, sans-serif; }
.selection-tray footer { padding-top: .35rem; border-top: 1px solid #cdbb95; }
.selection-tray footer { position: sticky; z-index: 4; bottom: -.78rem; margin-inline: -.78rem; margin-bottom: -.78rem; padding: .55rem .78rem .72rem; background: linear-gradient(180deg, #f5ead8f2, #fffdf6 38%); box-shadow: 0 -8px 18px #2d24151f; }
.empty-choice { padding: .4rem .55rem; border-radius: 6px; color: #8b272b; background: #ffe0dc; font: 700 12px Arial, sans-serif; }

.card-drop-zone {
  min-height: 58px;
  margin: .7rem 0;
  padding: .55rem .72rem;
  border: 1px dashed #b59a63;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: #64583f;
  background: linear-gradient(135deg, #fffaf0a8, #eadfc9a8);
  transition: min-height var(--micro-duration, .2s) ease, border-color var(--micro-duration, .2s) ease, background var(--micro-duration, .2s) ease, box-shadow var(--micro-duration, .2s) ease, transform var(--micro-duration, .2s) ease;
}
.card-drop-zone > span { width: 31px; height: 31px; flex: 0 0 31px; border: 1px solid #b99b5c; border-radius: 50%; display: grid; place-items: center; color: #72571f; background: #fff4d1; font: 900 20px/1 Arial, sans-serif; }
.card-drop-zone div { display: grid; gap: .08rem; }
.card-drop-zone b { color: #3b3222; font: 900 11px/1.25 Arial, sans-serif; letter-spacing: .03em; text-transform: uppercase; }
.card-drop-zone small { font: 11px/1.3 Arial, sans-serif; }
body.card-dragging .card-drop-zone { min-height: 72px; border: 2px dashed #c39427; color: #4c3a14; background: linear-gradient(135deg, #fff3be, #f4dc8e); box-shadow: 0 0 0 4px #d6a5332e, inset 0 1px #fff; }
.card-drop-zone.drag-over { border-style: solid; border-color: #fff0a1; color: #fff9df; background: linear-gradient(135deg, #715315, #c18e23); box-shadow: 0 0 0 5px #e9bd5255, 0 12px 25px #3a290c4a; transform: translateY(-2px) scale(1.01); }
.card-drop-zone.drag-over b { color: #fff; }
.card-drop-zone.drag-over > span { color: #503300; border-color: #fff1b1; background: #ffe58a; }

body.card-dragging .player.drop-legal,
body.card-dragging .queue-card.drop-action-legal {
  position: relative;
  outline: 3px solid #e1b642;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #e1b64230, 0 10px 23px #2d210d38;
}
body.card-dragging .player.drop-legal::before,
body.card-dragging .queue-card.drop-action-legal::before {
  content: 'UPUŚĆ — USTAW CEL';
  position: absolute;
  z-index: 8;
  inset: 6px 6px auto;
  padding: .2rem .35rem;
  border-radius: 5px;
  color: #2d2108;
  background: #ffe18a;
  pointer-events: none;
  font: 900 8px/1 Arial, sans-serif;
  letter-spacing: .06em;
  text-align: center;
}
body.card-dragging .queue-card.drop-action-legal::before { content: 'UPUŚĆ — REAKCJA NA TĘ KARTĘ'; }
body.card-dragging .player.drop-legal.drag-over,
body.card-dragging .queue-card.drop-action-legal.drag-over { outline-color: #fff0a1; background: #fff2b8; transform: translateY(-2px); }

.action-toolbar { margin: .75rem 0; padding: .7rem; border: 1px solid #d7c18e; border-radius: 10px; background: #fffaf0b8; }
.action-toolbar > b { color: #273943; font-size: .86rem; }
.action-group { display: flex; align-items: center; flex-wrap: wrap; gap: .42rem; margin-top: .45rem; }
.action-group > span { min-width: 82px; color: #75633d; font: 900 9px Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.forced-actions { padding: .4rem; border-left: 4px solid var(--red); background: #ffe4df; }
.relation-actions { padding-top: .4rem; border-top: 1px solid #e0d1b4; }
.token-actions button { color: #302003; border-color: #e6c055; background: linear-gradient(145deg, #f6d77c, #bd8b26); }
.pre-turn-actions button:disabled { opacity: .58; }
.fast-forward { box-shadow: 0 0 0 3px #deb64740, 0 8px 18px #3e2b1030; }

.celebration.no-president { color: #fff2ec; border-color: #c37b74; background: radial-gradient(circle at 50% -30%, #c45e52 0, transparent 42%), linear-gradient(135deg, #111d25, #522a2c, #172732); }
.celebration.no-president b { border-color: #e7a69c8c; }
.targeted-action { animation-iteration-count: 3; }
.bot-card-play { animation-iteration-count: 1, 2; }
.bot-card-play.targeting-human { animation-iteration-count: 1, 2, 3; }

/* Zagranie karty przez człowieka: karta leci z ręki na środek stołu.
   Warstwa nie przechwytuje kliknięć, więc kolejka reakcji pozostaje dostępna. */
.human-card-play-layer {
  --play-glow: #d7a53d99;
  position: fixed;
  inset: 0;
  z-index: 120;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  background: radial-gradient(circle at 50% 43%, var(--play-glow) 0, #101d2900 36%);
  animation: human-play-backdrop 2.5s ease-out both;
}
.human-card-play-layer.red { --play-glow: #bd3c477a; }
.human-card-play-layer.green { --play-glow: #21825d7a; }
.human-card-play-layer.blue { --play-glow: #3a73b67a; }
.human-card-play-layer.dual { --play-glow: #9a604f7a; }
.human-card-play-layer .human-card-flight-card.card {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 214px;
  min-width: 214px;
  height: 300px;
  min-height: 300px;
  margin: 0;
  cursor: default;
  transform-origin: center;
  box-shadow: 0 24px 55px #02070ccf, 0 0 0 2px #fff9, 0 0 38px var(--play-glow);
  animation: human-card-flight 2.5s cubic-bezier(.2,.78,.28,1) both;
}
.human-card-flight-card .card-play-hint { display: none; }
.human-card-play-caption {
  position: absolute;
  left: 50%;
  top: calc(43% + 166px);
  width: min(560px, calc(100vw - 2rem));
  display: grid;
  gap: .12rem;
  padding: .58rem .8rem;
  border: 1px solid #ffe8a6b8;
  border-radius: 10px;
  color: #fff9e8;
  text-align: center;
  background: linear-gradient(135deg, #0c1824ed, #263845ed);
  box-shadow: 0 10px 28px #000a;
  transform: translateX(-50%);
  animation: human-play-caption 2.5s ease-out both;
}
.human-card-play-caption small {
  color: #f0c968;
  font: 900 9px Arial, sans-serif;
  letter-spacing: .16em;
}
.human-card-play-caption strong { font-size: 1.22rem; line-height: 1.15; }
.human-card-play-caption span { font: 12px/1.35 Arial, sans-serif; }

@keyframes human-card-flight {
  0% {
    opacity: .55;
    transform: translate(calc(-50% + var(--play-start-x, 0px)), calc(-50% + var(--play-start-y, 55vh))) scale(var(--play-start-scale, .72)) rotate(-4deg);
    filter: brightness(.82);
  }
  42% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(1deg);
    filter: brightness(1.12);
  }
  70% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
    filter: brightness(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 46px)) scale(.88) rotate(1.5deg);
    filter: brightness(1.08);
  }
}
@keyframes human-play-caption {
  0%, 25% { opacity: 0; transform: translate(-50%, 14px) scale(.96); }
  42%, 76% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(.98); }
}
@keyframes human-play-backdrop {
  0%, 100% { opacity: 0; }
  25%, 75% { opacity: 1; }
}

/* Animacje botów żyją poza #app, dlatego kolejne renderowanie planszy ich nie przerywa. */
.bot-card-play-layer {
  --play-glow: #d7a53d8f;
  position: fixed;
  inset: 0;
  z-index: 119;
  overflow: hidden;
  pointer-events: auto;
  cursor: pointer;
  user-select: none;
  background: radial-gradient(circle at 50% 43%, var(--play-glow) 0, #101d2900 38%);
  animation: bot-play-backdrop 4.5s ease-out both;
}
.bot-card-play-layer.red { --play-glow: #bd3c477a; }
.bot-card-play-layer.green { --play-glow: #21825d7a; }
.bot-card-play-layer.blue { --play-glow: #3a73b67a; }
.bot-card-play-layer.dual { --play-glow: #9a604f7a; }
.bot-card-play-layer.targeting-human { --play-glow: #d5303f9c; }
.bot-card-play-layer .bot-card-flight-card.card {
  position: absolute;
  left: 50%;
  top: 43%;
  width: 214px;
  min-width: 214px;
  height: 300px;
  min-height: 300px;
  margin: 0;
  cursor: default;
  transform-origin: center;
  box-shadow: 0 24px 55px #02070cd9, 0 0 0 2px #fff9, 0 0 42px var(--play-glow);
  animation: bot-card-flight-complete 4.5s cubic-bezier(.18,.76,.25,1) both;
}
.bot-card-flight-card .card-play-hint { display: none; }
.bot-card-play-caption {
  position: absolute;
  left: 50%;
  top: calc(43% + 166px);
  width: min(590px, calc(100vw - 2rem));
  display: grid;
  gap: .12rem;
  padding: .6rem .85rem;
  border: 1px solid #ffe8a6c9;
  border-radius: 10px;
  color: #fff9e8;
  text-align: center;
  background: linear-gradient(135deg, #0b1723f2, #293d4bf2);
  box-shadow: 0 12px 32px #000b;
  transform: translateX(-50%);
  animation: bot-play-caption-complete 4.5s ease-out both;
}
.bot-card-play-layer.targeting-human .bot-card-play-caption {
  border-color: #ffb2a8;
  background: linear-gradient(135deg, #2b1015f2, #6b2029f2);
}
.bot-card-play-caption small {
  color: #f0c968;
  font: 900 9px Arial, sans-serif;
  letter-spacing: .16em;
}
.bot-card-play-layer.targeting-human .bot-card-play-caption small { color: #ffd1c9; }
.bot-card-play-caption strong { font-size: 1.22rem; line-height: 1.15; }
.bot-card-play-caption span { font: 12px/1.35 Arial, sans-serif; }
@keyframes bot-card-flight-complete {
  0% {
    opacity: .5;
    transform: translate(calc(-50% + var(--play-start-x, 45vw)), calc(-50% + var(--play-start-y, 0px))) scale(var(--play-start-scale, .68)) rotate(4deg);
    filter: brightness(.78);
  }
  28% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08) rotate(-1deg);
    filter: brightness(1.14);
  }
  90% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0);
    filter: brightness(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, calc(-50% - 44px)) scale(.9) rotate(-1deg);
    filter: brightness(1.06);
  }
}
@keyframes bot-play-caption-complete {
  0%, 16% { opacity: 0; transform: translate(-50%, 14px) scale(.96); }
  28%, 92% { opacity: 1; transform: translate(-50%, 0) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -12px) scale(.98); }
}
@keyframes bot-play-backdrop {
  0%, 100% { opacity: 0; }
  14%, 94% { opacity: 1; }
}

@media (max-height: 650px), (max-width: 560px) {
  .human-card-play-layer .human-card-flight-card.card {
    width: 170px;
    min-width: 170px;
    height: 238px;
    min-height: 238px;
  }
  .human-card-play-caption { top: calc(43% + 132px); }
  .bot-card-play-layer .bot-card-flight-card.card {
    width: 170px;
    min-width: 170px;
    height: 238px;
    min-height: 238px;
  }
  .bot-card-play-caption { top: calc(43% + 132px); }
}

@media (max-height: 800px) and (min-height: 651px) {
  :root { --hand-dock-height: 350px; }
  .hand-dock-inner { grid-template-rows: auto minmax(0, 1fr); }
  .hand-dock .card { width: 190px; min-width: 190px; height: 266px; min-height: 266px; flex-basis: 190px; }
}

/* Lokalny tryb wieloosobowy — prywatne przekazywanie urządzenia. */
.extra-player-names { display: contents; }
.hot-seat-screen {
  min-height: calc(100vh - 90px);
  padding: 1.25rem;
  display: grid;
  place-items: center;
}
.hot-seat-gate {
  width: min(520px, 100%);
  padding: clamp(1.5rem, 5vw, 3rem);
  display: grid;
  justify-items: center;
  gap: .72rem;
  color: #fff8e9;
  text-align: center;
  border: 1px solid #e0bd63a6;
  border-radius: 18px;
  background: radial-gradient(circle at 50% 0, #76592750, transparent 42%), linear-gradient(145deg, #132a37, #07131b 72%);
  box-shadow: 0 24px 60px #000a, inset 0 1px #ffffff17;
}
.hot-seat-gate::before {
  content: '';
  width: 60%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #e1b950, transparent);
}
.hot-seat-mark {
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  color: #ffe59a;
  border: 1px solid #f0cf7890;
  border-radius: 14px;
  font-size: 1.5rem;
  transform: rotate(45deg);
  box-shadow: inset 0 0 18px #f2c65c2e;
}
.hot-seat-gate p { margin: .2rem 0 0; color: #ddc277; font: 800 10px Arial, sans-serif; letter-spacing: .16em; }
.hot-seat-gate h2 { margin: 0; color: #fff8e9; font-size: clamp(1.35rem, 4vw, 2rem); }
.hot-seat-gate b { color: #ffe19a; font: 800 12px Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.hot-seat-gate small { max-width: 390px; color: #cbd5d8; font: 12px/1.5 Arial, sans-serif; }
.hot-seat-gate button { margin-top: .55rem; min-width: min(100%, 290px); }
.private-choice { border-left: 5px solid var(--gold); }

@media (max-width: 760px) {
  .extra-player-names { display: flex; flex-wrap: wrap; gap: .45rem; width: 100%; }
  .extra-player-names label { flex: 1 1 110px; }
  .extra-player-names input { width: 100%; }
}

@media (max-width: 760px) {
  .selection-tray { width: calc(100% - 1rem); max-height: calc(100vh - var(--hand-dock-height) - 12px); }
  .selection-summary { grid-template-columns: 1fr; }
  .player-metrics { grid-template-columns: 1.15fr .9fr .8fr; }
  .action-group > span { width: 100%; }
}

/* Zwijany dziennik pozostawia dostępny nagłówek i odzyskuje miejsce na planszę. */
.log-heading { display: flex; align-items: center; justify-content: space-between; gap: .55rem; }
.log-heading h2 { margin: .15rem 0; }
.log-toggle { padding: .34rem .54rem; white-space: nowrap; font-size: 10px; }
.log[hidden] { display: none; }
.log-aside { align-self: start; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.sidebar-section-heading h2 { margin: .15rem 0; }
.right-players {
  grid-template-columns: 1fr;
  max-height: min(52vh, 570px);
  margin: .45rem -.2rem 0;
  padding: .35rem .35rem .5rem .2rem;
  overflow-y: auto;
  scrollbar-color: #b99142 #eee1c8;
}
.right-players .player { min-height: 0; }
.sidebar-log { margin-top: .85rem; padding-top: .75rem; border-top: 1px solid #d9c499; }

/* Wpis dziennika porusza się tylko raz, gdy faktycznie został dopisany. */
.log-entry:first-child { animation: none; }
.log-entry.is-new { animation: log-enter .35s ease-out; }
.type-timeout .log-icon { color: #744d12; background: #f7dfaa; }

/* Zegar tury i automatycznego pasowania reakcji. */
.game-clock {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: .62rem;
  overflow: hidden;
  margin: .1rem 0 .7rem;
  padding: .62rem .72rem .78rem;
  border: 1px solid #c9a54f;
  border-radius: 10px;
  color: #3e2d0e;
  background: linear-gradient(120deg, #fff8df, #f3e2b4);
  box-shadow: 0 5px 13px #4e381621;
  font-family: Arial, sans-serif;
}
.game-clock.reaction { border-color: #8b70ae; color: #38284d; background: linear-gradient(120deg, #f7f1ff, #e5d9f2); }
.clock-symbol { width: 31px; height: 31px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: 17px; }
.game-clock span > b { display: block; font-size: 12px; letter-spacing: .03em; }
.game-clock span > small { display: block; margin-top: .08rem; opacity: .78; font-size: 10px; }
.game-clock > strong { display: flex; align-items: baseline; min-width: 43px; justify-content: flex-end; font-size: 23px; font-variant-numeric: tabular-nums; }
.game-clock > strong small { margin-left: 2px; font-size: 10px; text-transform: uppercase; }
.clock-track { position: absolute; inset: auto 0 0; height: 5px; background: #2a1b0f20; }
.clock-track > i { display: block; width: 100%; height: 100%; transform-origin: left center; background: linear-gradient(90deg, #b88724, #e5bd55); animation: clock-drain var(--clock-remaining, 0ms) linear forwards; transition: background .2s ease; will-change: transform; }
.reaction .clock-track > i { background: linear-gradient(90deg, #60407f, #a27bc3); }
.game-clock.is-urgent { border-color: #ba373b; color: #792126; background: linear-gradient(120deg, #fff3e7, #f7cbc4); }
.game-clock.is-urgent .clock-track > i { background: linear-gradient(90deg, #9d252b, #dd5958); }
@keyframes clock-drain { from { transform: scaleX(var(--clock-progress, 1)); } to { transform: scaleX(0); } }
html[data-motion="reduced"] .clock-track > i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .clock-track > i { animation: none; }
}

/* Globalna blokada FBI musi być czytelna bez otwierania szczegółów karty. */
.fbi-lock {
  border-color: #7e64a8;
  border-left-color: #49366e;
  background: linear-gradient(135deg, #eee9fb, #f9fbff);
  box-shadow: 0 6px 18px #3425522b;
}
.fbi-lock header { display: flex; align-items: center; justify-content: space-between; gap: .55rem; flex-wrap: wrap; }
.fbi-lock p { margin: .55rem 0; font: 13px/1.4 Arial, sans-serif; }
.fbi-lock .primary { margin-top: .25rem; background: linear-gradient(145deg, #7255a2, #3b285f); }
.fbi-force { margin-top: .75rem; padding-top: .7rem; border-top: 1px solid #8d77ad66; }
.fbi-force > b { display: block; color: #3f2d61; }
.fbi-force .choice-row { margin: .4rem 0; }
.fbi-force code { padding: .08rem .25rem; border-radius: 4px; background: #ddd2f0; color: #3b285f; }
.type-vote .log-icon { color: #513477; background: #e8dcfa; }

@media (max-width: 1080px) {
  .right-players { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); max-height: none; overflow: visible; }
}

@media (max-width: 560px) {
  .right-players { grid-template-columns: 1fr; }
}

/* BETA 7.0: wspólny, czytelny język ikon frakcji. */
.faction-icon {
  position: relative;
  overflow: visible;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform .18s ease, filter .18s ease;
}

.faction-icon::after { display: none; }

.faction-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 1px 0 #fff8) drop-shadow(0 1px 1px #0005);
}

.faction-svg .faction-main,
.faction-svg .faction-detail,
.faction-svg .faction-accent,
.faction-svg .faction-band {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.faction-svg .faction-detail { opacity: .82; stroke-width: 1.35; }
.faction-svg .faction-accent { stroke: var(--faction-accent, currentColor); stroke-width: 1.55; }
.faction-svg .faction-band { stroke: var(--faction-band, currentColor); stroke-width: 2.2; }
.faction-svg .faction-lens { fill: var(--faction-accent, currentColor); stroke: none; }

.faction-icon.mafia {
  --faction-accent: #d94c35;
  --faction-band: #b48320;
  color: #753722;
}

.faction-icon.government {
  --faction-accent: #a97b16;
  color: #285d93;
}

.faction-icon.media {
  --faction-accent: #aa7916;
  color: #0d746c;
}

/* Ikona na karcie dziedziczy kolor karty, a nie kolor frakcji.
   Selektor o tej samej lub większej swoistości nadpisuje starsze tła ze style.css. */
.faction-icon.mafia,
.faction-icon.government,
.faction-icon.media {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.card .faction-icon {
  --faction-accent: var(--card-accent);
  color: var(--card-accent);
}

.card .faction-icon.mafia {
  --faction-band: #a67a17;
}

.faction-icon.unknown { color: #67747a; }
.bot-card-play .faction-icon { --faction-accent: #ffe07a; --faction-band: #ffe07a; color: #fff; }
.card:hover:not(:disabled) .faction-icon { transform: translateY(-1px) scale(1.06); filter: brightness(1.1); }
.symbol-help .faction-icon { width: 28px; height: 28px; flex-basis: 28px; }
.token-help summary .faction-icon { margin-right: .28rem; vertical-align: middle; }

/* BETA 7.0 — zatwierdzony pakiet czytelności i animacji. */
:root { --pawn-duration: .9s; --micro-duration: .28s; }
html[data-motion="fast"] { --pawn-duration: .46s; --micro-duration: .14s; }
html[data-motion="reduced"] { --pawn-duration: .01ms; --micro-duration: .01ms; }
.pawn { transition-duration: var(--pawn-duration); }

/* Duża ręka pozostaje jednym rzędem, ale wyraźnie sygnalizuje dalsze karty. */
.hand-scroll-shell { position: relative; min-width: 0; min-height: 0; height: 100%; }
.hand-scroll-shell .hand-row-scroll { height: 100%; padding-inline: .55rem; }
.hand-scroll-cue {
  position: absolute;
  z-index: 9;
  top: 50%;
  width: 31px;
  height: 62px;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  color: #fff4bc;
  background: linear-gradient(90deg, #071219f2, #07121922);
  font: 900 32px/1 Arial, sans-serif;
  transform: translateY(-50%);
  transition: opacity .14s linear;
}
.hand-scroll-cue.left { left: 0; border-radius: 0 12px 12px 0; }
.hand-scroll-cue.right { right: 0; border-radius: 12px 0 0 12px; background: linear-gradient(270deg, #071219f2, #07121922); }
.hand-scroll-shell.can-scroll-left .hand-scroll-cue.left,
.hand-scroll-shell.can-scroll-right .hand-scroll-cue.right { opacity: .92; }
.hand-scroll-shell.can-scroll-left::before,
.hand-scroll-shell.can-scroll-right::after {
  content: '';
  position: absolute;
  z-index: 8;
  top: 0;
  bottom: 0;
  width: 42px;
  pointer-events: none;
}
.hand-scroll-shell.can-scroll-left::before { left: 0; background: linear-gradient(90deg, #071219e8, transparent); }
.hand-scroll-shell.can-scroll-right::after { right: 0; background: linear-gradient(270deg, #071219e8, transparent); }

/* Wybrana karta pozostaje jednoznaczna także w dużej ręce. */
.hand-dock.has-selection .card:not(.selected):not(.swap-selected) {
  opacity: .57;
  filter: saturate(.58) brightness(.74);
  transform: scale(.965);
}
.hand-dock .card.selected {
  z-index: 4;
  opacity: 1;
  filter: none;
  border-color: #fff3a6;
  transform: translateY(-12px) scale(1.035);
  box-shadow: 0 0 0 3px #d8a62f, 0 0 28px #ffd96d8c, 0 22px 36px #000b;
}
.hand-dock .card.selected::after { border-color: #fff4b7c9; box-shadow: inset 0 0 18px #ffe98933; }

/* Podgląd wyniku pochodzi z silnika zasad i nie pokazuje ukrytych kart. */
.effect-preview {
  margin: .52rem 0;
  padding: .62rem .72rem;
  border: 1px solid #85ad9a;
  border-left: 5px solid #287557;
  border-radius: 8px;
  color: #173629;
  background: linear-gradient(135deg, #e7f6ed, #fffaf0);
  font: 12px/1.38 Arial, sans-serif;
}
.effect-preview > b { display: block; margin-bottom: .25rem; color: #16563d; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.effect-preview ul { display: grid; gap: .18rem; margin: .2rem 0 .35rem; padding-left: 1.15rem; }
.effect-preview small { color: #65736d; }
.effect-preview.is-incomplete { border-color: #d2ad5f; border-left-color: #b07a1d; color: #6e511a; background: #fff5d8; }
.effect-preview.is-incomplete > b { color: #765313; }
.effect-preview.is-incomplete p { margin: .2rem 0; }
.preview-elimination { color: #962b31; font-weight: 800; }
.preview-victory { color: #805b0e; font-weight: 800; }

/* Pakt i koalicja są podpisane bezpośrednio przy każdym uczestniku. */
.player-relations { position: relative; z-index: 2; display: grid; gap: .25rem; margin-top: .42rem; }
.relation-ribbon {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: .32rem;
  padding: .28rem .42rem;
  border: 1px solid #9eb8c5;
  border-radius: 5px 12px 12px 5px;
  color: #21495c;
  background: linear-gradient(90deg, #dceef4, #f7fbfc);
  font: 700 9px/1.22 Arial, sans-serif;
}
.relation-ribbon i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: #44788e; font-style: normal; }
.coalition-ribbon { color: #654916; border-color: #d2b66c; background: linear-gradient(90deg, #fff0b9, #fffaf0); }
.coalition-ribbon i { background: #b08122; }
.player.relation-changed .player-relations { animation: relation-ribbon-arrive var(--state-fx-duration, 1.1s) cubic-bezier(.2,.82,.3,1.1) both; }
@keyframes relation-ribbon-arrive { 0% { opacity: 0; transform: translateX(22px); } 55% { opacity: 1; transform: translateX(-3px); } 100% { transform: translateX(0); } }

/* Zmiana popularności: różnica, źródło i ślad na torze. */
.metric.popularity { position: relative; overflow: visible; }
.popularity-delta {
  position: absolute;
  z-index: 5;
  top: -13px;
  right: -7px;
  min-width: 38px;
  padding: .23rem .36rem;
  border: 2px solid #fff;
  border-radius: 9px;
  color: #fff;
  text-align: center;
  font: 900 12px/1 Arial, sans-serif;
  box-shadow: 0 6px 13px #0005;
  animation: popularity-delta-pop var(--state-fx-duration, 1.2s) ease-out both;
}
.popularity-delta.gain { background: #16714d; }
.popularity-delta.loss { background: #a92731; }
.popularity-delta small { display: block; max-width: 92px; margin-top: .15rem; overflow: hidden; color: #fff; font: 700 7px/1.1 Arial, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.pawn-delta {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 5px);
  padding: .18rem .28rem;
  border: 1px solid #fff;
  border-radius: 6px;
  color: #fff;
  background: #1c7755;
  font: 900 10px/1 Arial, sans-serif;
  transform: translateX(-50%);
  animation: pawn-delta-float var(--state-fx-duration, 1.2s) ease-out both;
}
.pawn-delta.loss { background: #a92731; }
.pawn-trail {
  position: absolute;
  z-index: 3;
  height: 5px;
  min-width: 8px;
  border-radius: 99px;
  pointer-events: none;
  background: linear-gradient(90deg, #2fa47555, #2fa475, #2fa47555);
  box-shadow: 0 0 8px #2fa475aa;
  transform: translateY(50%);
  animation: pawn-trail-show var(--state-fx-duration, 1.2s) ease-out both;
}
.pawn-trail.loss { background: linear-gradient(90deg, #d7475055, #d74750, #d7475055); box-shadow: 0 0 8px #d74750aa; }
@keyframes popularity-delta-pop { 0% { opacity: 0; transform: translateY(14px) scale(.7); } 28%, 72% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-13px) scale(.9); } }
@keyframes pawn-delta-float { 0% { opacity: 0; transform: translate(-50%, 8px) scale(.7); } 30%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px) scale(.9); } }
@keyframes pawn-trail-show { 0% { opacity: 0; clip-path: inset(0 100% 0 0); } 28%, 72% { opacity: 1; clip-path: inset(0); } 100% { opacity: 0; } }

/* Animacja zagrania: wejście, czas czytania i przekazanie do kolejki. */
.human-card-play-layer,
.human-card-play-layer .human-card-flight-card.card,
.human-card-play-caption,
.bot-card-play-layer,
.bot-card-play-layer .bot-card-flight-card.card,
.bot-card-play-caption { animation-duration: var(--play-duration, 2.5s); }
.play-dismiss-hint { margin: .28rem 0 0; color: #d7e0e3; font: 700 9px/1.2 Arial, sans-serif; }

.resolution-toast {
  position: fixed;
  z-index: 132;
  top: 16%;
  left: 50%;
  min-width: min(360px, calc(100vw - 2rem));
  padding: .75rem 1rem;
  border: 1px solid #9ec6ad;
  border-radius: 12px;
  display: grid;
  justify-items: center;
  gap: .16rem;
  color: #edf9f1;
  background: linear-gradient(145deg, #103b2b, #1e6d4d);
  box-shadow: 0 18px 38px #0009;
  pointer-events: none;
  transform: translateX(-50%);
  animation: resolution-toast var(--resolution-duration, 1.5s) ease-out both;
}
.resolution-toast.blocked { color: #fff0ec; border-color: #e4948c; background: linear-gradient(145deg, #541c24, #a62d37); }
.resolution-toast.stolen { color: #fff7dc; border-color: #ebc45e; background: linear-gradient(145deg, #5d4412, #a87b20); }
.resolution-toast.victory { color: #fff7d7; border-color: #ffe18a; background: linear-gradient(145deg, #43300b, #b58625); }
.resolution-stamp { padding: .22rem .55rem; border: 2px solid currentColor; border-radius: 5px; font: 900 11px/1 Arial, sans-serif; letter-spacing: .12em; transform: rotate(-2deg); }
.resolution-toast b { font-size: 1.05rem; }
.resolution-toast small { font: 700 10px Arial, sans-serif; }
@keyframes resolution-toast { 0% { opacity: 0; transform: translate(-50%, -18px) scale(.78); } 24%, 75% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -14px) scale(.95); } }

/* Ważne momenty: Token, eliminacja i prezydentura. */
.power-metric { position: relative; overflow: visible; }
.token-delta { position: absolute; top: -8px; right: -4px; padding: .1rem .23rem; border-radius: 99px; color: #2d2105; background: #f1c958; font: 900 8px Arial, sans-serif; animation: token-delta-pulse var(--state-fx-duration, 1.2s) ease-out both; }
.token-flight {
  position: fixed;
  z-index: 145;
  padding: .34rem .5rem;
  border: 2px solid #fff2ad;
  border-radius: 99px;
  pointer-events: none;
  color: #2c2107;
  background: radial-gradient(circle at 35% 25%, #fff3a6, #d9a62f 72%);
  box-shadow: 0 0 20px #f4c955aa, 0 8px 18px #0006;
  font: 900 12px/1 Arial, sans-serif;
  animation: token-flight var(--state-fx-duration, 1.2s) cubic-bezier(.2,.72,.25,1) both;
}
.player.just-eliminated { animation: player-eliminated var(--state-fx-duration, 1.2s) ease-out both; }
.pawn.just-eliminated { animation: pawn-eliminated var(--state-fx-duration, 1.2s) ease-out both; }
.elimination-banner { position: fixed; z-index: 142; top: 12%; left: 50%; padding: .72rem 1.05rem; border: 1px solid #e49088; border-radius: 10px; color: #fff0ec; background: linear-gradient(145deg, #321319, #8f2831); box-shadow: 0 16px 35px #0009; pointer-events: none; font: 900 14px Arial, sans-serif; transform: translateX(-50%); animation: elimination-banner var(--state-fx-duration, 1.2s) ease-out both; }
@keyframes token-flight { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-12deg); } 18% { opacity: 1; } 78% { opacity: 1; transform: translate(calc(-50% + var(--token-x)), calc(-50% + var(--token-y))) scale(1.15) rotate(8deg); } 100% { opacity: 0; transform: translate(calc(-50% + var(--token-x)), calc(-50% + var(--token-y))) scale(.75) rotate(0); } }
@keyframes token-delta-pulse { 0% { opacity: 0; transform: scale(.6); } 35%, 75% { opacity: 1; transform: scale(1.12); } 100% { opacity: 0; transform: translateY(-7px); } }
@keyframes player-eliminated { 0% { opacity: 1; filter: none; transform: translateY(-2px); } 35% { filter: saturate(.2) brightness(.75); transform: translateX(-5px) rotate(-1deg); } 100% { opacity: .55; filter: grayscale(.85); transform: translateY(4px); } }
@keyframes pawn-eliminated { 0% { opacity: 1; transform: translateX(calc(-50% + var(--pawn-offset))) scale(1.2); } 45% { transform: translateX(calc(-50% + var(--pawn-offset))) scale(.82) rotate(18deg); } 100% { opacity: .72; transform: translateX(calc(-50% + var(--pawn-offset))) scale(1) rotate(0); } }
@keyframes elimination-banner { 0% { opacity: 0; transform: translate(-50%, -16px) scale(.75); } 25%, 72% { opacity: 1; transform: translate(-50%, 0) scale(1); } 100% { opacity: 0; transform: translate(-50%, -12px) scale(.94); } }

.celebration { min-height: 145px; display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; gap: .8rem; }
.celebration.is-new { animation: presidency-celebration 2.5s cubic-bezier(.2,.82,.28,1) both; }
.celebration.is-settled { animation: none; }
.celebration.is-settled .confetti { display: none; }
.celebration-copy { position: relative; z-index: 3; }
.presidential-seal { position: relative; z-index: 3; width: 102px; height: 102px; margin: auto; border: 3px double #ffe69a; border-radius: 50%; display: grid; place-content: center; color: #fff4c2; background: radial-gradient(circle, #b58425, #253743 70%); box-shadow: inset 0 0 0 5px #ffffff14, 0 0 25px #ffd96d6e; transform: rotate(-5deg); }
.presidential-seal span { font: 900 8px Arial, sans-serif; letter-spacing: .12em; }
.presidential-seal strong { font-size: 2.25rem; line-height: 1; }
.presidential-seal small { font: 800 10px Arial, sans-serif; }
.celebration.is-new .presidential-seal { animation: seal-stamp 1.15s cubic-bezier(.2,.82,.25,1.25) both; }
.celebration.game-win { min-height: 180px; background: radial-gradient(circle at 18% 50%, #ffe58a66, transparent 25%), radial-gradient(circle at 50% -20%, #fff0a5 0, transparent 35%), linear-gradient(135deg, #081722, #c08d28, #122b38); box-shadow: 0 0 0 3px #ffe28a75, 0 18px 42px #0008; }
.celebration.game-win .presidential-seal { width: 122px; height: 122px; }
.celebration.game-win h2 { font-size: 1.72rem; text-shadow: 0 3px 10px #0008; }
.celebration .confetti { z-index: 2; animation-duration: 2.2s; }
.celebration .confetti-1 { left: 5%; top: 4%; }
.celebration .confetti-2 { left: 18%; top: 3%; animation-delay: .18s; }
.celebration .confetti-3 { left: 42%; top: 1%; animation-delay: .35s; }
.celebration .confetti-4 { left: 58%; top: 7%; animation-delay: .12s; }
.celebration .confetti-5 { left: 72%; top: 2%; animation-delay: .45s; }
.celebration .confetti-6 { left: 86%; top: 5%; animation-delay: .24s; }
.celebration .confetti-7 { left: 94%; top: 16%; animation-delay: .58s; }
.celebration .confetti-8 { left: 64%; top: 18%; animation-delay: .7s; }
@keyframes presidency-celebration { 0% { opacity: 0; transform: scale(.78); filter: brightness(1.8); } 16% { opacity: 1; transform: scale(1.035); } 28%, 86% { transform: scale(1); filter: brightness(1); } 100% { transform: scale(1); } }
@keyframes seal-stamp { 0% { opacity: 0; transform: scale(2.4) rotate(-18deg); } 42% { opacity: 1; transform: scale(.92) rotate(-5deg); } 68% { transform: scale(1.08) rotate(-3deg); } 100% { transform: scale(1) rotate(-5deg); } }

@media (max-width: 560px) {
  .celebration { grid-template-columns: 1fr; }
  .presidential-seal { width: 84px; height: 84px; }
  .celebration.game-win .presidential-seal { width: 96px; height: 96px; }
}

html[data-motion="reduced"] *,
html[data-motion="reduced"] *::before,
html[data-motion="reduced"] *::after {
  scroll-behavior: auto !important;
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}

/* Tajny cel można zasłonić przed przekazaniem ekranu innej osobie. */
.secret-goal {
  width: 100%;
  min-height: 104px;
  margin: .95rem 0 .15rem;
  padding: .7rem .75rem;
  border: 1px solid #d8bd78;
  border-left: 4px solid #b98927;
  border-radius: 10px;
  display: grid;
  align-content: start;
  gap: .34rem;
  color: #27363d;
  text-align: left;
  background: linear-gradient(145deg, #fff8db, #efe0b5);
  box-shadow: inset 0 1px #fff, 0 4px 10px #4a35151d;
}
.secret-goal:hover:not(:disabled) { transform: translateY(-1px); border-color: #b78622; box-shadow: 0 8px 16px #4933142b; }
.secret-goal-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem; color: #614a1f; font: 800 10px/1.2 Arial, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
.secret-goal-heading i { width: 25px; height: 25px; flex: 0 0 25px; border: 1px solid #b78b35; border-radius: 50%; display: grid; place-items: center; color: #755311; background: #fff8df; font: 900 12px/1 Arial, sans-serif; font-style: normal; }
.secret-goal-text { color: #27363d; font: 700 12px/1.38 Arial, sans-serif; }
.secret-goal small { color: #76684b; font: 700 8px/1.2 Arial, sans-serif; letter-spacing: .04em; text-transform: uppercase; }
.secret-goal.is-hidden {
  min-height: 61px;
  padding: .5rem .62rem;
  border: 1px dashed #bcb7aa;
  border-left: 2px solid #9c978b;
  color: #696d6c;
  background: linear-gradient(145deg, #f4f1e9, #e9e5dc);
  box-shadow: none;
  opacity: .76;
}
.secret-goal.is-hidden:hover:not(:disabled) { opacity: 1; border-color: #948a73; box-shadow: 0 3px 8px #2c302e14; }
.secret-goal.is-hidden .secret-goal-heading { color: #666b69; letter-spacing: .04em; }
.secret-goal.is-hidden .secret-goal-text { display: none; }
.secret-goal.is-hidden small { color: #81827d; font-weight: 600; text-transform: none; }
.secret-goal.is-hidden .secret-goal-heading i { width: 21px; height: 21px; flex-basis: 21px; color: #77766f; border-color: #aaa69a; background: #f9f6ef; font-size: 10px; }
.secret-goal.is-empty { min-height: 82px; opacity: .72; }

/* Menu główne i nawigacja poza rozgrywką. */
[hidden] { display: none !important; }
.topbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem; }
.mode-badge {
  padding: .34rem .62rem;
  border: 1px solid #d7b45c7a;
  border-radius: 99px;
  color: #f6dc93;
  background: #020a104f;
  font: 800 9px/1 Arial, sans-serif;
  letter-spacing: .11em;
}
.menu-return { min-width: 132px; color: #f9ebc7; border-color: #d7b45c55; background: linear-gradient(145deg, #263c48, #101e27); }
.menu-return span { margin-right: .24rem; }
.app-stage { min-height: calc(100vh - 88px); }
.menu-screen { width: min(1040px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(2.2rem, 7vh, 5.5rem) 0 3rem; color: #fff9ea; }
.menu-hero { max-width: 710px; margin-bottom: 1.9rem; }
.menu-hero h2,
.menu-panel h2 { margin: .2rem 0 .5rem; color: #fff8e6; font-size: clamp(2rem, 5vw, 3.8rem); line-height: 1.04; letter-spacing: -.035em; text-shadow: 0 5px 18px #0008; }
.menu-hero > p:last-child { max-width: 650px; margin: .75rem 0 0; color: #cbd5d7; font-size: 1.05rem; }
.menu-kicker { margin: 0; color: #e4c373; font: 800 10px/1.2 Arial, sans-serif; letter-spacing: .2em; }
.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.mode-option {
  position: relative;
  min-height: 132px;
  padding: 1.15rem 1.2rem;
  border: 1px solid #ddc78655;
  border-radius: 16px;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: .9rem;
  overflow: hidden;
  color: #fff9ea;
  text-align: left;
  background: linear-gradient(145deg, #1d3442ed, #0b1922f5);
  box-shadow: 0 18px 42px #0006, inset 0 1px #ffffff0d;
}
.mode-option::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: #d4a23a; }
.mode-option.hotseat::before { background: #4b8cb2; }
.mode-option.multiplayer::before { background: #3b9b76; }
.mode-option.multiplayer .mode-icon { color: #9de2bf; border-color: #6bc99d66; }
.mode-option.settings { min-height: 132px; background: linear-gradient(145deg, #24343d, #101b22); }
.mode-option.settings::before { background: #8d74ae; }
.mode-option:hover:not(:disabled) { transform: translateY(-4px); box-shadow: 0 23px 48px #0008, 0 0 0 1px #f4d68155; }
.mode-option > span:nth-child(2) { min-width: 0; display: grid; gap: .2rem; }
.mode-option b { color: #fff6de; font: 800 1.18rem/1.15 Arial, sans-serif; }
.mode-option small { color: #bfcdd0; font: 12px/1.42 Arial, sans-serif; }
.mode-option > i { color: #e7c56e; font: 700 1.35rem/1 Arial, sans-serif; font-style: normal; transition: transform .18s ease; }
.mode-option:hover > i { transform: translateX(4px); }
.mode-icon {
  width: 54px;
  height: 54px;
  border: 1px solid #f2d27766;
  border-radius: 14px;
  display: grid !important;
  place-items: center;
  color: #f5d97f;
  background: #020a104d;
  font: 800 1.35rem/1 Arial, sans-serif;
  letter-spacing: -.35em;
  text-indent: -.35em;
}
.mode-option.singleplayer .mode-icon,
.mode-option.settings .mode-icon { letter-spacing: normal; text-indent: 0; }
.menu-panel {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
  padding: clamp(1.2rem, 4vw, 2.2rem);
  border: 1px solid #d9bd6d70;
  border-radius: 19px;
  color: #eef4f2;
  background: linear-gradient(145deg, #172c38f7, #091720fa);
  box-shadow: 0 25px 65px #0009, inset 0 1px #ffffff10;
}
.menu-panel h2 { margin-top: .3rem; font-size: clamp(1.8rem, 4vw, 2.65rem); }
.screen-description { max-width: 620px; margin: .5rem 0 1.4rem; color: #bfcdd0; }
.screen-back { margin: 0 0 1.7rem; padding: .42rem .65rem; color: #e5dac0; border-color: #ffffff1c; background: #07111877; }
.config-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .85rem; }
.config-grid label { color: #d9d2bf; font-size: 9px; }
.config-grid input,
.config-grid select { width: 100%; min-height: 43px; border-color: #dcc67d7d; background: #fffaf0; }
.extra-player-names { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.screen-actions { display: flex; justify-content: flex-end; gap: .65rem; margin-top: 1.25rem; }
.menu-primary { min-width: 190px; color: #2c2109; border-color: #ffebb0; background: linear-gradient(145deg, #f3cd6c, #b9811c); }
.menu-primary span { margin-left: .4rem; }
.motion-setting {
  padding: 1rem;
  border: 1px solid #d7c08055;
  border-radius: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 1rem;
  background: #ffffff08;
}
.motion-setting > span { display: grid; gap: .25rem; }
.motion-setting b { color: #fff5da; font: 800 14px Arial, sans-serif; }
.motion-setting small { color: #bdc9ca; font: 11px/1.4 Arial, sans-serif; }
.motion-setting select { min-height: 43px; padding: .55rem; border: 1px solid #d9c37c; border-radius: 8px; color: #172832; background: #fff9e9; font: 700 13px Arial, sans-serif; }
.motion-preview { height: 70px; margin-top: 1rem; border: 1px solid #ffffff12; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 11px; overflow: hidden; background: linear-gradient(90deg, #0a161d, #1c3441, #0a161d); }
.motion-preview span { width: 28px; height: 40px; border: 1px solid #ffe1927a; border-radius: 5px; background: linear-gradient(145deg, #9b3037, #4b1920); box-shadow: 0 7px 12px #0007; animation: menu-card-preview 2.5s ease-in-out infinite; }
.motion-preview span:nth-child(2) { background: linear-gradient(145deg, #2c805e, #103f31); animation-delay: .18s; }
.motion-preview span:nth-child(3) { background: linear-gradient(145deg, #3d73aa, #1a365e); animation-delay: .36s; }
@keyframes menu-card-preview { 0%, 100% { transform: translateY(4px); } 45% { transform: translateY(-7px); box-shadow: 0 13px 17px #0008; } }
.menu-confirm-overlay { position: fixed; z-index: 250; inset: 0; padding: 1rem; display: grid; place-items: center; background: #02070bd9; backdrop-filter: blur(5px); }
.menu-confirm { width: min(440px, 100%); padding: 1.5rem; border: 1px solid #d6b65d77; border-radius: 16px; color: #f7f0df; text-align: center; background: linear-gradient(145deg, #1b303b, #0b171f); box-shadow: 0 25px 70px #000c; }
.menu-confirm h2 { margin: .65rem 0 .4rem; font-size: 1.4rem; }
.menu-confirm p { margin: 0; color: #becacc; font-size: .9rem; }
.confirm-mark { width: 42px; height: 42px; margin: auto; border: 1px solid #e9c66a; border-radius: 50%; display: grid; place-items: center; color: #ffe18b; background: #6e4a104d; font: 900 1.2rem Arial, sans-serif; }
.menu-confirm .screen-actions { justify-content: center; }
.menu-confirm .danger { border-color: #d88982; background: linear-gradient(145deg, #a43a40, #5a1d25); }

/* Lobby i pokoje Multiplayer internet/LAN. */
.multiplayer-panel { width: min(900px, 100%); }
.network-server-status { margin: .75rem 0 1rem; padding: .65rem .8rem; border: 1px solid #4da67e66; border-radius: 9px; display: grid; grid-template-columns: 18px auto minmax(0, 1fr); align-items: center; gap: .35rem .5rem; color: #cfe8dc; background: #16372f80; font: 11px/1.35 Arial, sans-serif; }
.network-server-status > span { color: #62d69d; }
.network-server-status small { color: #9ebcb1; }
.network-server-status.checking { border-color: #ba913866; background: #4d3b1680; }
.network-server-status.checking > span { color: #e5bd5f; animation: network-wait-pulse 1.4s ease-in-out infinite; }
.network-server-status.error { border-color: #b84a5266; color: #ffd6d4; background: #54222980; }
.network-server-status.error > span { color: #eb737a; }
.network-warning { margin: 1rem 0; padding: .85rem 1rem; border: 1px solid #d09a50; border-left: 4px solid #d08b32; border-radius: 9px; color: #ffe9bd; background: #6b451c3d; }
.network-warning p { margin: .3rem 0 0; color: #d8cfbb; font-size: .86rem; }
.network-warning code { color: #fff0bb; }
.network-resume-card {
  margin: 0 0 1rem;
  padding: .9rem 1rem;
  border: 1px solid #62b68d73;
  border-left: 4px solid #4ba77c;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: .8rem;
  background: linear-gradient(135deg, #173c36cc, #102a30d9);
  box-shadow: inset 0 1px #ffffff0d, 0 8px 22px #0003;
}
.network-resume-icon { width: 40px; height: 40px; border: 1px solid #74c69d66; border-radius: 50%; display: grid; place-items: center; color: #a9e5c6; background: #071a1973; font: 900 1.35rem/1 Arial, sans-serif; }
.network-resume-copy { min-width: 0; display: grid; gap: .2rem; }
.network-resume-copy small { color: #82d3aa; font: 800 8px/1 Arial, sans-serif; letter-spacing: .14em; }
.network-resume-copy strong { color: #f3f2df; font: 800 14px/1.25 Arial, sans-serif; }
.network-resume-copy strong b { color: #aee8c9; letter-spacing: .08em; }
.network-resume-copy > span { color: #b8cac5; font: 11px/1.35 Arial, sans-serif; }
.network-resume-card .menu-primary { min-width: 155px; }
.network-entry-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.network-card { position: relative; padding: 1rem; border: 1px solid #d8bd6b4d; border-radius: 14px; display: grid; align-content: start; gap: .75rem; background: #ffffff08; }
.network-card h3 { margin: 0; color: #fff3d3; font-size: 1.05rem; }
.network-card-copy { min-height: 2.5em; margin: -.25rem 0 0; color: #aebfba; font: 11px/1.4 Arial, sans-serif; }
.network-card label { display: grid; gap: .25rem; color: #c8d1ce; font: 700 9px Arial, sans-serif; letter-spacing: .07em; text-transform: uppercase; }
.network-card input,
.network-card select { width: 100%; min-height: 43px; padding: .55rem .65rem; border: 1px solid #cdbb806e; border-radius: 8px; color: #172832; background: #fff9e9; font: 700 13px Arial, sans-serif; }
.network-card-icon { width: 38px; height: 38px; border: 1px solid #d8bb6d66; border-radius: 10px; display: grid; place-items: center; color: #eed17c; background: #06111780; font: 900 1.05rem Arial, sans-serif; }
.room-code-input { font-size: 1.25rem !important; letter-spacing: .18em; text-align: center; }
.network-quick-help { margin-top: 1rem; padding: .7rem .8rem; border: 1px solid #ffffff1a; border-radius: 9px; color: #c4d0cc; background: #ffffff08; font: 12px/1.5 Arial, sans-serif; }
.network-quick-help summary { color: #f0d68b; cursor: pointer; font-weight: 800; }
.network-quick-help ol { margin: .55rem 0 0; padding-left: 1.25rem; }
.room-code-block { padding: 1rem; border: 1px solid #e0c46b6b; border-radius: 13px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem 1rem; background: linear-gradient(145deg, #071820, #18343e); }
.room-code-block span { grid-column: 1; color: #d0bd84; font: 800 9px Arial, sans-serif; letter-spacing: .15em; }
.room-code-block strong { grid-column: 1; color: #ffe492; font: 900 clamp(2rem, 8vw, 3.6rem)/1 Arial, sans-serif; letter-spacing: .15em; }
.room-code-block button { grid-column: 2; grid-row: 1 / 3; }
.room-address { margin: .6rem 0 1.25rem; color: #b9c8c8; font: 12px Arial, sans-serif; }
.room-address b { color: #eef3e9; user-select: all; }
.room-security { display: inline-flex; margin-left: .35rem; padding: .12rem .35rem; border: 1px solid #66b98d55; border-radius: 99px; color: #9bdab8; background: #173b2e; font: 800 8px Arial, sans-serif; letter-spacing: .05em; text-transform: uppercase; }
.room-security.insecure { border-color: #d49b5555; color: #efc680; background: #4b351d; }
.network-invite { margin-top: .75rem; padding: .8rem; border: 1px solid #65ba9070; border-radius: 11px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: .65rem; background: linear-gradient(135deg, #123a31, #102b31); }
.network-invite-icon { width: 35px; height: 35px; border: 1px solid #7cd2a65e; border-radius: 50%; display: grid; place-items: center; color: #a9e8c8; background: #07191880; font-size: 1.1rem; }
.network-invite > span:nth-child(2) { min-width: 0; display: grid; gap: .14rem; }
.network-invite small { color: #82d3aa; font: 800 8px Arial, sans-serif; letter-spacing: .13em; }
.network-invite b { overflow: hidden; color: #f0f5e8; font: 700 11px Arial, sans-serif; text-overflow: ellipsis; white-space: nowrap; user-select: all; }
.network-invite em { color: #a8bbb5; font: 10px/1.3 Arial, sans-serif; font-style: normal; }
.network-invite .menu-primary { min-width: 165px; }
.lobby-heading { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.lobby-heading h2 { margin: 0; font-size: 1.4rem; }
.network-seat-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; margin-top: .75rem; }
.network-seat { min-width: 0; padding: .62rem .68rem; border: 1px solid #ffffff1a; border-left: 3px solid #4da67e; border-radius: 9px; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: .55rem; background: #ffffff08; }
.network-seat.bot { border-left-color: #ba9138; }
.network-seat.disconnected { border-left-color: #a94a4f; opacity: .72; }
.network-seat > span:nth-child(2) { display: grid; gap: .12rem; min-width: 0; }
.network-seat b { overflow: hidden; color: #f4eee0; font: 800 12px Arial, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.network-seat small { color: #96aaa9; font: 800 8px Arial, sans-serif; letter-spacing: .06em; }
.network-seat > i { color: #6ad39f; font-style: normal; }
.network-seat.bot > i { color: #e1bc61; }
.network-seat.disconnected > i { color: #d86c72; }
.seat-number { width: 27px; height: 27px; border: 1px solid #ffffff24; border-radius: 50%; display: grid; place-items: center; color: #d8c993; background: #07121977; font: 900 10px Arial, sans-serif; }
.network-host-controls { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.network-host-controls .menu-primary { margin-left: auto; }
.network-lobby-hint { margin: .8rem 0 0; padding: .55rem .7rem; border-radius: 7px; color: #bdc9c6; background: #ffffff07; font: 12px/1.4 Arial, sans-serif; }
.network-message { min-height: 1.4rem; margin: .8rem 0 0; color: #9ed9b9; font: 700 11px/1.4 Arial, sans-serif; }
.network-message.error { color: #f0a29e; }
.mode-badge.connection-lost { border-color: #d56d72; color: #ffd0cd; background: #66282e; animation: network-wait-pulse 1.4s ease-in-out infinite; }
.network-wait { min-height: 260px; display: grid; place-content: center; justify-items: center; text-align: center; }
.network-wait > span { width: 52px; height: 52px; border: 1px solid #d2ad5f; border-radius: 50%; display: grid; place-items: center; color: #936d1f; background: #fff1c9; font-size: 1.5rem; animation: network-wait-pulse 1.8s ease-in-out infinite; }
.network-wait p { max-width: 420px; color: #67736f; }
.network-preview { border-color: #6da18d; border-left-color: #34765c; background: #eef8f3; }
@keyframes network-wait-pulse { 0%,100% { transform: scale(.92); opacity: .72; } 50% { transform: scale(1); opacity: 1; } }

@media (max-width: 700px) {
  .menu-screen { padding-top: 2rem; }
  .mode-grid { grid-template-columns: 1fr; }
  .mode-option.settings { grid-column: auto; }
  .config-grid,
  .extra-player-names { grid-template-columns: 1fr; }
  .motion-setting { grid-template-columns: 1fr; }
  .network-entry-grid,
  .network-seat-list { grid-template-columns: 1fr; }
  .network-resume-card { grid-template-columns: 38px minmax(0, 1fr); }
  .network-resume-card .menu-primary { grid-column: 1 / -1; width: 100%; }
  .network-server-status { grid-template-columns: 16px minmax(0, 1fr); }
  .network-server-status small { grid-column: 2; }
  .room-code-block { grid-template-columns: 1fr; }
  .room-code-block button { grid-column: 1; grid-row: auto; }
  .network-invite { grid-template-columns: 34px minmax(0, 1fr); }
  .network-invite .menu-primary { grid-column: 1 / -1; width: 100%; }
  .network-host-controls { flex-direction: column; }
  .network-host-controls button { width: 100%; }
  .topbar-actions { width: 100%; justify-content: space-between; }
}

@media (max-width: 470px) {
  .mode-option { min-height: 112px; grid-template-columns: 46px minmax(0, 1fr) auto; padding: .9rem; }
  .mode-icon { width: 44px; height: 44px; font-size: 1.05rem; }
  .menu-hero h2 { font-size: 2.15rem; }
  .mode-badge { display: none; }
  .menu-return { width: 100%; }
  .screen-actions { flex-direction: column-reverse; }
  .screen-actions button { width: 100%; }
}
