.room-settings-content form { overflow-y: auto; min-height: 0; padding: 1rem; }
.room-settings-content .room-settings-tabs { padding: 0.75rem 1rem 0; }
#lobby-screen { flex-direction: column; }
#lobby-screen .lobby-layout { flex: 1; min-height: 0; height: auto; }
.room-settings-summary { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 0.5rem; margin: 1rem auto 0; width: calc(100% - 4rem); max-width: 1200px; }
.room-settings-summary span { border: 1px solid #343b50; border-radius: 1rem; padding: 0.4rem 0.7rem; background: #171c2c; font-size: 0.8rem; }
.room-settings-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.room-settings-fields { display: grid; gap: 0.8rem; margin-bottom: 1rem; }
.room-settings-fields label { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.room-settings-fields input[type="number"] { width: 5rem; }
.room-settings-fields input:not([type="checkbox"]):not([type="range"]), .room-settings-fields select { background: #171c2c; color: #fff; border: 1px solid #586078; border-radius: 5px; padding: 0.5rem; }
.leaderboard-content { width: min(700px, 95vw); }
.leaderboard-tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.leaderboard-scroll { max-height: 60vh; overflow: auto; }
.leaderboard-table { width: 100%; border-collapse: collapse; text-align: left; }
.leaderboard-table th, .leaderboard-table td { padding: 0.75rem; border-bottom: 1px solid #343b50; }
.leaderboard-current { background: #143e40; color: #00f5d4; }
.team-controls { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; margin-bottom: 0.75rem; }
.team-controls select { background: #171c2c; color: #fff; border: 1px solid #586078; padding: 0.5rem; border-radius: 6px; }
.team-heading { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; padding: 0.6rem; margin-top: 0.5rem; border-left: 4px solid var(--team-color); color: var(--team-color); list-style: none; }
.team-start-hint { font-size: 0.8rem; color: #adb5c9; margin-bottom: 0.75rem; }
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a25;
  --primary: #00f5d4;
  --primary-dark: #00c4aa;
  --secondary: #7b2cbf;
  --accent: #ff6b6b;
  --text: #ffffff;
  --text-muted: #8888aa;
  --border: #2a2a3a;
  --success: #00f5d4;
  --warning: #ffd93d;
}

body {
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow: hidden;
  background-image: 
    radial-gradient(ellipse at 20% 80%, rgba(123, 44, 191, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(0, 245, 212, 0.1) 0%, transparent 50%);
}

#app {
  width: 100vw;
  height: 100vh;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  justify-content: center;
  align-items: center;
}

.screen.active {
  display: flex;
}

/* Landing Page */
#landing-screen {
  position: relative;
  overflow: hidden;
}

#landing-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

.landing-content {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  pointer-events: none;
}

.landing-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 5rem;
  text-align: center;
  margin-top: 2rem;
}

.landing-title .title-curve {
  color: var(--primary);
  text-shadow: 0 0 30px rgba(0, 245, 212, 0.5);
}

.landing-title .title-arena {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.landing-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  max-width: 800px;
  padding: 2rem;
}

.landing-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  background: rgba(18, 18, 26, 0.8);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: default;
  transition: all 0.3s ease;
  pointer-events: none;
}

.landing-menu-item.highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 30px rgba(0, 245, 212, 0.4);
  transform: scale(1.1);
}

.landing-menu-item.encircled {
  border-color: var(--warning);
  box-shadow: 0 0 40px rgba(255, 217, 61, 0.6);
  animation: pulse-glow 0.5s ease infinite;
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 40px rgba(255, 217, 61, 0.6); }
  50% { box-shadow: 0 0 60px rgba(255, 217, 61, 0.9); }
}

.menu-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.menu-text {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 1px;
}

/* Landing Instructions Overlay */
.landing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 15, 0.95);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.landing-overlay.hidden {
  display: none;
}

.landing-instructions-content {
  text-align: center;
  max-width: 500px;
  padding: 2rem;
}

.landing-instructions-content h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 2rem;
  letter-spacing: 3px;
}

.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.instruction-step {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-align: left;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.step-icon {
  font-size: 2rem;
  min-width: 50px;
  text-align: center;
}

.instruction-step p {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.instruction-step strong {
  color: var(--text);
}

.btn-glow {
  animation: btn-glow-pulse 2s ease infinite;
}

@keyframes btn-glow-pulse {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 245, 212, 0.4); }
  50% { box-shadow: 0 0 40px rgba(0, 245, 212, 0.7); }
}

/* Landing Feedback */
.landing-feedback {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 200;
  background: var(--primary);
  color: var(--bg-dark);
  padding: 1.5rem 3rem;
  border-radius: 12px;
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  animation: feedback-pop 0.5s ease;
}

@keyframes feedback-pop {
  0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
  50% { transform: translate(-50%, -50%) scale(1.2); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.container {
  max-width: 600px;
  width: 100%;
  padding: 2rem;
}

/* Typography */
.game-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 4rem;
  text-align: center;
  margin-bottom: 0.5rem;
  letter-spacing: 0.1em;
}

.title-curve {
  color: var(--primary);
  text-shadow: 0 0 30px rgba(0, 245, 212, 0.5);
}

.title-arena {
  color: var(--accent);
  text-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
}

.tagline {
  text-align: center;
  color: var(--text-muted);
  font-size: 1.2rem;
  margin-bottom: 3rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

/* Forms */
.menu-form {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  font-family: 'Rajdhani', sans-serif;
  background: var(--bg-dark);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 20px rgba(0, 245, 212, 0.2);
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-muted);
}

/* Buttons */
.button-group {
  display: flex;
  gap: 1rem;
}

.btn {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem 1.5rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-primary {
  flex: 1;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: var(--bg-dark);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(0, 245, 212, 0.3);
}

.btn-secondary {
  flex: 1;
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-secondary:hover {
  background: rgba(0, 245, 212, 0.1);
  transform: translateY(-2px);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  background: var(--secondary);
  color: var(--text);
}

.btn-small:hover {
  background: #9b4bdf;
}

.btn-text {
  background: transparent;
  color: var(--text-muted);
  padding: 0.5rem;
}

.btn-text:hover {
  color: var(--text);
}

.btn-large {
  padding: 1.25rem 2.5rem;
  font-size: 1.2rem;
}

.btn-danger {
  background: var(--accent);
  color: var(--bg-dark);
  width: 100%;
  margin-top: 1rem;
}

.btn-danger:hover {
  background: #ff8585;
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 1.2em;
}

/* Room List */
.room-list-section {
  margin-top: 2rem;
}

.room-list-section h3 {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.room-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  max-height: 200px;
  overflow-y: auto;
}

.room-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s ease;
}

.room-item:last-child {
  border-bottom: none;
}

.room-item:hover {
  background: var(--bg-card-hover);
}

.room-item-icon {
  width: 40px;
  height: 40px;
  background: var(--bg-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.room-item-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.room-item-actions {
  margin-left: auto;
}

.room-item-name {
  font-weight: 700;
  color: var(--text);
}

.room-item-code {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.room-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.room-item-players {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
}

.btn-join {
  background: var(--primary);
  color: var(--bg-dark);
}

.btn-spectate {
  background: transparent;
  border: 1px solid var(--text-muted);
  color: var(--text-muted);
}

.btn-spectate:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.no-rooms {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
}

.join-by-code {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.join-by-code input {
  flex: 1;
  text-transform: uppercase;
}

.hidden {
  display: none !important;
}

/* Lobby */
.lobby-layout {
  display: flex;
  gap: 2rem;
  height: 100vh;
  width: 100vw;
  padding: 2rem;
  justify-content: center;
}

.lobby-left {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
}

.lobby-room-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: var(--primary);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.lobby-players-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  min-height: 200px;
}

.player-list {
  list-style: none;
}

.player-list-item {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  background: var(--bg-dark);
}

.player-color-bar {
  width: 4px;
  height: 40px;
  border-radius: 2px;
  margin-right: 1rem;
}

.player-info {
  flex: 1;
}

.player-name {
  font-weight: 600;
  color: var(--text);
}

.player-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.player-host-tag {
  background: var(--primary);
  color: var(--bg-dark);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.lobby-spectators-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.lobby-spectators-panel h4 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.spectator-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.spectator-item {
  background: var(--bg-dark);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.lobby-right {
  width: 320px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lobby-actions-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.lobby-actions-panel h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-action {
  flex: 1;
  padding: 0.75rem 1rem;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 8px;
}

.btn-leave {
  background: #dc2626;
  color: white;
}

.btn-leave:hover {
  background: #b91c1c;
}

.btn-play {
  background: #a855f7;
  color: white;
}

.btn-play:hover {
  background: #9333ea;
}

.btn-spectate {
  background: #6366f1;
  color: white;
}

.btn-spectate:hover {
  background: #4f46e5;
}

.btn-join-player {
  background: #10b981;
  color: white;
}

.btn-join-player:hover {
  background: #059669;
}

.status-indicator {
  flex: 1;
  padding: 0.75rem 1rem;
  background: #6366f1;
  color: white;
  font-weight: 700;
  text-transform: uppercase;
  border-radius: 8px;
  text-align: center;
  font-size: 0.85rem;
}

.btn-room-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-room-link:hover {
  border-color: var(--primary);
}

.btn-room-link strong {
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  letter-spacing: 0.1em;
}

.copy-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.lobby-chat-panel {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.lobby-chat-panel h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.lobby-chat-panel .chat-messages {
  flex: 1;
  min-height: 350px;
}

.lobby-chat-panel .chat-input-row {
  margin-top: 0.75rem;
}

.players-list, .game-settings {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
}

.players-list h3, .game-settings h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.players-list ul {
  list-style: none;
}

.player-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.player-item:last-child {
  border-bottom: none;
}

.player-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.player-name {
  flex: 1;
}

.player-host {
  font-size: 0.75rem;
  color: var(--warning);
  text-transform: uppercase;
}

.instructions {
  list-style: none;
}

.instructions li {
  padding: 0.5rem 0;
  color: var(--text-muted);
}

kbd {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.85rem;
  color: var(--primary);
}

.points-to-win {
  color: var(--accent);
  font-weight: 700;
}

.lobby-actions {
  text-align: center;
}

.waiting-message {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Game Screen */
.game-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  padding: 1rem;
  gap: 1rem;
}

.game-sidebar {
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-sidebar-top {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.game-sidebar-bottom {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.game-chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  min-height: 200px;
}

.game-chat-panel .chat-panel-layout {
  height: 100%;
}

.game-chat-panel .chat-messages {
  min-height: 120px;
  max-height: 150px;
}

.game-chat-icon-tab {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  opacity: 0.5;
}

.game-chat-icon-tab:hover {
  opacity: 0.8;
}

.game-chat-icon-tab.active {
  opacity: 1;
}

.game-sidebar h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

#scoreboard {
  list-style: none;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

.score-item:last-child {
  border-bottom: none;
}

.score-item.dead {
  opacity: 0.4;
}

.score-color {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.score-icon {
  font-size: 1rem;
  margin-right: 0.25rem;
}

.score-name {
  flex: 1;
  font-size: 0.95rem;
}

/* Player icon in lobby */
.player-icon {
  font-size: 1.2rem;
  margin-right: 0.5rem;
}

.score-points {
  font-family: 'Orbitron', sans-serif;
  font-weight: 700;
  color: var(--primary);
}

.round-info {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.survival-time {
  text-align: center;
  padding: 0.5rem 0;
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
}

#round-number {
  color: var(--accent);
  font-weight: 700;
}

.game-canvas-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-canvas-container {
  display: flex;
  justify-content: center;
  align-items: center;
}

#game-canvas-container canvas {
  background: var(--bg-dark);
  max-width: 100%;
  max-height: 100%;
}

/* Overlays */
.overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.9);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border-radius: 8px;
}

#countdown-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 8rem;
  font-weight: 900;
  color: var(--primary);
  text-shadow: 0 0 50px rgba(0, 245, 212, 0.5);
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.8; }
}

#round-end-overlay h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

/* Game Results Overlay */
.game-results-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  border-radius: 8px;
  overflow-y: auto;
}

.results-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.results-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.results-hint {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.results-list {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 1rem;
}

.result-item.winner {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--bg-card) 0%, rgba(0, 245, 212, 0.1) 100%);
}

.result-position {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  width: 2rem;
  text-align: center;
}

.result-position.gold { color: #FFD700; }
.result-position.silver { color: #C0C0C0; }
.result-position.bronze { color: #CD7F32; }

.result-color-bar {
  width: 4px;
  height: 40px;
  border-radius: 2px;
}

.result-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-name {
  font-weight: 600;
  font-size: 1rem;
}

.result-score {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.result-coins {
  font-size: 0.85rem;
  color: #ffd700;
  font-weight: 600;
}

.result-rank {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.result-rank-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.result-rank-change {
  font-size: 0.85rem;
  font-weight: 600;
}

.result-rank-change.positive {
  color: #4ade80;
}

.result-rank-change.negative {
  color: #ff6b6b;
}

.result-rank-change.neutral {
  color: var(--text-muted);
}

.btn-back-lobby {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-back-lobby:hover {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

#round-end-overlay p,
#game-over-overlay p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

#winner-message {
  font-size: 1.5rem;
  color: var(--primary) !important;
}

/* Player Profile Popup */
.game-chat-panel,
.lobby-chat-panel,
.menu-chat-panel {
  position: relative;
}

.player-profile-popup {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

.player-profile-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.player-profile-color {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.player-profile-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-profile-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.player-profile-close:hover {
  color: var(--text);
}

.player-profile-level {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  padding: 0.2rem 0.4rem;
  background: var(--bg-dark);
  border-radius: 4px;
  display: inline-block;
}

.player-profile-stats {
  background: var(--bg-dark);
  border-radius: 6px;
  padding: 0.5rem;
  margin-bottom: 0.5rem;
  flex: 1;
}

.player-profile-stats-header,
.player-profile-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0.25rem;
  text-align: center;
  font-size: 0.7rem;
}

.player-profile-stats-header {
  color: var(--text-muted);
  margin-bottom: 0.25rem;
  font-weight: 600;
}

.player-profile-stats-row {
  color: var(--text);
}

.player-profile-stats-row span:first-child {
  text-align: left;
  color: var(--text-muted);
}

.player-profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
}

.profile-action-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}

.profile-action-btn:hover {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.profile-action-btn.muted {
  background: #ff6b6b;
  border-color: #ff6b6b;
  color: white;
}

.clickable-name {
  cursor: pointer;
  transition: color 0.2s;
}

.clickable-name:hover {
  color: var(--primary);
}

.guest-chat-notice {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 6px;
  font-style: italic;
}

.notification-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 8px;
  height: 8px;
  background: #ff4444;
  border-radius: 50%;
  border: 1px solid var(--bg-card);
}

.friend-requests-section {
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.friend-requests-section h4 {
  color: #ff6b6b;
}

.friend-requests-section:empty,
.friend-requests-section.hidden {
  display: none;
}

.profile-action-btn.report-btn {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  color: white;
}

.profile-action-btn.report-btn:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}

.menu-chat-icon-tab,
.chat-icon-tab,
.game-chat-icon-tab {
  position: relative;
}

.player-list-item {
  cursor: pointer;
}

.player-list-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  .game-title {
    font-size: 2.5rem;
  }
  
  .lobby-content {
    grid-template-columns: 1fr;
  }
  
  .game-container {
    flex-direction: column;
  }
  
  .game-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  
  .game-sidebar h3 {
    width: 100%;
  }
  
  #scoreboard {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .score-item {
    border: none;
    padding: 0.5rem;
  }
}

/* Settings Button */
.btn-settings {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 100%;
  margin-top: 0.5rem;
}

.btn-settings:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Modal */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.5rem;
  color: var(--primary);
}

.btn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
}

.btn-close:hover {
  color: var(--text);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
}

/* Settings Sections */
.settings-section {
  margin-bottom: 1.5rem;
}

.settings-section:last-child {
  margin-bottom: 0;
}

.settings-section h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  gap: 0.75rem;
}

.setting-row > label:first-child {
  flex: 1;
  color: var(--text);
  font-size: 0.9rem;
  min-width: 0;
}

.setting-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.setting-value {
  min-width: 40px;
  text-align: right;
  color: var(--primary);
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
}

.refresh-hint {
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
}

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--bg-dark);
  border-radius: 2px;
  outline: none;
  flex-shrink: 0;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--primary);
  border-radius: 50%;
  cursor: pointer;
  border: none;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 18px;
  transition: 0.3s;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 12px;
  width: 12px;
  left: 2px;
  bottom: 2px;
  background-color: var(--text-muted);
  border-radius: 50%;
  transition: 0.3s;
}

.toggle input:checked + .toggle-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.toggle input:checked + .toggle-slider:before {
  transform: translateX(14px);
  background-color: var(--bg-dark);
}

/* Select dropdown */
.setting-select {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  cursor: pointer;
  min-width: 120px;
}

.setting-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Keybind button */
.keybind-btn {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  cursor: pointer;
  min-width: 80px;
  text-align: center;
  transition: all 0.2s;
}

.keybind-btn:hover {
  border-color: var(--primary);
}

.keybind-btn.listening {
  border-color: var(--accent);
  color: var(--accent);
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Ping display */
.ping-display {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: 'Orbitron', sans-serif;
}

.ping-display.good { color: #4ade80; }
.ping-display.medium { color: #fbbf24; }
.ping-display.bad { color: #f87171; }

/* Auth Screen */
.auth-container {
  max-width: 400px;
}

.auth-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  padding: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.auth-tab:hover {
  border-color: var(--primary);
}

.auth-tab.active {
  background: var(--primary);
  color: var(--bg-dark);
  border-color: var(--primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.btn-full {
  width: 100%;
}

.auth-error {
  color: #f87171;
  font-size: 0.85rem;
  text-align: center;
}

.guest-note {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
}

/* Menu Layout */
.menu-layout {
  display: flex;
  gap: 2rem;
  height: 100vh;
  width: 100vw;
  padding: 1.5rem;
  justify-content: center;
}

.menu-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 700px;
}

.menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.game-title-small {
  font-size: 1.5rem;
}

.game-title-small .title-curve,
.game-title-small .title-arena {
  font-size: inherit;
}

.menu-header-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn-header {
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-header:hover {
  border-color: var(--primary);
}

.btn-logout {
  background: #dc2626;
  border-color: #dc2626;
  color: white;
}

.btn-logout:hover {
  background: #b91c1c;
}

.room-list-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.room-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.room-list-header h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.room-list-actions {
  display: flex;
  gap: 0.5rem;
}

.menu-right {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Profile Panel */
.profile-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.profile-panel h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.profile-avatar {
  width: 50px;
  height: 50px;
  background: var(--bg-dark);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--text-muted);
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-weight: 700;
  font-size: 1.1rem;
}

.profile-member {
  font-size: 0.8rem;
  color: var(--primary);
}

.profile-stats {
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 0.75rem;
}

.profile-level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.level-badge {
  background: var(--primary);
  color: var(--bg-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.rank-badge {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: var(--bg-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.coins-badge {
  background: linear-gradient(135deg, #ffd700, #ffb347);
  color: var(--bg-dark);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.85rem;
}

.xp-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.xp-text-small {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.xp-bar {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transition: width 0.3s;
}

/* Friends Panel */
.friends-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 350px;
}

.friends-panel h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.friends-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.friends-tab {
  flex: 1;
  padding: 0.5rem;
  background: var(--bg-dark);
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.friends-tab.active {
  background: var(--primary);
  color: var(--bg-dark);
}

.friends-tab-content {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.friends-online, .friends-offline {
  margin-bottom: 0.75rem;
}

.friends-offline {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.5rem;
}

.friends-online h4, .friends-offline h4 {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.global-chat-messages {
  flex: 1;
  min-height: 150px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

/* Inline PM conversation */
#pm-conversation-view {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.pm-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.pm-header span {
  font-weight: 600;
  color: var(--primary);
}

.pm-messages-inline {
  flex: 1;
  min-height: 150px;
  max-height: 250px;
  overflow-y: auto;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pm-msg {
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  max-width: 85%;
  word-break: break-word;
}

.pm-msg.sent {
  background: var(--primary);
  color: var(--bg-dark);
  align-self: flex-end;
}

.pm-msg.received {
  background: var(--border);
  align-self: flex-start;
}

.pm-msg-text {
  font-size: 0.9rem;
}

.pm-msg-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

/* Toast notifications (shadcn/sonner style) */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  pointer-events: none;
}

.toast {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #1a1a24;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.625rem 0.875rem;
  width: 280px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  transform: translateY(-100%) scale(1);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-show {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.toast-show.toast-stacked-1 {
  transform: translateY(8px) scale(0.95);
  opacity: 0.8;
  z-index: -1;
}

.toast-show.toast-stacked-2 {
  transform: translateY(16px) scale(0.9);
  opacity: 0.6;
  z-index: -2;
}

.toast-exit {
  transform: translateY(-100%) scale(1);
  opacity: 0;
}

.toast-error {
  border-color: #ff6b6b;
  background: #1a1a24;
}

.toast-success {
  border-color: #4ade80;
  background: #1a1a24;
}

.toast-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-message {
  font-size: 0.8rem;
  color: var(--text);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.toast-close:hover {
  opacity: 1;
}

/* Input error state with shake */
.input-error {
  border-color: #ff6b6b !important;
  box-shadow: 0 0 0 2px rgba(255, 107, 107, 0.2) !important;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

.pm-day-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 1rem 0 0.5rem;
}

.pm-day-separator span {
  background: var(--bg-dark);
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Notifications */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--bg-card);
  border: 1px solid var(--primary);
  border-radius: 8px;
  padding: 1rem 1.5rem;
  color: var(--text);
  font-size: 0.9rem;
  z-index: 10000;
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.notification.show {
  transform: translateX(0);
}

/* Unread badge */
.unread-badge {
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 10px;
  margin-left: 0.5rem;
}

/* Floating Friends Panel */
.floating-friends-panel {
  position: fixed;
  right: 20px;
  bottom: 80px;
  width: 320px;
  max-height: 450px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.floating-friends-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.floating-friends-header h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--primary);
}

.floating-friends-content {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem;
  min-height: 200px;
  max-height: 350px;
}

.friends-toggle-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary);
  border: none;
  cursor: pointer;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: 0 4px 15px rgba(0, 245, 212, 0.3);
  transition: transform 0.2s;
}

.friends-toggle-btn:hover {
  transform: scale(1.1);
}

.friends-toggle-btn .unread-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  margin: 0;
}

/* Chat Panel with Icon Tabs */
.chat-panel-layout {
  display: flex;
  height: 100%;
  gap: 0;
}

.chat-icon-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.25rem;
  background: transparent;
}

.chat-icon-tab,
.menu-chat-icon-tab {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
  opacity: 0.5;
}

.chat-icon-tab:hover,
.menu-chat-icon-tab:hover {
  opacity: 0.8;
}

.chat-icon-tab.active,
.menu-chat-icon-tab.active {
  opacity: 1;
}

.chat-icon-tab .unread-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
}

.online-count-badge {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: #10b981;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0 0.25rem;
  border-radius: 6px;
  min-width: 14px;
  text-align: center;
}

.chat-panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-tab-header {
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border-radius: 0 8px 0 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.chat-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-tab-content .chat-messages,
.chat-tab-content .pm-messages-inline {
  flex: 1;
  min-height: 200px;
}

.chat-tab-content .friends-online,
.chat-tab-content .friends-offline {
  max-height: 100px;
  overflow-y: auto;
}

.friends-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--bg-dark);
  border-radius: 6px;
  cursor: pointer;
}

.friend-item:hover {
  background: var(--border);
}

.friend-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.friend-status.online {
  background: #10b981;
}

.friend-name {
  flex: 1;
  font-size: 0.9rem;
}

.friend-actions {
  display: flex;
  gap: 0.25rem;
}

.friend-action-btn {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.friend-action-btn.chat {
  background: var(--primary);
  color: var(--bg-dark);
}

.friend-action-btn.remove {
  background: #dc2626;
  color: white;
}

.friend-action-btn.accept {
  background: #10b981;
  color: white;
}

.friend-action-btn.decline {
  background: #6b7280;
  color: white;
}

.add-friend-row {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.75rem;
}

.add-friend-row input {
  flex: 1;
  padding: 0.5rem;
  font-size: 0.85rem;
}

.no-items {
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1rem;
}

/* PM Modal */
.pm-modal {
  width: 400px;
  max-height: 500px;
  display: flex;
  flex-direction: column;
}

.pm-messages {
  flex: 1;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.pm-message {
  margin-bottom: 0.5rem;
  padding: 0.5rem;
  border-radius: 6px;
  max-width: 80%;
}

.pm-message.sent {
  background: var(--primary);
  color: var(--bg-dark);
  margin-left: auto;
}

.pm-message.received {
  background: var(--border);
}

.pm-message-text {
  font-size: 0.9rem;
}

.pm-message-time {
  font-size: 0.7rem;
  opacity: 0.7;
  margin-top: 0.25rem;
}

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

.pm-input-row input {
  flex: 1;
}

/* User Search Modal */
.user-search-modal {
  width: 400px;
}

.search-input-row {
  margin-bottom: 1rem;
}

.search-input-row input {
  width: 100%;
  padding: 0.75rem;
}

.user-search-results {
  max-height: 300px;
  overflow-y: auto;
}

.user-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-dark);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.user-result-info {
  flex: 1;
}

.user-result-name {
  font-weight: 600;
}

.user-result-level {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Tooltip icon */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  margin-left: 0.4rem;
  position: relative;
  flex-shrink: 0;
}

.tooltip-icon:hover {
  background: var(--primary);
  color: var(--bg-dark);
}

.tooltip-icon:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-dark);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 400;
  white-space: normal;
  width: 200px;
  text-align: center;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  line-height: 1.4;
}

.tooltip-icon:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--border);
  z-index: 101;
}

/* Chat */
.chat-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  margin-top: 1.5rem;
}

.chat-container h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.75rem;
}

.chat-messages {
  height: 150px;
  overflow-y: auto;
  background: var(--bg-dark);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-messages-small {
  height: 100px;
}

.chat-message {
  font-size: 0.85rem;
  line-height: 1.4;
  word-break: break-word;
}

.chat-message-name {
  font-weight: 700;
  margin-right: 0.4rem;
}

.chat-message-text {
  color: var(--text);
}

.chat-message-system {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.8rem;
}

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

.chat-input-row input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

.chat-input-row .btn {
  padding: 0.5rem 0.75rem;
}

/* Color Picker Modal */
.color-picker-content {
  max-width: 400px;
  padding: 1.5rem;
}

.color-picker-content .modal-header {
  margin-bottom: 1.5rem;
}

.color-picker-content .modal-header h2 {
  font-size: 1.2rem;
  letter-spacing: 2px;
}

.color-grid {
  margin-bottom: 1.5rem;
}

.color-section-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.color-grid-section {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}


.color-option {
  aspect-ratio: 1;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.color-option:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px currentColor;
}

.color-option.selected {
  border-color: white;
  box-shadow: 0 0 20px currentColor;
}

.color-option.taken {
  opacity: 0.3;
  cursor: not-allowed;
}

.color-option.taken:hover {
  transform: none;
  box-shadow: none;
}

.color-picker-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.color-picker-actions .btn {
  min-width: 100px;
}

/* Make color bar clickable in lobby */
.player-color-bar.clickable {
  cursor: pointer;
  transition: all 0.2s;
}

.player-color-bar.clickable:hover {
  box-shadow: 0 0 10px currentColor;
  transform: scaleY(1.2);
}
