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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding-top: 80px;
}

.container {
  width: 100%;
  max-width: 720px;
  padding: 0 20px;
}

h1 {
  text-align: center;
  margin-bottom: 8px;
  font-size: 28px;
}

.subtitle {
  text-align: center;
  color: #888;
  margin-bottom: 28px;
  font-size: 15px;
}

.input-group {
  display: flex;
  gap: 8px;
}

.input-group input {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
}

.input-group button {
  padding: 12px 24px;
  background: #f38020;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.input-group button:hover {
  background: #e06f10;
}

.input-group button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

.result {
  margin-top: 16px;
  padding: 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  word-break: break-all;
}

.result:empty {
  display: none;
}

.result.error {
  border-color: #e74c3c;
  color: #e74c3c;
}

.result .action-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  margin-bottom: 8px;
}

.result .url-output {
  font-weight: 600;
  color: #f38020;
  cursor: pointer;
  font-size: 16px;
}

.result .url-output:hover {
  text-decoration: underline;
}

.result .details {
  margin-top: 10px;
  font-size: 13px;
  color: #666;
  line-height: 1.6;
}

.copied-toast {
  font-size: 12px;
  color: #27ae60;
  margin-top: 4px;
}

/* Leaderboard */
.leaderboard {
  margin-top: 40px;
}

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

.leaderboard-header h2 {
  font-size: 18px;
}

.ws-status {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
}

.ws-status.connected {
  background: #e8f5e9;
  color: #2e7d32;
}

.ws-status.disconnected {
  background: #fbe9e7;
  color: #c62828;
}

#leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  font-size: 13px;
}

#leaderboard-table th {
  background: #fafafa;
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
  border-bottom: 1px solid #ddd;
}

#leaderboard-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

#leaderboard-table tbody tr:hover {
  background: #fafafa;
}

.empty-row {
  text-align: center;
  color: #aaa;
  padding: 20px 12px !important;
}

.click-count {
  font-weight: 700;
  color: #f38020;
}
