/* ─── Lokalne Czcionki ────────────────────────────────────────────── */
@font-face {
  font-family: 'Cinzel Decorative';
  src: url('fonts/CinzelDecorative-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Cinzel Decorative';
  src: url('fonts/CinzelDecorative-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('fonts/Inter-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('fonts/Inter-Medium.ttf') format('truetype');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('fonts/Inter-SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: Inter;
  src: url('fonts/Inter-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ─── Tokens & Reset ─────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.lock-scroll {
  overflow: hidden !important;
}

:root {
  --clr-bg: #0b0b1a;
  --clr-surface: #12122a;
  --clr-surface2: #1a1a38;
  --clr-border: rgb(140 100 255 / 25%);
  --clr-purple: #8b5cf6;
  --clr-primary: var(--clr-purple);
  --clr-purple-lt: #a78bfa;
  --clr-blue: #3b82f6;
  --clr-cyan: #06b6d4;
  --clr-gold: #f59e0b;
  --clr-green: #10b981;
  --clr-red: #ef4444;
  --clr-text: #e2e8f0;
  --clr-text-dim: #94a3b8;

  /* Ustalanie Od Ogółu: Główna szerokość gry */

  /* Główna szerokość gry: Na telefonach (mała wysokość/szerokość) zajmujemy 100vw.
     Na komputerach/wysokich ekranach ograniczamy szerokość, by wszystko zmieściło się w pionie. */
  --game-width: min(480px, 100vw);
  --board-padding: 12px;
  --tile-gap: 6px;

  /* Szczegół (kafelek) wyliczany z ogółu (szerokości gry) */
  --tile-size: calc((var(--game-width) - (2 * var(--board-padding)) - (4 * var(--tile-gap))) / 5);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --font-title: 'Cinzel Decorative',
    serif;
  --font-tile: 'Inter',
    sans-serif;
  --font-body: 'Inter',
    sans-serif;
  --glow-purple: 0 0 16px rgb(139 92 246 / 55%);
  --glow-gold: 0 0 16px rgb(245 158 11 / 60%);
  --glow-cyan: 0 0 16px rgb(6 182 212 / 55%);
}

/* ─── VIP Golden Username ────────────────────────────────────────────── */
.golden-vip-name {
  background: linear-gradient(135deg, #fff3a1 0%, #fbbf24 40%, #f59e0b 70%, #d97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: #fbbf24;
  font-weight: 700;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.75)) drop-shadow(0 0 14px rgba(251, 191, 36, 0.45));
  position: relative;
  display: inline-block;
  overflow: visible !important;
  z-index: 2;
}

.player-name.golden-vip-name,
.party-name.golden-vip-name,
#discord-name.golden-vip-name {
  overflow: visible !important;
  text-overflow: clip;
}

/* Specjalne ograniczenie dla Areny, gdy ekran jest zbyt niski w stosunku do szerokości */
@media (height >=500px) {
  :root {
    --safe-v: calc((100dvh - 360px) * 0.92);
    --game-width: min(480px, 100vw, var(--safe-v));
  }
}


*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
  user-select: none;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

input,
textarea,
[contenteditable] {
  user-select: text;
  user-select: text;
  user-select: text;
  user-select: text;
}


html,
body {
  min-height: 100%;
  background: var(--clr-bg);
  color: var(--clr-text);
  font-family: var(--font-body);
}

/* Ukrycie scrollbara dla wszystkich przeglądarek */
* {
  scrollbar-width: none !important;

  /* Firefox */
  -ms-overflow-style: none !important;

  /* IE/Edge */
}

*::-webkit-scrollbar {
  display: none !important;

  /* Chrome/Safari */
}

html,
body {
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
}

/* ─── Particles ──────────────────────────────────────────────────── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  animation: float linear infinite;
  opacity: 0;
}

@keyframes float {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: .6;
  }

  90% {
    opacity: .4;
  }

  100% {
    transform: translateY(-10vh) scale(1.2);
    opacity: 0;
  }
}

/* ─── Screens ────────────────────────────────────────────────────── */
.screen {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: var(--game-width);
  min-height: 100dvh;
  display: none;
  z-index: 10;
  background: var(--clr-bg);
  box-shadow: 0 0 100px rgb(0 0 0 / 50%);
}

.screen.active {
  display: flex;
  flex-direction: column;
  overflow-y: visible;
  padding-bottom: 60px;
  animation: fadeInScreen 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInScreen {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Lobby nadal centrujemy, bo tam jest tylko jedna karta */
#screen-lobby.active {
  align-items: center;
  padding: 40px 0;
}

@media (width <=1023px) {
  #screen-lobby.active {
    padding-top: 50px !important;
  }
}




/* ─── Lobby ──────────────────────────────────────────────────────── */
.lobby-card {
  position: relative;
  background: linear-gradient(135deg, var(--clr-surface) 0%, #1d0f3a 100%);
  border: 1px solid var(--clr-border);
  border-radius: calc(var(--game-width) * 0.035);
  padding: calc(var(--game-width) * 0.12) calc(var(--game-width) * 0.08) calc(var(--game-width) * 0.09);
  width: calc(var(--game-width) - 24px);
  max-width: 92vw;
  box-shadow: 0 0 80px rgb(139 92 246 / 20%), inset 0 1px 0 rgb(255 255 255 / 8%);
  text-align: center;
  margin: auto 0;
}

.lobby-top-controls {
  position: absolute;
  top: calc(var(--game-width) * 0.03);
  left: calc(var(--game-width) * 0.03);
  right: calc(var(--game-width) * 0.03);
  display: flex;
  gap: calc(var(--game-width) * 0.02);
  z-index: 1000;
  align-items: stretch;
}

#btn-settings {
  margin-left: auto;
}

.lang-selector {
  position: static;
}

.btn-leaderboard {
  background: rgb(255 255 255 / 5%);
  backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgb(255 255 255 / 10%);
  padding: calc(var(--game-width) * 0.012) calc(var(--game-width) * 0.02);
  border-radius: calc(var(--game-width) * 0.016);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
  min-width: calc(var(--game-width) * 0.08);
  height: calc(var(--game-width) * 0.075);
  box-sizing: border-box;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-leaderboard:disabled,
.btn-leaderboard.soon,
.soon {
  opacity: 0.5;
  cursor: not-allowed !important;
  pointer-events: auto;
}

.btn-leaderboard.soon:hover {
  background: rgb(255 255 255 / 5%) !important;
  border-color: rgb(255 255 255 / 10%) !important;
  box-shadow: none !important;
}

.settings-icon {
  width: calc(var(--game-width) * 0.045);
  height: calc(var(--game-width) * 0.045);
  display: block;
  opacity: 0.9;
}

.podium-icon {
  display: flex;
  align-items: flex-end;
  gap: calc(var(--game-width) * 0.004);
  height: calc(var(--game-width) * 0.03);
}

.podium-icon .bar {
  width: calc(var(--game-width) * 0.01);
  background: #fff;
  border-radius: 1px;
}

.bar-1 {
  height: 100%;
}

.bar-2 {
  height: 60%;
}

.bar-3 {
  height: 40%;
}

.custom-dropdown {
  position: relative;
  min-width: calc(var(--game-width) * 0.16);
}

.dropdown-trigger {
  background: rgb(255 255 255 / 5%);
  backdrop-filter: blur(8px);
  border: 1px solid rgb(255 255 255 / 10%);
  color: #fff;
  font-size: calc(var(--game-width) * 0.026);
  padding: calc(var(--game-width) * 0.012) calc(var(--game-width) * 0.024);
  border-radius: calc(var(--game-width) * 0.016);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: calc(var(--game-width) * 0.016);
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  height: calc(var(--game-width) * 0.075);
  box-sizing: border-box;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.dropdown-trigger:disabled,
.dropdown-trigger.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  border-color: rgb(255 255 255 / 10%) !important;
  background: rgb(255 255 255 / 2%) !important;
}

/* --- Discord Player Card (Compact Version) --- */
.discord-profile {
  display: none !important;
}

.discord-profile.hidden {
  display: none;
}

.discord-avatar-wrapper {
  width: calc(var(--game-width) * 0.065);
  height: calc(var(--game-width) * 0.065);
  border-radius: 50%;
  border: 1px solid var(--clr-gold);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgb(212 175 55 / 30%);
}

#discord-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: calc(var(--game-width) * 0.015);
  overflow: hidden;
}

.discord-label {
  font-size: calc(var(--game-width) * 0.022);
  color: var(--clr-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  white-space: nowrap;
}

.discord-name {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.035);
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


@media (hover: hover) {

  .dropdown-trigger:hover,
  .btn-leaderboard:hover {
    background: rgb(255 255 255 / 10%);
    border-color: var(--clr-purple-lt);
    box-shadow: 0 0 15px rgb(167 139 250 / 20%);
  }
}

.dropdown-arrow {
  font-size: calc(var(--game-width) * 0.024);
  opacity: 0.5;
  margin-left: auto;
  display: inline-block;
  transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-arrow {
  transform: rotate(180deg);
}

.current-flag {
  width: calc(var(--game-width) * 0.036);
  height: calc(var(--game-width) * 0.024);
  display: flex;
  align-items: center;
  border-radius: calc(var(--game-width) * 0.004);
  overflow: hidden;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
}

.flag-icon {
  width: calc(var(--game-width) * 0.045);
  height: calc(var(--game-width) * 0.03);
  display: flex;
  align-items: center;
  border-radius: calc(var(--game-width) * 0.005);
  overflow: hidden;
  box-shadow: 0 1px 3px rgb(0 0 0 / 30%);
}

.current-flag svg,
.flag-icon svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + calc(var(--game-width) * 0.02));
  left: 0;
  background: rgb(20 15 35 / 95%);
  backdrop-filter: blur(12px);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: calc(var(--game-width) * 0.025);
  padding: calc(var(--game-width) * 0.015);
  min-width: calc(var(--game-width) * 0.33);
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(var(--game-width) * -0.02));
  transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgb(0 0 0 / 50%);
  pointer-events: none;
}

.custom-dropdown.active .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: calc(var(--game-width) * 0.025);
  padding: calc(var(--game-width) * 0.02) calc(var(--game-width) * 0.03);
  border-radius: calc(var(--game-width) * 0.015);
  cursor: pointer;
  color: rgb(255 255 255 / 80%);
  font-size: calc(var(--game-width) * 0.032);
  transition: background 0.15s, color 0.15s;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .dropdown-item:hover {
    background: rgb(255 255 255 / 10%);
    color: #fff;
  }
}

.dropdown-item.active {
  background: rgb(167 139 250 / 20%);
  color: var(--clr-purple-lt);
}

.dropdown-item.disabled {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  pointer-events: auto !important;
}

@media (hover: hover) {
  .dropdown-item.disabled:hover {
    background: transparent !important;
    color: rgb(255 255 255 / 80%) !important;
    box-shadow: none !important;
  }
}


.logo {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.085);
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: .04em;
  margin-bottom: calc(var(--game-width) * 0.015);
  white-space: nowrap;
}

.tagline {
  color: var(--clr-text-dim);
  font-size: calc(var(--game-width) * 0.03);
  margin-bottom: calc(var(--game-width) * 0.05);
}

.form-group {
  text-align: left;
  margin-bottom: calc(var(--game-width) * 0.04);
}

.form-group label {
  display: block;
  font-size: calc(var(--game-width) * 0.026);
  font-weight: 600;
  color: var(--clr-purple-lt);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: calc(var(--game-width) * 0.016);
}

.form-group input {
  width: 100%;
  padding: calc(var(--game-width) * 0.025) calc(var(--game-width) * 0.032);
  border-radius: calc(var(--game-width) * 0.016);
  border: 1px solid var(--clr-border);
  background: rgb(255 255 255 / 5%);
  color: var(--clr-text);
  font-family: var(--font-body);
  font-size: calc(var(--game-width) * 0.032);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.form-group input:disabled,
.form-group input.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  background: rgb(255 255 255 / 2%) !important;
  border-color: rgb(255 255 255 / 10%) !important;
}

.form-group input:focus {
  border-color: var(--clr-purple);
  box-shadow: var(--glow-purple);
}

.input-with-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-with-button input {
  padding-right: calc(var(--game-width) * 0.12) !important;
}

.btn-input-action {
  position: absolute;
  right: 0;
  height: 100%;
  padding: 0 calc(var(--game-width) * 0.035);
  background: transparent;
  border: none;
  border-left: 1px solid var(--clr-border);
  color: var(--clr-purple-lt);
  font-family: var(--font-body);
  font-size: calc(var(--game-width) * 0.03);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.6;
}

.input-with-button:focus-within .btn-input-action {
  opacity: 1;
}

@media (hover: hover) {
  .btn-input-action:hover {
    color: #fff;
    opacity: 1;
  }
}

.btn-input-action.hidden {
  display: none;
}

.player-count-lobby {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.016);
  font-size: calc(var(--game-width) * 0.028);
  color: var(--clr-text-dim);
  margin-bottom: calc(var(--game-width) * 0.06);
  background: rgb(255 255 255 / 4%);
  padding: calc(var(--game-width) * 0.012) calc(var(--game-width) * 0.035);
  border-radius: calc(var(--game-width) * 0.04);
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  border: 1px solid rgb(255 255 255 / 5%);
}

.online-dot {
  width: calc(var(--game-width) * 0.016);
  height: calc(var(--game-width) * 0.016);
  background: var(--clr-green);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--clr-green);
  animation: dot-pulse 2s infinite;
}

@keyframes dot-pulse {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.4);
    opacity: 0.5;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.lobby-status {
  margin-top: calc(var(--game-width) * 0.032);
  color: var(--clr-cyan);
  font-size: calc(var(--game-width) * 0.03);
  min-height: 1.4em;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1
  }

  50% {
    opacity: .5
  }
}

.rules {
  margin-top: 0;
  text-align: left;
  background: rgb(255 255 255 / 3%);
  border: 1px solid var(--clr-border);
  border-radius: calc(var(--game-width) * 0.016);
  padding: calc(var(--game-width) * 0.035) calc(var(--game-width) * 0.045);
}

.rules h3 {
  font-size: calc(var(--game-width) * 0.028);
  font-weight: 600;
  color: var(--clr-gold);
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: calc(var(--game-width) * 0.02);
}

.rules ul {
  list-style: none;
}

.rules li {
  font-size: calc(var(--game-width) * 0.027);
  color: var(--clr-text-dim);
  padding: calc(var(--game-width) * 0.008) 0;
  line-height: 1.5;
  display: flex;
  align-items: center;
}

.rule-badge {
  display: inline-block;
  padding: calc(var(--game-width) * 0.002) calc(var(--game-width) * 0.008);
  border-radius: 4px;
  font-size: calc(var(--game-width) * 0.022);
  font-weight: 900;
  margin-right: calc(var(--game-width) * 0.02);
  min-width: calc(var(--game-width) * 0.07);
  text-align: center;
}

.rb-dl {
  background: rgb(59 130 246 / 30%);
  color: #93c5fd;
  border: 1px solid rgb(59 130 246 / 55%);
  text-shadow: 0 0 6px #3b82f6;
}

.rb-tl {
  background: rgb(168 85 247 / 30%);
  color: #d8b4fe;
  border: 1px solid rgb(168 85 247 / 65%);
  text-shadow: 0 0 6px #a855f7;
}

.rb-dw {
  background: rgb(245 158 11 / 30%);
  color: #fcd34d;
  border: 1px solid rgb(245 158 11 / 65%);
  text-shadow: 0 0 6px #f59e0b;
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

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

.btn:disabled,
.btn.disabled {
  opacity: .4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  box-shadow: var(--glow-purple);
}

@media (hover: hover) {
  .btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    box-shadow: 0 0 28px rgb(139 92 246 / 70%);
  }
}

#btn-join {
  padding: calc(var(--game-width) * 0.025) calc(var(--game-width) * 0.05);
  font-size: calc(var(--game-width) * 0.035);
  border-radius: calc(var(--game-width) * 0.016);
}

.btn-secondary {
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid transparent !important;
  box-shadow: 0 4px 12px rgb(0 0 0 / 10%) !important;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease !important;
}

@media (hover: hover) {
  .btn-secondary:hover:not(:disabled) {
    background: #fff !important;
    box-shadow: 0 4px 20px rgb(255 255 255 / 20%), 0 0 15px rgb(255 255 255 / 10%) !important;
    transform: translateY(-1.5px);
  }
}

.player-count-buttons {
  display: flex;
  gap: calc(var(--game-width) * 0.016);
  width: 100%;
  margin-bottom: calc(var(--game-width) * 0.025);
}

.btn-player-count {
  flex: 1;
  height: calc(var(--game-width) * 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--clr-border);
  border-radius: calc(var(--game-width) * 0.016);
  background: var(--clr-surface2);
  color: var(--clr-text-dim);
  font-family: inherit;
  font-size: calc(var(--game-width) * 0.045);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
  user-select: none;
}

@media (hover: hover) {
  .btn-player-count:hover {
    background: rgb(255 255 255 / 5%);
    color: var(--clr-text);
  }
}

.btn-player-count.active {
  background: linear-gradient(135deg, #7c3aed, #2563eb);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-purple);
}

.btn-player-count:disabled,
.btn-player-count.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-submit {
  width: 100%;
  background: linear-gradient(135deg, #059669, #10b981);
  color: #fff;
  box-shadow: 0 0 12px rgb(16 185 129 / 40%);
}

@media (hover: hover) {
  .btn-submit:hover:not(:disabled) {
    box-shadow: 0 0 24px rgb(16 185 129 / 60%);
  }
}

.btn-clear {
  width: 100%;
  background: rgb(239 68 68 / 15%);
  border: 1px solid rgb(239 68 68 / 35%);
  color: #fca5a5;
}

@media (hover: hover) {
  .btn-clear:hover:not(:disabled) {
    background: rgb(239 68 68 / 25%);
  }
}

.btn-spell {
  position: relative;
  z-index: 1;
  overflow: hidden;
  width: 100%;
  background: linear-gradient(135deg, #7c3aed55, #06b6d455);
  border: 1px solid rgb(139 92 246 / 40%);
  color: var(--clr-purple-lt);
}

.btn-spell::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #7c3aed88, #06b6d488);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

@media (hover: hover) {
  .btn-spell:hover:not(:disabled)::before {
    opacity: 1;
  }

  .btn-spell:hover:not(:disabled) {
    box-shadow: var(--glow-cyan);
  }
}

.gem-cost {
  font-size: .75rem;
  opacity: .7;
}

/* ─── Game Screen Layout ─────────────────────────────────────────── */
#screen-game {
  background: transparent;
  min-height: 100vh;
}

.game-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgb(11 11 26 / 90%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  padding-top: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--clr-border);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  place-items: center stretch;
  flex-shrink: 0;
  box-sizing: border-box;
}

@media (width <=1023px) {
  .game-header {
    padding-top: 35px !important;
  }
}








.solo-leave-card {
  display: flex;
  justify-content: center;
  align-items: stretch;
  height: 100%;
  width: 100%;
}

.btn-leave-solo-arena {
  background: rgb(139 92 246 / 10%);
  border: 1px dashed rgb(139 92 246 / 40%);
  backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--clr-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.005);
  padding: calc(var(--game-width) * 0.008) calc(var(--game-width) * 0.016);
  border-radius: var(--radius-md);
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

@media (hover: hover) {
  .btn-leave-solo-arena:hover {
    background: rgb(139 92 246 / 20%);
    border-style: solid;
    border-color: var(--clr-purple);
    box-shadow: 0 0 15px rgb(139 92 246 / 30%);
  }
}

.btn-leave-solo-arena .icon {
  font-size: calc(var(--game-width) * 0.05);
}

.btn-leave-solo-arena .text {
  font-size: calc(var(--game-width) * 0.02);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--clr-text-dim);
  width: 100%;
  text-align: center;
  line-height: 1.15;
  display: block;
  box-sizing: border-box;
}

.player-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: calc(var(--game-width) * 0.22);
  position: relative;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
}

.player-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

@media (width <=1023px) {
  .game-header {
    padding: 2px 8px;
    min-height: auto;
  }

  .player-card {
    min-width: auto;
    padding: 2px;
    gap: calc(var(--game-width) * 0.01);
  }

  .player-name {
    max-width: calc(var(--game-width) * 0.2);
  }

  .player-avatar,
  .player-avatar img,
  .player-avatar .avatar-img {
    width: calc(var(--game-width) * 0.1) !important;
    height: calc(var(--game-width) * 0.1) !important;
  }

  .player-avatar {
    font-size: 2.1rem !important;
  }
}

.player-avatar {
  font-size: calc(var(--game-width) * 0.08) !important;
  width: calc(var(--game-width) * 0.08) !important;
  height: calc(var(--game-width) * 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
  overflow: hidden !important;
  border-radius: 50% !important;
}

.p0-glow {
  filter: drop-shadow(0 0 6px rgb(139 92 246 / 60%));
  border: 1px solid rgb(139 92 246 / 30%);
}

.p1-glow {
  filter: drop-shadow(0 0 6px rgb(6 182 212 / 60%));
  border: 1px solid rgb(6 182 212 / 30%);
}

.p2-glow {
  filter: drop-shadow(0 0 6px rgb(245 158 11 / 60%));
  border: 1px solid rgb(245 158 11 / 30%);
}

.p3-glow {
  filter: drop-shadow(0 0 6px rgb(16 185 129 / 60%));
  border: 1px solid rgb(16 185 129 / 30%);
}

.player-avatar img,
.player-avatar .avatar-img {
  width: 100% !important;
  height: 100% !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  display: block !important;
}

.player-name {
  display: block;
  font-weight: 700;
  font-size: calc(var(--game-width) * 0.035);
  color: #f8fafc;
  max-width: calc(var(--game-width) * 0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-size-adjust: none;
}

/* Zmniejszenie kafelk??w gdy s?? dwa w kolumnie */
.header-side-col .player-card:nth-child(2),
.header-side-col .player-card:first-child:not(:only-child) {
  padding: 0 4px;
  gap: 0;
}

.header-side-col .player-card:nth-child(2) .player-name,
.header-side-col .player-card:first-child:not(:only-child) .player-name {
  font-size: calc(var(--game-width) * 0.03);
}

.header-side-col .player-card:nth-child(2) .player-score,
.header-side-col .player-card:first-child:not(:only-child) .player-score {
  font-size: calc(var(--game-width) * 0.045);
}

.header-side-col .player-card:nth-child(2) .player-avatar,
.header-side-col .player-card:first-child:not(:only-child) .player-avatar {
  width: calc(var(--game-width) * 0.065) !important;
  height: calc(var(--game-width) * 0.065) !important;
  font-size: calc(var(--game-width) * 0.05) !important;
}

.header-side-col .player-card:nth-child(2) .avatar-img,
.header-side-col .player-card:first-child:not(:only-child) .avatar-img {
  width: calc(var(--game-width) * 0.065) !important;
  height: calc(var(--game-width) * 0.065) !important;
}

.player-score {
  display: block;
  font-size: calc(var(--game-width) * 0.05);
  color: var(--clr-gold);
  font-weight: 800;
  font-family: var(--font-timer);
  transition: color 0.3s ease, text-shadow 0.3s ease, transform 0.3s ease;
}

.player-score.shiny {
  color: #fff !important;
  text-shadow: none !important;
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: none !important;
}

.player-score.plain {
  color: #fbbf24 !important;
  text-shadow: none !important;
  background: none !important;
  -webkit-text-fill-color: initial !important;
  opacity: 1 !important;
}

.pts-label {
  font-size: 0.5em;
  font-weight: 400;
  color: var(--clr-text-dim);
  margin-left: 2px;
  vertical-align: middle;
  -webkit-text-fill-color: var(--clr-text-dim);

  /* Reset fill for gradient text */
}

.num-shiny {
  color: #fff !important;
  font-weight: 800;
  text-shadow: 0 0 10px rgb(245 158 11 / 80%) !important;
  background: linear-gradient(135deg, #f59e0b, #fbbf24) !important;
  background-clip: text !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  animation: score-glow 2s ease-in-out infinite alternate !important;
}

.num-plain-gold {
  color: #fbbf24 !important;
  font-weight: 800;
  text-shadow: none !important;
}

@keyframes score-glow {
  from {
    filter: drop-shadow(0 0 2px rgb(245 158 11 / 50%));
  }

  to {
    filter: drop-shadow(0 0 8px rgb(245 158 11 / 90%));
  }
}

/* Player card positioning - now dynamic via Grid Auto Flow */
.player-card {
  align-items: center;
  justify-self: center;
}

#player-card-0 .player-meta {
  justify-content: center;
  width: 100%;
}

#player-card-1 .player-meta {
  justify-content: center;
  width: 100%;
}

.game-center {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  padding: 0 8px;
  padding-top: 4px;
  width: 100%;
  justify-self: center;
  z-index: 20;
  gap: 2px;
  min-width: 0;
}


@media (width <=1023px) {
  .game-center {
    padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.04);
    margin-bottom: 4px;
  }

  .timer-display {
    /* Jeszcze węższy start (28px) i ciaśniejszy tekst */
    font-size: clamp(15px, calc(var(--game-width) * 0.12 - 29.6px), 28px) !important;
    letter-spacing: -0.02em;
    margin: 0;
  }

  .btn-timer {
    /* Mniejszy start (15px) i połowa poziomego paddingu */
    font-size: clamp(10px, calc(var(--game-width) * 0.07 - 18.6px), 15px) !important;
    padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.02);
  }
}



.turn-status {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-height: auto;
  margin-bottom: 4px;
}

.turn-status-text {
  font-size: calc(var(--game-width) * 0.033);
  margin: 0;
  white-space: nowrap;
  color: #f8fafc !important;
  padding: calc(var(--game-width) * 0.005) calc(var(--game-width) * 0.03);
  border-radius: 25px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: inline-block;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.turn-status-text.your-turn {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  box-shadow: 0 0 20px rgb(168 85 247 / 50%);
}

.turn-status-text.opponent-turn {
  background: linear-gradient(135deg, #475569, #1e293b);
  border: 1px solid rgb(255 215 0 / 30%);
  box-shadow: 0 0 15px rgb(0 0 0 / 60%);
  color: #f8fafc !important;
}

.turn-meta {
  font-size: calc(var(--game-width) * 0.025);
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2px;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 32px;

  /* Blokuje wysokość, aby nagłówek nie "skakał" */
  margin-top: 4px;
}

.timer-display {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.07);
  color: var(--clr-gold);
  text-shadow: var(--glow-gold);
  min-width: 0;

  /* Stała szerokość dla czasu */
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.announcement {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgb(18 11 38 / 88%);
  backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 2px solid var(--clr-purple);
  padding: calc(var(--game-width) * 0.06) calc(var(--game-width) * 0.08);
  border-radius: var(--radius-lg);
  color: #fff;
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.055);
  z-index: 2000;
  text-align: center;
  box-shadow: 0 20px 50px rgb(0 0 0 / 80%), var(--glow-purple);
  pointer-events: auto;
  width: min(var(--game-width) * 0.9, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.03);
  animation: announcement-pop .4s cubic-bezier(.34, 1.56, .64, 1);
}

/* Full-screen frosted glass violet blur behind non-blocking active announcements usunięto, używamy niezależnego zewnętrznego #global-announcement-backdrop */

.announcement.non-blocking {
  pointer-events: none !important;
}

@media (width <=480px) {
  .announcement {
    width: 94vw;
    padding: 20px 15px;
  }
}

/* Stan PAUZY */
.game-paused header,
.game-paused main {
  filter: grayscale(0.7) blur(4px);
  transition: filter 0.5s ease;
}

/* Fizyczna blokada kliknięć nad CAŁĄ grą */
.game-paused::after,
.game-waiting::after,
.game-disconnected::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgb(0 0 0 / 1%);

  /* Prawie niewidoczna, ale blokuje */
  z-index: 1999;
  cursor: not-allowed;
  pointer-events: auto;
}

.game-disconnected::after {
  background: rgb(0 0 0 / 40%);
  backdrop-filter: blur(2px);
  z-index: 3999;

  /* Tuż pod disconnect-overlay (4000) */
}

.game-disconnected header,
.game-disconnected main {
  filter: grayscale(0.8) blur(6px);
  transition: filter 0.4s ease;
}


/* Ogłoszenie musi być NAD blokadą */
.announcement {
  z-index: 2005 !important;
  pointer-events: auto !important;
}

.announcement.hidden {
  display: none !important;
}

.disconnect-notice {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  margin-top: 10px;
}

.disconnect-notice strong {
  color: var(--clr-gold);
}

.disconnect-notice p {
  margin: 5px 0;
}

.btn-timer {
  background: rgb(245 158 11 / 15%);
  border: 1px solid rgb(245 158 11 / 40%);
  color: var(--clr-gold);
  padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.03);
  border-radius: 20px;
  font-size: calc(var(--game-width) * 0.03);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), filter 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (hover: hover) {
  .btn-timer:hover:not(:disabled) {
    filter: brightness(1.3);
    transform: translateY(-1px);
  }
}

.btn-timer:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Announcement Variants */
.announcement.success {
  color: var(--clr-purple-lt);
  border-color: var(--clr-purple);
}

.announcement.info {
  color: var(--clr-cyan);
  border-color: var(--clr-cyan);
}

.announcement.hidden {
  display: none !important;
}

.announcement.error {
  color: #ef4444;
  border-color: #ef4444;
}

@keyframes announcement-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 0;
  }

  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-12px);
  }
}

@keyframes history-item-appear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

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

/* ─── Game Main ──────────────────────────────────────────────────── */
.game-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: calc(var(--game-width) * 0.02);
  padding: calc(var(--game-width) * 0.02) 0;
  overflow: hidden auto;
  flex: 1;
  width: 100%;
}

/* ─── Board ──────────────────────────────────────────────────────── */
.board-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: var(--game-width);
  margin: 0 auto;
  padding-top: 5px;
  justify-content: flex-start;
}

.board-container>* {
  margin: 0 !important;
}

/* Usuwamy wszelkie marginesy dzieci */

.board-relative {
  position: relative;
  margin: 0 auto;
}

.board-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Responsive Overrides for Top-Down scaling */
@media (width <=1023px) {
  /* Usunięto nadpisanie --game-width dla :root, aby działało skalowanie vh/dvh */

  #screen-game {
    overflow-x: hidden;
  }

  .game-main {
    padding: 12px 0;
    gap: 14px;
  }

  .board-container {
    padding-top: 2px;
    gap: 2px;
  }



  .board-header {
    min-height: auto;
    margin: 0;
  }

  .panel-section {
    padding: 6px 10px;
    flex: 1;
    min-width: 140px;
  }
}

.word-display {
  font-family: var(--font-body);
  font-size: calc(var(--game-width) * 0.053);
  font-weight: 700;
  color: var(--clr-purple-lt);
  text-transform: uppercase;
  background: rgb(255 255 255 / 3%);
  padding: calc(var(--game-width) * 0.008) calc(var(--game-width) * 0.04);
  border-radius: calc(var(--game-width) * 0.016);
  border: 1px solid rgb(255 255 255 / 8%);
  width: calc(var(--game-width) - 24px);
  height: calc(var(--game-width) * 0.093);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  box-sizing: border-box;
}



.score-preview {
  font-size: calc(var(--game-width) * 0.03);
  color: var(--clr-gold);
  font-weight: 600;
  min-height: 0;
  margin: 0;
}

.board.selecting-target {
  cursor: default;
}

.board.swap-active .tile {
  animation: tile-pulse 1.5s infinite ease-in-out;
  box-shadow: 0 0 15px rgb(168 85 247 / 30%);
}

@keyframes tile-pulse {
  0% {
    box-shadow: 0 0 10px rgb(168 85 247 / 20%);
    filter: brightness(1);
  }

  50% {
    box-shadow: 0 0 25px rgb(192 132 252 / 70%);
    filter: brightness(1.2);
  }

  100% {
    box-shadow: 0 0 10px rgb(168 85 247 / 20%);
    filter: brightness(1);
  }
}

#path-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 60;

  /* NAD kafelkami (z-index: 5) dla czystych krawędzi */
  border-radius: var(--radius-lg);
}

.board {
  display: grid;
  grid-template-columns: repeat(5, var(--tile-size));
  grid-template-rows: repeat(5, var(--tile-size));
  gap: var(--tile-gap);
  padding: var(--board-padding);
  background: rgb(17 17 40 / 70%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgb(139 92 246 / 15%), inset 0 1px 0 rgb(255 255 255 / 6%);
  user-select: none;
  touch-action: none;
  cursor: default;
  position: relative;

  /* Kluczowe dla pozycjonowania płótna wewnątrz */
}

/* ─── Tile ───────────────────────────────────────────────────────── */
.tile {
  width: var(--tile-size);
  height: var(--tile-size);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, #1e1b4b, #1a1a38);
  border: 1px solid rgb(139 92 246 / 25%);
  display: flex;
  align-items: center;
  justify-content: center;

  /* Idealne środkowanie litery */
  position: relative;

  /* Kluczowe dla z-index */
  z-index: 5;

  /* Wyżej niż linia połączenia (z-index: 2) */
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  overflow: hidden;
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  user-select: none;
}

.tile.multi-selected {
  transition: transform .12s ease, box-shadow .12s ease !important;
}

.tile::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgb(255 255 255 / 6%) 0%, transparent 60%);
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
}

.tile::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: auto;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

/* Wizualna reakcja CAŁEGO kafelka na hover i zaznaczenie */
.tile.selected {
  border-color: rgb(167 139 250 / 60%);
}

@media (hover: hover) {
  .tile:has(::after:hover) {
    border-color: rgb(167 139 250 / 60%);
  }
}

.tile.selected {
  background: linear-gradient(145deg, #4c1d95, #1e1b4b) !important;
  box-shadow: 0 0 20px rgb(139 92 246 / 50%), inset 0 0 10px rgb(167 139 250 / 30%);
  pointer-events: none;
  z-index: 6;

  /* Na samym wierzchu podczas wyboru */
}

.tile.opponent-selected {
  border-color: var(--clr-cyan) !important;
  box-shadow: 0 0 15px rgb(6 182 212 / 40%);
}

@media (hover: hover) {
  .tile:has(::after:hover) .tile-letter {
    color: #fff;
    text-shadow: 0 0 12px rgb(167 139 250 / 60%);
  }
}

.tile-inner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.board.shuffling .tile-inner {
  opacity: 0 !important;
  transition: none !important;
}

.tile-letter {
  font-family: var(--font-tile);
  font-size: calc(var(--tile-size) * 0.55);

  /* Powiększenie litery do 55% kafelka */
  font-weight: 800;
  color: var(--clr-text);
  pointer-events: none;
  z-index: 2;
  transition: color .2s ease;
}

.tile-value {
  position: absolute;
  bottom: calc(var(--tile-size) * 0.08);
  right: calc(var(--tile-size) * 0.1);
  font-size: calc(var(--tile-size) * 0.18);
  font-weight: 700;
  color: var(--clr-text-dim);
  pointer-events: none;
  line-height: 1;
}

.tile-multiplier {
  position: absolute;
  top: 0;
  left: 0;
  font-size: calc(var(--tile-size) * 0.16);
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 8px 0 10px;
  pointer-events: auto;
  cursor: pointer;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-sizing: border-box;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tile-gem {
  position: absolute;
  bottom: calc(var(--tile-size) * 0.08);
  left: calc(var(--tile-size) * 0.08);
  font-size: calc(var(--tile-size) * 0.25);
  pointer-events: none;
  z-index: 3;
  animation: gem-float 2s ease-in-out infinite;
}

@keyframes gem-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(10deg);
  }
}

/* Multiplier colours */
.tile.mult-DL {
  border-color: rgb(59 130 246 / 55%);
}

.tile.mult-DL .tile-multiplier {
  background: rgb(59 130 246 / 30%);
  color: #93c5fd;
  text-shadow: 0 0 6px #3b82f6;
}

.tile.mult-TL {
  border-color: rgb(168 85 247 / 65%);
}

.tile.mult-TL .tile-multiplier {
  background: rgb(168 85 247 / 30%);
  color: #d8b4fe;
  text-shadow: 0 0 6px #a855f7;
}

.tile.mult-DW {
  border-color: rgb(245 158 11 / 65%);
}

.tile.mult-DW .tile-multiplier {
  background: rgb(245 158 11 / 30%);
  color: #fcd34d;
  text-shadow: 0 0 6px #f59e0b;
}

/* Selection order badge */
.sel-badge {
  position: absolute;
  font-size: .6rem;
  font-weight: 800;
  border-radius: 4px;
  padding: 0 3px;
  line-height: 1.4;
  pointer-events: none;
  z-index: 15;
}



.sel-badge.p0-badge {
  color: #c4b5fd;
  background: rgb(124 58 237 / 85%);
}

.sel-badge.p1-badge {
  color: #a5f3fc;
  background: rgb(8 145 178 / 85%);
}

.sel-badge.p2-badge {
  color: #fef08a;
  background: rgb(217 119 6 / 85%);
}

.sel-badge.p3-badge {
  color: #a7f3d0;
  background: rgb(5 150 105 / 85%);
}

/* Selected tile */
.tile.p0-selected {
  background: linear-gradient(145deg, #4c1d95, #1e1b4b) !important;
  border-color: #a78bfa;
  box-shadow: 0 0 25px rgb(139 92 246 / 60%);
  z-index: 50;
}

.tile.p1-selected {
  background: linear-gradient(145deg, #083344, #082f49) !important;
  border-color: #22d3ee;
  box-shadow: 0 0 25px rgb(6 182 212 / 60%);
  z-index: 50;
}

.tile.p2-selected {
  background: linear-gradient(145deg, #451a03, #422006) !important;
  border-color: #fbbf24;
  box-shadow: 0 0 25px rgb(245 158 11 / 60%);
  z-index: 50;
}

.tile.p3-selected {
  background: linear-gradient(145deg, #064e3b, #022c22) !important;
  border-color: #34d399;
  box-shadow: 0 0 25px rgb(16 185 129 / 60%);
  z-index: 50;
}

.tile.tile-opponent-selected {
  box-shadow: 0 0 10px rgb(0 0 0 / 30%) !important;
  z-index: 45;
}

/* Wzmocniony cień tekstu dla liter w zaznaczonych kafelkach, dający idealną czytelność */
.tile.p0-selected .tile-inner,
.tile.p1-selected .tile-inner,
.tile.p2-selected .tile-inner,
.tile.p3-selected .tile-inner,
.tile.multi-selected .tile-inner {
  text-shadow: 0 0 calc(var(--game-width) * 0.015) rgb(0 0 0 / 95%), 0 1px 3px rgb(0 0 0 / 90%) !important;
  color: #fff !important;
}

.tile.tile-opponent-selected .tile-inner {
  text-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(0 0 0 / 80%) !important;
  color: rgb(255 255 255 / 90%) !important;
}

@keyframes selection-glow {

  0%,
  100% {
    opacity: 0.7;
    transform: translate(-50%, -50%) scale(1);
  }

  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
}

.tile.p0-selected .tile-letter {
  color: #fff;
  text-shadow: 0 0 10px rgb(167 139 250 / 80%);
  z-index: 5;
}

.tile.p1-selected .tile-letter {
  color: #fff;
  text-shadow: 0 0 10px rgb(34 211 238 / 80%);
  z-index: 5;
}

.tile.p2-selected .tile-letter {
  color: #fff;
  text-shadow: 0 0 10px rgb(251 191 36 / 80%);
  z-index: 5;
}

.tile.p3-selected .tile-letter {
  color: #fff;
  text-shadow: 0 0 10px rgb(52 211 153 / 80%);
  z-index: 5;
}

.tile-gem {
  position: absolute;
  bottom: 4px;
  left: 5px;
  font-size: .85rem;
  pointer-events: none;
  animation: gem-float 2s ease-in-out infinite;
}

@keyframes gem-float {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-2px) scale(1.1);
  }
}

/* Animations */
@keyframes tile-spawn {
  from {
    transform: translateY(-20px) scale(.8);
    opacity: 0;
  }

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

.tile.spawning {
  animation: tile-spawn .35s cubic-bezier(.34, 1.56, .64, 1) forwards;
}

@keyframes shuffle-pop {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  50% {
    transform: scale(0.95) rotate(2deg);
    filter: brightness(1.5);
  }

  100% {
    transform: scale(1);
    filter: brightness(1);
  }
}

.shuffle-anim .tile:nth-child(4n) {
  --tx: -150px;
  --ty: -150px;
  --tr: -20deg;
}

.shuffle-anim .tile:nth-child(4n+1) {
  --tx: 150px;
  --ty: 150px;
  --tr: 20deg;
}

.shuffle-anim .tile:nth-child(4n+2) {
  --tx: -150px;
  --ty: 150px;
  --tr: 15deg;
}

.shuffle-anim .tile:nth-child(4n+3) {
  --tx: 150px;
  --ty: -150px;
  --tr: -15deg;
}

.shuffle-anim .tile {
  animation: tile-shuffle-fly 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes tile-shuffle-fly {
  0% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--tr)) scale(0.5);
    opacity: 0;
  }

  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
}

@keyframes magic-flash {
  0% {
    box-shadow: 0 0 0 0 rgb(139 92 246 / 0%);
    transform: scale(1);
  }

  50% {
    box-shadow: 0 0 30px 10px rgb(139 92 246 / 80%);
    transform: scale(1.1);
  }

  100% {
    box-shadow: 0 0 0 0 rgb(139 92 246 / 0%);
    transform: scale(1);
  }
}

.tile.swap-anim {
  animation: magic-flash .6s ease-out;
  z-index: 50;
}

@keyframes board-refresh {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ── Game Over Suspense ────────────────────────────────────────── */
.calculating-anim {
  display: inline-block;
  animation: pulse-dots 1.5s infinite;
}

@keyframes pulse-dots {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }

  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.overlay-reveal-zone {
  position: relative;
  padding: 10px;
  width: 100%;
  z-index: 10;
}

.fanfare-particle {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  font-size: 1.8rem;
  z-index: 10001;
  will-change: transform, opacity;
}

.gameover-controls {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin-top: 10px;
}

#btn-rematch.ready {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 0 15px rgb(34 197 94 / 40%);
  transform: scale(1.02);
}

#btn-rematch.ready::after {
  content: ' ✓';
}

#btn-rematch.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(1);
}

@keyframes magic-flash-anim {
  0% {
    transform: scale(1);
  }

  15% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.flying-gem {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--clr-cyan);
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
  box-shadow: 0 0 15px var(--clr-cyan);
  z-index: 90;
  pointer-events: none;
  transition: background 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), filter 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275), transform 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes gem-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
    filter: brightness(1.5);
  }

  100% {
    transform: scale(1);
  }
}

.gem-slot.pulse {
  animation: gem-pulse 0.4s ease-out;
}

.flying-tile-inner {
  position: absolute;
  pointer-events: none;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* --- Discord Player Card (Compact Version) --- */
.discord-profile {
  display: none !important;
}

.discord-profile.hidden {
  display: none;
}

.discord-avatar-wrapper {
  width: calc(var(--game-width) * 0.065);
  height: calc(var(--game-width) * 0.065);
  border-radius: 50%;
  border: 1px solid var(--clr-purple-lt);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 10px rgb(167 139 250 / 40%);
}

.discord-avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discord-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: calc(var(--game-width) * 0.015);
  overflow: hidden;
}

.discord-label {
  font-size: calc(var(--game-width) * 0.022);
  color: var(--clr-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  white-space: nowrap;
}

.discord-name {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.035);
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 50%);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Support Section ────────────────────────────────────────────── */
.support-container {
  margin-top: calc(var(--game-width) * 0.04);
}

.btn-kofi {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.025);
  background: rgb(255 94 91 / 10%);
  border: 1px solid rgb(255 94 91 / 30%);
  padding: calc(var(--game-width) * 0.028) calc(var(--game-width) * 0.04);
  border-radius: calc(var(--game-width) * 0.016);
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
  margin-top: calc(var(--game-width) * 0.02);
}

@media (hover: hover) {
  .btn-kofi:hover {
    background: rgb(255 94 91 / 20%);
    border-color: rgb(255 94 91 / 60%);
    box-shadow: 0 0 20px rgb(255 94 91 / 30%);
    transform: translateY(-2px);
  }
}

.kofi-icon {
  font-size: calc(var(--game-width) * 0.05);
  animation: heart-beat 1.5s infinite;
}

.kofi-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.kofi-title {
  color: #ff5e5b;
  font-weight: 700;
  font-size: calc(var(--game-width) * 0.028);
  letter-spacing: 0.5px;
}

.kofi-desc {
  color: var(--clr-text-dim);
  font-size: calc(var(--game-width) * 0.022);
}



@keyframes heart-beat {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }
}

/* ─── Waiting Overlay (Floating) ─────────────────────────────────── */
.waiting-overlay {
  border: 2px solid var(--clr-cyan) !important;
  box-shadow: 0 20px 60px rgb(0 0 0 / 80%), 0 0 30px rgb(6 182 212 / 30%) !important;
  z-index: 3000 !important;
  background: rgb(18 11 38 / 88%) !important;
  padding: 30px 40px !important;
}

.waiting-title {
  font-family: var(--font-title) !important;
  font-size: clamp(1.3rem, 5vw, 1.8rem) !important;
  color: var(--clr-cyan) !important;
  text-shadow: 0 0 10px rgb(6 182 212 / 30%);
  margin-bottom: 20px !important;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-leave-arena {
  background: #fff !important;
  color: #111 !important;
  border-radius: 50px !important;
  padding: 8px 24px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 15px rgb(0 0 0 / 40%) !important;
  border: none !important;
  width: auto !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease !important;
}

@media (hover: hover) {
  .btn-leave-arena:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgb(0 0 0 / 50%) !important;
    background: #f0f0f0 !important;
  }
}

.waiting-actions {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* Magiczny przycisk wyjścia z Areny Solo */
.btn-leave-solo-arena {
  background: rgb(139 92 246 / 10%);
  border: 1px dashed rgb(139 92 246 / 40%);
  backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: var(--clr-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.008);
  padding: calc(var(--game-width) * 0.025);
  border-radius: var(--radius-md);
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
  height: 100%;
  cursor: pointer;
  box-sizing: border-box;
}

@media (hover: hover) {
  .btn-leave-solo-arena:hover {
    background: rgb(139 92 246 / 20%);
    border-style: solid;
    border-color: var(--clr-purple);
    box-shadow: 0 0 20px rgb(139 92 246 / 30%);
    transform: translateY(-2px) scale(1.02);
  }
}

.btn-leave-solo-arena .icon {
  font-size: calc(var(--game-width) * 0.055);
  filter: drop-shadow(0 0 5px rgb(255 255 255 / 20%));
  transition: transform 0.3s ease;
}

@media (hover: hover) {
  .btn-leave-solo-arena:hover .icon {
    transform: scale(1.1) translateY(-2px);
  }
}

.btn-leave-solo-arena .text {
  font-size: calc(var(--game-width) * 0.021);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--clr-text-dim);
  transition: color 0.3s ease;
  width: 100%;
  text-align: center;
  line-height: 1.15;
  display: block;
  box-sizing: border-box;
}

@media (hover: hover) {
  .btn-leave-solo-arena:hover .text {
    color: #fff;
  }
}

/* ─── Disconnect Overlay ────────────────────────────────────────── */
.disconnect-overlay {
  border: 2px solid var(--clr-red) !important;
  box-shadow: 0 20px 60px rgb(0 0 0 / 80%), 0 0 30px rgb(239 68 68 / 30%) !important;
  z-index: 4000 !important;
  background: rgb(18 11 38 / 88%) !important;
  padding: 30px 40px !important;
}

.disconnect-title {
  font-family: var(--font-title) !important;
  font-size: clamp(1.3rem, 5vw, 1.8rem) !important;
  color: var(--clr-red) !important;
  text-shadow: 0 0 10px rgb(239 68 68 / 30%);
  margin-bottom: 15px !important;
  text-transform: uppercase;
}

.disconnect-msg {
  color: #fff !important;
  font-size: 1rem !important;
  margin-bottom: 25px !important;
  line-height: 1.5;
}

.disconnect-msg strong {
  color: var(--clr-gold);
}

.new-board-anim .tile {
  animation: board-refresh .5s cubic-bezier(.34, 1.56, .64, 1) both;
}

.new-board-anim .tile:nth-child(5n+1) {
  animation-delay: 0.05s;
}

.new-board-anim .tile:nth-child(5n+2) {
  animation-delay: 0.1s;
}

.new-board-anim .tile:nth-child(5n+3) {
  animation-delay: 0.15s;
}

.new-board-anim .tile:nth-child(5n+4) {
  animation-delay: 0.2s;
}

.new-board-anim .tile:nth-child(5n+5) {
  animation-delay: 0.25s;
}

/* ─── Panels ─────────────────────────────────────────────────────── */
.panel-section {
  background: rgb(17 17 40 / 75%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.panel-label {
  font-size: calc(var(--game-width) * 0.025);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--clr-text-dim);
}

.score-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--game-width) * 0.045);
  font-size: calc(var(--game-width) * 0.03);
  color: var(--clr-gold);
  font-weight: 600;
  margin-top: calc(var(--game-width) * 0.008);
}

.actions {
  gap: 8px;
}

.gems-display {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-cyan);
  text-shadow: var(--glow-cyan);
}

.word-feedback {
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(var(--game-width) * 0.05);
  font-size: calc(var(--game-width) * 0.027);
  font-weight: 600;
  margin-top: calc(var(--game-width) * 0.004) !important;
  width: 100%;
  max-width: 460px;
  white-space: nowrap;
  overflow: hidden;
}

.word-feedback.success {
  color: var(--clr-green);
}

.word-feedback.error {
  color: var(--clr-red);
}

.history-section {
  max-height: 240px;
  overflow-y: auto;
}

.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: calc(var(--game-width) * 0.03);
  padding: calc(var(--game-width) * 0.012) calc(var(--game-width) * 0.02);
  border-radius: var(--radius-sm);
  background: rgb(139 92 246 / 10%);
  animation: history-item-appear .3s ease-out forwards;
  border-left: 3px solid transparent;
  min-height: calc(var(--game-width) * 0.105);
  box-sizing: border-box;
  position: relative;
}

.p0-color {
  background: rgb(139 92 246 / 15%);
  border-left-color: #8b5cf6;
}

.p1-color {
  background: rgb(6 182 212 / 15%);
  border-left-color: #06b6d4;
}

.p2-color {
  background: rgb(245 158 11 / 15%);
  border-left-color: #f59e0b;
}

.p3-color {
  background: rgb(16 185 129 / 15%);
  border-left-color: #10b981;
}

.p0-color .history-player {
  color: #a78bfa;
}

.p1-color .history-player {
  color: #22d3ee;
}

.p2-color .history-player {
  color: #fbbf24;
}

.p3-color .history-player {
  color: #34d399;
}

.p0-text {
  color: #a78bfa !important;
}

.p1-text {
  color: #22d3ee !important;
}

.p2-text {
  color: #fbbf24 !important;
}

.p3-text {
  color: #34d399 !important;
}

.history-num {
  font-weight: 800;
  font-size: calc(var(--game-width) * 0.022);
  color: var(--clr-gold);
  opacity: 0.7;
  margin-right: calc(var(--game-width) * 0.015);
}

.history-main {
  flex: 1;
}

.history-word {
  font-weight: 700;
  color: #fff;
  font-size: calc(var(--game-width) * 0.035);
  line-height: 1.1;
}

.history-m-dl {
  color: #94c0ff;
}

.history-m-tl {
  color: #d1a8ff;
}

.history-m-dw {
  color: #ffdf85;
}

.history-pts {
  color: var(--clr-gold);
  font-weight: 600;
}

.history-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.history-spells {
  display: flex;
  gap: 4px;
}

.history-spell-tag {
  font-size: calc(var(--game-width) * 0.035);
  line-height: 1;
  filter: drop-shadow(0 0 3px rgb(255 255 255 / 20%));
  cursor: pointer;
  transition: transform 0.2s ease;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .history-spell-tag:hover {
    transform: scale(1.3) rotate(15deg);
  }
}

.history-spell-tag:active {
  transform: scale(1.1);
  transition: transform 0.1s;
}

.history-word.is-thinking {
  color: var(--clr-text-dim);
  font-style: italic;
  animation: thinking-pulse 1.5s infinite ease-in-out;
}

@keyframes thinking-pulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.history-player {
  font-size: calc(var(--game-width) * 0.022);
  opacity: 0.5;
  display: block;
  text-transform: uppercase;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  top: calc(var(--game-width) * 0.008);
}

/* Game Center & Timer */
.game-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.turn-indicator {
  text-align: center;
  margin-bottom: 5px;
}

.turn-meta {
  font-size: calc(var(--game-width) * 0.025);
  color: #f8fafc;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.turn-status {
  font-size: calc(var(--game-width) * 0.033);
  font-weight: 800;
  color: #f8fafc;
  padding: 2px 10px;
  border-radius: 4px;
}

.turn-status.my-turn {
  color: #fff;
  background: rgb(139 92 246 / 30%);
  box-shadow: 0 0 15px rgb(139 92 246 / 40%);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px rgb(139 92 246 / 40%);
  }

  50% {
    box-shadow: 0 0 20px rgb(139 92 246 / 60%);
  }

  100% {
    box-shadow: 0 0 5px rgb(139 92 246 / 40%);
  }
}

.timer-display {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.07);
  color: #fff;
  text-shadow: 0 0 15px rgb(255 255 255 / 30%);
  line-height: 1;
}

.timer-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 5px;
}

.btn-timer {
  display: block;
  margin: 0;
  font-size: calc(var(--game-width) * 0.03);
  font-weight: 700;
  padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.03);
  background: var(--clr-gold);
  color: #000;
  border: none;
  border-radius: 6px;
  box-shadow: 0 4px 15px rgb(245 158 11 / 40%);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
  cursor: pointer;
}

@media (hover: hover) {
  .btn-timer:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgb(245 158 11 / 60%);
  }
}

.btn-timer:active:not(:disabled) {
  transform: translateY(0);
}

.btn-timer:disabled {
  background: rgb(255 255 255 / 5%);
  color: rgb(255 255 255 / 30%);
  box-shadow: none;
  cursor: not-allowed;
  border: 1px solid rgb(255 255 255 / 10%);
}

/* Opponent Selection */
.tile.opponent-selected {
  box-shadow: inset 0 0 0 2px rgb(147 197 253 / 50%), 0 0 15px rgb(147 197 253 / 30%);
  opacity: 1;
}

/* Kafelki nieaktywnych graczy — tło i ramka przyciemniane w JS (getPlayerColor),
   tu tylko wyłączamy box-shadow aby nie świecił */
.board.active-turn-p0 .tile.p1-selected:not(.p0-selected),
.board.active-turn-p0 .tile.p2-selected:not(.p0-selected),
.board.active-turn-p0 .tile.p3-selected:not(.p0-selected),
.board.active-turn-p1 .tile.p0-selected:not(.p1-selected),
.board.active-turn-p1 .tile.p2-selected:not(.p1-selected),
.board.active-turn-p1 .tile.p3-selected:not(.p1-selected),
.board.active-turn-p2 .tile.p0-selected:not(.p2-selected),
.board.active-turn-p2 .tile.p1-selected:not(.p2-selected),
.board.active-turn-p2 .tile.p3-selected:not(.p2-selected),
.board.active-turn-p3 .tile.p0-selected:not(.p3-selected),
.board.active-turn-p3 .tile.p1-selected:not(.p3-selected),
.board.active-turn-p3 .tile.p2-selected:not(.p3-selected) {
  box-shadow: none !important;
}

/* Board disabled during opponent turn — brak blokady pointer-events (gracz może pomagać) */


/* Ochrona kafelków aktywnego gracza przed wyszarzeniem na ekranach graczy bez tury */
.board.active-turn-p0.disabled .tile.p0-selected,
.board.active-turn-p1.disabled .tile.p1-selected,
.board.active-turn-p2.disabled .tile.p2-selected,
.board.active-turn-p3.disabled .tile.p3-selected {
  filter: none !important;
  opacity: 1 !important;
}

.player-card.is-offline {
  filter: grayscale(1) opacity(0.5);
  transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(8 4 18 / 45%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  display: flex;
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: linear-gradient(145deg, #1e1b4b, #0f172a);
  padding: 30px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--clr-purple);
  box-shadow: 0 0 50px rgb(139 92 246 / 30%);
  text-align: center;
  max-width: 400px;
  width: 90%;
  margin-top: env(safe-area-inset-top, 0);
  margin-bottom: env(safe-area-inset-bottom, 0);
}

.letter-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: calc(var(--game-width) * 0.018);
  margin: calc(var(--game-width) * 0.04) 0;
}

.letter-btn {
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: calc(var(--game-width) * 0.016);
  color: #fff;
  font-size: calc(var(--game-width) * 0.048);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 1;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.letter-btn-char {
  pointer-events: none;
}

.letter-btn-val {
  position: absolute;
  bottom: calc(var(--game-width) * 0.008);
  right: calc(var(--game-width) * 0.012);
  font-size: calc(var(--game-width) * 0.02);
  opacity: 0.6;
  font-weight: normal;
  pointer-events: none;
}

@media (hover: hover) {
  .letter-btn:hover {
    background: var(--clr-primary);
    border-color: var(--clr-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgb(139 92 246 / 30%);
  }
}

.letter-picker-content {
  max-width: calc(var(--game-width) - 24px) !important;
  width: 92% !important;
  padding: calc(var(--game-width) * 0.06) !important;
  border-radius: calc(var(--game-width) * 0.04) !important;
}

.letter-picker-content h3 {
  font-size: calc(var(--game-width) * 0.042) !important;
  margin-bottom: calc(var(--game-width) * 0.015) !important;
}

.letter-picker-content #btn-cancel-swap {
  font-size: calc(var(--game-width) * 0.035) !important;
  padding: calc(var(--game-width) * 0.02) calc(var(--game-width) * 0.04) !important;
  width: auto !important;
  display: inline-flex !important;
}

/* ─── Overlay (Game Over) ────────────────────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgb(8 4 18 / 45%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: linear-gradient(135deg, var(--clr-surface) 0%, #1d0f3a 100%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: calc(var(--game-width) * 0.07) calc(var(--game-width) * 0.05);
  padding-bottom: calc(var(--game-width) * 0.08 + env(safe-area-inset-bottom, 0px));
  width: min(var(--game-width), 94vw);
  text-align: center;
  box-shadow: 0 0 100px rgb(139 92 246 / 30%);
  animation: slide-in .4s ease;
}

.overlay-icon {
  font-size: calc(var(--game-width) * 0.12);
  margin-bottom: calc(var(--game-width) * 0.03);
}

.overlay-card h2 {
  font-family: var(--font-title);
  font-size: calc(var(--game-width) * 0.065);
  background: linear-gradient(135deg, #a78bfa, #06b6d4);
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: calc(var(--game-width) * 0.02);
}

.overlay-card p {
  color: var(--clr-text-dim);
  margin-bottom: 24px;
}

.final-scores {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--game-width) * 0.03);
  justify-content: center;
  margin: 0 auto calc(var(--game-width) * 0.06);
  width: 100%;
  max-width: calc(var(--game-width) * 0.85);
}

.final-score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(var(--game-width) * 0.005);
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  padding: calc(var(--game-width) * 0.025) calc(var(--game-width) * 0.02);
  flex: 0 0 calc(50% - calc(var(--game-width) * 0.015));
  max-width: calc(50% - calc(var(--game-width) * 0.015));
  box-sizing: border-box;
  text-align: center;
}

.final-score-block.p0 {
  background: rgb(139 92 246 / 12%);
  border-color: rgb(139 92 246 / 50%);
  box-shadow: 0 0 20px rgb(139 92 246 / 25%);
}

.final-score-block.p1 {
  background: rgb(6 182 212 / 12%);
  border-color: rgb(6 182 212 / 50%);
  box-shadow: 0 0 20px rgb(6 182 212 / 25%);
}

.final-score-block.p2 {
  background: rgb(245 158 11 / 12%);
  border-color: rgb(245 158 11 / 50%);
  box-shadow: 0 0 20px rgb(245 158 11 / 25%);
}

.final-score-block.p3 {
  background: rgb(16 185 129 / 12%);
  border-color: rgb(16 185 129 / 50%);
  box-shadow: 0 0 20px rgb(16 185 129 / 25%);
}

.final-score-block.p0 strong {
  color: #a78bfa;
  text-shadow: 0 0 10px rgb(167 139 250 / 50%);
}

.final-score-block.p1 strong {
  color: #22d3ee;
  text-shadow: 0 0 10px rgb(34 211 238 / 50%);
}

.final-score-block.p2 strong {
  color: #fbbf24;
  text-shadow: 0 0 10px rgb(251 191 36 / 50%);
}

.final-score-block.p3 strong {
  color: #34d399;
  text-shadow: 0 0 10px rgb(52 211 153 / 50%);
}


.score-content {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: 2.5rem;
}

.score-wrapper {
  position: relative;
  display: inline-flex;
  align-items: baseline;
}


.final-score-block span {
  font-size: calc(var(--game-width) * 0.028);
  color: #fff;
}

.final-score-block strong,
.base-val {
  font-size: calc(var(--game-width) * 0.07);
  font-weight: 800;
  line-height: 1.1;
  color: var(--clr-gold);
}

/* Historia ruchów na ekranie końcowym */
#go-history-section {
  width: 100%;
  margin-top: 12px;
}

.go-history-toggle {
  width: 100%;
  padding: 10px 16px;
  background: rgb(255 255 255 / 8%);
  border: 1px solid rgb(255 255 255 / 15%);
  border-radius: 10px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.03em;
}

@media (hover: hover) {
  .go-history-toggle:hover {
    background: rgb(255 255 255 / 14%);
  }
}

.go-history-list {
  list-style: none;
  padding: 8px 0 0;
  margin: 0;
  max-height: 260px;
  overflow-y: auto;
}

.go-history-list.hidden {
  display: none;
}

.go-history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: rgb(255 255 255 / 5%);
  border-radius: 8px;
  font-size: 0.8rem;
}

.go-history-num {
  color: rgb(255 255 255 / 40%);
  font-size: 0.72rem;
  min-width: 24px;
}

.go-history-player {
  color: rgb(255 255 255 / 60%);
  font-size: 0.75rem;
  min-width: 50px;
}

.go-history-word {
  font-weight: 700;
  color: #fff;
  flex: 1;
  letter-spacing: 0.05em;
}

.go-history-spells {
  display: flex;
  gap: 2px;
}

.go-history-pts {
  color: #f59e0b;
  font-weight: 700;
  min-width: 32px;
  text-align: right;
}

.gem-on-tile {
  position: absolute;
  top: calc(var(--tile-size) * 0.1);
  right: calc(var(--tile-size) * 0.1);
  width: calc(var(--tile-size) * 0.25);
  height: calc(var(--tile-size) * 0.25);
  background: radial-gradient(circle at 30% 30%, #06b6d4, #0891b2);
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
  box-shadow: 0 0 10px rgb(6 182 212 / 60%);
  z-index: 3;
  animation: gem-float 2s ease-in-out infinite;
}

@keyframes gem-float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-3px) rotate(10deg);
  }
}

/* Gems & Spells */
.gems-container {
  display: grid;
  grid-template-columns: repeat(10, 1fr);

  /* 10 równych kolumn */
  gap: calc(var(--game-width) * 0.015);
  margin-bottom: 8px;
  width: 100%;
}

.gem-slot {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: rgb(255 255 255 / 5%);
  border: 1px solid rgb(255 255 255 / 10%);
  clip-path: polygon(50% 0%, 100% 35%, 80% 100%, 20% 100%, 0% 35%);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.gem-slot.filled {
  background: var(--clr-cyan);
  box-shadow: 0 0 10px var(--clr-cyan);
  border-color: #fff;
}

.spells-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-spell {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  padding: calc(var(--game-width) * 0.030) calc(var(--game-width) * 0.03);
  font-size: calc(var(--game-width) * 0.032);
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@keyframes spell-blink {

  0%,
  100% {
    box-shadow: 0 0 4px rgb(6 182 212 / 30%);
    border-color: rgb(139 92 246 / 40%);
  }

  50% {
    box-shadow: var(--glow-cyan);
    border-color: rgb(139 92 246 / 80%);
  }
}

@keyframes spell-bg-blink {

  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.btn-spell.spell-confirming {
  animation: spell-blink 1.25s ease-in-out infinite !important;
}

.btn-spell.spell-confirming::before {
  animation: spell-bg-blink 1.25s ease-in-out infinite !important;
}

/* Pressed state only for the active toggle spell (Swap letter) */
.btn-spell.active {
  transform: scale(0.95) !important;
  box-shadow: var(--glow-cyan) !important;
  border-color: rgb(6 182 212 / 80%) !important;
}

/* Active Swap Tile background stays permanently lit in hover state */
.btn-spell.active::before {
  opacity: 1 !important;
}

.btn-spell.spell-fading-out {
  transition: box-shadow 0.4s ease, border-color 0.4s ease !important;
  box-shadow: 0 0 4px rgb(6 182 212 / 30%) !important;
  border-color: rgb(139 92 246 / 40%) !important;
}

.btn-spell.spell-fading-out::before {
  transition: opacity 0.4s ease !important;
  opacity: 0 !important;
}

.gem-cost {
  opacity: 0.7;
  font-size: 0.75rem;
}

.spell-tip {
  font-size: 0.75rem;
  color: var(--clr-gold);
  text-align: center;
  margin-top: 5px;
  font-style: italic;
  animation: pulse-glow 2s infinite;
}

/* Responsive */

/* Animacje podsumowania końcowego */
.base-val {
  font-weight: 800;
  font-size: calc(var(--game-width) * 0.055) !important;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
  line-height: 1;
  display: block;
  width: 100%;
}

.base-val.shiny {
  color: #fbbf24 !important;
  background: linear-gradient(135deg, #f59e0b, #fcd34d) !important;
  background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  text-shadow: 0 0 20px rgb(245 158 11 / 80%) !important;
  animation: score-glow 2s ease-in-out infinite alternate !important;
}

.base-val.plain-gold {
  color: #fbbf24;
  background: none;
  -webkit-text-fill-color: initial;
  text-shadow: none !important;
}

.score-unit {
  font-size: 0.55em;
  opacity: 0.7;
  color: #fff;
  font-weight: 400;
  margin-left: 2px;
}

.bonus-val {
  color: var(--clr-cyan);
  font-size: 0.85rem;
  font-weight: 800;
  transition: background 0.6s ease, color 0.6s ease, border-color 0.6s ease, box-shadow 0.6s ease, opacity 0.6s ease, filter 0.6s ease, transform 0.6s ease;
  white-space: pre !important;

  /* Wymusza brak zawijania */
  pointer-events: none;
  position: absolute;
  left: 100%;
  margin-left: 8px;
  top: 50%;
  transform: translateY(-30%);
  text-align: left;
}

.final-pop {
  animation: score-pop 0.4s ease-out;
  text-shadow: 0 0 15px var(--clr-gold) !important;
}

@keyframes score-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.2);
  }

  100% {
    transform: scale(1);
  }
}

/* Custom Premium Tooltip */
.custom-tooltip {
  position: fixed;
  pointer-events: none;
  background: rgb(15 23 42 / 85%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgb(139 92 246 / 40%);
  color: #fff;
  padding: calc(var(--game-width) * 0.016) calc(var(--game-width) * 0.028);
  border-radius: calc(var(--game-width) * 0.02);
  font-size: calc(var(--game-width) * 0.026);
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 32px rgb(0 0 0 / 50%), 0 0 15px rgb(139 92 246 / 20%);
  transition: opacity 0.15s ease;
  opacity: 0;
  white-space: nowrap;
}

.custom-tooltip.active {
  opacity: 1;
}

/* Mini Profile Tooltip Card styles */
.mini-card {
  display: flex;
  flex-direction: column;
  gap: calc(var(--game-width) * 0.015);
  min-width: calc(var(--game-width) * 0.35);
  max-width: calc(var(--game-width) * 0.45);
  padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.015);
}

.mini-card-header {
  display: flex;
  align-items: center;
  gap: calc(var(--game-width) * 0.02);
  border-bottom: 1px solid rgb(255 255 255 / 8%);
  padding-bottom: calc(var(--game-width) * 0.01);
}

.mini-card-avatar {
  width: calc(var(--game-width) * 0.075);
  height: calc(var(--game-width) * 0.075);
  border-radius: 50%;
  border: calc(var(--game-width) * 0.003) solid rgb(139 92 246 / 50%);
  object-fit: cover;
}

.mini-card-info {
  display: flex;
  flex-direction: column;
  gap: calc(var(--game-width) * 0.002);
}

.mini-card-name {
  font-size: calc(var(--game-width) * 0.03);
  font-weight: 700;
  color: #fff;
}

.mini-card-title {
  font-size: calc(var(--game-width) * 0.022);
  font-weight: 600;
  color: #a78bfa;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mini-card-stats {
  display: flex;
  flex-direction: column;
  gap: calc(var(--game-width) * 0.008);
}

.mini-card-stat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: calc(var(--game-width) * 0.024);
  gap: calc(var(--game-width) * 0.04);
}

.mini-card-label {
  color: rgb(255 255 255 / 60%);
  font-weight: 500;
}

.mini-card-value {
  color: #fff;
  font-weight: 700;
  text-align: right;
}

.mini-card-loading {
  font-size: calc(var(--game-width) * 0.024);
  color: #a78bfa;
  padding: calc(var(--game-width) * 0.01) calc(var(--game-width) * 0.02);
  display: flex;
  align-items: center;
  gap: calc(var(--game-width) * 0.01);
}

/* ─── Modals ─────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgb(8 4 18 / 45%);
  backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease, filter 0.3s ease, transform 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: linear-gradient(135deg, var(--clr-surface) 0%, #1d0f3a 100%);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: calc(var(--game-width) - 40px);
  max-width: 90vw;
  box-shadow: 0 0 50px rgb(0 0 0 / 50%);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

/* --- Stats Modal --- */
.stats-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--clr-border);
  padding-bottom: 16px;
}

.stats-avatar-wrapper {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--clr-gold);
  overflow: hidden;
  box-shadow: 0 0 15px rgb(245 158 11 / 30%);
}

#stats-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#stats-name {
  font-family: var(--font-title);
  font-size: 1.5rem;
  color: #fff;
}

.stats-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-item {
  background: rgb(255 255 255 / 5%);
  padding: calc(var(--game-width) * 0.02) !important;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: calc(var(--game-width) * 0.008) !important;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--clr-purple-lt);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: #fff;
  white-space: nowrap;
}

/* ─── LEADERBOARD & HALL OF FAME (CONSOLIDATED) ───────────────── */

.modal-content.leaderboard-modal-content {
  width: calc(var(--game-width) - 24px) !important;
  max-width: 95% !important;
  margin: 0 auto !important;
  padding: 0 !important;

  /* Usuwamy mikropaddingi */
  background: #1a1a38;
  border: 1px solid var(--clr-border) !important;
  overflow: hidden;
  box-sizing: border-box;
}

.leaderboard-modal-content h2 {
  font-size: calc(var(--game-width) * 0.07) !important;
  margin: calc(var(--game-width) * 0.02) 0 calc(var(--game-width) * 0.016) !important;
  text-align: center;
}

.leaderboard-mode-filters {
  display: flex;
  justify-content: center;
  gap: calc(var(--game-width) * 0.018);
  padding: 0 calc(var(--game-width) * 0.03);
  margin-top: calc(var(--game-width) * 0.022);
  margin-bottom: calc(var(--game-width) * 0.01);
}

.mode-filter-btn {
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-dim);
  padding: calc(var(--game-width) * 0.015) calc(var(--game-width) * 0.035) !important;
  border-radius: calc(var(--game-width) * 0.04);
  font-size: calc(var(--game-width) * 0.025) !important;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s, transform 0.2s;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mode-filter-btn.active {
  background: var(--clr-blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 10px rgb(50 150 255 / 50%);
}

@media (hover: hover) {
  .mode-filter-btn:hover:not(.active) {
    background: rgb(255 255 255 / 12%);
    color: #fff;
    border-color: rgb(59 130 246 / 50%);
    transform: translateY(-1px);
  }

  .mode-filter-btn.active:hover {
    background: #3b82f6;
    box-shadow: 0 0 15px rgb(50 150 255 / 80%);
    transform: translateY(-1px);
  }
}


.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: calc(var(--game-width) * 0.015);
  padding: 0 calc(var(--game-width) * 0.025);

  /* Padding tylko dla przycisków */
  margin: calc(var(--game-width) * 0.025) 0;
}

.leaderboard-tabs .tab-btn {
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--clr-border);
  color: var(--clr-text-dim);
  padding: calc(var(--game-width) * 0.016) calc(var(--game-width) * 0.01) !important;
  border-radius: calc(var(--game-width) * 0.016);
  font-size: calc(var(--game-width) * 0.024) !important;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.2s, filter 0.2s, transform 0.2s;
  user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.leaderboard-tabs .tab-btn.active {
  background: var(--clr-purple);
  color: #fff;
  border-color: transparent;
  box-shadow: var(--glow-purple);
}

@media (hover: hover) {
  .leaderboard-tabs .tab-btn:hover:not(.active) {
    background: rgb(255 255 255 / 12%);
    color: #fff;
    border-color: rgb(139 92 246 / 50%);
    transform: translateY(-1px);
  }

  .leaderboard-tabs .tab-btn.active:hover {
    background: #9d6eff;
    box-shadow: 0 0 15px rgb(139 92 246 / 80%);
    transform: translateY(-1px);
  }
}

.leaderboard-content {
  height: calc((var(--game-width) * 0.1) + (var(--game-width) * 0.95) + 2px) !important;
  overflow-y: auto;
  background: #12122a;
  border-top: 1px solid rgb(255 255 255 / 10%);

  /* Subtelna linia pod zakładkami */
  border-bottom: 1px solid rgb(255 255 255 / 10%);

  /* Subtelna linia na dole tabeli */
  width: 100%;
  box-sizing: border-box;
}

/* Custom scrollbar dla stabilności wizualnej */
.leaderboard-content::-webkit-scrollbar {
  width: 6px;
}

.leaderboard-content::-webkit-scrollbar-track {
  background: #1a1a38;
}

.leaderboard-content::-webkit-scrollbar-thumb {
  background: var(--clr-border);
  border-radius: 10px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: separate;

  /* Stabilniejsze dla sticky niż collapse */
  border-spacing: 0;
  table-layout: fixed;
  margin-bottom: 0;
}

.leaderboard-table td {
  border-right: 1px solid rgb(255 255 255 / 5%);
  border-bottom: 1px solid rgb(255 255 255 / 5%);
  padding: 0 calc(var(--game-width) * 0.01) !important;

  /* No vertical padding to keep row height strictly identical */
  height: calc(var(--game-width) * 0.095) !important;

  /* Fixed strict height */
  font-size: 1em !important;
  color: var(--clr-text);
  vertical-align: middle;
}

.leaderboard-table th:last-child,
.leaderboard-table td:last-child {
  border-right: none;
}

.leaderboard-table thead tr {
  position: sticky;
  top: 0;

  /* Powrót do 0 eliminuje "skok" przy startowaniu scrolla */
  z-index: 12;
  background: #1a1a38 !important;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  z-index: 12;
  background: transparent !important;
  color: var(--clr-purple-lt);
  height: calc(var(--game-width) * 0.1) !important;
  border-top: 1px solid #31314c !important;

  /* 100% opaque border equivalent to 10% white over #1a1a38 */
  border-bottom: 1px solid #31314c !important;

  /* 100% opaque border equivalent to 10% white over #1a1a38 */
  border-right: none !important;
  overflow: visible;
  font-family: var(--font-body) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.th-content {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  font-size: 1em !important;
  width: auto;
  min-width: max-content;
  pointer-events: none;
}

.leaderboard-table tfoot {
  position: sticky;
  bottom: 0;
  z-index: 15;
}

/* Przenosimy sticky na komórki td stopki dla stabilności */
.leaderboard-table tfoot td {
  position: sticky;
  bottom: 0;

  /* Powrót do 0 dla stabilności */
  z-index: 15;
  background: #1a1a38;
  transform: translateZ(0);
  will-change: transform;
}

/* Hover efekt dla wierszy */
@media (hover: hover) {
  .leaderboard-table tbody tr:hover {
    background: rgb(255 255 255 / 3%);
  }
}

/* My Rank Sticky Row */
.me-row td {
  position: sticky;
  top: calc(var(--game-width) * 0.1) !important;

  /* Tuż pod przyklejonym nagłówkiem */
  bottom: 0;

  /* Przyklejony na dole, gdy jesteśmy wyżej na liście */
  z-index: 20 !important;

  /* Powyżej zwykłych tr (z-index 11) i thead tr (z-index 12) */
  background: #1a1a38 !important;
  border-top: 1px solid var(--clr-primary) !important;
  border-bottom: 1px solid var(--clr-primary) !important;
  border-left: none !important;
  border-right: 1px solid #252542 !important;

  /* 100% opaque border equivalent to 5% white over #1a1a38 */
  color: var(--clr-primary) !important;
  font-weight: 800 !important;
  box-shadow: inset 0 1px 0 var(--clr-primary), inset 0 -1px 0 var(--clr-primary), 0 -10px 25px rgb(0 0 0 / 50%);
  clip-path: inset(0 -100px 0 -100px) !important;

  /* Maska 100% w pionie (odcina cień na sąsiednie wiersze), ale pozwala cieniom lekko nachodzić na kolumny w poziomie */
}

.me-row td:last-child {
  border-right: none !important;
}

.me-row .col-word {
  color: #fff !important;
}

/* Column Alignment & Specifics */
td.col-rank {
  text-align: center;
  color: var(--clr-gold);
  font-weight: 700;
}

td.col-lang {
  text-align: center;
  color: var(--clr-text);
}

td.col-word {
  text-align: center;
  font-family: var(--font-tile);
  font-size: 1.15em;
}

td.col-val {
  text-align: center;
  font-family: var(--font-title);
  color: var(--clr-cyan);
}

td.col-wizard {
  font-size: 1.1em;
}

/* Dynamic Scaling Utilities */
.scale-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.12s ease-in-out;
}

.leaderboard-table.scaling-done .scale-wrapper {
  opacity: 1 !important;
}

.leaderboard-table th .scale-wrapper {
  overflow: visible !important;
  position: relative;
  z-index: 15;
}

.scale-wrapper.left {
  justify-content: flex-start;
}

.scale-content {
  white-space: nowrap;
  transform-origin: center center;
}

.scale-wrapper.left .scale-content {
  transform-origin: left center;
}

.wizard-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: calc(var(--game-width) * 0.015);
  height: 100%;
  width: 100%;
}

.wizard-cell span {
  flex: 1;
  white-space: nowrap;
}

.lb-avatar {
  width: calc(var(--game-width) * 0.055);
  height: calc(var(--game-width) * 0.055);
  border-radius: 50%;
  border: 1px solid var(--clr-border);
  flex-shrink: 0;

  /* Prevent avatar from shrinking when nickname is extremely long */
}

/* --- Profile View in Hall of Fame --- */
.lb-profile-view {
  animation: fadeIn 0.3s ease;
  padding: 25px;
  min-height: calc(45px + (var(--game-width) * 0.95) + 2px) !important;

  /* Spójność z nową wysokością tabeli */
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.leaderboard-content.profile-active {
  height: calc((var(--game-width) * 0.1) + (var(--game-width) * 0.95) + 2px) !important;
}

.leaderboard-content.profile-active .lb-profile-view {
  min-height: 0 !important;
  padding: 15px 25px 25px;
}

.lb-name-wrapper {
  line-height: 1.2;
}

.lb-subtext {
  font-family: var(--font-body);
  letter-spacing: 0.5px;
  font-size: 0.65em !important;
  color: var(--clr-text-dim);
}

.lb-profile-view .stats-name {
  font-size: 1.2em !important;
}

.lb-profile-view .stat-label {
  font-size: 0.6em !important;
  white-space: normal !important;
  line-height: 1.1 !important;
  text-align: center;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 2.2em;
  overflow-wrap: break-word !important;
  word-break: break-word !important;
}

.lb-profile-view .stat-label .rule-badge {
  font-size: 0.8em !important;
  padding: 0.1em 0.4em !important;
  min-width: 1.8em !important;
  border-radius: 0.3em !important;
  margin: 0 !important;
  line-height: 1 !important;
  display: inline-block !important;
}

.lb-profile-view .stat-value {
  font-size: 1em !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

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

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

/* ─── Screen Resizer ─────────────────────────────────────────────── */
.resize-handle {
  position: absolute;
  top: 0;
  width: 16px;
  height: 100%;
  cursor: col-resize;
  z-index: 10000;
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.resize-handle-left {
  left: -8px;
}

.resize-handle-right {
  right: -8px;
}

@media (hover: hover) {
  .resize-handle:hover {
    background-color: rgb(139 92 246 / 12%);
    box-shadow: inset 0 0 10px rgb(139 92 246 / 20%), 0 0 15px rgb(139 92 246 / 35%);
  }
}

body.resizing-active {
  cursor: col-resize !important;
  user-select: none !important;
  user-select: none !important;
}

body.resizing-active * {
  cursor: col-resize !important;
  user-select: none !important;
  user-select: none !important;
}

/* Hide handles only if the device has a coarse pointer (touch) and no hover capability */
@media (pointer: coarse) and (hover: none) {
  .resize-handle {
    display: none !important;
  }
}

/* ─── Linked Party Style ─────────────────────────────────────────── */
#linked-party-group {
  margin-top: calc(var(--game-width) * 0.03);
  margin-bottom: calc(var(--game-width) * 0.03);
}

.linked-party-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(var(--game-width) * 0.015);
  background: rgb(255 255 255 / 5%);
  border: 1px solid var(--clr-border);
  padding: calc(var(--game-width) * 0.02) calc(var(--game-width) * 0.03);
  border-radius: calc(var(--game-width) * 0.016);
}

.linked-party-slots {
  display: flex;
  gap: calc(var(--game-width) * 0.018);
}

.party-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: calc(var(--game-width) * 0.11);
  position: relative;
}

.party-avatar-wrapper {
  position: relative;
  width: calc(var(--game-width) * 0.082);
  height: calc(var(--game-width) * 0.082);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: calc(var(--game-width) * 0.005) solid rgb(139 92 246 / 20%);
  background: rgb(255 255 255 / 3%);
  transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Styled for empty slots: grey background with green plus icon */
.party-slot.empty .party-avatar-wrapper {
  border: calc(var(--game-width) * 0.005) dashed rgb(255 255 255 / 12%);
  background: rgb(255 255 255 / 1%);
  cursor: pointer;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (hover: hover) {
  .party-slot.empty:hover .party-avatar-wrapper {
    border-color: #10B981;
    background: rgb(16 185 129 / 8%);
    transform: scale(1.05);
    box-shadow: 0 0 calc(var(--game-width) * 0.025) rgb(16 185 129 / 25%);
  }
}

.party-slot.empty .party-avatar-wrapper:active {
  transform: scale(0.95);
  border-color: #10B981;
  background: rgb(16 185 129 / 12%);
}

.party-avatar-plus {
  color: #10B981;

  /* Emerald / Magic Green */
  font-size: calc(var(--game-width) * 0.045);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
}

/* Styled for active zlinked-active state with a vibrant magic purple neon pulse glow */
.party-slot.active .party-avatar-wrapper {
  border-color: #8B5CF6;
  background: linear-gradient(135deg, rgb(139 92 246 / 25%), rgb(236 72 153 / 25%));
  box-shadow: 0 0 calc(var(--game-width) * 0.02) rgb(139 92 246 / 40%), inset 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 20%);
  animation: partyPulse 2s infinite ease-in-out;
}

@keyframes partyPulse {
  0% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(139 92 246 / 30%);
  }

  50% {
    box-shadow: 0 0 calc(var(--game-width) * 0.03) rgb(139 92 246 / 70%);
  }

  100% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(139 92 246 / 30%);
  }
}

/* Styled for active in-game state with a vibrant premium red neon pulse glow */
.party-slot.active.in-game .party-avatar-wrapper {
  border-color: #EF4444;
  background: linear-gradient(135deg, rgb(239 68 68 / 25%), rgb(244 63 94 / 25%));
  box-shadow: 0 0 calc(var(--game-width) * 0.02) rgb(239 68 68 / 40%), inset 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 20%);
  animation: partyPulseRed 2s infinite ease-in-out;
}

@keyframes partyPulseRed {
  0% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(239 68 68 / 30%);
  }

  50% {
    box-shadow: 0 0 calc(var(--game-width) * 0.03) rgb(239 68 68 / 70%);
  }

  100% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(239 68 68 / 30%);
  }
}

/* Styled for active but unlinked state (just a simple gray border, no glow/purple/pulse) */
.party-slot.active.unlinked .party-avatar-wrapper {
  border: calc(var(--game-width) * 0.005) solid rgb(255 255 255 / 15%);
  background: rgb(255 255 255 / 3%);
  box-shadow: none;
  animation: none;
}

/* Styled for unlinked in-game state: gets a premium gray neon pulse glow */
.party-slot.active.unlinked.in-game .party-avatar-wrapper {
  border-color: rgb(255 255 255 / 40%);
  background: linear-gradient(135deg, rgb(255 255 255 / 10%), rgb(255 255 255 / 5%));
  box-shadow: 0 0 calc(var(--game-width) * 0.02) rgb(255 255 255 / 20%), inset 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 10%);
  animation: partyPulseGray 2s infinite ease-in-out;
}

@keyframes partyPulseGray {
  0% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 10%);
  }

  50% {
    box-shadow: 0 0 calc(var(--game-width) * 0.03) rgb(255 255 255 / 30%);
  }

  100% {
    box-shadow: 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 10%);
  }
}



.party-avatar-inner {
  font-size: calc(var(--game-width) * 0.036);
  font-weight: 600;
  color: #F3F4F6;
  text-transform: uppercase;
}

.party-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.party-crown {
  position: absolute;
  top: calc(var(--game-width) * -0.018);
  right: calc(var(--game-width) * -0.012);
  font-size: calc(var(--game-width) * 0.026);
  z-index: 2;
  transform: rotate(15deg);
  filter: drop-shadow(0 calc(var(--game-width) * 0.005) calc(var(--game-width) * 0.01) rgb(0 0 0 / 50%));
  display: none;
}

.party-slot.leader .party-crown {
  display: block;
}

.party-kick {
  position: absolute;
  top: calc(var(--game-width) * -0.005);
  right: calc(var(--game-width) * -0.005);
  width: calc(var(--game-width) * 0.026);
  height: calc(var(--game-width) * 0.026);
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: calc(var(--game-width) * 0.020);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  box-shadow: 0 calc(var(--game-width) * 0.002) calc(var(--game-width) * 0.008) rgb(239 68 68 / 40%);
  opacity: 0;
  pointer-events: none;
  transition: background 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.2s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), filter 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
}

@media (hover: hover) {
  .party-slot.active:hover .party-kick {
    opacity: 1;
    pointer-events: auto;
  }

  .party-kick:hover {
    background: #dc2626;
    transform: scale(1.15);
    box-shadow: 0 calc(var(--game-width) * 0.003) calc(var(--game-width) * 0.012) rgb(220 38 38 / 60%);
  }
}

.party-name {
  margin-top: calc(var(--game-width) * 0.01);
  font-size: calc(var(--game-width) * 0.032);
  color: rgb(255 255 255 / 50%);
  width: calc(var(--game-width) * 0.135);
  max-width: calc(var(--game-width) * 0.135);
  white-space: nowrap;
  text-align: center;
  transition: color 0.3s ease;
}

.party-slot.active .party-name {
  color: rgb(255 255 255 / 85%);
  font-weight: 500;
}

.btn-party-link {
  width: calc(var(--game-width) * 0.24);
  height: calc(var(--game-width) * 0.088);
  padding: 0 !important;
  font-size: calc(var(--game-width) * 0.024) !important;
  font-weight: 700;
  border-radius: calc(var(--game-width) * 0.016) !important;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border) !important;
  color: var(--clr-text-dim) !important;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, filter 0.2s ease, transform 0.2s ease;
  user-select: none;
}

@media (hover: hover) {
  .btn-party-link:hover:not(.zlink-active) {
    background: rgb(255 255 255 / 5%);
    color: var(--clr-text) !important;
  }
}

.btn-party-link.zlink-active {
  background: linear-gradient(135deg, #7c3aed, #2563eb) !important;
  border-color: transparent !important;
  color: #FFF !important;
  box-shadow: var(--glow-purple);
}

@media (hover: hover) {
  .btn-party-link.zlink-active:hover {
    filter: brightness(1.15);
  }
}



/* ─── Loading State for Party Slot ─── */
.party-slot.loading .party-avatar-inner {
  opacity: 0 !important;
}

.party-slot.loading .party-crown {
  display: none !important;
}

.party-slot.loading .party-avatar-wrapper {
  border-color: #8B5CF6 !important;
  background: linear-gradient(135deg, rgb(139 92 246 / 25%), rgb(236 72 153 / 25%)) !important;
  box-shadow: 0 0 calc(var(--game-width) * 0.02) rgb(139 92 246 / 40%), inset 0 0 calc(var(--game-width) * 0.01) rgb(255 255 255 / 20%) !important;
  animation: partyPulse 1.5s infinite ease-in-out !important;
}

.party-slot.loading .party-avatar-wrapper::after {
  content: '';
  position: absolute;
  width: calc(var(--game-width) * 0.035);
  height: calc(var(--game-width) * 0.035);
  border: calc(var(--game-width) * 0.005) solid rgb(255 255 255 / 15%);
  border-top-color: #8B5CF6;
  border-radius: 50%;
  animation: partySpinner 0.8s linear infinite;
  box-sizing: border-box;
}

.party-slot.loading .party-name::after {
  content: '';
  display: inline-block;
  width: 12px;
  text-align: left;
  animation: partyDots 1.5s steps(4, end) infinite;
}

@keyframes partyDots {

  0%,
  20% {
    content: '';
  }

  40% {
    content: '.';
  }

  60% {
    content: '..';
  }

  80%,
  100% {
    content: '...';
  }
}

@keyframes partySpinner {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ─── Skeleton Loader & Shimmer Styles ─── */
.skeleton {
  position: relative;
  overflow: hidden;
  background: rgb(255 255 255 / 4%) !important;
  border-radius: calc(var(--game-width) * 0.016) !important;
  box-sizing: border-box;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg,
      transparent,
      rgb(255 255 255 / 8%),
      transparent);
  animation: lbShimmer 1.6s infinite;
}

@keyframes lbShimmer {
  100% {
    transform: translateX(100%);
  }
}

.skeleton-avatar {
  border-radius: 50% !important;
  border: 1px solid rgb(255 255 255 / 8%) !important;
}

.skeleton-text {
  border-radius: calc(var(--game-width) * 0.008) !important;
}

.skeleton-label {
  height: calc(var(--game-width) * 0.02) !important;
  width: calc(var(--game-width) * 0.12) !important;
  margin-bottom: calc(var(--game-width) * 0.01) !important;
  border-radius: calc(var(--game-width) * 0.004) !important;
}

.skeleton-value {
  height: calc(var(--game-width) * 0.035) !important;
  width: calc(var(--game-width) * 0.18) !important;
  border-radius: calc(var(--game-width) * 0.006) !important;
}

#btn-close-leaderboard {
  display: flex !important;
  width: max-content !important;
  margin: calc(var(--game-width) * 0.02) auto !important;
  padding: calc(var(--game-width) * 0.015) calc(var(--game-width) * 0.08) !important;
  font-size: calc(var(--game-width) * 0.035) !important;
  border-radius: calc(var(--game-width) * 0.018) !important;
  align-items: center;
  justify-content: center;
}