* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
*::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  position: relative;
  font-family: 'Manrope', sans-serif;
  user-select: none;
  touch-action: manipulation;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  pointer-events: none;
  z-index: 1;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.118s ease-out;
}

#role-screen.screen {
  position: fixed !important;
}

.screen.active {
  pointer-events: auto;
  z-index: 10;
  opacity: 1;
}

.modal-overlay {
  opacity: 0;
  transition: opacity 0.118s ease-out;
}

.modal-overlay[data-open] {
  opacity: 1;
}

.modal-overlay .modal-panel {
  transform: scale(0.98) translateY(8px);
  transition: transform 0.118s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-overlay[data-open] .modal-panel {
  transform: scale(1) translateY(0);
}

.screen-content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.card-flip {
  transform-style: preserve-3d;
}

.card-flip.revealed .card-front {
  transform: rotateY(0deg);
}

.card-flip.revealed .card-back {
  transform: rotateY(-180deg);
}

.card-inner {
  perspective: 1000px;
  width: 100%;
  height: 100%;
}

.card-back,
.card-front {
  backface-visibility: hidden;
  transition: transform 0.5s ease;
}

.card-front {
  transform: rotateY(180deg);
}

.cards-grid {
  display: grid;
  gap: 0.75rem;
  flex: 1;
  min-height: 0;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(0, 1fr));
  overflow: hidden;
  align-items: center;
  justify-items: center;
}

.cards-grid > .card-wrap:nth-child(10) {
  grid-column: 2;
}

.card-wrap {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-wrap .card-inner {
  flex: 0 0 auto;
  height: 100%;
  width: auto;
  aspect-ratio: 5/7;
  max-width: 100%;
}

.card-wrap .card-flip {
  width: 100%;
  height: 100%;
  position: relative;
}

#players-list {
  align-items: stretch;
}

.player-cell.player-slot {
  touch-action: none;
}

.player-slot__row {
  align-items: center;
}

.player-slot__foul-pill {
  transform: translateY(0.1875rem);
}

.role-icon {
  display: block;
  flex-shrink: 0;
}
.role-icon--large {
  width: 45vmin;
  height: 45vmin;
  max-width: 280px;
  max-height: 280px;
}
.role-icon--small {
  width: 2.25rem;
  height: 2.25rem;
}
.role-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

#game-screen #timer {
  line-height: 1;
  font-weight: 600;
  font-size: clamp(2.75rem, 2rem + 3.2vmin, 4rem);
}

@keyframes timer-pill-shake {
  0%,
  100% {
    transform: translateY(0.1875rem) translateX(0);
  }
  20% {
    transform: translateY(0.1875rem) translateX(-4px);
  }
  40% {
    transform: translateY(0.1875rem) translateX(4px);
  }
  60% {
    transform: translateY(0.1875rem) translateX(-3px);
  }
  80% {
    transform: translateY(0.1875rem) translateX(3px);
  }
}

#game-screen .timer-pill.timer-pill--shake {
  animation: timer-pill-shake 0.38s ease-in-out;
}

#game-screen #voting-order.voting-order-queue {
  font-size: clamp(1.125rem, 4.2vmin, 1.5rem);
  line-height: 1.45;
}

input.mafia-checkbox {
  -webkit-appearance: none;
  appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  flex-shrink: 0;
  border-radius: 2px;
  border: 1px solid rgba(212, 175, 55, 0.32);
  background-color: #0c0a09;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition:
    border-color 0.15s ease-out,
    background-color 0.15s ease-out,
    box-shadow 0.15s ease-out,
    transform 0.12s ease-out;
}

input.mafia-checkbox:hover {
  border-color: rgba(212, 175, 55, 0.5);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(212, 175, 55, 0.08);
}

input.mafia-checkbox:focus-visible {
  outline: 2px solid rgba(212, 175, 55, 0.35);
  outline-offset: 2px;
}

input.mafia-checkbox:checked {
  background-color: rgba(127, 29, 29, 0.42);
  border-color: rgba(212, 175, 55, 0.55);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 5 8.7 9.5 3.3' stroke='%23d4af37' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 0.7rem auto;
}

input.mafia-checkbox:active:not(:disabled) {
  transform: scale(0.94);
}

.music-item-settings-wrap {
  overflow: hidden;
}

.music-item-settings-inner {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.music-item-settings-panel {
  opacity: 0;
  transform: translateY(-6px);
  transition:
    opacity 0.2s ease-out,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.music-item-settings-wrap.is-open .music-item-settings-panel {
  opacity: 1;
  transform: translateY(0);
}

.music-item-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  flex-shrink: 0;
  font-size: 0.6rem;
  line-height: 1;
  color: rgba(212, 175, 55, 0.72);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.music-item-expanded .music-item-chevron {
  transform: rotate(90deg);
}

.music-preview-btn.is-playing {
  border-color: rgba(212, 175, 55, 0.55);
  color: #d4af37;
  background-color: rgba(127, 29, 29, 0.35);
}

.timer-voice-duck-block--inactive {
  opacity: 0.45;
  pointer-events: none;
}

#timer-voice-duck-mul-wrap.timer-voice-duck-mul-wrap--inactive {
  opacity: 0.45;
  pointer-events: none;
}
