/* --== Cursor Styles ==-- */

#cursorField {
  position: relative;
  height: 100%;
  width: 100%;
  pointer-events: none;
}

.cursor {
  position: absolute;
  width: 16px;
  height: 16px;
  z-index: 10000;
  transform: translate(-50%, -50%);
  transition:
    left 0.05s linear,
    top 0.05s linear;
  will-change: left, top;
}

.cursor.local-cursor {
  transition:
    left 0.035s ease-out,
    top 0.035s ease-out;
}

.shape-square {
  border-radius: 2px;
}

.shape-circle {
  border-radius: 50%;
}

.shape-triangle {
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.shape-diamond {
  clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.shape-star {
  clip-path: polygon(
    50% 0%,
    61% 35%,
    98% 35%,
    68% 57%,
    79% 91%,
    50% 70%,
    21% 91%,
    32% 57%,
    2% 35%,
    39% 35%
  );
}

.shape-hexagon {
  clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}

.shape-octagon {
  clip-path: polygon(
    30% 0%,
    70% 0%,
    100% 30%,
    100% 70%,
    70% 100%,
    30% 100%,
    0% 70%,
    0% 30%
  );
}

.shape-trapezoid {
  clip-path: polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%);
}

.cursor-inner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 66.6667%;
  height: 66.6667%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.sonar {
  position: absolute;
  border: 2px solid;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: sonarExpand 0.8s ease-out forwards;
}

@keyframes sonarExpand {
  from {
    width: 0;
    height: 0;
    opacity: 0.8;
  }

  to {
    width: 120px;
    height: 120px;
    opacity: 0;
  }
}

.cursor.spin {
  animation: cursorSpin 0.2s ease-in-out;
}

@keyframes cursorSpin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.cursor.jump {
  animation: cursorJump 0.3s ease;
}

@keyframes cursorJump {
  0% {
    transform: translate(-50%, -50%) translateY(0);
  }

  40% {
    transform: translate(-50%, -50%) translateY(-14px);
  }

  100% {
    transform: translate(-50%, -50%) translateY(0);
  }
}

.key-container {
  position: absolute;
  pointer-events: none;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.key-letter {
  position: absolute;
  top: 0;
  font-family: "3270", sans-serif;
  font-size: 36px;
  line-height: 1;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, calc(-100% - 20px));
  transition:
    left 0.15s ease,
    top 0.15s ease;
  animation:
    keyFadeUp 0.2s ease-out forwards,
    keyFadeOut 0.3s ease-in 4.7s forwards;
}

@keyframes keyFadeUp {
  from {
    opacity: 0;
    transform: translate(-50%, -50%);
  }

  to {
    opacity: 1;
    transform: translate(-50%, calc(-100% - 20px));
  }
}

@keyframes keyFadeOut {
  to {
    opacity: 0;
  }
}

.key-letter.clearing {
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  transform: translate(-50%, calc(-100% - 20px)) scale(0);
  opacity: 0;
}

.alt-menu {
  position: absolute;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid #fff;
  padding: 8px 12px;
  font-family: "3270", sans-serif;
  font-size: 20px;
  color: #fff;
  white-space: nowrap;
  z-index: 2;
  transform: translate(12px, -50%);
}

.alt-menu-item {
  cursor: pointer;
  padding: 2px 0;
}

.alt-menu-item:hover {
  color: #ffdd55;
}

.selecting-ring {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid #fff;
  border-radius: 50%;
  border-bottom-color: transparent;
  border-left-color: transparent;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.05s linear,
    top 0.05s linear;
  animation: selectingPulse 1s ease-in-out infinite;
}

@keyframes selectingPulse {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.join-halo {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.area-circle {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.area-circle-label {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 10px);
  font-family: "3270", sans-serif;
  font-size: 18px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

.cursor.lobby-member {
  border-radius: 50% !important;
  clip-path: none !important;
}

.cursor.lobby-member .cursor-inner {
  display: none;
}

.cursor.reject-flash {
  animation: rejectShake 0.25s ease;
}

@keyframes rejectShake {
  0%,
  100% {
    transform: translate(-50%, -50%);
  }

  50% {
    transform: translate(-50%, -50%) scale(0.8);
  }
}

.select-mode .cursor {
  pointer-events: auto;
}

.select-mode .cursor:hover {
  filter: brightness(1.4);
}

.invite-popup {
  position: absolute;
  top: 100%;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  padding: 8px 12px;
  transform: translate(-50%, 12px);
  font-family: "3270", sans-serif;
  color: #fff;
  text-align: center;
  z-index: 3;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.invite-popup-game {
  font-size: 18px;
  text-transform: uppercase;
  margin-bottom: 6px;
  white-space: nowrap;
}

.invite-popup-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.invite-popup-join,
.invite-popup-x {
  padding: 2px 10px;
  border: 1px solid #fff;
  font-size: 16px;
}

.invite-popup-join:hover {
  background: #ffdd55;
  color: #000;
}

.invite-popup-x:hover {
  background: #ff3b3b;
  color: #000;
}

.start-game-btn {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translate(-50%, 30px);
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  padding: 6px 14px;
  font-family: "3270", sans-serif;
  color: #fff;
  font-size: 16px;
  white-space: nowrap;
  z-index: 3;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.start-game-btn:hover {
  background: #ffdd55;
  color: #000;
}

.game-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.game-dealer {
  position: absolute;
  top: 6%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 3px solid #fff;
  padding: 16px 24px;
  min-width: 260px;
  text-align: center;
  color: #fff;
  font-family: "3270", sans-serif;
  font-size: 1.3em;
}

.game-players {
  position: absolute;
  bottom: 12%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
}

.game-slot {
  position: relative;
  pointer-events: auto;
  background: rgba(0, 0, 0, 0.85);
  border: 2px solid #fff;
  padding: 10px 14px;
  width: fit-content;
  height: fit-content;
  text-align: center;
  color: #fff;
  font-family: "3270", sans-serif;
}

.game-slot.active-turn {
  border-color: #ffdd55;
  box-shadow: 0 0 8px #ffdd55;
}

.game-quit-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 20px;
  height: 20px;
  line-height: 18px;
  border: 1px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.85);
  font-size: 12px;
}

.game-quit-btn:hover {
  background: #ff3b3b;
}

.game-slot-name {
  font-size: 16px;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.card-mount {
  display: flex;
  justify-content: center;
}

.card-pocket {
  position: relative;
  height: 100px;
  margin: 6px 0;
  overflow: hidden;
}

.card-pocket-glow {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 6px;
  border-radius: 3px;
  z-index: 0;
}

.playing-card {
  position: absolute;
  bottom: -40px;
  width: 60px;
  height: 120px;
  background: #f5f2ea;
  border: 1px solid #999;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  transform-origin: bottom center;
  transform: rotate(var(--rot, 0deg));
  transition: transform 0.15s ease;
  font-family: "3270", sans-serif;
}

.playing-card:hover {
  transform: rotate(var(--rot, 0deg)) translateY(-15px);
  z-index: 999 !important;
}

.card-corner {
  position: absolute;
  font-size: 13px;
  font-weight: bold;
  line-height: 1;
}

.card-corner-tl {
  top: 4px;
  left: 4px;
}

.card-corner-tr {
  top: 4px;
  right: 4px;
}

.card-corner-bl {
  bottom: 4px;
  left: 4px;
  transform: rotate(180deg);
}

.card-corner-br {
  bottom: 4px;
  right: 4px;
  transform: rotate(180deg);
}

.card-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 24px;
  font-weight: bold;
}

.card-back {
  background: repeating-linear-gradient(
    45deg,
    #16305c,
    #16305c 6px,
    #0b1c38 6px,
    #0b1c38 12px
  );
}

.playing-card.clickable {
  cursor: pointer;
}

.uno-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.uno-pile {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.uno-draw-pile {
  position: absolute;
  right: 2px;
  pointer-events: auto;
}

.uno-draw-pile.clickable {
  cursor: pointer;
}

.uno-discard-top {
  position: absolute;
  left: 2px;
  pointer-events: none;
}

.uno-color-tag {
  position: absolute;
  height: 10px;
  width: 130px;
  top: 45px;
  transform: translateX(-50%);
  border-radius: 5px;
}

.uno-wild {
  background: conic-gradient(
    #d1263a 0deg 90deg,
    #f4c430 90deg 180deg,
    #2e8b57 180deg 270deg,
    #3a6fd1 270deg 360deg
  );
}

.uno-wild .card-corner,
.uno-wild .card-center {
  text-shadow:
    0 0 3px #000,
    0 0 3px #000,
    0 0 3px #000;
}

.uno-pending-badge {
  position: absolute;
  right: -35px;
  top: 36px;
  background: #ff3b3b;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 10px;
  padding: 2px 8px;
  font-family: "3270", sans-serif;
  font-size: 16px;
  font-weight: bold;
}

.uno-pass-btn,
.uno-call-btn,
.uno-catch-btn {
  margin-top: 6px;
  display: inline-block;
  padding: 4px 14px;
  background: rgba(0, 0, 0, 0.85);
  border: 1px solid #fff;
  color: #fff;
  font-family: "3270", sans-serif;
  font-size: 14px;
  pointer-events: auto;
}

.uno-pass-btn:hover {
  background: #fff;
  color: #000;
}

.uno-call-btn {
  color: #ffdd55;
  font-size: 16px;
  font-weight: bold;
}

.uno-call-btn:hover {
  background: #ffdd55;
  color: #000;
}

.uno-catch-btn {
  background: #ff3b3b;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  animation: unoCatchPulse 0.5s ease-in-out infinite alternate;
}

.uno-catch-btn:hover {
  background: #fff;
  color: #ff3b3b;
}

@keyframes unoCatchPulse {
  from {
    transform: scale(1);
  }

  to {
    transform: scale(1.08);
  }
}

.uno-seat {
  position: absolute;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
}

.uno-seat-name {
  font-family: "3270", sans-serif;
  font-size: 16px;
  text-transform: uppercase;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.uno-cursor-clone {
  width: 28px;
  height: 28px;
  margin: 6px auto 0;
  border: 2px solid #fff;
}

.uno-seat.active-turn .uno-cursor-clone {
  border-color: #ffdd55;
  box-shadow: 0 0 8px #ffdd55;
}

.uno-seat-hand {
  transform: scale(0.5);
  transform-origin: top center;
  margin-top: -10px;
  pointer-events: none;
}

.uno-hand {
  position: relative;
  height: 100px;
  pointer-events: auto;
}

.uno-hand .playing-card {
  bottom: 0;
}

.uno-hand-wrap {
  position: relative;
}

.uno-hand-glow {
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
  opacity: 0.4;
}

.uno-hand-glow.active-turn {
  background: #ffdd55;
  box-shadow: 0 0 20px #ffdd55;
  opacity: 1;
}

.uno-color-picker {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  gap: 10px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.9);
  border: 2px solid #fff;
  pointer-events: auto;
  z-index: 20;
}

.uno-color-swatch {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #fff;
}

.uno-winner-banner {
  position: absolute;
  top: 30%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.9);
  border: 3px solid #ffdd55;
  color: #ffdd55;
  font-family: "3270", sans-serif;
  font-size: 2em;
  padding: 16px 32px;
  pointer-events: none;
  white-space: nowrap;
}

.game-slot-total {
  font-size: 18px;
  font-weight: bold;
  opacity: 0.85;
}

.game-slot-result {
  font-size: 20px;
  font-weight: bold;
  margin-top: 4px;
}

.game-slot-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.game-btn {
  border: 1px solid #fff;
  padding: 4px 12px;
  font-size: 20px;
}

.game-btn:hover {
  background: #fff;
  color: #000;
}

.game-btn.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.game-indicator {
  position: absolute;
  left: 50%;
  pointer-events: none;
  font-family: "3270", sans-serif;
  font-size: 16px;
  color: #fff;
  text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  z-index: 1;
  transition:
    left 0.05s linear,
    top 0.05s linear;
}

.game-indicator-above {
  transform: translate(-50%, -200%);
}

.game-indicator-below {
  transform: translate(-50%, 20px);
}

/* --== ADMIN HAMMER ==-- */

.admin-hammer {
  position: absolute;
  width: 0;
  height: 0;
  transform: rotate(var(--facing, 0deg));
  pointer-events: none;
  z-index: 4;
}

.admin-hammer::before {
  content: "";
  position: absolute;
  top: 0;
  left: -2.5px;
  width: 5px;
  height: 38px;
  background: #6b4a2f;
}

.admin-hammer::after {
  content: "";
  position: absolute;
  top: 35px;
  left: -15px;
  width: 30px;
  height: 15px;
  background: #cccccc;
  border: 1px solid #fff;
  border-radius: 3px;
}

.admin-hammer.permaban::after {
  background: #ff3b3b;
}

.admin-hammer.swing {
  animation: hammerSwing 0.17s ease-out forwards;
}

@keyframes hammerSwing {
  0% {
    transform: rotate(var(--facing, 0deg));
  }

  55% {
    transform: rotate(calc(var(--facing, 0deg) - 50deg));
  }

  100% {
    transform: rotate(calc(var(--facing, 0deg) + 8deg));
  }
}

.admin-hammer-zone {
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 59, 59, 0.12);
  border: 1px solid rgba(255, 59, 59, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 3;
}

/* --== Achievements ==-- */

.connectHeaderActions {
  display: flex;
  gap: 12px;
}

#achievementsMenu {
  position: absolute;
  inset: 74px 0 0 0;
  z-index: 20000;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.96);
  border-top: 2px solid #b0e0ff;
  pointer-events: auto;
}


#connectScreen.achievements-open #cursorField,
#connectScreen.achievements-open #connectMobileControls {
  visibility: hidden;
  pointer-events: none;
}

.achievementsTopBar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 18px;
  font-size: 22px;
  border-bottom: 1px solid #b0e0ff;
}

.achievementsTopBar button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
}

#achievementsGrid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-content: start;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
}

.achievement-card {
  --achievement-color: #b0e0ff;
  position: relative;
  min-height: 250px;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #f8fcff;
  background: linear-gradient(180deg, #10171d 0%, #080b0f 100%);
  border: 1px solid #5b6974;
  font-family: inherit;
  cursor: pointer;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease;
}

.achievement-card:hover {
  transform: translateY(-2px);
  border-color: #9dbfd5;
}

.achievement-card img {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid currentColor;
  background: #030507;
}

.achievement-card.achieved {
  border-color: var(--achievement-color);
  box-shadow: 0 0 18px
    color-mix(in srgb, var(--achievement-color) 55%, transparent);
}

.achievement-card.achieved img {
  box-shadow: 0 0 18px
    color-mix(in srgb, var(--achievement-color) 85%, transparent);
}

.achievement-card.locked {
  border-color: #4b5560;
  color: #d6dee4;
}

.achievement-card.locked img {
  filter: grayscale(1) brightness(0.42);
  box-shadow: none;
}

.achievement-card-title {
  font-size: 21px;
  line-height: 1.08;
  text-align: center;
  letter-spacing: 0.02em;
}

.achievement-card-count {
  font-size: 14px;
  opacity: 0.92;
  color: #d0ebff;
}

.achievement-card-source {
  margin-top: auto;
  padding-top: 4px;
  font-size: 21px;
  line-height: 1.08;
  letter-spacing: 0.04em;
  color: #d0ebff;
  opacity: 0.9;
}

.achievement-card-detail {
  display: none;
  width: 100%;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  text-align: left;
  font-size: 16px;
  line-height: 1.5;
}

.achievement-card-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.achievement-card-label {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: #d0ebff;
  opacity: 0.92;
}

.achievement-card-note,
.achievement-card-requirement {
  color: #ffffff;
}

.achievement-detail-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 240;
}

.achievement-detail-overlay.inactive {
  display: none;
}

.achievement-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.18s ease;
}

.achievement-detail-overlay.active .achievement-detail-backdrop {
  opacity: 1;
}

.achievement-detail-modal {
  position: relative;
  width: min(560px, calc(100% - 40px));
  min-height: 0;
  max-height: calc(100% - 40px);
  padding: 22px 22px 20px;
  gap: 14px;
  overflow: auto;
  transform: scale(0.88);
  opacity: 0;
  transition:
    transform 0.2s ease,
    opacity 0.2s ease;
  cursor: default;
}

.achievement-detail-overlay.active .achievement-detail-modal {
  transform: scale(1);
  opacity: 1;
}

.achievement-detail-modal img {
  width: 136px;
  height: 136px;
}

.achievement-detail-modal .achievement-card-title {
  font-size: 28px;
}

.achievement-detail-modal .achievement-card-count {
  font-size: 17px;
}

.achievement-detail-modal .achievement-card-detail {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.achievement-detail-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.achievement-toast {
  --achievement-color: #b0e0ff;
  position: fixed;
  right: 20px;
  bottom: -180px;
  z-index: 3000;
  width: min(460px, calc(100vw - 40px));
  min-height: 110px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  color: #ffffff;
  background: linear-gradient(
    180deg,
    rgba(11, 15, 20, 0.98) 0%,
    rgba(4, 6, 9, 0.99) 100%
  );
  border: 2px solid var(--achievement-color);
  box-shadow:
    0 0 24px color-mix(in srgb, var(--achievement-color) 70%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.65);
  font-family: "3270", sans-serif;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.95);
  transition:
    bottom 0.35s ease,
    right 0.35s ease,
    opacity 0.35s ease;
  opacity: 0;
}

.achievement-toast.show {
  bottom: 20px;
  opacity: 1;
}

.achievement-toast.leave {
  right: -500px;
  opacity: 0;
}

.achievement-toast img {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--achievement-color);
  background: #030507;
}

.achievement-toast-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.achievement-toast-label {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: #d7eefc;
  opacity: 0.96;
}

.achievement-toast strong {
  color: var(--achievement-color);
  font-size: 24px;
  line-height: 1.05;
}

.achievement-toast-description {
  font-size: 18px;
  line-height: 1.3;
  color: #ffffff;
}

@media (max-width: 700px) {
  #achievementsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .achievement-card {
    min-height: 225px;
  }

  .achievement-card img {
    width: 74px;
    height: 74px;
  }

  .achievement-detail-modal {
    width: calc(100% - 24px);
    padding: 18px 16px 16px;
  }

  .achievement-detail-modal img {
    width: 104px;
    height: 104px;
  }

  .achievement-detail-modal .achievement-card-title {
    font-size: 24px;
  }

  .achievement-toast {
    width: calc(100vw - 24px);
    right: 12px;
  }

  .achievement-toast.show {
    bottom: 12px;
  }
}

.achievementsPlayers {
  display: flex;
  gap: 8px;
  padding: 0 14px 10px;
  overflow-x: auto;
  pointer-events: auto;
}

.achievement-player {
  flex: 0 0 auto;
  border: 1px solid #596a75;
  background: #080b0d;
  color: #9fb9ca;
  font: inherit;
  font-size: 15px;
  padding: 5px 9px;
  cursor: pointer;
}

.achievement-player.selected {
  color: #ffffff;
  border-color: #b0e0ff;
  box-shadow: 0 0 8px rgba(176, 224, 255, 0.35);
}

/* --== Mobile ==-- */
@media (max-width: 1024px) {
  #connectScreen {
    overflow: hidden;
  }

  #connectHeader {
    flex: 0 0 auto;
  }

  #cursorField {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    touch-action: none;
  }

  #connectMobileControls {
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 190;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 8px;
    pointer-events: none;
  }

  #connectMobileControls button,
  #connectMobileControls input,
  #connectMobileTypeWrap {
    pointer-events: auto;
  }

  #connectMobileControls button,
  #connectMobileInput {
    min-height: 44px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid #ffffff;
    font: inherit;
    font-size: 16px;
    padding: 6px 9px;
    touch-action: manipulation;
  }

  #connectMobileTypeWrap {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-left: 8px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.65);
    font-size: 14px;
  }

  #connectMobileInput {
    width: min(38vw, 170px);
    border-width: 0 0 0 1px;
    outline: none;
  }

  #connectScreen.game-active #connectMobileControls {
    display: none;
  }

  .cursor {
    width: 18px;
    height: 18px;
  }

  .alt-menu {
    left: 50% !important;
    top: 50% !important;
    min-width: min(220px, calc(100% - 30px));
    transform: translate(-50%, -50%);
    padding: 12px 16px;
    font-size: 20px;
    z-index: 205;
  }

  .alt-menu-item {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .invite-popup,
  .start-game-btn {
    max-width: calc(100% - 20px);
    font-size: 15px;
  }

  .invite-popup-join,
  .invite-popup-x,
  .start-game-btn {
    min-height: 40px;
  }

  .area-circle {
    width: 150px;
    height: 150px;
  }

  .area-circle-label {
    font-size: 14px;
  }

  .game-dealer {
    top: 4%;
    width: min(90%, 420px);
    min-width: 0;
    padding: 8px 10px;
    border-width: 2px;
    font-size: 16px;
  }

  .game-players {
    left: 6px;
    right: 6px;
    bottom: 5%;
    transform: none;
    gap: 6px;
  }

  .game-slot {
    max-width: calc(50vw - 14px);
    padding: 7px 8px;
  }

  .game-slot-name,
  .game-slot-total,
  .game-slot-result {
    font-size: 14px;
  }

  .game-btn {
    min-height: 38px;
    padding: 5px 10px;
    font-size: 16px;
  }

  .playing-card {
    width: 48px;
    height: 96px;
  }

  .card-pocket,
  .uno-hand {
    height: 82px;
  }

  .card-center {
    font-size: 19px;
  }

  .card-corner {
    font-size: 11px;
  }

  .uno-pile {
    top: 46%;
  }

  .uno-color-picker {
    gap: 6px;
    padding: 8px;
  }

  .uno-color-swatch {
    width: 44px;
    height: 44px;
  }

  .uno-winner-banner {
    width: max-content;
    max-width: calc(100% - 20px);
    padding: 10px 16px;
    font-size: 24px;
    white-space: normal;
    text-align: center;
  }

  #achievementsMenu {
    inset: 58px 0 0;
    min-height: 0;
    overflow: hidden;
    overscroll-behavior: contain;
  }

  #achievementsGrid {
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }

  #achievementsGrid .achievement-card {
    touch-action: pan-y;
  }

  .achievementsPlayers {
    flex: 0 0 auto;
    -webkit-overflow-scrolling: touch;
  }

  .achievementsTopBar {
    padding: 8px 10px;
    font-size: 16px;
  }

  .connectHeaderActions {
    gap: 4px;
  }

  #achievementsButton {
    font-size: 14px;
  }
}

@media (hover: none) {
  .alt-menu-item:hover,
  .game-btn:hover,
  .invite-popup-join:hover,
  .invite-popup-x:hover,
  .start-game-btn:hover,
  .playing-card:hover {
    filter: none;
  }
}

@media (max-width: 1024px) {
  #connectHeader .titleReturn {
    font-size: 16px;
    white-space: nowrap;
  }

  #connectHeader .connectHeaderActions {
    margin-left: auto;
  }
}

@media (max-width: 340px) {
  #connectHeader .titleReturn {
    font-size: 14px;
  }

  #connectHeader .backButton {
    min-height: 38px;
    padding: 3px 4px;
    font-size: 12px;
  }

  #connectHeader .connectHeaderActions {
    gap: 2px;
  }

  #connectMobileControls button,
  #connectMobileInput {
    font-size: 14px;
  }
}
