* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #1a1a2e;
  color: #e0e0e0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1rem;
}

.container {
  max-width: 440px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
}

header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.title-icon {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.title-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.1rem;
}

header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.04em;
  text-shadow: none;
}

.title-letter {
  display: inline-block;
  background: linear-gradient(135deg, #fff 0%, #b0c4de 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  will-change: filter;
  -webkit-filter: brightness(1);
  filter: brightness(1);
  animation: letter-glow 10s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.15s);
}

@keyframes letter-glow {
  0%, 8%, 100% {
    -webkit-filter: brightness(1);
    filter: brightness(1);
  }
  4% {
    -webkit-filter: brightness(1.5) drop-shadow(0 0 3px rgba(176, 196, 222, 0.5));
    filter: brightness(1.5) drop-shadow(0 0 3px rgba(176, 196, 222, 0.5));
  }
}

.subtitle {
  font-size: 0.8rem;
  color: #777;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-align: left;
}

#mode-toggle {
  display: flex;
  background: #16213e;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #333;
}

.mode-btn {
  padding: 0.5rem 0.9rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 0;
  background: transparent;
  color: #888;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.mode-btn.active {
  background: #3498db;
  color: #fff;
}

.mode-btn:hover:not(.active) {
  background: #1e2f4a;
  color: #ccc;
}

.badge {
  display: inline-block;
  padding: 0.25rem 1rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-easy { background: #2ecc71; color: #000; }
.badge-medium { background: #f39c12; color: #000; }
.badge-hard { background: #e74c3c; color: #fff; }
.badge-expert { background: #8e44ad; color: #fff; }

#status-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #333;
}

#min-moves-info {
  font-size: 0.85rem;
  color: #999;
}

#grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  justify-items: center;
}

.card {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-width: 120px;
  background: #16213e;
  border: 2px solid #444;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, opacity 0.15s;
  user-select: none;
}

.card .suit {
  font-size: 1.1rem;
  color: #888;
  margin-top: 0.15rem;
}

.card.correct {
  background: #1b4332;
  border-color: #2ecc71;
}

.card.correct .suit {
  color: #2ecc71;
}

/* Drag interaction */
#grid .card {
  touch-action: none;
  cursor: grab;
}

#grid .card:active {
  cursor: grabbing;
}

#grid.dragging .card:not(.drag-preview):not(.drag-will-commit) {
  opacity: 0.4;
}

.card.drag-preview {
  border-color: #3498db;
  box-shadow: 0 0 10px rgba(52, 152, 219, 0.3);
}

.card.drag-will-commit {
  border-color: #2ecc71;
  box-shadow: 0 0 16px rgba(46, 204, 113, 0.4);
}

.drag-hint {
  text-align: center;
  font-size: 0.85rem;
  color: #555;
  padding: 0.5rem 0;
  letter-spacing: 0.03em;
  transition: opacity 0.2s;
}

/* How to Play tutorial */
#howto-content {
  display: flex;
  flex-direction: column;
}

.howto-rules {
  list-style: none;
  display: grid;
}

.howto-rules li {
  grid-row: 1;
  grid-column: 1;
  padding: 0.55rem 0.75rem;
  background: #1a2a3a;
  border-radius: 8px;
  border-left: 3px solid #3498db;
  font-size: 0.85rem;
  color: #e0e0e0;
  line-height: 1.35;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.howto-rules li.howto-active {
  opacity: 1;
  transform: translateY(0);
}

#reserve-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.reserve-label {
  font-size: 1rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

#reserve {
  width: 90px;
  aspect-ratio: 3 / 4;
}

#controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.group-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #888;
}

.btn-row {
  display: flex;
  gap: 0.5rem;
}

.btn-row button {
  flex: 1;
}

button {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  background: #2a2a4a;
  color: #e0e0e0;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

button:hover {
  background: #3a3a6a;
}

button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.col-controls .btn-row {
  justify-content: center;
}

.col-btn-pair {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.col-btn-pair span {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.col-btn-pair button {
  width: 100%;
  padding: 0.6rem;
}

.hidden {
  display: none !important;
}

#inperson-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#btn-show-solution {
  width: 100%;
  padding: 0.85rem;
  background: #1a2a3a;
  color: #3498db;
  font-size: 1rem;
  border: 1px solid #3498db44;
}

#btn-show-solution:hover {
  background: #223a52;
}

.solution-visible {
  background: #16213e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1rem;
  max-height: 400px;
  overflow-y: auto;
}

.solution-header {
  font-size: 0.9rem;
  color: #999;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.solution-steps {
  list-style: none;
  counter-reset: step;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.solution-steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem;
  background: #1a1a2e;
  border-radius: 8px;
  border-left: 3px solid #3498db;
}

.solution-steps li::before {
  content: "Step " counter(step);
  font-size: 0.7rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.solution-steps li strong {
  font-size: 1rem;
  color: #e0e0e0;
}

.step-state {
  font-size: 0.8rem;
  color: #888;
  font-family: monospace;
}

.solution-error {
  color: #e74c3c;
  text-align: center;
  padding: 0.5rem;
}

#inperson-result {
  display: flex;
  gap: 0.5rem;
}

.btn-solved {
  flex: 1;
  background: #1b4332 !important;
  color: #2ecc71 !important;
  border: 1px solid #2ecc7144 !important;
}

.btn-solved:hover:not(:disabled) {
  background: #265e45 !important;
}

.btn-failed {
  flex: 1;
  background: #4a1111 !important;
  color: #e74c3c !important;
  border: 1px solid #e74c3c44 !important;
}

.btn-failed:hover:not(:disabled) {
  background: #5a2020 !important;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  justify-items: center;
  width: 100%;
  position: relative;
}

.mini-grid.dragging .card:not(.drag-preview):not(.drag-will-commit) {
  opacity: 0.4;
}

.mini-card {
  max-width: 80px;
  font-size: 1.4rem !important;
  border-radius: 8px !important;
}

.mini-card .suit {
  font-size: 0.6rem !important;
}

.mini-reserve-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.3rem;
}

.mini-reserve-label {
  font-size: 0.8rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.solution-step-label {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: #3498db;
  padding-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

#message {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  padding: 1rem;
  border-radius: 10px;
}

#message.win {
  background: #1b4332;
  color: #2ecc71;
  border: 2px solid #2ecc71;
}

#message.lose {
  background: #4a1111;
  color: #e74c3c;
  border: 2px solid #e74c3c;
}

footer {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
}

footer button {
  flex: 1;
  font-size: 0.9rem;
}

#btn-easier {
  background: #3a2a1a;
  color: #f39c12;
}

#btn-easier:hover {
  background: #4a3a2a;
}

#btn-harder {
  background: #1a2a3a;
  color: #3498db;
}

#btn-harder:hover {
  background: #2a3a4a;
}

#btn-new {
  background: #2a4a2a;
  color: #2ecc71;
}

#btn-new:hover {
  background: #3a5a3a;
}

#leaderboard-section {
  margin-top: 0.5rem;
  padding: 1.25rem;
  background: #16213e;
  border: 1px solid #333;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#leaderboard-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ccc;
  letter-spacing: 0.04em;
}

#lb-auth {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 40px;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
}

#user-name {
  font-size: 0.85rem;
  color: #e0e0e0;
  font-weight: 600;
}

#user-elo, #user-peak {
  font-size: 0.85rem;
  color: #aaa;
}

.lb-stat-sep {
  color: #555;
  font-size: 0.85rem;
}

#btn-signout {
  padding: 0.3rem 0.65rem;
  font-size: 0.7rem;
  background: #2a2a3a;
  color: #888;
  border-radius: 6px;
  border: 1px solid #444;
  margin-left: 0.25rem;
}

#btn-signout:hover {
  background: #3a3a4a;
  color: #ccc;
}

#lb-signin-prompt {
  font-size: 0.8rem;
  color: #666;
  text-align: center;
}

#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#leaderboard-table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #333;
}

#leaderboard-table thead th:first-child {
  width: 2rem;
  text-align: center;
}

#leaderboard-table thead th:nth-child(3),
#leaderboard-table thead th:nth-child(4) {
  text-align: right;
  width: 4rem;
}

#leaderboard-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #262640;
  color: #ccc;
}

#leaderboard-table tbody td:first-child {
  text-align: center;
  color: #888;
  font-weight: 600;
}

#leaderboard-table tbody td:nth-child(3),
#leaderboard-table tbody td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

#leaderboard-table tbody tr.lb-me {
  background: #1b4332;
}

#leaderboard-table tbody tr.lb-me td {
  color: #2ecc71;
  font-weight: 600;
}

.btn-google-fallback {
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: #fff;
  color: #333;
  border: 1px solid #dadce0;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-google-fallback:hover {
  background: #f7f8f8;
  border-color: #c6c6c6;
}

.btn-google-fallback:active {
  background: #eee;
}

#lb-empty {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  padding: 0.5rem 0;
}

#lb-my-stats {
  width: 100%;
  padding-top: 0.75rem;
  border-top: 1px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.my-stats-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.my-stats-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #ccc;
}

.card.face-down {
  background: #0f1a30;
  border-color: #2a5a8a;
  box-shadow: inset 0 0 0 3px #0a1020, 0 2px 8px rgba(0, 0, 0, 0.4);
}

.card-back-inner {
  font-size: 2.5rem;
  color: #3498db;
  opacity: 0.3;
}

/* End-of-round popup */
#popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
  animation: popup-fade-in 0.25s ease-out;
}

#popup {
  background: #16213e;
  border: 2px solid #333;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  animation: popup-scale-in 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  max-height: 85vh;
  overflow-y: auto;
}

#popup-icon {
  font-size: 2.8rem;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.popup-icon-win {
  background: #1b4332;
  border: 3px solid #2ecc71;
  color: #2ecc71;
}

.popup-icon-lose {
  background: #4a1111;
  border: 3px solid #e74c3c;
  color: #e74c3c;
}

#popup-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  margin: 0;
}

#popup-subtitle {
  font-size: 0.95rem;
  color: #999;
  text-align: center;
  margin: 0;
}

.popup-elo {
  text-align: center;
  margin: 0.25rem 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.elo-value {
  color: #e0e0e0;
  font-variant-numeric: tabular-nums;
}

.elo-delta {
  font-size: 0.95rem;
  font-weight: 600;
}

.elo-up {
  color: #2ecc71;
}

.elo-down {
  color: #e74c3c;
}

#popup-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.75rem;
}

#popup-btn-next {
  width: 100%;
  padding: 0.9rem;
  font-size: 1.05rem;
  background: #2a4a2a;
  color: #2ecc71;
  border: 1px solid #2ecc7144;
  border-radius: 10px;
}

#popup-btn-next:hover {
  background: #3a5a3a;
}

#popup-btn-solution {
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
  background: #1a2a3a;
  color: #3498db;
  border: 1px solid #3498db44;
  border-radius: 10px;
}

#popup-btn-solution:hover {
  background: #223a52;
}

.popup-solution-visible {
  width: 100%;
  background: #1a1a2e;
  border: 1px solid #333;
  border-radius: 10px;
  padding: 1rem;
  overflow: visible;
}

@keyframes popup-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popup-scale-in {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---------- Multiplayer group UI ---------- */

#group-section {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

#group-intro {
  font-size: 0.85rem;
  color: #9aa5b8;
  line-height: 1.4;
  padding: 0.6rem 0.75rem;
  background: #16213e;
  border: 1px solid #2a3556;
  border-radius: 8px;
  text-align: center;
}

#group-entry {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
  padding: 1rem;
  background: #16213e;
  border: 1px solid #2a3556;
  border-radius: 10px;
}

.group-btn-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.group-btn-row button {
  flex: 1;
}

#btn-create-group {
  background: #2a4a2a;
  color: #2ecc71;
  border: 1px solid #2ecc7144;
  font-size: 1rem;
}

#btn-create-group:hover {
  background: #3a5a3a;
}

.group-subhint {
  font-size: 0.8rem;
  color: #777;
  text-align: center;
}

#group-auth {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: stretch;
  padding: 1rem;
  background: #16213e;
  border: 1px solid #2a3556;
  border-radius: 10px;
}

#group-auth h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #ccc;
  text-align: center;
  margin: 0 0 0.25rem;
}

#group-auth-signin {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: center;
}

.group-auth-or {
  font-size: 0.75rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
}

#btn-guest-start {
  background: #2a2a4a;
  color: #e0e0e0;
}

#group-guest-form {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

#group-guest-form input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-size: 1rem;
  background: #0f1a30;
  border: 1px solid #2a3556;
  color: #e0e0e0;
  border-radius: 8px;
  outline: none;
}

#group-guest-form input:focus {
  border-color: #3498db;
}

.group-err {
  color: #e74c3c;
  font-size: 0.85rem;
  text-align: center;
}

.btn-subtle {
  background: transparent !important;
  color: #888 !important;
  font-size: 0.85rem !important;
  border: 1px solid #333 !important;
}

.btn-subtle:hover {
  color: #ccc !important;
  background: #1a2a3a !important;
}

#group-qr {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  align-items: center;
  padding: 1rem;
  background: #16213e;
  border: 1px solid #2a3556;
  border-radius: 10px;
}

.group-qr-label {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

#group-qr-container {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.group-qr-link {
  font-size: 0.75rem;
  color: #7a8aa8;
  word-break: break-all;
  text-align: center;
  font-family: monospace;
  padding: 0.4rem 0.6rem;
  background: #0f1a30;
  border-radius: 6px;
  width: 100%;
}

#group-qr .btn-row {
  width: 100%;
}

#group-team {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  background: #16213e;
  border: 1px solid #2a3556;
  border-radius: 10px;
}

.group-team-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

#group-team-name {
  flex: 1;
  padding: 0.55rem 0.75rem;
  font-size: 1.05rem;
  font-weight: 700;
  background: #0f1a30;
  border: 1px solid #2a3556;
  color: #e0e0e0;
  border-radius: 8px;
  outline: none;
  letter-spacing: 0.02em;
}

#group-team-name:focus {
  border-color: #3498db;
}

.btn-refresh {
  width: 40px;
  height: 40px;
  padding: 0 !important;
  background: #1a2a3a !important;
  color: #3498db !important;
  border: 1px solid #3498db44 !important;
  font-size: 1.3rem !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 8px !important;
}

.btn-refresh:hover {
  background: #223a52 !important;
}

.btn-refresh.spinning {
  animation: refresh-spin 0.6s linear;
}

@keyframes refresh-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.group-team-elo-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: #ccc;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #2a3556;
}

.group-team-games {
  color: #888;
  font-size: 0.85rem;
}

#group-team-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#group-team-table td {
  padding: 0.55rem 0.5rem;
  border-bottom: 1px solid #1e2a44;
  color: #ccc;
}

#group-team-table tr:last-child td {
  border-bottom: none;
}

#group-team-table td.name-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.leader-badge {
  display: inline-block;
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  background: #2a4a2a;
  color: #2ecc71;
  border: 1px solid #2ecc7144;
  border-radius: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.guest-badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.4rem;
  background: #2a2a3a;
  color: #888;
  border: 1px solid #444;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.member-solo-elo {
  font-size: 0.75rem;
  color: #666;
  margin-left: 0.4rem;
}

.btn-kick {
  padding: 0.3rem 0.6rem !important;
  font-size: 0.75rem !important;
  background: #3a1a1a !important;
  color: #e27575 !important;
  border: 1px solid #5a2a2a !important;
  border-radius: 6px !important;
}

.btn-kick:hover {
  background: #5a2a2a !important;
}

.btn-deal {
  width: 100%;
  padding: 0.95rem !important;
  font-size: 1.1rem !important;
  background: #2a4a2a !important;
  color: #2ecc71 !important;
  border: 1px solid #2ecc7144 !important;
  font-weight: 700 !important;
}

.btn-deal:hover {
  background: #3a5a3a !important;
}

.group-wait {
  text-align: center;
  font-size: 0.9rem;
  color: #888;
  padding: 0.75rem;
  background: #1a2a3a;
  border-radius: 8px;
  font-style: italic;
}

.btn-leave-self {
  background: transparent !important;
  color: #888 !important;
  border: 1px solid #444 !important;
  font-size: 0.85rem !important;
  padding: 0.55rem !important;
}

.btn-leave-self:hover {
  background: #2a1a1a !important;
  color: #e27575 !important;
  border-color: #5a2a2a !important;
}

#group-leaderboard-section {
  margin-top: 0.5rem;
  padding: 1.25rem;
  background: #16213e;
  border: 1px solid #333;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

#group-leaderboard-section h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ccc;
  letter-spacing: 0.04em;
}

#group-lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

#group-lb-table thead th {
  text-align: left;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid #333;
}

#group-lb-table thead th:first-child {
  width: 2rem;
  text-align: center;
}

#group-lb-table thead th:nth-child(3),
#group-lb-table thead th:nth-child(4) {
  text-align: right;
  width: 4rem;
}

#group-lb-table tbody td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #262640;
  color: #ccc;
}

#group-lb-table tbody td:first-child {
  text-align: center;
  color: #888;
  font-weight: 600;
}

#group-lb-table tbody td:nth-child(3),
#group-lb-table tbody td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

#group-lb-table tbody tr:last-child td {
  border-bottom: none;
}

#group-lb-empty {
  font-size: 0.85rem;
  color: #555;
  text-align: center;
  padding: 0.5rem 0;
}

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.4rem;
  }

  .title-icon {
    width: 44px;
    height: 44px;
  }

  .mode-btn {
    padding: 0.45rem 0.55rem;
    font-size: 0.75rem;
  }

  .card {
    font-size: 1.8rem;
    border-radius: 10px;
  }

  .howto-rules li {
    font-size: 0.8rem;
    padding: 0.45rem 0.6rem;
  }
}
