html {
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial;
  color: white;
  padding: 24px;
  margin: 0;
  min-height: 100vh;
  box-sizing: border-box;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #0f1115;
  z-index: -1;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

#status {
  position: fixed;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;

  background: rgba(23, 26, 33, 0.95);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: 40px;
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;

  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);

  transition:
    top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
    opacity 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

#status.show {
  top: 24px;
  opacity: 1;
  pointer-events: auto;
}

h1,
h2,
h3 {
  letter-spacing: 0.02em;
}

#menu {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px;
  margin: 16px 0 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}

#menu input {
  height: 42px;
  min-width: 150px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: white;
  padding: 0 12px;
  outline: none;
}

#menu input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

#menu button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    filter 0.15s ease;
  cursor: pointer;
}

#menu button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.28);
  filter: brightness(1.06);
}

#menu button:active {
  transform: translateY(1px) scale(0.99);
}

.or-divider {
  margin: 10px 0;
  text-align: center;
  opacity: 0.5;
}

.greenButton {
  background: linear-gradient(135deg, #2ecc71 0%, #1f9f57 100%);
}

.blueButton {
  background: linear-gradient(135deg, #2d7dff 0%, #1358d4 100%);
}

.yellowButton {
  background: linear-gradient(135deg, #f1c40f 0%, #e0ad00 100%);
}

.orangeButton {
  background: linear-gradient(135deg, #ff8a3d 0%, #dd5a00 100%);
}

.redButton {
  background: linear-gradient(135deg, #ff3b3b 0%, #b30000 100%);
}

#hand {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.card {
  width: 80px;
  height: 120px;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 24px;
  font-weight: bold;
  color: white;
  position: relative;
  overflow: hidden;
  transform: scale(0.8);
  transition:
    transform 0.15s,
    box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card.pop {
  transform: scale(1);
}

.card.pop:hover {
  transform: translateY(-10px) scale(1.05);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.card-value {
  position: relative;
  z-index: 1;
}

.card.reverse .card-value,
.card.skip .card-value {
  display: none;
}

.red {
  background: linear-gradient(135deg, #ff6464 0%, #d60000 55%, #9d0000 100%);
}

.blue {
  background: linear-gradient(135deg, #6aa5ff 0%, #1358d4 55%, #0c2f82 100%);
}

.green {
  background: linear-gradient(135deg, #79e08f 0%, #1f9f57 55%, #0f6b38 100%);
}

.yellow {
  background: linear-gradient(135deg, #ffe780 0%, #e0ad00 55%, #9a7100 100%);
}

#topCard .card {
  cursor: default;
  position: relative;
  overflow: hidden;
  transform: none;
  box-shadow: none;
  width: 100px;
  height: 140px;
  font-size: 28px;
  margin-top: 8px;
}

#topCard .card.required-color {
  border: 3px solid var(--required-color);
  box-shadow:
    0 0 0 2px rgba(0, 0, 0, 0.15),
    0 0 18px var(--required-color);
}

#topCard .card.required-color::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--required-color);
  box-shadow: 0 0 12px var(--required-color);
}

.card-symbol {
  position: absolute;
  inset: 0;
  opacity: 0.95;
  z-index: 0;
}

.card-symbol--reverse::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.card-symbol--reverse::before {
  content: "↺";
  font-size: 68px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.15);
}

.card-symbol--skip::before {
  content: "⊘";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 66px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.96);
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.12);
}

.card-symbol--wild::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  transform: translate(-50%, -50%) rotate(45deg);
  border-radius: 14px;
  background: conic-gradient(
    #ff3b3b 0 25%,
    #2d7dff 25% 50%,
    #2ecc71 50% 75%,
    #f1c40f 75% 100%
  );
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 14px rgba(255, 255, 255, 0.18);
}

.player {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin: 8px 0;
  border-radius: 12px;
  opacity: 0.7;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.player-content {
  flex: 1;
}

.player-avatar,
.profile-avatar,
.friend-avatar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  font-weight: 800;
  letter-spacing: 0.04em;
  overflow: hidden;
}

.player-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 0.75rem;
}

.profile-avatar {
  width: 110px;
  height: 110px;
  margin: 0 auto 14px;
  border-radius: 50%;
  font-size: 2rem;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.friend-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 0.75rem;
}

.player.active {
  opacity: 1;
  background: rgba(46, 204, 113, 0.18);
  border-color: rgba(46, 204, 113, 0.4);
  border-left: 4px solid #2ecc71;
  transform: translateX(4px);
}

.color-picker {
  display: none;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.95);
  padding: 15px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  gap: 5px;
  z-index: 999;
}

.color-options {
  display: flex;
  gap: 15px;
}

.cancel-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 22px;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.2s;
}

.cancel-btn:hover {
  color: #fff;
  transform: scale(1.1);
}

.color-btn {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.color-btn:hover {
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.color-btn.red {
  background: #ff3b3b;
}
.color-btn.blue {
  background: #2d7dff;
}
.color-btn.green {
  background: #2ecc71;
}
.color-btn.yellow {
  background: #f1c40f;
}

.color-btn:active {
  transform: scale(0.95);
}

.card.wild {
  background: linear-gradient(135deg, #111111 0%, #2a2a2a 45%, #000000 100%);
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: white;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.card.plus4 {
  background: linear-gradient(135deg, #ff00cc, #3333ff, #00ffcc);
  background-size: 300% 300%;
  animation: gradientMove 4s ease infinite;
  border: 2px solid rgba(255, 255, 255, 0.22);
  color: white;
  font-weight: 900;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

@keyframes gradientMove {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

#colorPicker {
  backdrop-filter: blur(5px);
}

.winner-banner {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: 90%;
  max-width: 500px;
  padding: 32px 24px;
  border-radius: 24px;
  background: rgba(15, 17, 21, 0.95);
  border: 3px solid #f1c40f;
  box-shadow:
    0 25px 60px rgba(0, 0, 0, 0.8),
    0 0 50px rgba(241, 196, 15, 0.5);
  color: #ffffff;
  font-size: 1.8rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(241, 196, 15, 0.6);
  z-index: 10000;
  box-sizing: border-box;
}

.winner-banner.visible {
  animation: winnerPopIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes winnerPopIn {
  0% {
    transform: translate(-50%, -50%) scale(0.3);
    opacity: 0;
  }
  70% {
    transform: translate(-50%, -50%) scale(1.06);
  }
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.screen[hidden] {
  display: none !important;
}

.screen {
  width: 100%;
}

.players-container {
  margin-top: 24px;
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.turn-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  margin: 10px 0 20px;
  border-radius: 12px;
  transition: all 0.3s ease;
}

#turnIndicator {
  font-size: 1.2rem;
  font-weight: 800;
}

.turn-timer-display {
  font-size: 1.2rem;
  font-weight: 800;
  color: #e74c3c;
  text-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
}

.my-turn {
  background: rgba(46, 204, 113, 0.2);
  color: #2ecc71;
  border: 1px solid rgba(46, 204, 113, 0.4);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
  animation: pulseGlow 2s infinite;
}

.other-turn {
  background: rgba(255, 255, 255, 0.05);
  color: #aaa;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes pulseGlow {
  0% {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
  }
  50% {
    box-shadow: 0 0 25px rgba(46, 204, 113, 0.5);
  }
  100% {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
  }
}

.login-menu {
  flex-direction: column;
  max-width: 320px;
  margin: 10vh auto !important;
  align-items: stretch !important;
}

.login-menu input {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
}

.login-menu button {
  width: 100%;
  margin-bottom: 8px;
}

.profile-menu-container {
  flex-direction: column;
  align-items: flex-start;
}

.profile-display-name {
  margin-bottom: 5px;
}

#profileViewMode {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.profile-username-wrapper {
  opacity: 0.7;
  margin-bottom: 20px;
}

.profile-bio-box {
  background: rgba(0, 0, 0, 0.2);
  padding: 15px;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 20px;
}

.profile-bio-box p {
  margin: 0;
}

.profile-edit-btn {
  margin-bottom: 20px;
}

.profile-edit-mode {
  width: 100%;
}

.profile-input-group {
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
}

.profile-input-label {
  margin-bottom: 5px;
  font-weight: bold;
}

.profile-input-field,
.profile-textarea-field {
  width: 100%;
  padding: 8px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  box-sizing: border-box;
}

.profile-input-field::placeholder,
.profile-textarea-field::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.profile-textarea-field {
  resize: none;
}

.profile-edit-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-stats-container {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.profile-stat-box {
  padding: 15px;
  border-radius: 8px;
  text-align: center;
  min-width: 100px;
}

.profile-stat-box.stat-games {
  background: rgba(45, 125, 255, 0.2);
}

.profile-stat-box.stat-wins {
  background: rgba(46, 204, 113, 0.2);
}

.profile-stat-box.stat-playtime {
  background: rgba(241, 196, 15, 0.2);
}

.profile-stat-value {
  font-size: 24px;
  font-weight: bold;
}

.profile-stat-value.stat-color-blue {
  color: #2d7dff;
}

.profile-stat-value.stat-color-green {
  color: #2ecc71;
}

.profile-stat-value.stat-color-yellow {
  color: #f1c40f;
}

.profile-stat-label {
  font-size: 12px;
  opacity: 0.8;
}

.profile-member-since {
  opacity: 0.6;
  font-size: 14px;
}

.profile-back-btn {
  margin-top: 10px;
}

.chat-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 320px;
  height: 400px;
  background: rgba(18, 18, 18, 0.95);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1000;
  backdrop-filter: blur(10px);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.chat-message {
  word-break: break-word;
  line-height: 1.4;
}

.chat-time {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.8rem;
  margin-right: 6px;
}

.chat-sender {
  font-weight: 800;
  color: #2ecc71;
  margin-right: 6px;
}

.chat-text {
  color: rgba(255, 255, 255, 0.9);
}

.chat-system {
  font-style: italic;
  font-size: 0.85rem;
  opacity: 0.7;
  margin: 4px 0;
}

.chat-system .chat-sender {
  color: #f1c40f;
}

.chat-system .chat-text {
  color: inherit;
}

#chatInput {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 14px;
  color: white;
  font-size: 1rem;
  outline: none;
}

#chatInput::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.chat-container[hidden] {
  display: none !important;
}

.chat-header {
  background: rgba(255, 255, 255, 0.08);
  padding: 12px 14px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
  user-select: none;
}

.chat-header:hover {
  background: rgba(255, 255, 255, 0.15);
}

#chatToggleIcon {
  font-size: 0.8rem;
  transition: transform 0.5s ease;
}

.chat-container.collapsed {
  height: 40px;
}

.chat-container.collapsed .chat-messages,
.chat-container.collapsed #chatInput {
  display: none;
}

.chat-container.collapsed #chatToggleIcon {
  transform: rotate(180deg);
}

.friends-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9000;
}

.friends-overlay[hidden] {
  display: none !important;
}

.friends-panel {
  background: rgba(20, 24, 30, 0.95);
  width: 90%;
  max-width: 400px;
  height: 80vh;
  max-height: 600px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.friends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.friends-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-btn:hover {
  color: white;
}

.friends-add-section {
  padding: 15px 20px;
  display: flex;
  gap: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.friends-add-section input {
  flex: 1;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: white;
  padding: 0 12px;
  outline: none;
}

.friends-add-section button {
  height: 38px;
  padding: 0 15px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  color: white;
  cursor: pointer;
}

.friends-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  padding: 12px 0;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.tab-btn.active {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

.tab-btn.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: #97a8a0;
}

.badge {
  background: #ff3b3b;
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
  margin-left: 5px;
}

.status-dot {
  display: block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  align-self: center;
}

.friends-content-area {
  flex: 1;
  overflow-y: auto;
  padding: 15px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friend-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 10px;
}

.friend-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.empty-state {
  opacity: 0.5;
  text-align: center;
}

.remove-friend-btn {
  background: transparent;
  border: none;
  color: #ff3b3b;
  cursor: pointer;
  transition: color 0.2s;
}

.friend-btn {
  padding: 5px 10px;
  font-size: 0.8rem;
  border: 0;
  border-radius: 50px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  color: white;
  cursor: pointer;
}

.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.invite-toast {
  background: rgba(20, 24, 30, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-left: 4px solid #2d7dff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  pointer-events: auto;
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  min-width: 250px;
}

.leaderboard-container {
  max-width: 460px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 0 16px;
}

.leaderboard-card {
  background: rgba(20, 24, 30, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

.leaderboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.leaderboard-header button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: white;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.leaderboard-header h2 {
  margin: 0;
}

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

.leaderboard-table th {
  padding: 12px;
  font-weight: 600;
  opacity: 0.6;
  text-transform: uppercase;
  font-size: 13px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-row {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.15s ease;
}

.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.02);
}

.leaderboard-row td {
  padding: 14px 12px;
}

.rank-col {
  font-weight: bold;
}

.top-rank {
  font-size: 20px;
}

.leaderboard-player-link {
  cursor: pointer;
  font-weight: 600;
  transition: color 0.2s;
}

.leaderboard-player-link:hover {
  color: #f1c40f;
}

.wins-col {
  font-weight: 700;
  color: #2ecc71;
}

.text-right {
  text-align: right;
}

@keyframes slideInRight {
  from {
    transform: translateX(120%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.sixseven-combo-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 10, 14, 0.75);
  backdrop-filter: blur(4px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease;
  font-family:
    "Inter",
    system-ui,
    -apple-system,
    sans-serif;
}

.player-picker {
  display: none;
  flex-direction: column;
  align-items: center;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(20, 20, 20, 0.95);
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
  gap: 15px;
  z-index: 999;
  color: white;
  width: 320px;
  box-sizing: border-box;
}

.player-picker h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.player-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px;
  box-sizing: border-box;
}

.player-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  transition:
    transform 0.15s ease,
    background 0.15s ease,
    border-color 0.15s ease;
}

.player-btn:hover {
  transform: scale(1.02);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
}

.player-btn:active {
  transform: scale(0.98);
}

@keyframes mergeLeft {
  0% {
    transform: translateX(-150px) rotate(-10deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 0.8;
    filter: blur(2px);
  }
}

@keyframes mergeRight {
  0% {
    transform: translateX(150px) rotate(10deg);
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: translateX(0) rotate(0deg);
    opacity: 0.8;
    filter: blur(2px);
  }
}

.sixseven-anim-card {
  position: absolute;
  width: 70px;
  height: 110px;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  color: white;
  font-size: 2rem;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.card-6 {
  animation: mergeLeft 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.card-7 {
  animation: mergeRight 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes logoZoomIn {
  0% {
    transform: scale(0.3);
    opacity: 0;
    filter: drop-shadow(0 0 0 rgba(255, 215, 0, 0));
  }
  70% {
    transform: scale(1.1);
    filter: drop-shadow(0 0 30px rgba(255, 215, 0, 0.8));
  }
  100% {
    transform: scale(1);
    opacity: 1;
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.4));
  }
}

.sixseven-big-logo {
  font-size: 7rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 30%, #ffd700 100%);
  background-clip: text;
  color: transparent;
  line-height: 1;
  margin-bottom: 15px;
  letter-spacing: -2px;
  animation: logoZoomIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#room-settings {
  width: 100%;
  margin-top: 30px;
  padding: 25px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-sizing: border-box;
}

.room-settings-title {
  letter-spacing: 2px;
  font-size: 2rem;
  margin: 0;
  text-align: center;
}

.panel-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px 15px 15px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  position: absolute;
  top: -10px;
  left: 15px;
  background: #0d1117;
  padding: 0 8px;
  font-family: monospace;
  font-size: 0.75rem;
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.label-text {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
}

.toggle-switch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  padding: 4px 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
  background-color: #232d38;
  border-radius: 20px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  pointer-events: auto;
}

.switch-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 2px;
  background-color: #7f8c8d;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.toggle-switch input:checked + .switch-slider {
  background-color: rgba(46, 204, 113, 0.2);
  border-color: #2ecc71;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.2);
}

.toggle-switch input:checked + .switch-slider::before {
  transform: translateX(22px);
  background-color: #2ecc71;
  box-shadow: 0 0 8px #2ecc71;
}

.panel-input-group {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#room-settings input[type="number"],
#room-settings select {
  font-weight: bold;
  background: #161b22;
  border: 1px solid #30363d;
  color: white;
  border-radius: 6px;
  padding: 6px 10px;
  outline: none;
  text-align: center;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}

#room-settings input[type="number"] {
  min-width: 30px;
  width: 30px;
  height: 20px;
}

#room-settings select {
  cursor: pointer;
  min-width: 130px;
}

#room-settings input[type="number"]:focus,
#room-settings select:focus {
  border-color: #fff;
  box-shadow: 0 0 10px rgba(237, 244, 255, 0.2);
}

#room-settings select option {
  background: #161b22;
  color: white;
  text-shadow: none;
}

@media (max-width: 600px) {
  body {
    padding: 12px;
  }

  .card {
    width: 65px;
    height: 100px;
    font-size: 24px;
  }

  #hand .card {
    margin-left: 0;
  }

  #topCard .card {
    width: 80px;
    height: 120px;
    font-size: 32px;
  }

  #menu input,
  #menu button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
  }

  .or-divider {
    width: 100%;
  }

  #turnIndicator,
  .turn-timer-display {
    font-size: 1rem;
  }

  .chat-container {
    width: 100%;
    height: 35vh;
    bottom: 0;
    right: 0;
    border-radius: 16px 16px 0 0;
  }

  .room-settings {
    padding: 15px;
  }
}

@media (min-width: 601px) {
  body {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr;
    height: 100vh;
    padding: 24px;
    overflow: hidden;
    box-sizing: border-box;
  }

  body:has(.players-container:not([hidden])) {
    grid-template-columns: 1fr 320px;
    gap: 24px;
  }

  #roomScreen #menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  #roomScreen #menu h3 {
    font-size: 2.5rem;
    margin: 0;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    width: 100%;
  }

  #roomScreen #menu p {
    font-size: 1.2rem;
    margin: 0;
  }

  #roomScreen #menu button {
    width: 100%;
    max-width: 300px;
    margin: 0;
  }

  .screen {
    grid-column: 1;
    grid-row: 1;
    height: 100%;
    overflow-y: auto;
    padding-right: 8px;
  }

  .players-container {
    grid-column: 2;
    grid-row: 1;
    margin-top: 0;
    height: calc(100% - 60px);
    overflow-y: auto;
    box-sizing: border-box;
  }

  .chat-container {
    right: 24px;
    bottom: 24px;
    width: 320px;
    max-height: 300px;
  }
}
