/* Игровой стол: оппоненты, голос, таймер, действия, победа/поражение, приглашение */

.table-hint {
  font-size: 0.8rem;
  color: var(--text-primary);
  text-align: center;
  padding: 0.75rem 1rem;
  pointer-events: none;
  line-height: 1.45;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
  max-width: 72%;
  position: relative;
  z-index: 1;
}

.mic-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  height: 28px;
  justify-content: flex-end;
  color: var(--text-muted);
  opacity: 0.35;
  transition: opacity 0.2s, color 0.2s;
}

.mic-indicator.idle .mic-bars i {
  animation: none;
  transform: scaleY(0.25);
}

.mic-indicator.speaking {
  opacity: 1;
  color: var(--orange-light);
}

.mic-indicator.speaking .mic-svg {
  filter: drop-shadow(0 0 6px var(--orange-glow));
  animation: micPulse 0.55s ease-in-out infinite alternate;
}

.mic-svg {
  width: 16px;
  height: 16px;
  display: block;
}

.mic-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.mic-bars i {
  display: block;
  width: 3px;
  height: 10px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleY(0.25);
  transform-origin: bottom;
}

.mic-indicator.speaking .mic-bars i:nth-child(1) {
  animation: micBar 0.45s ease-in-out infinite alternate;
}

.mic-indicator.speaking .mic-bars i:nth-child(2) {
  animation: micBar 0.38s ease-in-out 0.08s infinite alternate;
}

.mic-indicator.speaking .mic-bars i:nth-child(3) {
  animation: micBar 0.52s ease-in-out 0.04s infinite alternate;
}

#btn-ready.is-ready {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  border-color: var(--glass-border);
}

#game-screen.phase-waiting .turn-indicator,
#game-screen.phase-waiting .action-bar {
  display: none !important;
}

#game-screen.phase-waiting #table-hint,
#game-screen.phase-playing #table-hint {
  display: none !important;
}

#game-screen.phase-waiting .self-seat-slot,
#game-screen.phase-playing .self-seat-slot {
  display: none;
}

.game-lobby-bar {
  display: none;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 0.75rem);
  z-index: 50;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  width: auto;
  max-width: 95%;
  padding: 0;
  background: transparent;
  border: none;
  backdrop-filter: none;
  flex-shrink: 0;
}

#game-screen.phase-waiting .game-lobby-bar {
  display: grid;
  justify-items: stretch;
  width: min(calc(100vw - 2 * var(--ui-pad-x)), 420px);
  max-width: min(calc(100vw - 2 * var(--ui-pad-x)), 420px);
}

#game-screen.phase-waiting .game-lobby-bar #btn-ready {
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 0.72rem 1.45rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

#game-screen.phase-waiting .game-lobby-bar .invite-bar {
  width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

#game-screen.phase-waiting .game-lobby-bar .invite-bar .btn-invite {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

#game-screen.phase-waiting .game-lobby-bar #waiting-status {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
  font-size: 0.84rem;
  color: var(--text-secondary);
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.75);
  line-height: 1.35;
}

#game-screen .table-hint {
  position: relative;
  z-index: 2;
  margin: 0;
  padding: 0.5rem 0.75rem;
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-primary);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.65);
}

#game-screen {
  background: transparent;
  position: relative;
  align-items: center;
}

.game-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 0.5rem;
  padding: calc(env(safe-area-inset-top) + 0.35rem) 0.5rem 0;
  background: transparent;
  backdrop-filter: none;
  border: none;
  pointer-events: none;
}

.game-top-bar .voice-bar {
  grid-column: 1;
  justify-self: start;
  position: relative;
  margin: 0;
  flex-shrink: 0;
  pointer-events: auto;
}

/* Номер строго по центру экрана */
.room-code {
  grid-column: 2;
  justify-self: center;
  position: relative;
  margin: 0;
  font-family: 'Unbounded', 'Inter', system-ui, sans-serif;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.35rem;
  color: transparent;
  background: linear-gradient(102deg, #fffaf4 0%, #f4ebe1 46%, #f0c7a2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  pointer-events: none;
  white-space: nowrap;
}

/* Правая треть: таймер по центру промежутка до «Выйти» */
.game-top-end {
  grid-column: 3;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  pointer-events: none;
}

.turn-timer-slot {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.game-top-end > .btn-leave-room {
  pointer-events: auto;
  flex-shrink: 0;
}

.turn-timer {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.turn-timer.hidden {
  display: none;
}

.turn-timer-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.turn-timer-bg {
  fill: none;
  stroke: rgba(255,255,255,0.12);
  stroke-width: 2.5;
}

.turn-timer-arc {
  fill: none;
  stroke: var(--orange, #f5a623);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-dasharray: 97.4 97.4;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear, stroke 0.4s;
}

.turn-timer-arc.urgent {
  stroke: #e05252;
}

.turn-timer-val {
  position: relative;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  z-index: 1;
}

.game-top-bar .btn-leave-room {
  position: relative;
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.55rem 1rem;
  white-space: nowrap;
  border-radius: var(--radius-pill);
}

.voice-bar {
  display: flex;
  gap: 0.35rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 0.28rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shine), var(--glass-shadow);
}

.game-table {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: var(--game-col-w);
  height: 100%;
  min-height: 0;
  padding: 0;
  overflow: visible;
}

#game-screen .opponents-row {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--game-top-bar-h) + var(--opponents-offset, 0px));
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  justify-content: space-evenly;
  flex-wrap: nowrap;
  width: 100%;
  padding: 0.15rem 0.25rem 0.05rem;
  gap: 0.15rem;
  flex-shrink: 0;
  overflow: visible;
}

#game-screen .zone-center {
  position: absolute;
  top: calc(env(safe-area-inset-top) + var(--game-zone-top));
  bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 1.25rem);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  margin: 0;
  padding: 0;
  width: 100%;
  overflow: visible;
  container-type: size;
}

#game-screen .game-bottom-dock {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  flex-shrink: 0;
  padding-bottom: env(safe-area-inset-bottom);
  overflow: visible;
}

#game-screen .zone-player {
  position: relative;
  z-index: 12;
  margin-bottom: 0;
  padding-bottom: 0.15rem;
  flex-shrink: 0;
  overflow: visible;
  transform: translateY(-18px);
}

#game-screen .opponent-slot {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
  padding: 0;
  gap: 0.12rem;
  overflow: visible;
}

#game-screen .turn-indicator {
  display: none;
}

#game-screen .action-bar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 42px);
  left: 50%;
  transform: translateX(-50%);
  flex-shrink: 0;
  gap: 0.35rem;
  max-width: min(95%, var(--game-col-w));
  margin: 0;
  z-index: 50;
}

.opponents-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem;
  flex-shrink: 0;
}

.opponent-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.15rem 0.25rem;
  background: transparent;
  border: none;
  box-shadow: none;
  min-width: 0;
}

.opponent-avatar {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  width: 56px;
  min-height: 56px;
  padding: 0.35rem 0.25rem 0.25rem;
  border-radius: 8px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.28);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, width 0.25s ease, min-height 0.25s ease;
}

.opponent-slot.active-turn .opponent-avatar {
  border-color: #27ae60;
  box-shadow: 0 0 10px rgba(39, 174, 96, 0.45);
}

.opponent-slot.player-ready .opponent-avatar {
  border-color: rgba(76, 175, 80, 0.85);
  box-shadow: 0 0 10px rgba(76, 175, 80, 0.35);
}

.opponent-slot.is-defender .opponent-avatar {
  border-color: #e74c3c;
  box-shadow: 0 0 10px rgba(231, 76, 60, 0.45);
}

.take-bubble {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) scale(0.82);
  transform-origin: 50% 100%;
  padding: 0.34rem 0.62rem;
  border-radius: 12px;
  background: rgba(18, 18, 26, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  pointer-events: none;
  z-index: 40;
  opacity: 0;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.take-bubble::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(18, 18, 26, 0.94);
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}

.take-bubble.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.take-bubble.hide {
  opacity: 0;
  transform: translateX(-50%) scale(0.88) translateY(4px);
}

.zone-player .take-bubble {
  bottom: calc(100% + 6px);
}

/* «Беру» у оппонента — под рукавом карт, стрелка вверх */
.take-bubble.take-bubble--below {
  top: calc(100% + 4px);
  bottom: auto;
  transform-origin: 50% 0;
}

.take-bubble.take-bubble--below::after {
  top: -5px;
  bottom: auto;
  border-right: none;
  border-bottom: none;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.take-bubble.take-bubble--below.hide {
  transform: translateX(-50%) scale(0.88) translateY(-4px);
}

.opponent-avatar .mic-indicator {
  position: absolute;
  top: 2px;
  left: 3px;
  width: 14px;
  height: 14px;
  font-size: 0.55rem;
}

/* Пока игрок молчит — вместо индикатора микрофона видна первая буква ника */

.opponent-avatar .mic-indicator.idle {
  display: none;
}

.opponent-letter {
  position: absolute;
  inset: 0 0 1.15rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text-primary);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

.opponent-name {
  font-size: 0.72rem;
  color: var(--text-secondary);
  max-width: 96px;
  font-weight: 500;
  text-align: center;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

/* Во время перестройки оппонентской руки — без переходов поворота */

.zone-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
}

.table-hint {
  position: relative;
  z-index: 1;
}

.zone-player {
  position: relative;
  flex-shrink: 0;
  padding-bottom: 0.35rem;
}

.game-bottom-dock {
  flex-shrink: 0;
  position: relative;
}

.turn-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  text-align: center;
  font-size: 0.84rem;
  padding: 0.4rem 0.75rem;
  min-height: 1.5rem;
  flex-shrink: 0;
  color: var(--text-secondary);
  font-weight: 500;
}

.turn-value {
  font-weight: 600;
}

.turn-indicator.yours .turn-value {
  color: var(--orange-light);
}

.turn-indicator.opponent .turn-value {
  color: var(--text-primary);
}

.action-bar {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 42px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
  z-index: 50;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(95%, var(--game-col-w));
}

.action-bar .btn {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  min-width: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

/* Кнопка Бито сливается с фоном стола — даём ей читаемый тёмный фон */

#btn-pass {
  background: rgba(20, 20, 28, 0.78);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
}

#btn-pass:not(:disabled):hover {
  background: rgba(40, 40, 55, 0.88);
  border-color: rgba(255, 255, 255, 0.35);
}

.crown-badge {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  font-size: 1.3rem;
  line-height: 1;
  pointer-events: none;
  animation: crownDrop 0.55s cubic-bezier(0.34, 1.5, 0.64, 1) both;
  filter: drop-shadow(0 2px 6px rgba(255, 200, 0, 0.7));
  z-index: 20;
}

/* Затемнение аватара победившего оппонента */

.opponent-finished .opponent-avatar {
  border-color: rgba(255, 200, 0, 0.7) !important;
  box-shadow: 0 0 14px rgba(255, 200, 0, 0.4) !important;
}

.win-flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  animation: winFlashBg 3.8s ease forwards;
  pointer-events: none;
}

.win-flash-overlay.win-flash-out {
  animation: winFlashFadeOut 0.6s ease both;
}

.win-flash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: winContentIn 0.6s cubic-bezier(0.34, 1.5, 0.64, 1) both;
}

.win-flash-crown {
  font-size: clamp(5rem, 18vw, 9rem);
  line-height: 1;
  filter: drop-shadow(0 4px 20px rgba(255, 200, 0, 0.8));
  animation: crownSpin 0.8s cubic-bezier(0.34, 1.4, 0.64, 1) 0.1s both,
             crownFloat 2s ease-in-out 1s infinite alternate;
}

.win-flash-text {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.06em;
  text-shadow: 0 2px 12px rgba(255, 200, 0, 0.6),
    0 0 40px rgba(255, 200, 0, 0.3);
  animation: winTextIn 0.5s ease 0.25s both;
}

.lose-flash-icon {
  filter: drop-shadow(0 4px 20px rgba(160, 170, 210, 0.55));
}

.lose-flash-icon .jester-hat {
  display: block;
  width: 1.15em;
  height: auto;
}

.jester-badge {
  position: absolute;
  top: -17px;
  left: 50%;
  width: 28px;
  line-height: 0;
  transform: translateX(-50%);
  pointer-events: none;
  animation: jesterDrop 0.55s cubic-bezier(0.34, 1.5, 0.64, 1) both;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.55));
  z-index: 20;
}

.jester-badge .jester-hat {
  display: block;
  width: 100%;
  height: auto;
}

.opponent-loser .opponent-avatar {
  border-color: rgba(142, 68, 173, 0.85) !important;
  box-shadow: 0 0 14px rgba(142, 68, 173, 0.45) !important;
}

.lose-flash-text {
  text-shadow: 0 2px 12px rgba(160, 170, 220, 0.55),
    0 0 40px rgba(120, 130, 180, 0.28);
}

#action-bar:not(.hidden) {
  animation: actionBarIn 0.22s cubic-bezier(0.34, 1.25, 0.64, 1) both;
}

#turn-indicator:not(.hidden) {
  animation: turnIndIn 0.2s ease both;
}

#game-screen #opponents-row[data-opp-count="3"] {
  --opp-hand-scale: 0.44;
}

#game-screen #opponents-row[data-opp-count="4"] {
  --opp-hand-scale: 0.40;
}

.invite-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  width: min(92vw, 320px);
}

.invite-bar.hidden {
  display: none;
}

.invite-bar .btn-invite {
  flex: 1 1 140px;
  min-height: 2.5rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
}

@keyframes micBar {
  0% { transform: scaleY(0.3); }
  100% { transform: scaleY(1); }
}

@keyframes micPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.12); }
}

@keyframes crownDrop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-28px) scale(0.4) rotate(-15deg); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(2px) scale(1.15) rotate(5deg); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); }
}

@keyframes winFlashBg {
  0%   { background: rgba(0, 0, 0, 0); }
  15%  { background: rgba(0, 0, 0, 0.55); }
  75%  { background: rgba(0, 0, 0, 0.55); }
  100% { background: rgba(0, 0, 0, 0); }
}

@keyframes winFlashFadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes winContentIn {
  from { opacity: 0; transform: scale(0.3) translateY(30px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes crownSpin {
  from { transform: rotate(-30deg) scale(0.5); opacity: 0; }
  to   { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes crownFloat {
  from { transform: translateY(0); }
  to   { transform: translateY(-8px); }
}

@keyframes jesterDrop {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(0.4) rotate(15deg); }
  60%  { opacity: 1; transform: translateX(-50%) translateY(2px) scale(1.12) rotate(-5deg); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1) rotate(0deg); }
}

@keyframes winTextIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: none; }
}

@keyframes actionBarIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes turnIndIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

@media (min-width: 880px) {
  .opponent-letter {
    font-size: 1.9rem;
  }
}

@media (max-width: 768px) {
  #game-screen .opponent-avatar {
    width: 64px;
    min-height: 64px;
    padding: 0.38rem 0.25rem 0.25rem;
  }

  #game-screen .opponent-name {
    font-size: 0.66rem;
    max-width: 64px;
  }

  #game-screen .opponent-slot {
    gap: 0;
  }

  #game-screen .action-bar .btn {
    font-size: 0.94rem;
    font-weight: 600;
    padding: 0.65rem 1.1rem;
    border-radius: var(--radius-pill);
  }

  /* Бито и Взять — одинаковый заметный стиль на мобайл */

  #game-screen #btn-pass,
  #game-screen #btn-take {
    font-size: 1rem;
    padding: 0.75rem 1.4rem;
    background: rgba(20, 20, 28, 0.82);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.28);
  }

  #game-screen .game-bottom-dock .zone-player {
    transform: translateY(-26px);
  }

  #game-screen .zone-center {
    bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 1.35rem);
  }

  #game-screen .action-bar {
    bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 48px);
  }

  /* Кнопки микрофона и динамика — меньше */

  #game-screen .game-top-bar .voice-bar {
    padding: 0.14rem 0.18rem;
    gap: 0.32rem;
  }

  #game-screen .game-top-bar .btn-voice {
    width: 30px;
    height: 30px;
  }

  #game-screen .game-top-bar .btn-voice .voice-icon {
    width: 16px;
    height: 16px;
  }

  #game-screen #opponents-row[data-opp-count="3"] {
    --opp-hand-scale: 0.42;
  }

  #game-screen #opponents-row[data-opp-count="3"] .opponent-avatar {
    width: 60px;
    min-height: 60px;
  }

  #game-screen #opponents-row[data-opp-count="4"] {
    --opp-hand-scale: 0.38;
  }

  #game-screen #opponents-row[data-opp-count="4"] .opponent-avatar {
    width: 56px;
    min-height: 56px;
  }
}

@media (max-width: 480px) {
  #game-screen .game-top-bar {
    padding: calc(env(safe-area-inset-top) + 0.35rem) 0.4rem 0;
    column-gap: 0.35rem;
  }

  #game-screen .game-top-bar .voice-bar {
    padding: 0.14rem 0.18rem;
    gap: 0.32rem;
  }

  #game-screen .game-top-bar .btn-voice {
    width: 30px;
    height: 30px;
  }

  #game-screen .game-top-bar .btn-voice .voice-icon {
    width: 16px;
    height: 16px;
  }

  #game-screen .game-top-bar .btn-leave-room {
    font-size: 0.88rem;
    padding: 0.52rem 0.85rem;
  }

  #game-screen .opponent-avatar {
    width: 66px;
    min-height: 66px;
    padding: 0.4rem 0.24rem 0.24rem;
  }

  #game-screen .opponent-name {
    font-size: 0.68rem;
    max-width: 66px;
  }

  #game-screen .action-bar .btn {
    padding: 0.42rem 0.7rem;
    font-size: 0.78rem;
  }

  #game-screen.phase-waiting .game-lobby-bar {
    bottom: calc(env(safe-area-inset-bottom) + 0.55rem);
    gap: 0.4rem;
  }

  #game-screen.phase-waiting .game-lobby-bar #waiting-status {
    font-size: 0.8rem;
  }
}

@media (max-width: 360px) {
  #game-screen .game-top-bar .btn-leave-room {
    font-size: 0.82rem;
    padding: 0.48rem 0.72rem;
  }
}

@media (min-width: 769px) {
  /* ПК: рукав игрока чуть выше от нижнего края */

  #game-screen .zone-player {
    transform: translateY(-34px);
  }

  #game-screen .action-bar {
    bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 64px);
  }

  #game-screen {
    align-items: stretch;
  }

  #game-screen .game-table {
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  #game-screen .game-top-bar {
    padding: calc(env(safe-area-inset-top) + 0.35rem) max(0.75rem, env(safe-area-inset-right)) 0 max(0.75rem, env(safe-area-inset-left));
    column-gap: 0.75rem;
  }

  #game-screen .game-top-bar .voice-bar {
    padding: 0.35rem;
    gap: 0.35rem;
  }

  /* Номер визуально как высота кнопки «Выйти» */
  #game-screen .room-code {
    font-size: 1.55rem;
    line-height: 1;
    font-weight: 700;
  }

  #game-screen .turn-timer {
    width: 42px;
    height: 42px;
  }

  #game-screen .turn-timer-val {
    font-size: 0.9rem;
  }

  /* Таймер левее от «Выйти» — больше воздуха справа от слота */
  #game-screen .turn-timer-slot {
    justify-content: flex-end;
    padding-right: 1.35rem;
  }

  #game-screen .game-top-bar .btn-leave-room {
    font-size: 1.05rem;
    padding: 0.72rem 1.35rem;
  }

  #game-screen .zone-center {
    top: calc(env(safe-area-inset-top) + var(--game-zone-top));
    bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 1.5rem);
  }

  #game-screen .action-bar {
    max-width: min(95%, var(--desk-display-w));
  }

  #game-screen .opponent-avatar {
    width: 88px;
    min-height: 88px;
    padding: 0.5rem 0.35rem 0.35rem;
  }

  #game-screen .opponent-name {
    font-size: 0.82rem;
    max-width: 92px;
  }

  #game-screen .opponent-avatar .mic-indicator {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  #game-screen .action-bar .btn {
    padding: 0.72rem 1.45rem;
    font-size: 1rem;
  }

  #game-screen.phase-waiting .game-lobby-bar #waiting-status {
    font-size: 0.92rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  #game-screen #opponents-row[data-opp-count="3"] {
    --opp-hand-scale: 0.44;
  }

  #game-screen #opponents-row[data-opp-count="4"] {
    --opp-hand-scale: 0.40;
  }
}

@media (min-width: 1025px) {
  #game-screen #opponents-row[data-opp-count="3"] {
    --opp-hand-scale: 0.44;
  }

  #game-screen #opponents-row[data-opp-count="3"] .opponent-avatar {
    width: 80px;
    min-height: 80px;
  }

  #game-screen #opponents-row[data-opp-count="4"] {
    --opp-hand-scale: 0.40;
  }

  #game-screen #opponents-row[data-opp-count="4"] .opponent-avatar {
    width: 72px;
    min-height: 72px;
  }
}

@media (orientation: landscape) and (max-height: 500px) and (min-device-width: 401px) {
  #game-screen .action-bar {
    bottom: calc(env(safe-area-inset-bottom) + var(--card-h) + 36px);
  }
}
