:root {
  --bg: #080d19;
  --bg2: #0e1527;
  --card: #141d31;
  --card2: #18243b;
  --line: rgba(255,255,255,.09);
  --text: #f7f9ff;
  --muted: #8995ab;
  --accent: #6d7cff;
  --accent2: #8490ff;
  --green: #3bd38a;
  --danger: #ff6174;
  --radius: 22px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.app {
  width: 100%;
  height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% -20%, rgba(109,124,255,.22), transparent 35%),
    var(--bg);
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  opacity: 0;
  transform: translateX(18px);
}

.screen.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateX(0);
  animation: screenIn .22s ease;
}

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

.welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
  gap: 30px;
}

.brand {
  text-align: center;
  font-weight: 950;
  letter-spacing: .2em;
  font-size: clamp(40px, 12vw, 64px);
}

.brand-sub {
  text-align: center;
  color: var(--muted);
  margin-top: -24px;
}

.card,
.login-card,
.game-card,
.chat-card {
  background: linear-gradient(180deg, rgba(24,36,59,.96), rgba(15,23,40,.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 60px rgba(0,0,0,.25);
}

.login-card {
  padding: 24px;
}

.login-card h1 {
  margin: 0 0 7px;
}

.login-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0 0 20px;
}

.input {
  width: 100%;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #0d1424;
  color: white;
  padding: 0 15px;
}

.input:focus {
  border-color: rgba(109,124,255,.8);
  box-shadow: 0 0 0 3px rgba(109,124,255,.12);
}

.input.big {
  height: 57px;
  font-size: 18px;
}

.btn {
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  transition: transform .12s ease, opacity .12s ease;
}

.btn:active {
  transform: scale(.97);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--accent), #535fff);
  box-shadow: 0 10px 30px rgba(83,95,255,.24);
}

.btn.secondary {
  color: white;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
}

.btn.big {
  min-height: 55px;
  margin-top: 13px;
}

.topbar,
.game-topbar {
  flex: 0 0 auto;
  min-height: calc(70px + env(safe-area-inset-top));
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: rgba(8,13,25,.92);
  backdrop-filter: blur(18px);
  z-index: 5;
}

.logo {
  font-size: 22px;
  font-weight: 950;
  letter-spacing: .14em;
}

.online {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 10px rgba(59,211,138,.7);
}

.nick {
  padding: 8px 12px;
  background: rgba(255,255,255,.06);
  border-radius: 12px;
  font-size: 13px;
  color: #dfe5ff;
}

.scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 15px calc(25px + env(safe-area-inset-bottom));
}

.section-title {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  margin: 2px 4px 11px;
}

.game-card {
  padding: 18px;
  margin-bottom: 14px;
}

.game-icon {
  font-size: 35px;
  margin-bottom: 10px;
}

.game-info h2 {
  margin: 0;
  font-size: 19px;
}

.game-info p {
  margin: 7px 0 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.waiting {
  font-size: 12px;
  color: var(--green);
  margin-bottom: 15px;
}

.game-card .btn {
  margin-top: 8px;
}

.chat-card {
  margin-top: 20px;
  overflow: hidden;
}

.chat-head {
  height: 54px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.chat-head span {
  color: var(--muted);
  font-size: 12px;
}

.messages {
  height: 250px;
  overflow-y: auto;
  padding: 13px;
}

.message {
  margin: 0 0 10px;
  line-height: 1.35;
  font-size: 14px;
  word-break: break-word;
}

.message .author {
  color: var(--accent2);
  font-weight: 800;
  margin-right: 6px;
}

.message.system {
  color: var(--muted);
  font-style: italic;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
}

.send-btn {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 15px;
  background: var(--accent);
  color: white;
  font-size: 20px;
}

.game-topbar {
  min-height: calc(62px + env(safe-area-inset-top));
}

.icon-btn {
  width: 43px;
  height: 43px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: white;
  font-size: 20px;
}

.game-title-wrap {
  text-align: center;
}

.game-title {
  font-weight: 850;
}

.room-code {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.players-bar {
  min-height: 46px;
  padding: 8px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  background: var(--bg2);
}

.player-chip {
  flex: 1;
  text-align: center;
  padding: 7px 9px;
  border-radius: 11px;
  background: rgba(255,255,255,.05);
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-chip.me {
  outline: 1px solid rgba(109,124,255,.55);
}

.game-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
}

.game-status {
  width: 100%;
  min-height: 38px;
  text-align: center;
  color: #dbe1f2;
  font-size: 14px;
  font-weight: 700;
  padding: 8px;
}

.waiting-room {
  width: min(92vw, 430px);
  margin: auto;
  text-align: center;
  padding: 30px 20px;
}

.waiting-room p {
  color: var(--muted);
}

.invite-link {
  margin: 13px 0;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  font-size: 12px;
  word-break: break-all;
}

.spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid rgba(255,255,255,.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.ultimate-board {
  width: min(94vw, 520px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 5px;
  border-radius: 20px;
  background: rgba(255,255,255,.11);
  animation: boardAppear .25s ease;
}

@keyframes boardAppear {
  from { opacity: .3; transform: scale(.97); }
  to { opacity: 1; transform: scale(1); }
}

.small-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,.09);
  border-radius: 11px;
  overflow: hidden;
  transition: opacity .15s, box-shadow .15s, transform .15s;
}

.small-board.locked {
  opacity: .38;
}

.small-board.active-board {
  box-shadow: 0 0 0 3px var(--accent), 0 0 24px rgba(109,124,255,.32);
  transform: scale(.985);
}

.ultimate-cell {
  border: 0;
  background: #10182a;
  color: white;
  min-width: 0;
  min-height: 0;
  padding: 0;
  font-size: clamp(17px, 7vw, 34px);
  font-weight: 900;
}

.ultimate-cell:active {
  background: #1b2742;
}

.small-winner {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  background: rgba(11,16,32,.92);
  font-size: clamp(46px, 16vw, 95px);
  font-weight: 950;
  animation: winPop .3s ease;
}

@keyframes winPop {
  from { opacity: 0; transform: scale(.6); }
  to { opacity: 1; transform: scale(1); }
}

.soccer-wrap {
  width: min(92vw, 430px);
  aspect-ratio: 9 / 14;
  max-height: calc(100dvh - 190px);
}

#soccerCanvas {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 18px;
  background-image: url('/boisko.jpg');
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  touch-action: none;
}

.game-over {
  width: min(92vw, 430px);
  padding: 20px 10px;
  text-align: center;
}

.game-over-title {
  font-size: 26px;
  font-weight: 950;
  margin: 10px 0;
}

.game-chat {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  transform: translateY(105%);
  background: #101829;
  border-radius: 24px 24px 0 0;
  border-top: 1px solid var(--line);
  transition: transform .22s ease;
  padding-bottom: env(safe-area-inset-bottom);
}

.game-chat.open {
  transform: translateY(0);
}

.chat-drawer-head {
  height: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 13px 8px 17px;
  border-bottom: 1px solid var(--line);
}

.room-messages {
  height: min(42vh, 330px);
}

.shade {
  position: absolute;
  inset: 0;
  z-index: 15;
  background: rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transition: .2s;
}

.shade.show {
  opacity: 1;
  visibility: visible;
}

.queue-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 25px;
  background: rgba(4,7,14,.88);
  backdrop-filter: blur(12px);
}

.queue-box {
  width: min(100%, 360px);
  padding: 28px;
  text-align: center;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
}

.queue-box p {
  color: var(--muted);
}

.toast {
  position: fixed;
  z-index: 200;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translate(-50%, 25px);
  width: max-content;
  max-width: calc(100vw - 30px);
  padding: 11px 16px;
  border-radius: 13px;
  background: #eef1ff;
  color: #101525;
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  pointer-events: none;
  transition: .2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.desktop-block {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 30px;
  background:
    radial-gradient(circle at 30% 20%, #182347, transparent 40%),
    #080d19;
}

.desktop-card {
  max-width: 560px;
  text-align: center;
}

.logo-big {
  font-size: 70px;
  font-weight: 950;
  letter-spacing: .18em;
}

.desktop-card h1 {
  font-size: 34px;
}

.desktop-card p {
  color: #dce3f7;
  font-size: 18px;
}

.desktop-card .muted {
  color: var(--muted);
}


/* ================================
   GRACZE ONLINE / ZAPROSZENIA
   ================================ */

.online-card {
  margin: 18px 0;
  background:
    linear-gradient(
      180deg,
      rgba(24,36,59,.96),
      rgba(15,23,40,.96)
    );
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.players-toggle {
  width: 100%;
  min-height: 62px;
  border: 0;
  padding: 12px 17px;
  color: var(--text);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: left;
}

.players-toggle strong {
  display: block;
  font-size: 15px;
}

#playersOnlineInfo {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

#playersArrow {
  color: var(--muted);
  font-size: 22px;
  transition: transform .18s ease;
}

.players-toggle.open #playersArrow {
  transform: rotate(180deg);
}

.players-panel {
  padding: 0 12px 12px;
}

.online-player-list {
  margin-top: 9px;
  max-height: 300px;
  overflow-y: auto;
}

.online-player-row {
  min-height: 58px;
  padding: 8px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--line);
}

.online-player-row:last-child {
  border-bottom: 0;
}

.online-player-data {
  min-width: 0;
  flex: 1;
}

.online-player-name {
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-player-status {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.online-player-status.available {
  color: var(--green);
}

.invite-buttons {
  display: flex;
  gap: 5px;
}

.invite-mini-btn {
  height: 36px;
  min-width: 44px;
  padding: 0 9px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.07);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

.invite-mini-btn:active {
  transform: scale(.95);
}

.player-empty {
  padding: 18px 7px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.room-invite-box {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.room-invite-title {
  margin-bottom: 9px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.room-player-list {
  max-height: 180px;
}

.invite-game-name {
  margin: 16px 0 20px;
  padding: 13px;
  border-radius: 14px;
  background: rgba(109,124,255,.13);
  border: 1px solid rgba(109,124,255,.28);
  font-weight: 850;
}

.invite-icon,
.leave-symbol {
  margin-bottom: 10px;
  font-size: 42px;
}

.opponent-left-box p,
.invite-box p {
  color: var(--muted);
  line-height: 1.45;
}


/* ================================
   MENU / KONTAKT
   ================================ */

.top-actions,
.game-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-shade {
  position: fixed;
  inset: 0;
  z-index: 290;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(3px);
  opacity: 0;
  visibility: hidden;
  transition: .2s;
}

.menu-shade.show {
  opacity: 1;
  visibility: visible;
}

.munit-menu {
  position: fixed;
  z-index: 300;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(86vw, 350px);
  padding:
    calc(15px + env(safe-area-inset-top))
    14px
    calc(20px + env(safe-area-inset-bottom));
  background: #101829;
  border-left: 1px solid var(--line);
  box-shadow: -20px 0 60px rgba(0,0,0,.35);
  transform: translateX(105%);
  transition: transform .22s ease;
}

.munit-menu.open {
  transform: translateX(0);
}

.menu-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3px 14px;
  border-bottom: 1px solid var(--line);
}

.menu-logo {
  font-size: 20px;
  font-weight: 950;
  letter-spacing: .14em;
}

.menu-sub {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.menu-item {
  width: 100%;
  margin-top: 13px;
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.045);
  color: white;
  text-align: left;
}

.menu-item-icon {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(109,124,255,.14);
  font-size: 20px;
}

.menu-item > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}

.menu-item strong {
  display: block;
  font-size: 14px;
}

.menu-item small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.menu-chevron {
  color: var(--muted);
  font-size: 24px;
}

.contact-overlay {
  position: fixed;
  inset: 0;
  z-index: 400;
  padding:
    calc(15px + env(safe-area-inset-top))
    14px
    calc(15px + env(safe-area-inset-bottom));
  display: flex;
  align-items: flex-end;
  background: rgba(3,6,13,.8);
  backdrop-filter: blur(8px);
}

.contact-modal {
  width: 100%;
  max-height: 92dvh;
  overflow-y: auto;
  padding: 19px;
  border-radius: 25px;
  background: #121b2d;
  border: 1px solid var(--line);
  box-shadow: 0 25px 80px rgba(0,0,0,.45);
  animation: contactIn .22s ease;
}

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

.contact-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 19px;
}

.contact-modal-head h2 {
  margin: 0;
  font-size: 21px;
}

.contact-modal-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.form-label {
  display: flex;
  justify-content: space-between;
  margin: 14px 3px 7px;
  font-size: 12px;
  font-weight: 800;
}

.form-label span {
  color: var(--muted);
  font-weight: 500;
}

.email-info {
  margin: 7px 3px 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.contact-textarea {
  width: 100%;
  min-height: 145px;
  resize: vertical;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: none;
  background: #0d1424;
  color: white;
  font: inherit;
  line-height: 1.45;
}

.contact-textarea:focus {
  border-color: rgba(109,124,255,.8);
  box-shadow: 0 0 0 3px rgba(109,124,255,.12);
}

.contact-trap {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
}

/* =========================================
   ULTIMATE TIC TAC TOE - POPRAWIONA PLANSZA
   ========================================= */

.ultimate-board {
  width: min(94vw, 520px) !important;
  aspect-ratio: 1 / 1 !important;

  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-template-rows: repeat(3, 1fr) !important;

  /* GRUBE LINIE MIĘDZY 9 GŁÓWNYMI POLAMI */
  gap: 7px !important;

  padding: 7px !important;

  background: rgba(190, 200, 230, .32) !important;

  border: 2px solid rgba(210, 220, 245, .30) !important;
  border-radius: 18px !important;

  overflow: hidden !important;
}

.small-board {
  position: relative !important;

  width: 100% !important;
  height: 100% !important;

  min-width: 0 !important;
  min-height: 0 !important;

  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  grid-template-rows: repeat(3, 1fr) !important;

  /* CIENKIE LINIE WEWNĄTRZ MAŁEJ PLANSZY */
  gap: 2px !important;

  background: rgba(150, 165, 200, .35) !important;

  border-radius: 8px !important;

  overflow: hidden !important;

  /* NIGDY NIE ZMIENIAMY ROZMIARU */
  transform: none !important;

  transition:
    opacity .15s ease,
    box-shadow .15s ease,
    outline-color .15s ease !important;
}

/* POLE 1 Z 9 WEWNĄTRZ MAŁEJ PLANSZY */
.ultimate-cell {
  width: 100% !important;
  height: 100% !important;

  min-width: 0 !important;
  min-height: 0 !important;

  margin: 0 !important;
  padding: 0 !important;

  border: 0 !important;
  border-radius: 0 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: #111a2c !important;

  color: #f4f6ff !important;

  font-size: clamp(18px, 7vw, 35px) !important;
  line-height: 1 !important;
  font-weight: 900 !important;

  transform: none !important;

  transition:
    background .1s ease,
    color .1s ease !important;
}

/* KLIK NIE ZMIENIA ROZMIARU */
.ultimate-cell:active {
  transform: none !important;
  background: #18243b !important;
}

/* DOZWOLONA PLANSZA */
.small-board.active-board {
  transform: none !important;

  opacity: 1 !important;

  outline: 3px solid #6d7cff !important;
  outline-offset: -3px !important;

  box-shadow:
    0 0 0 1px rgba(109,124,255,.35),
    0 0 18px rgba(109,124,255,.26) !important;
}

/* NIEDOZWOLONE PLANSZE - NIE ZMNIEJSZAMY ICH */
.small-board.locked {
  transform: none !important;
  opacity: .42 !important;
}

/* WYGRANA MAŁA PLANSZA */
.small-winner {
  position: absolute !important;
  inset: 0 !important;

  z-index: 5 !important;

  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  background: rgba(10,16,29,.94) !important;

  font-size: clamp(44px, 15vw, 90px) !important;
  line-height: 1 !important;
  font-weight: 950 !important;

  pointer-events: none !important;
}

/* NA BARDZO MAŁYCH TELEFONACH */
@media (max-width: 380px) {
  .ultimate-board {
    gap: 5px !important;
    padding: 5px !important;
  }

  .small-board {
    gap: 1px !important;
  }
}


/* =====================================
   GRACZE ONLINE W GÓRNYM MENU
   ===================================== */

.players-top-wrap {
  position: relative;
}

.players-top-btn {
  height: 43px;
  min-width: 58px;
  padding: 0 12px;

  border: 1px solid var(--line);
  border-radius: 14px;

  background: rgba(255,255,255,.06);
  color: white;

  font-size: 14px;
  font-weight: 800;
}

.players-top-btn:active {
  transform: scale(.96);
}

.players-top-panel {
  position: fixed;

  top: calc(78px + env(safe-area-inset-top));
  right: 14px;

  z-index: 150;

  width: min(88vw, 350px);
  max-height: 65dvh;

  padding: 14px;

  border-radius: 20px;
  border: 1px solid var(--line);

  background: #111a2c;

  box-shadow:
    0 22px 70px rgba(0,0,0,.55);
}

.players-top-title {
  margin: 2px 3px 12px;

  font-size: 15px;
  font-weight: 900;
}

.players-top-panel .online-player-list {
  max-height: 48dvh;
  margin-top: 10px;
  overflow-y: auto;
}

/* stary duży blok nie jest już potrzebny */
.online-card {
  display: none !important;
}

@media (max-width: 390px) {

  .nick {
    max-width: 82px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .players-top-btn {
    min-width: 51px;
    padding: 0 9px;
  }
}


/* =========================================================
   MUNIT 2026 — MODERN MOBILE UI
   ========================================================= */

:root {
  --bg: #070a12;
  --bg2: #0b0f1a;

  --card: rgba(18, 24, 40, .78);
  --card-strong: rgba(24, 31, 51, .94);

  --text: #f7f8fc;
  --muted: #8f98aa;

  --line: rgba(255,255,255,.075);

  --accent: #6c63ff;
  --accent2: #8b7cff;

  --green: #39d98a;
  --danger: #ff647c;

  --radius: 24px;
}


/* ---------- TŁO ---------- */

html,
body {
  background:
    radial-gradient(
      circle at 15% -10%,
      rgba(89, 80, 255, .20),
      transparent 35%
    ),
    radial-gradient(
      circle at 100% 20%,
      rgba(42, 153, 255, .10),
      transparent 28%
    ),
    #070a12 !important;
}

.app {
  background:
    radial-gradient(
      circle at 20% -5%,
      rgba(105, 88, 255, .15),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #090d17 0%,
      #070a12 100%
    ) !important;
}


/* ---------- HEADER ---------- */

.topbar,
.game-topbar {
  min-height: calc(76px + env(safe-area-inset-top)) !important;

  padding:
    calc(13px + env(safe-area-inset-top))
    16px
    13px !important;

  background: rgba(8, 12, 21, .72) !important;

  border-bottom:
    1px solid rgba(255,255,255,.065) !important;

  backdrop-filter:
    blur(22px)
    saturate(140%) !important;

  -webkit-backdrop-filter:
    blur(22px)
    saturate(140%) !important;
}

.logo {
  font-size: 25px !important;
  font-weight: 950 !important;

  letter-spacing: .18em !important;

  background:
    linear-gradient(
      135deg,
      #ffffff,
      #b8bdff
    );

  -webkit-background-clip: text;
  background-clip: text;

  color: transparent !important;
}

.online {
  margin-top: 5px !important;

  font-size: 11px !important;
  font-weight: 650 !important;

  color: #9099aa !important;
}

.dot {
  width: 8px !important;
  height: 8px !important;

  background: #36d98d !important;

  box-shadow:
    0 0 0 4px rgba(54,217,141,.08),
    0 0 14px rgba(54,217,141,.45) !important;
}


/* ---------- NICK ---------- */

.nick {
  height: 43px !important;

  display: flex !important;
  align-items: center !important;

  padding: 0 14px !important;

  border:
    1px solid rgba(255,255,255,.06) !important;

  border-radius: 15px !important;

  background:
    rgba(255,255,255,.055) !important;

  color: #e7e9f2 !important;

  font-size: 13px !important;
  font-weight: 700 !important;
}


/* ---------- IKONY HEADERA ---------- */

.icon-btn,
.players-top-btn {
  width: 44px !important;
  height: 44px !important;

  min-width: 44px !important;

  padding: 0 !important;

  display: grid !important;
  place-items: center !important;

  border:
    1px solid rgba(255,255,255,.075) !important;

  border-radius: 15px !important;

  background:
    rgba(255,255,255,.055) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.035);

  color: #f1f3fa !important;

  transition:
    transform .14s ease,
    background .14s ease,
    border-color .14s ease !important;
}

.icon-btn:active,
.players-top-btn:active {
  transform: scale(.92) !important;

  background:
    rgba(255,255,255,.10) !important;
}

.players-top-btn {
  width: auto !important;

  min-width: 52px !important;

  padding: 0 10px !important;

  display: flex !important;
  gap: 5px !important;

  font-size: 13px !important;
}


/* ---------- GŁÓWNA ZAWARTOŚĆ ---------- */

.scroll {
  padding:
    18px
    14px
    calc(35px + env(safe-area-inset-bottom))
    !important;
}

.section-title {
  margin:
    2px
    5px
    12px !important;

  color: #747e91 !important;

  font-size: 11px !important;
  font-weight: 850 !important;

  letter-spacing: .13em !important;
}


/* =========================================================
   KARTY GIER
   ========================================================= */

.game-card {
  position: relative !important;

  padding: 18px !important;

  margin-bottom: 13px !important;

  border:
    1px solid rgba(255,255,255,.07) !important;

  border-radius: 25px !important;

  background:
    linear-gradient(
      145deg,
      rgba(24,31,51,.92),
      rgba(14,19,33,.88)
    ) !important;

  box-shadow:
    0 15px 45px rgba(0,0,0,.22),
    inset 0 1px 0 rgba(255,255,255,.035)
    !important;

  overflow: hidden !important;

  transition:
    transform .18s ease,
    border-color .18s ease !important;
}


/* subtelne światło w karcie */

.game-card::before {
  content: "";

  position: absolute;

  width: 180px;
  height: 180px;

  top: -110px;
  right: -70px;

  border-radius: 50%;

  background:
    radial-gradient(
      circle,
      rgba(105,95,255,.16),
      transparent 70%
    );

  pointer-events: none;
}


/* ---------- IKONA GRY ---------- */

.game-icon {
  width: 52px !important;
  height: 52px !important;

  margin-bottom: 13px !important;

  display: grid !important;
  place-items: center !important;

  border-radius: 17px !important;

  background:
    linear-gradient(
      145deg,
      rgba(108,99,255,.20),
      rgba(108,99,255,.06)
    ) !important;

  border:
    1px solid rgba(130,120,255,.20) !important;

  font-size: 27px !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.06) !important;
}


/* ---------- TYTUŁ ---------- */

.game-info h2 {
  margin: 0 !important;

  font-size: 21px !important;
  font-weight: 880 !important;

  letter-spacing: -.025em !important;
}

.game-info p {
  margin:
    7px
    0
    9px !important;

  color: #8e98aa !important;

  font-size: 13px !important;

  line-height: 1.48 !important;
}


/* ---------- STATUS SZUKANIA ---------- */

.waiting {
  display: inline-flex !important;

  align-items: center !important;

  min-height: 25px !important;

  padding: 0 9px !important;

  margin-bottom: 13px !important;

  border-radius: 999px !important;

  background:
    rgba(55,216,140,.08) !important;

  color: #47dd96 !important;

  font-size: 10px !important;
  font-weight: 750 !important;
}


/* =========================================================
   PRZYCISKI GIER
   ========================================================= */

.game-card .btn {
  min-height: 48px !important;

  border-radius: 15px !important;

  margin-top: 7px !important;

  font-size: 13px !important;

  letter-spacing: .025em !important;
}


/* dwa przyciski w jednej linii */

.game-card .quick-btn,
.game-card .private-btn {
  width: calc(50% - 5px) !important;

  display: inline-flex !important;

  align-items: center !important;
  justify-content: center !important;

  vertical-align: top !important;
}

.game-card .quick-btn {
  margin-right: 6px !important;
}


/* główny */

.btn.primary {
  background:
    linear-gradient(
      135deg,
      #7168ff,
      #555dff
    ) !important;

  box-shadow:
    0 8px 24px rgba(85,93,255,.22),
    inset 0 1px 0 rgba(255,255,255,.16)
    !important;
}


/* dodatkowy */

.btn.secondary {
  background:
    rgba(255,255,255,.055) !important;

  border:
    1px solid rgba(255,255,255,.085) !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.025)
    !important;
}

.btn {
  transition:
    transform .12s ease,
    filter .12s ease,
    background .12s ease !important;
}

.btn:active {
  transform: scale(.965) !important;

  filter: brightness(1.08);
}


/* =========================================================
   GRACZE ONLINE
   ========================================================= */

.players-top-panel {
  top:
    calc(82px + env(safe-area-inset-top))
    !important;

  right: 12px !important;

  width:
    min(90vw, 360px)
    !important;

  padding: 15px !important;

  border:
    1px solid rgba(255,255,255,.08)
    !important;

  border-radius: 22px !important;

  background:
    rgba(15,21,35,.96) !important;

  backdrop-filter:
    blur(25px)
    saturate(140%) !important;

  -webkit-backdrop-filter:
    blur(25px)
    saturate(140%) !important;

  box-shadow:
    0 25px 80px rgba(0,0,0,.55)
    !important;
}

.players-top-title {
  font-size: 16px !important;

  font-weight: 850 !important;

  margin-bottom: 12px !important;
}

.online-player-row {
  min-height: 56px !important;

  padding: 8px 3px !important;

  border-bottom:
    1px solid rgba(255,255,255,.055)
    !important;
}

.online-player-name {
  font-weight: 780 !important;
}

.invite-mini-btn {
  height: 36px !important;

  border-radius: 11px !important;

  background:
    rgba(255,255,255,.065) !important;

  border:
    1px solid rgba(255,255,255,.07)
    !important;
}


/* =========================================================
   INPUTY / CZAT
   ========================================================= */

.input,
.country-answer-input,
.contact-textarea {
  background:
    rgba(8,12,22,.82) !important;

  border:
    1px solid rgba(255,255,255,.075)
    !important;

  border-radius: 14px !important;

  color: #f4f6fb !important;

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.018)
    !important;
}

.input:focus,
.country-answer-input:focus,
.contact-textarea:focus {
  border-color:
    rgba(112,103,255,.72) !important;

  box-shadow:
    0 0 0 3px rgba(112,103,255,.10)
    !important;
}


/* ---------- CZAT ---------- */

.chat-card {
  margin-top: 16px !important;

  border:
    1px solid rgba(255,255,255,.065)
    !important;

  border-radius: 23px !important;

  background:
    rgba(15,21,35,.72)
    !important;

  box-shadow:
    0 15px 45px rgba(0,0,0,.18)
    !important;
}

.chat-head {
  border-bottom:
    1px solid rgba(255,255,255,.055)
    !important;
}


/* =========================================================
   EKRAN GRY
   ========================================================= */

.game-title {
  font-size: 18px !important;

  font-weight: 850 !important;

  letter-spacing: -.02em !important;
}

.room-code {
  margin-top: 3px !important;

  color: #7f899b !important;

  font-size: 10px !important;
}

.players-bar {
  min-height: 52px !important;

  padding: 8px 14px !important;

  background:
    rgba(11,16,28,.80) !important;

  border-bottom:
    1px solid rgba(255,255,255,.055)
    !important;
}

.player-chip {
  padding: 8px 10px !important;

  border-radius: 13px !important;

  background:
    rgba(255,255,255,.045)
    !important;

  border:
    1px solid transparent;
}

.player-chip.me {
  outline: none !important;

  border-color:
    rgba(112,103,255,.45)
    !important;

  background:
    rgba(112,103,255,.09)
    !important;
}

.game-status {
  margin: 5px 0 7px !important;

  font-size: 14px !important;

  color: #dfe3ed !important;
}


/* =========================================================
   PAŃSTWA–MIASTA
   ========================================================= */

.countries-box {
  border:
    1px solid rgba(255,255,255,.07)
    !important;

  border-radius: 22px !important;

  background:
    linear-gradient(
      145deg,
      rgba(23,30,49,.90),
      rgba(13,18,31,.88)
    )
    !important;

  box-shadow:
    0 15px 45px rgba(0,0,0,.18)
    !important;
}

.country-letter {
  border: none !important;

  background:
    linear-gradient(
      145deg,
      #756bff,
      #525aff
    )
    !important;

  box-shadow:
    0 12px 30px rgba(86,91,255,.25)
    !important;
}


/* =========================================================
   MENU HAMBURGER
   ========================================================= */

.munit-menu {
  background:
    rgba(12,17,29,.97)
    !important;

  backdrop-filter:
    blur(25px)
    saturate(140%)
    !important;

  -webkit-backdrop-filter:
    blur(25px)
    saturate(140%)
    !important;

  border-left:
    1px solid rgba(255,255,255,.07)
    !important;
}

.menu-item {
  border-radius: 17px !important;

  background:
    rgba(255,255,255,.045)
    !important;

  border:
    1px solid rgba(255,255,255,.065)
    !important;
}


/* =========================================================
   SUBTELNE ANIMACJE
   ========================================================= */

.game-card {
  animation:
    modernCardIn .28s ease both;
}

.game-card:nth-of-type(2) {
  animation-delay: .035s;
}

.game-card:nth-of-type(3) {
  animation-delay: .07s;
}

@keyframes modernCardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   MAŁE TELEFONY
   ========================================================= */

@media (max-width: 380px) {

  .topbar {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .logo {
    font-size: 22px !important;
  }

  .nick {
    max-width: 70px !important;

    padding:
      0
      10px
      !important;
  }

  .game-card {
    padding: 15px !important;
  }

  .game-info h2 {
    font-size: 19px !important;
  }

  .game-card .btn {
    font-size: 11px !important;
  }
}

