/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;900&family=Pacifico&family=Space+Grotesk:wght@500;700;900&display=swap');

/* --- Design System Tokens --- */
:root {
  --navy:      #0F172A;   /* Main background, deep navy */
  --blue:      #3B82F6;   /* Primary button, accent */
  --blue-dark: #1D4ED8;   /* Hover state */
  --blue-light:#DBEAFE;   /* Card backgrounds, light */
  --ice:       #F0F9FF;   /* Page background */
  --slate:     #64748B;   /* Secondary text */
  --white:     #FFFFFF;
  --gold:      #F59E0B;   /* Winner, special highlight */
  --green:     #10B981;   /* Unique answer */
  --yellow:    #FBBF24;   /* Same answer */
  --red:       #EF4444;   /* Error, wrong */

  --font-display: 'Space Grotesk', sans-serif;
  --font-body:    'Nunito', sans-serif;

  --shadow-normal: 0 4px 24px rgba(15, 23, 42, 0.08);
  --shadow-hover: 0 8px 32px rgba(59, 130, 246, 0.2);
  --shadow-neon: 0 0 20px rgba(59, 130, 246, 0.4);
  --transition: all 0.2s ease;
}

/* --- Dark Theme Overrides --- */
html.dark-theme {
  --ice:       #0F172A;   /* Dark page background */
  --white:     #1E293B;   /* Dark card background */
  --navy:      #F8FAFC;   /* Dark theme light text */
  --slate:     #94A3B8;   /* Dark theme muted text */
  --blue-light:#334155;   /* Dark theme borders/secondary elements */
  --shadow-normal: 0 4px 24px rgba(0, 0, 0, 0.4);
}


/* --- Base & Reset --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--ice);
  color: var(--navy);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  padding: 20px;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(220, 230, 242, 0.5);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb {
  background: var(--blue-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

/* --- Common Components --- */
h1, h2, h3, .font-display {
  font-family: var(--font-display);
  font-weight: 700;
}

.card {
  background-color: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-normal);
  padding: 30px;
  width: 100%;
  max-width: 580px;
  transition: var(--transition);
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
}

/* Inputs & Form Elements */
.form-group {
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  display: block;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--navy);
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--blue-light);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: var(--transition);
  color: var(--navy);
}

.form-control:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  width: 100%;
  text-decoration: none;
  gap: 8px;
  outline: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--blue);
  color: var(--white);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
  background-color: var(--blue-dark);
  box-shadow: 0 6px 16px rgba(29, 78, 216, 0.4);
}

.btn-secondary {
  background-color: var(--white);
  color: var(--blue);
  border: 2px solid var(--blue);
}

.btn-secondary:hover {
  background-color: var(--blue-light);
}

.btn-danger {
  background-color: var(--red);
  color: var(--white);
}

.btn-danger:hover {
  background-color: #DC2626;
}

/* Badge System */
.badge {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
}

.badge-success {
  background-color: #D1FAE5;
  color: var(--green);
}

.badge-warning {
  background-color: #FEF3C7;
  color: var(--yellow);
}

.badge-info {
  background-color: var(--blue-light);
  color: var(--blue);
}

.badge-danger {
  background-color: #FEE2E2;
  color: var(--red);
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  font-weight: 700;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

/* --- EKRAN 1: PROFİL OLUŞTURMA (index.html) --- */
.profile-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.profile-subtitle {
  text-align: center;
  color: var(--slate);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* Drag and Drop Zone */
.avatar-upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 24px;
}

.avatar-dropzone {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px dashed var(--blue-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  background-color: var(--ice);
}

.avatar-dropzone:hover, .avatar-dropzone.dragover {
  border-color: var(--blue);
  background-color: var(--blue-light);
}

.avatar-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--slate);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 10px;
}

.avatar-placeholder svg {
  width: 32px;
  height: 32px;
  color: var(--blue);
  margin-bottom: 4px;
}

/* Default Fallback Avatar */
.default-avatar-preview {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 3rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#avatar-input {
  display: none;
}

/* --- EKRAN 2: LOBİ (lobby.html) --- */
.lobby-container {
  width: 100%;
  max-width: 900px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Profile Card Widget */
.profile-widget {
  background-color: var(--white);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  width: 100%;
}

.profile-widget-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 900;
  font-size: 1.5rem;
}

.user-name {
  font-weight: 900;
  font-size: 1.2rem;
  color: var(--navy);
}

/* Double Deck Grid for Create/Join */
.lobby-deck {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
}

.deck-card {
  background: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
}

.deck-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(59, 130, 246, 0.15);
  border-color: var(--blue-light);
}

.deck-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--ice);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  margin-bottom: 16px;
}

.deck-icon svg {
  width: 30px;
  height: 30px;
}

.deck-title {
  margin-bottom: 8px;
  font-size: 1.4rem;
}

.deck-description {
  color: var(--slate);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.4;
}

.deck-form {
  width: 100%;
  margin-top: auto;
}

/* Waiting Room Area */
.waiting-room-card {
  width: 100%;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow-normal);
  padding: 30px;
  display: none; /* Shown dynamically */
  flex-direction: column;
  gap: 24px;
}

.room-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--ice);
  padding-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.room-code-box {
  background-color: var(--navy);
  color: var(--white);
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-display);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.room-code-box:hover {
  background-color: #1E293B;
  box-shadow: var(--shadow-neon);
}

.room-code-text {
  font-size: 1.4rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.room-code-copy-icon {
  width: 18px;
  height: 18px;
  opacity: 0.7;
}

.room-settings-indicator {
  display: flex;
  gap: 12px;
}

/* Players List Grid */
.players-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 12px;
}

.player-lobby-card {
  background-color: var(--ice);
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(59, 130, 246, 0.05);
  position: relative;
  transition: var(--transition);
}

.player-lobby-card.is-host {
  border: 2px solid var(--gold);
}

.player-lobby-card .host-crown {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: var(--gold);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.player-lobby-card .host-crown svg {
  width: 14px;
  height: 14px;
}

.player-lobby-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 900;
  font-size: 1.8rem;
}

.player-lobby-name {
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.waiting-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* --- EKRAN 3: OYUN (game.html) --- */
.game-layout {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 20px;
}

/* Top Stats Header */
.game-stats-header {
  grid-column: 1 / span 2;
  background-color: var(--white);
  border-radius: 12px;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--slate);
  letter-spacing: 1px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--navy);
}

.timer-box {
  background-color: var(--navy);
  color: var(--white);
  padding: 8px 16px;
  border-radius: 8px;
  min-width: 100px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.6rem;
  position: relative;
  overflow: hidden;
}

.timer-box.warning {
  background-color: var(--red);
  animation: pulse 1s infinite alternate;
}

/* Right Leaderboard Side Panel */
.leaderboard-panel {
  background-color: var(--white);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: fit-content;
}

.panel-title {
  font-size: 1.2rem;
  border-bottom: 2px solid var(--ice);
  padding-bottom: 12px;
  margin-bottom: 4px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 8px;
  background-color: var(--ice);
  transition: var(--transition);
}

.leaderboard-item.is-self {
  border: 2px solid var(--blue);
  background-color: var(--blue-light);
}

.leaderboard-rank {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--blue);
  width: 24px;
}

.leaderboard-player-info {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.leaderboard-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
}

.leaderboard-name {
  font-weight: 700;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.leaderboard-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  text-align: right;
}

.leaderboard-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--slate);
  margin-left: 8px;
}

.leaderboard-status.submitted {
  background-color: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Center Content Area */
.game-center-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

/* Roulette Panel */
.roulette-panel {
  background-color: var(--white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

/* Halo Wrapper Around Roulette */
.roulette-halo-wrapper {
  position: relative;
  width: 300px;
  height: 300px;
  border-radius: 16px;
  padding: 4px;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-normal);
}

.roulette-halo-wrapper::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  background: linear-gradient(45deg, var(--blue), #F43F5E, var(--yellow), var(--green), var(--blue));
  background-size: 400% 400%;
  border-radius: 20px;
  z-index: -1;
  animation: rotateGradient 8s linear infinite;
  opacity: 0.6;
}

.roulette-card {
  width: 100%;
  height: 100%;
  background-color: var(--navy);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.roulette-letter {
  font-family: var(--font-display);
  font-size: 100px;
  font-weight: 900;
  color: var(--white);
  text-align: center;
  transition: filter 0.05s ease, transform 0.05s ease;
}

.roulette-letter.blur {
  filter: blur(8px);
  transform: translateY(10px) scale(0.9);
}

.roulette-letter.scale-up {
  font-size: 120px;
  color: var(--yellow);
  animation: popLetter 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Categories Input Sheet */
.game-round-panel {
  background-color: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: none; /* Shown dynamically */
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.category-input-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.category-input-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: center;
  gap: 16px;
}

.category-label-badge {
  background-color: var(--ice);
  color: var(--blue-dark);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: right;
  border-left: 4px solid var(--blue);
}

.category-input-field {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 2px solid var(--blue-light);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 700;
  outline: none;
  transition: var(--transition);
}

.category-input-field:focus {
  border-color: var(--blue);
  background-color: #FAF5FF;
}

/* Letter Indicator Overlay */
.letter-float-indicator {
  background-color: var(--yellow);
  color: var(--navy);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
  margin-left: 12px;
  box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}

/* --- TUR ÖZETİ / SONUÇLAR (game.html Table) --- */
.results-panel {
  background-color: var(--white);
  border-radius: 12px;
  padding: 30px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: none; /* Shown dynamically */
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  max-width: 100%;
}

.results-table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 8px;
  border: 1px solid var(--blue-light);
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.95rem;
  min-width: 700px;
}

.results-table th {
  background-color: var(--ice);
  color: var(--navy);
  font-family: var(--font-display);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--blue-light);
}

.results-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--ice);
  vertical-align: middle;
}

.results-table tr:hover {
  background-color: rgba(240, 249, 255, 0.3);
}

.result-cell-player {
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-cell-player img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.result-cell-fallback {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  color: var(--white);
  font-weight: 900;
  font-size: 0.95rem;
}

.word-badge {
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 700;
  display: block;
  text-align: center;
  font-size: 0.9rem;
}

/* Highlighting classes */
.word-badge.unique {
  background-color: #D1FAE5;
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.word-badge.duplicate {
  background-color: #FEF3C7;
  color: #D97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.word-badge.invalid {
  background-color: #FEE2E2;
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.word-badge.empty {
  background-color: #F3F4F6;
  color: var(--slate);
  border: 1px solid rgba(100, 116, 139, 0.2);
  font-style: italic;
}

.round-score-badge {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--blue-dark);
}

/* Countdown bar for auto-round transition */
.auto-progress-bar-container {
  width: 100%;
  height: 6px;
  background-color: var(--ice);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 10px;
}

.auto-progress-bar {
  height: 100%;
  background-color: var(--blue);
  width: 100%;
}

/* --- EKRAN 4: OYUN SONU (game.html GameOver) --- */
.game-over-panel {
  background-color: var(--white);
  border-radius: 12px;
  padding: 40px;
  box-shadow: var(--shadow-normal);
  border: 1px solid rgba(59, 130, 246, 0.1);
  display: none; /* Shown dynamically */
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
}

.winner-crown-big {
  color: var(--gold);
  animation: float 2s ease-in-out infinite;
}

.winner-crown-big svg {
  width: 60px;
  height: 60px;
}

.winner-card {
  position: relative;
  margin-bottom: 16px;
}

.winner-avatar-frame {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 5px solid var(--gold);
  padding: 4px;
  background-color: var(--white);
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.4);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.winner-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.winner-avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--white);
  font-size: 4rem;
}

.winner-ribbon {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--gold);
  color: var(--white);
  font-weight: 900;
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 4px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  white-space: nowrap;
}

.winner-name {
  font-size: 2rem;
  font-weight: 900;
  margin-top: 12px;
  color: var(--navy);
}

.winner-score {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--blue-dark);
}

.game-over-list {
  width: 100%;
  max-width: 450px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.game-over-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-radius: 10px;
  background-color: var(--ice);
}

.game-over-item.first-place {
  background-color: #FEF3C7;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.game-over-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.game-over-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.1rem;
}

.game-over-score {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.2rem;
}

.game-over-actions {
  display: flex;
  gap: 16px;
  width: 100%;
  max-width: 450px;
}

/* --- ANIMATIONS --- */
@keyframes rotateGradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

@keyframes popLetter {
  0% { transform: scale(0.3); opacity: 0; filter: blur(4px); }
  70% { transform: scale(1.1); filter: blur(0); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes float {
  0% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-10px) rotate(3deg); }
  100% { transform: translateY(0px) rotate(0deg); }
}

@keyframes shrinkProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* --- RESPONSIVE / MOBILE DESIGN --- */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  .lobby-deck {
    grid-template-columns: 1fr;
  }

  .game-layout {
    grid-template-columns: 1fr;
  }

  .game-stats-header {
    grid-column: 1;
    padding: 12px;
  }

  /* Categories Inputs in mobile: wrap and stack */
  .category-input-row {
    grid-template-columns: 100px 1fr;
    gap: 8px;
  }

  .category-label-badge {
    font-size: 0.95rem;
    padding: 8px 10px;
  }

  .category-input-field {
    font-size: 1rem;
    padding: 10px 12px;
  }

  /* Leaderboard in Mobile: normal page flow */
  .leaderboard-panel {
    position: static;
    transform: none !important;
    width: 100%;
    max-height: none;
    margin-top: 20px;
    box-shadow: var(--shadow-normal);
    border: 1px solid rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    padding: 24px;
  }

  .leaderboard-panel.open {
    transform: none !important;
  }

  /* Handle/Bar to pull up */
  .leaderboard-panel::before {
    display: none !important;
  }

  .panel-title {
    font-size: 1.2rem;
    text-align: left;
    margin-top: 0;
    cursor: default;
  }

  /* Leave bottom padding for screen */
  .game-center-content {
    padding-bottom: 60px;
  }
  
  .theme-toggle-btn {
    top: 10px !important;
    right: 10px !important;
    width: 36px !important;
    height: 36px !important;
  }
}

/* --- Welcome Handwritten Greeting --- */
.handwritten-welcome {
  font-family: 'Pacifico', cursive;
  font-size: 2.2rem;
  color: var(--blue);
  text-align: center;
  margin-bottom: 12px;
  text-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
  animation: float 4s ease-in-out infinite;
}

/* --- Theme Toggle Button --- */
.theme-toggle-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: var(--white);
  border: 2px solid var(--blue-light);
  color: var(--navy);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-normal);
  transition: var(--transition);
  z-index: 1000;
  outline: none;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-hover);
  border-color: var(--blue);
}

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

.theme-toggle-btn .sun-icon {
  display: none;
  color: #FBBF24;
}

.theme-toggle-btn .moon-icon {
  display: block;
  color: var(--blue);
}

html.dark-theme .theme-toggle-btn .sun-icon {
  display: block;
}

html.dark-theme .theme-toggle-btn .moon-icon {
  display: none;
}

/* --- Footer Copyright --- */
.footer-copyright {
  margin-top: 40px;
  font-size: 0.8rem;
  color: var(--slate);
  text-align: center;
  width: 100%;
  padding: 10px 0;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* --- Safe Image Avatar Sizing --- */
.leaderboard-player-info img,
.result-cell-player img,
.room-players-table img {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  object-fit: cover !important;
  border: 2px solid var(--blue-light) !important;
  display: block;
}

.leaderboard-player-info img {
  border: 2px solid var(--blue) !important;
}

/* --- Trivia Mode Styles --- */
.trivia-question-box {
  background-color: var(--ice);
  border: 2px solid var(--blue-light);
  border-radius: 12px;
  padding: 24px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  line-height: 1.5;
  margin-bottom: 20px;
  box-shadow: inset 0 2px 4px rgba(15, 23, 42, 0.02);
}

.trivia-options-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.trivia-option-btn {
  background-color: var(--white);
  border: 2px solid var(--blue-light);
  color: var(--navy);
  padding: 16px 20px;
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  outline: none;
}

.trivia-option-btn:hover {
  border-color: var(--blue);
  background-color: var(--ice);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

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

.trivia-option-btn.selected {
  border-color: var(--blue);
  background-color: var(--blue-light);
  box-shadow: 0 0 0 1px var(--blue);
}

.trivia-option-btn.correct {
  border-color: var(--green) !important;
  background-color: #D1FAE5 !important;
  color: #065F46 !important;
}

.trivia-option-btn.incorrect {
  border-color: var(--red) !important;
  background-color: #FEE2E2 !important;
  color: #991B1B !important;
}

.option-badge {
  background-color: var(--blue-light);
  color: var(--blue-dark);
  font-family: var(--font-display);
  font-weight: 900;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.trivia-option-btn:hover .option-badge,
.trivia-option-btn.selected .option-badge {
  background-color: var(--blue);
  color: var(--white);
}

/* --- Mode Selection View --- */
.mode-card-btn {
  background-color: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: 12px;
  padding: 24px;
  width: 100%;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  outline: none;
  text-align: center;
}

.mode-card-btn:hover {
  transform: translateY(-4px);
  border-color: var(--blue);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
  background-color: var(--ice);
}

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

/* Trivia Difficulty Badge colors */
.badge-easy {
  background-color: #D1FAE5;
  color: var(--green);
}
.badge-medium {
  background-color: #FEF3C7;
  color: #D97706;
}
.badge-hard {
  background-color: #FEE2E2;
  color: var(--red);
}

/* --- Draw Rush Mode Styles --- */
.draw-workspace {
  display: grid !important;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  width: 100%;
}

.color-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.1s ease;
  border: 2px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}
.color-circle:hover {
  transform: scale(1.15);
}
.color-circle.active {
  transform: scale(1.2);
  border: 2px solid var(--blue);
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* Tool Buttons active state */
.drawing-toolbar .tool-btn.active {
  background-color: var(--blue) !important;
  color: var(--white) !important;
  border-color: var(--blue) !important;
}

/* System messages in guessing chat */
.chat-msg {
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.4;
  word-break: break-word;
}
.chat-msg-user {
  background-color: var(--ice);
  color: var(--navy);
}
.chat-msg-system-correct {
  background-color: #D1FAE5;
  color: #065F46;
  font-weight: 700;
  border-left: 4px solid var(--green);
}
.chat-msg-system-close {
  background-color: #FEF3C7;
  color: #92400E;
  font-weight: 700;
  border-left: 4px solid var(--yellow);
}
.chat-msg-system-info {
  background-color: var(--blue-light);
  color: var(--blue-dark);
  font-style: italic;
}

/* Mobile responsive constraints for draw layout */
@media (max-width: 768px) {
  .draw-workspace {
    grid-template-columns: 1fr !important;
  }
  .draw-chat-container {
    height: 350px !important;
  }
}

/* --- Music Guessing Mode Styles --- */
.music-option-btn {
  background-color: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: 8px;
  padding: 14px 20px;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 12px;
  outline: none;
  min-width: 0;
  text-align: left;
}

.music-option-btn:hover {
  border-color: var(--blue);
  background-color: var(--ice);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.08);
}

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

.music-option-btn.selected {
  border-color: var(--blue);
  background-color: var(--blue-light);
  box-shadow: 0 0 0 1px var(--blue);
}

.music-option-btn:hover .option-badge,
.music-option-btn.selected .option-badge {
  background-color: var(--blue);
  color: var(--white);
}

/* Music Visualizer Bar Animation */
@keyframes visualizerBounce {
  0%, 100% { height: 5px; }
  50% { height: 28px; }
}

.visualizer-container.playing .bar:nth-child(1) { animation: visualizerBounce 0.8s ease-in-out infinite; }
.visualizer-container.playing .bar:nth-child(2) { animation: visualizerBounce 0.5s ease-in-out infinite 0.1s; }
.visualizer-container.playing .bar:nth-child(3) { animation: visualizerBounce 0.7s ease-in-out infinite 0.2s; }
.visualizer-container.playing .bar:nth-child(4) { animation: visualizerBounce 0.6s ease-in-out infinite 0.15s; }
.visualizer-container.playing .bar:nth-child(5) { animation: visualizerBounce 0.9s ease-in-out infinite 0.05s; }


/* --- Kızma Birader (Ludo) Mode CSS Styles --- */

.ludo-base {
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.1);
  position: relative;
}

.base-red { background: linear-gradient(135deg, #FEE2E2, #EF4444); }
.base-green { background: linear-gradient(135deg, #DCFCE7, #10B981); }
.base-yellow { background: linear-gradient(135deg, #FEF9C3, #F59E0B); }
.base-blue { background: linear-gradient(135deg, #DBEAFE, #3B82F6); }

.base-inner {
  width: 75%;
  height: 75%;
  background-color: rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  backdrop-filter: blur(4px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 12px;
  padding: 10px;
}

.base-slot {
  background-color: var(--white);
  border-radius: 50%;
  border: 2px dashed rgba(0,0,0,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.ludo-cell {
  background-color: var(--white);
  border: 1px solid var(--blue-light);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 1;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
}

.home-red { background-color: #FEE2E2; border-color: rgba(239, 68, 68, 0.2); }
.home-green { background-color: #DCFCE7; border-color: rgba(16, 185, 129, 0.2); }
.home-yellow { background-color: #FEF9C3; border-color: rgba(245, 158, 11, 0.2); }
.home-blue { background-color: #DBEAFE; border-color: rgba(59, 130, 246, 0.2); }

.start-red { background-color: #EF4444 !important; border: 2px solid #B91C1C; }
.start-green { background-color: #10B981 !important; border: 2px solid #047857; }
.start-yellow { background-color: #F59E0B !important; border: 2px solid #B45309; }
.start-blue { background-color: #3B82F6 !important; border: 2px solid #1D4ED8; }

.safe-cell {
  background-color: #F8FAFC;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.star-icon {
  width: 14px;
  height: 14px;
  color: #E2E8F0;
}

.safe-cell .star-icon {
  color: #FBBF24;
}

.ludo-goal {
  position: relative;
  background-color: #F1F5F9;
  border-radius: 6px;
  box-shadow: inset 0 4px 8px rgba(0,0,0,0.05);
  overflow: hidden;
  border: 2px solid var(--blue-light);
}

/* Tokens Styling */
.ludo-token {
  position: absolute;
  width: 75%;
  height: 75%;
  max-width: 24px;
  max-height: 24px;
  min-width: 14px;
  min-height: 14px;
  border-radius: 50%;
  border: 2px solid var(--white);
  cursor: pointer;
  box-shadow: 0 4px 6px rgba(0,0,0,0.25);
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  color: var(--white);
}

.token-red { background-color: #EF4444; }
.token-green { background-color: #10B981; }
.token-yellow { background-color: #F59E0B; }
.token-blue { background-color: #3B82F6; }

.ludo-token.selectable {
  animation: tokenPulseRed 1.5s infinite;
  z-index: 12;
}

.ludo-token.selectable.token-red { animation-name: tokenPulseRed; }
.ludo-token.selectable.token-green { animation-name: tokenPulseGreen; }
.ludo-token.selectable.token-yellow { animation-name: tokenPulseYellow; }
.ludo-token.selectable.token-blue { animation-name: tokenPulseBlue; }

.ludo-token.selectable:hover {
  transform: scale(1.25) translateY(-2px);
  box-shadow: 0 8px 12px rgba(0,0,0,0.3);
}

/* Token Pulse Keyframes */
@keyframes tokenPulseRed {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.8); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes tokenPulseGreen {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.8); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes tokenPulseYellow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.8); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes tokenPulseBlue {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.8); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Overlapping Token Stacks */
.token-stack {
  position: absolute;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: 90%;
  height: 90%;
  gap: 2px;
}

.token-stack .ludo-token {
  position: relative;
  width: 14px;
  height: 14px;
  border-width: 1px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
  font-size: 0.5rem;
}

.token-stack.size-2 .ludo-token {
  width: 16px;
  height: 16px;
}

.token-stack.size-3 .ludo-token,
.token-stack.size-4 .ludo-token {
  width: 12px;
  height: 12px;
}

/* Barricade Indicator */
.ludo-cell.has-barricade {
  box-shadow: inset 0 0 0 3px #DC2626, 0 0 8px rgba(220, 38, 38, 0.4);
  border-color: #DC2626;
  background-color: #FEF2F2 !important;
}

.ludo-cell.has-barricade::after {
  content: '🔒';
  position: absolute;
  font-size: 0.65rem;
  top: -2px;
  right: -2px;
  z-index: 15;
}

/* Ghost Token (Hover Preview Destination) */
.ghost-token {
  opacity: 0.45;
  border-style: dashed !important;
  box-shadow: none !important;
  pointer-events: none;
  animation: ghostBlink 1s infinite alternate;
}

@keyframes ghostBlink {
  from { opacity: 0.25; }
  to { opacity: 0.65; }
}

/* Log lines formatting */
.ludo-log-line {
  line-height: 1.4;
  padding: 4px 8px;
  border-radius: 4px;
  border-left: 3px solid var(--blue-light);
  background-color: var(--ice);
}

.ludo-log-line-system {
  border-left-color: var(--blue);
  color: var(--blue-dark);
  font-weight: 700;
}

.ludo-log-line-eat {
  border-left-color: #EF4444;
  background-color: #FEF2F2;
  color: #991B1B;
  font-weight: bold;
}

.ludo-log-line-win {
  border-left-color: #FBBF24;
  background-color: #FFFBEB;
  color: #92400E;
  font-weight: bold;
}

/* Die Rolling Animations */
@keyframes dieShake {
  0% { transform: translate(1px, 1px) rotate(0deg); }
  10% { transform: translate(-1px, -2px) rotate(-1deg); }
  20% { transform: translate(-3px, 0px) rotate(1deg); }
  30% { transform: translate(0px, 2px) rotate(0deg); }
  40% { transform: translate(1px, -1px) rotate(1deg); }
  50% { transform: translate(-1px, 2px) rotate(-1deg); }
  60% { transform: translate(-3px, 1px) rotate(0deg); }
  70% { transform: translate(2px, 1px) rotate(-1deg); }
  80% { transform: translate(-1px, -1px) rotate(1deg); }
  90% { transform: translate(2px, 2px) rotate(0deg); }
  100% { transform: translate(1px, -2px) rotate(-1deg); }
}

.ludo-die-container.rolling {
  animation: dieShake 0.4s linear infinite;
  border-color: #EF4444 !important;
  color: #EF4444 !important;
}

/* --- Giriş Sayfası Arayüz Genişleme Tasarımı --- */
.main-content-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .card.card-expanded {
    max-width: 900px;
  }
  .card.card-expanded .main-content-layout {
    flex-direction: row;
    align-items: flex-start;
  }
  .card.card-expanded .profile-col {
    width: 280px;
    flex-shrink: 0;
    border-right: 2px solid var(--blue-light);
    padding-right: 20px;
  }
}

.profile-summary-box {
  background: rgba(59, 130, 246, 0.05);
  border: 1px dashed var(--blue-light);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}

.modes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .modes-grid {
    grid-template-columns: 1fr;
  }
}

.mode-card-btn {
  background-color: var(--white);
  border: 2px solid var(--blue-light);
  border-radius: 10px;
  padding: 16px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  outline: none;
}

.mode-card-btn:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.mode-title-text {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
}

.mode-desc-text {
  font-size: 0.75rem;
  color: var(--slate);
  line-height: 1.3;
}

/* --- UNO Oyun Kartı Tasarımı (Premium Neon) --- */
.uno-card {
  width: 76px;
  height: 114px;
  border-radius: 8px;
  border: 3px solid var(--white);
  position: relative;
  cursor: pointer;
  user-select: none;
  font-family: var(--font-display);
  box-sizing: border-box;
  overflow: hidden;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease, border-color 0.2s ease;
}

.uno-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.uno-card-corner {
  position: absolute;
  font-size: 0.75rem;
  font-weight: 900;
}
.uno-card-corner.top-left {
  top: 4px;
  left: 6px;
}
.uno-card-corner.bottom-right {
  bottom: 4px;
  right: 6px;
  transform: rotate(180deg);
}

.uno-card-center {
  font-size: 2rem;
  font-weight: 900;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Colors */
.uno-card.card-red {
  background: linear-gradient(135deg, #EF4444, #B91C1C);
  color: var(--white);
}
.uno-card.card-green {
  background: linear-gradient(135deg, #10B981, #047857);
  color: var(--white);
}
.uno-card.card-blue {
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  color: var(--white);
}
.uno-card.card-yellow {
  background: linear-gradient(135deg, #FBBF24, #D97706);
  color: #1E293B;
  border-color: #1E293B;
}

/* Wild Cards background */
.uno-card.card-wild {
  background: radial-gradient(circle, #1E293B 30%, #0F172A 100%);
  color: var(--white);
  border-color: #94A3B8;
}

.uno-card.card-wild .uno-card-center {
  background: linear-gradient(45deg, #EF4444, #F59E0B, #10B981, #3B82F6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2.2rem;
}

/* Back face style */
.uno-card.card-back {
  background: radial-gradient(circle, #EF4444 20%, #7F1D1D 100%);
  color: var(--white);
  border-color: var(--white);
}
.uno-card.card-back .uno-card-logo {
  font-size: 1.4rem;
  font-weight: 900;
  transform: rotate(-20deg);
  border: 2px solid var(--white);
  padding: 4px 8px;
  border-radius: 50%;
  background-color: #1E293B;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

/* Playable Neon Glow Outline */
.uno-card.playable {
  animation: unoPlayablePulse 1.5s infinite alternate;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
  border-color: #60A5FA;
}

.uno-card.playable.card-red { border-color: #F87171; box-shadow: 0 0 12px rgba(239, 68, 68, 0.7); }
.uno-card.playable.card-green { border-color: #34D399; box-shadow: 0 0 12px rgba(16, 185, 129, 0.7); }
.uno-card.playable.card-blue { border-color: #60A5FA; box-shadow: 0 0 12px rgba(59, 130, 246, 0.7); }
.uno-card.playable.card-yellow { border-color: #FBBF24; box-shadow: 0 0 12px rgba(245, 158, 11, 0.7); }
.uno-card.playable.card-wild { border-color: #A78BFA; box-shadow: 0 0 12px rgba(139, 92, 246, 0.7); }

@keyframes unoPlayablePulse {
  from { transform: translateY(0); box-shadow: 0 0 4px currentColor; }
  to { transform: translateY(-4px); box-shadow: 0 0 16px currentColor; }
}

/* Fan-out Hand Layout */
.uno-hand-container {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 140px;
  margin: 15px 0;
  padding: 0 40px;
  position: relative;
}

.uno-card-wrapper {
  position: relative;
  width: 38px;
  height: 114px;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  z-index: 10;
}

.uno-card-wrapper:hover {
  z-index: 100;
  width: 76px;
}

.uno-card-wrapper:hover .uno-card {
  transform: translateY(-30px) scale(1.2) rotate(0deg) !important;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

/* Selected card highlight */
.uno-card.selected {
  transform: translateY(-22px) scale(1.08) !important;
  border-color: #FBBF24 !important;
  box-shadow: 0 0 0 3px #FBBF24, 0 8px 20px rgba(0,0,0,0.35) !important;
  animation: none !important;
}

/* UNO ihbar timer bar */
.uno-declare-timer {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, #EF4444, #FBBF24);
  border-radius: 0 2px 2px 0;
  transition: width 0.1s linear;
}

/* UNO! button flashing when timer active */
.uno-btn-flash {
  animation: unoBtnFlash 0.4s infinite alternate !important;
}
@keyframes unoBtnFlash {
  from { box-shadow: 0 4px 12px rgba(239,68,68,0.3); transform: scale(1); }
  to   { box-shadow: 0 0 24px rgba(239,68,68,0.9); transform: scale(1.06); }
}

/* Turn indicator animations */
@keyframes sweepClockwise {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes sweepCounterClockwise {
  from { transform: rotate(360deg); }
  to { transform: rotate(0deg); }
}

.uno-direction-indicator.clockwise {
  animation: sweepClockwise 12s linear infinite;
  border-color: var(--blue);
}
.uno-direction-indicator.counter-clockwise {
  animation: sweepCounterClockwise 12s linear infinite;
  border-color: #F43F5E;
}

/* Logs and buttons style */
.uno-log-line {
  line-height: 1.4;
  padding: 3px 6px;
  border-radius: 4px;
  background-color: var(--ice);
  border-left: 3px solid var(--blue-light);
  margin-bottom: 2px;
}

/* --- Taboo Mode Style --- */
.taboo-word-card {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--blue-light);
  border-radius: 16px;
  box-shadow: var(--shadow-normal);
  width: 100%;
  max-width: 500px;
  padding: 24px;
  text-align: center;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

.dark-theme .taboo-word-card {
  background: rgba(30, 41, 59, 0.7);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

.taboo-forbidden-word {
  border: 1px solid #F87171;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 4px 0;
  font-weight: 800;
  color: #EF4444;
  background-color: rgba(239, 68, 68, 0.05);
  font-size: 1rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.taboo-chat-container {
  box-shadow: var(--shadow-normal);
  transition: all 0.3s ease;
}

.dark-theme .taboo-chat-container {
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.dark-theme .taboo-chat-container > div:first-child {
  background-color: rgba(30, 41, 59, 0.9) !important;
  border-bottom-color: rgba(255, 255, 255, 0.1) !important;
  color: #f1f5f9 !important;
}

.dark-theme #taboo-guess-form {
  background-color: rgba(30, 41, 59, 0.9) !important;
  border-top-color: rgba(255, 255, 255, 0.1) !important;
}

/* --- UNO Opponent Card Display Style --- */
.uno-opponents-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 500px;
  margin-bottom: 15px;
  padding: 10px;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(59, 130, 246, 0.2);
  border-radius: 12px;
}
.dark-theme .uno-opponents-container {
  background-color: rgba(15, 23, 42, 0.2);
  border-color: rgba(255, 255, 255, 0.05);
}
.uno-opponent-hand {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--blue-light);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 100px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  position: relative;
}
.dark-theme .uno-opponent-hand {
  background: rgba(30, 41, 59, 0.6);
  border-color: rgba(255, 255, 255, 0.1);
}
.uno-opponent-hand.active-turn {
  border-color: #3B82F6;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  transform: translateY(-2px);
  background: linear-gradient(180deg, var(--white) 0%, var(--ice) 100%);
}
.dark-theme .uno-opponent-hand.active-turn {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(59, 130, 246, 0.1) 100%);
  border-color: #60A5FA;
}
.uno-opponent-name {
  font-weight: 800;
  font-size: 0.75rem;
  color: var(--navy);
  margin-bottom: 6px;
  text-align: center;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dark-theme .uno-opponent-name {
  color: #f1f5f9;
}
.uno-opponent-cards {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 48px;
  width: 70px;
  margin-top: 4px;
}
.uno-opponent-card-back {
  width: 28px;
  height: 40px;
  background: radial-gradient(circle, #EF4444 20%, #7F1D1D 100%);
  border: 1px solid white;
  border-radius: 3px;
  box-shadow: 0 1.5px 3px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  transition: transform 0.2s ease, left 0.2s ease;
}
.uno-opponent-card-back::after {
  content: 'UNO';
  font-size: 0.4rem;
  font-weight: 900;
  color: white;
  transform: rotate(-20deg);
  background-color: #1E293B;
  border: 1px solid white;
  border-radius: 50%;
  width: 20px;
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.uno-opponent-hand.vulnerable {
  animation: unoOpponentFlash 0.5s infinite alternate;
}
@keyframes unoOpponentFlash {
  from { border-color: rgba(239, 68, 68, 0.4); box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
  to   { border-color: rgba(239, 68, 68, 1); box-shadow: 0 0 15px rgba(239, 68, 68, 0.8); }
}

@media (max-width: 480px) {
  /* Opponents hands responsive */
  .uno-opponents-container {
    gap: 8px !important;
    padding: 6px !important;
    margin-bottom: 10px !important;
  }
  .uno-opponent-hand {
    min-width: 76px !important;
    padding: 4px 6px !important;
    border-radius: 8px !important;
  }
  .uno-opponent-name {
    font-size: 0.6rem !important;
    margin-bottom: 2px !important;
    max-width: 65px !important;
  }
  .uno-opponent-cards {
    height: 32px !important;
    width: 50px !important;
    margin-top: 2px !important;
  }
  .uno-opponent-card-back {
    width: 20px !important;
    height: 28px !important;
    border-radius: 2px !important;
  }
  .uno-opponent-card-back::after {
    width: 14px !important;
    height: 9px !important;
    font-size: 0.28rem !important;
    box-shadow: 0 0.5px 1px rgba(0,0,0,0.3) !important;
  }

  /* Main Board responsive */
  .uno-board {
    gap: 20px !important;
    padding: 12px !important;
    min-height: 140px !important;
    max-width: 320px !important;
    margin: 0 auto !important;
  }
  
  /* Player's own cards responsive */
  .uno-card {
    width: 54px !important;
    height: 80px !important;
    border-width: 2px !important;
    border-radius: 5px !important;
  }
  .uno-card-wrapper {
    width: 22px !important;
    height: 80px !important;
  }
  .uno-card-wrapper:hover {
    width: 54px !important;
  }
  .uno-hand-container {
    height: 95px !important;
    padding: 0 15px !important;
    margin: 5px 0 !important;
  }
  .uno-card-center {
    font-size: 1.2rem !important;
  }
  .uno-card-corner {
    font-size: 0.55rem !important;
  }
  .uno-card-logo {
    font-size: 0.9rem !important;
  }
  .uno-card.card-back .uno-card-logo {
    font-size: 0.9rem !important;
    padding: 2px 4px !important;
  }

  /* Disable sticky hover transform on mobile */
  .uno-card-wrapper:hover .uno-card {
    transform: none !important;
    box-shadow: none !important;
  }
  .uno-card-wrapper:hover {
    z-index: auto !important;
    width: 22px !important;
  }

  /* Override selected styling on mobile to scale translation appropriately */
  .uno-card.selected {
    transform: translateY(-12px) scale(1.04) !important;
    z-index: 100 !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.3) !important;
    border-color: #3B82F6 !important;
  }
}




