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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-lighter: #334155;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --border: #475569;
  --card-red: #dc2626;
  --card-black: #1e293b;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #1a1a2e 100%);
  min-height: 100vh;
  color: var(--text-primary);
  overflow-x: hidden;
}

/* Shutdown Banner */
.shutdown-banner {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10000;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  padding: 16px 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.4s ease-out;
}

.shutdown-banner.active {
  display: block;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.shutdown-content {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
}

.shutdown-icon {
  font-size: 1.5rem;
  animation: spin 2s linear infinite;
}

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

.shutdown-message {
  font-size: 1rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.4;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  position: relative;
}

/* Screens - hide all by default, show only active */
.screen {
  display: none !important;
}

#lobby.active {
  display: block !important;
}

#joinScreen.active {
  display: block !important;
}

#waitingRoom.active {
  display: flex !important;
}

#gameScreen.active {
  display: flex !important;
}

/* Lobby */
#lobby {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* Join Screen */
#joinScreen {
  max-width: 500px;
  margin: 0 auto;
  padding: 40px 20px;
}

.join-info {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.join-code {
  text-align: center;
  font-size: 1.2rem;
  margin-bottom: 25px;
}

.join-code strong {
  color: var(--primary);
  letter-spacing: 2px;
}

.logo {
  text-align: center;
  margin-bottom: 40px;
}

.logo h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
}

.logo h1 span {
  color: var(--primary);
}

.logo p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.lobby-content {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.input-group input,
.input-group select {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--bg-lighter);
  color: var(--text-primary);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.input-group select option {
  background: var(--bg-card);
}

.btn {
  padding: 14px 28px;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: var(--bg-lighter);
  color: var(--text-primary);
  border: 2px solid var(--border);
  width: 100%;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-public {
  background: linear-gradient(135deg, var(--warning) 0%, #d97706 100%);
  color: #1e293b;
  border: 2px solid var(--warning);
  font-weight: 600;
  width: 100%;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.btn-public:hover {
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-public.public-active {
  background: linear-gradient(135deg, var(--secondary) 0%, #059669 100%);
  color: white;
  border: 2px solid var(--secondary);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-public.public-active:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-small {
  padding: 10px 16px;
  font-size: 0.9rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.divider {
  display: flex;
  align-items: center;
  margin: 30px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.divider span {
  padding: 0 15px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.create-game-section h3,
.join-game-section h3 {
  margin-bottom: 15px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.rules-section {
  margin-top: 20px;
  text-align: center;
}

.rules-section p {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.divider-learn {
  margin: 20px 0 15px;
}

.btn-rules {
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #1f2937;
  width: 100%;
  border: 2px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.3);
  letter-spacing: 0.5px;
}

.btn-rules:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.4);
}

.live-games-section {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.live-games-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 10px;
}

.live-games-header h3 {
  font-size: 1.1rem;
  color: var(--text-primary);
}

.live-games-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.no-live-games {
  color: var(--text-secondary);
  font-style: italic;
  text-align: center;
  padding: 10px 0;
}

.live-game {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(37, 99, 235, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.live-game-names {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.live-game-score {
  color: var(--warning);
  font-weight: 700;
}

.live-game.public {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.2);
}

.live-game-cta {
  margin-left: auto;
}

.btn-join {
  padding: 8px 14px;
  font-size: 0.9rem;
  background: var(--secondary);
  color: white;
  border-radius: 8px;
}

.btn-join:disabled {
  background: var(--bg-lighter);
  color: var(--text-secondary);
}

/* Waiting Room */
#waitingRoom {
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
}

.waiting-content {
  text-align: center;
  background: var(--bg-card);
  padding: 50px;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.waiting-content h2 {
  margin-bottom: 30px;
  font-size: 1.8rem;
}

.loader {
  width: 50px;
  height: 50px;
  border: 4px solid var(--bg-lighter);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 30px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.share-link {
  margin-top: 20px;
}

.share-link p {
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.link-box {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.link-box input {
  flex: 1;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: var(--bg-lighter);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.game-code {
  font-size: 1.2rem;
}

.game-code strong {
  color: var(--primary);
  letter-spacing: 2px;
}

.public-game-controls {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.public-status {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

/* Game Screen */
#gameScreen {
  flex-direction: column;
  min-height: calc(100vh - 40px);
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Video Chat & Text Chat */
.video-chat-container {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  justify-content: center;
}

.video-box {
  position: relative;
  width: 240px;
  height: 180px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid var(--border);
}

/* Text Chat Box */
.chat-box {
  width: 240px;
  height: 180px;
  background: var(--bg-card);
  border-radius: 12px;
  border: 2px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.chat-message {
  padding: 4px 8px;
  border-radius: 6px;
  max-width: 90%;
  word-wrap: break-word;
}

.chat-message.own {
  background: var(--primary);
  color: white;
  align-self: flex-end;
}

.chat-message.other {
  background: var(--bg-lighter);
  color: var(--text-primary);
  align-self: flex-start;
}

.chat-message .sender {
  font-size: 0.65rem;
  opacity: 0.7;
  display: block;
  margin-bottom: 2px;
}

.chat-input-area {
  display: flex;
  gap: 4px;
  padding: 6px;
  border-top: 1px solid var(--border);
}

.chat-input-area input {
  flex: 1;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-lighter);
  color: var(--text-primary);
  font-size: 0.75rem;
  font-family: inherit;
}

.chat-input-area input:focus {
  outline: none;
  border-color: var(--primary);
}

.btn-chat-send {
  padding: 6px 10px;
  font-size: 0.7rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-chat-send:hover {
  background: var(--primary-dark);
}

.video-box video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.video-box video.active {
  display: block;
}

.video-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-lighter);
  color: var(--text-secondary);
  font-size: 0.8rem;
  text-align: center;
  padding: 10px;
}

.video-placeholder.hidden {
  display: none;
}

.video-label {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
}

.video-controls {
  position: absolute;
  bottom: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.btn-video, .btn-audio {
  padding: 6px 10px;
  font-size: 0.7rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 3px;
}

.btn-video:hover, .btn-audio:hover {
  background: var(--primary-dark);
}

.btn-video.broadcasting,
.btn-audio.active {
  background: var(--success, #22c55e);
}

.btn-video.broadcasting:hover,
.btn-audio.active:hover {
  background: #16a34a;
}

.video-icon, .audio-icon {
  font-size: 0.85rem;
}

.local-video-box {
  border-color: var(--primary);
}

.opponent-video-box.has-video {
  border-color: var(--secondary);
}

@media (max-width: 768px) {
  .video-chat-container {
    flex-direction: column;
    align-items: center;
  }
  
  .video-box,
  .chat-box {
    width: 200px;
    height: 150px;
  }
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--bg-card);
  border-radius: 12px;
  margin-bottom: 15px;
}

.player-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#goLobbyBtn {
  display: none;
}

.player-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.connection-status {
  font-size: 0.85rem;
  color: var(--danger);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: none;
  border: 1px solid rgba(239, 68, 68, 0.6);
  padding: 2px 6px;
  border-radius: 999px;
}

.connection-status.active {
  display: inline-block;
}

.player-name {
  font-weight: 600;
  font-size: 1.1rem;
}

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

.player-score strong {
  color: var(--secondary);
}

.card-count {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.game-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.round-info, .target-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.round-info strong, .target-info strong {
  color: var(--warning);
}

/* Cards */
.opponent-hand {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 15px;
  flex-wrap: wrap;
}

.card {
  width: 70px;
  height: 100px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  user-select: none;
}

.card-back {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 3px solid #60a5fa;
  cursor: default;
}

.card-back .deck-count {
  font-size: 1.2rem;
  color: white;
}

.card-front {
  background: white;
  border: 2px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.card-front.hearts,
.card-front.diamonds {
  color: var(--card-red);
}

.card-front.clubs,
.card-front.spades {
  color: var(--card-black);
}

.card-rank {
  font-size: 1.4rem;
  line-height: 1;
}

.card-suit {
  font-size: 1.8rem;
  line-height: 1;
}

.card:hover:not(.card-back):not(.selected):not(.dragging):not(.table-card) {
  transform: translateY(-8px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card.selected {
  transform: translateY(-15px);
  box-shadow: 0 12px 30px rgba(37, 99, 235, 0.4);
  border-color: var(--primary);
  border-width: 3px;
}

.card.clickable {
  cursor: pointer;
}

.card.clickable:hover:not(.dragging) {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Drag and Drop */
.card.dragging {
  opacity: 0.5;
  transform: scale(1.05);
  cursor: grabbing;
}

.card.drag-over {
  border: 3px dashed var(--primary);
  background: rgba(37, 99, 235, 0.1);
}

.card[draggable="true"] {
  cursor: grab;
}

.card[draggable="true"]:active {
  cursor: grabbing;
}

/* Table Melds */
.table-melds-container {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 15px;
}

.table-melds-container h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.meld-hint {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  opacity: 0.7;
}

.table-melds {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  min-height: 80px;
  align-items: center;
}

.no-melds {
  color: var(--text-secondary);
  font-style: italic;
}

.table-meld {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid var(--secondary);
  border-radius: 10px;
  transition: all 0.2s;
}

.meld-label {
  font-size: 0.7rem;
  color: var(--secondary);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 1px;
}

.meld-cards {
  display: flex;
  gap: 4px;
}

.table-meld.clickable-meld {
  cursor: pointer;
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
  animation: pulse-glow-green 1.5s ease-in-out infinite;
}

@keyframes pulse-glow-green {
  0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.3); }
  50% { box-shadow: 0 0 15px rgba(34, 197, 94, 0.6); }
}

.table-meld.clickable-meld:hover {
  border-color: #16a34a;
  background: rgba(34, 197, 94, 0.35);
  transform: scale(1.05);
  animation: none;
}

.table-meld.invalid-meld {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.15);
  animation: pulse-glow-orange 1.5s ease-in-out infinite;
}

@keyframes pulse-glow-orange {
  0%, 100% { box-shadow: 0 0 5px rgba(249, 115, 22, 0.3); }
  50% { box-shadow: 0 0 15px rgba(249, 115, 22, 0.5); }
}

.table-meld .card {
  width: 50px;
  height: 72px;
  cursor: default;
}

.table-meld .card .card-rank {
  font-size: 1rem;
}

.table-meld .card .card-suit {
  font-size: 1.2rem;
}

/* Game Table */
.game-table {
  display: flex;
  justify-content: center;
  gap: 60px;
  align-items: center;
  padding: 25px;
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
  border-radius: 20px;
  margin-bottom: 15px;
  box-shadow: inset 0 4px 20px rgba(0, 0, 0, 0.3);
}

.deck-area,
.discard-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.deck-area p,
.discard-area p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}

.deck {
  position: relative;
}

.deck .card-back::before,
.deck .card-back::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  border: 3px solid #60a5fa;
  border-radius: 8px;
  z-index: -1;
}

.deck .card-back::before {
  top: -4px;
  left: 2px;
}

.deck .card-back::after {
  top: -8px;
  left: 4px;
}

.deck.clickable {
  cursor: pointer;
}

.deck.clickable:hover .card-back {
  transform: scale(1.05);
}

.discard-pile {
  min-width: 70px;
  min-height: 100px;
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.discard-pile .card {
  margin: 0;
}

/* Turn Indicator */
.turn-indicator {
  text-align: center;
  padding: 12px 20px;
  background: var(--bg-card);
  border-radius: 10px;
  margin-bottom: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.turn-indicator.your-turn {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

/* Your Hand */
.your-hand {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 20px;
  background: var(--bg-card);
  border-radius: 16px;
  margin-bottom: 15px;
  min-height: 140px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.btn-sort {
  background: var(--bg-lighter);
  color: var(--text-primary);
  border: 2px solid var(--border);
  padding: 12px 20px;
}

.btn-sort:hover {
  background: var(--border);
}

.btn-meld {
  background: var(--secondary);
  color: white;
  padding: 12px 24px;
  min-width: 200px;
}

.btn-meld:hover:not(:disabled) {
  background: #059669;
  transform: translateY(-2px);
}

.btn-meld:disabled {
  background: var(--bg-lighter);
  color: var(--text-secondary);
}

.selection-info {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.selection-info strong {
  color: var(--primary);
  font-size: 1.1rem;
}

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

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 20px;
  max-width: 600px;
  width: 90%;
  text-align: center;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-content h2 {
  margin-bottom: 20px;
  font-size: 1.8rem;
}

.modal-content h2.rummy-title {
  color: var(--warning);
  font-size: 2.5rem;
  text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
  animation: rummy-glow 1s ease-in-out infinite alternate;
}

@keyframes rummy-glow {
  from { text-shadow: 0 0 10px rgba(245, 158, 11, 0.5); }
  to { text-shadow: 0 0 30px rgba(245, 158, 11, 0.8), 0 0 50px rgba(245, 158, 11, 0.4); }
}

#resultMessage {
  font-size: 1.2rem;
  margin-bottom: 25px;
  color: var(--secondary);
}

.rules-modal .modal-content {
  text-align: left;
  max-width: 780px;
}

.rules-modal h2 {
  text-align: center;
}

.rules-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 25px;
}

.rules-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 25px;
}

.rules-block {
  background: var(--bg-lighter);
  border-radius: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-bottom: 20px;
}

.rules-block h3 {
  margin-bottom: 12px;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.rules-list {
  list-style: disc;
  padding-left: 20px;
  margin: 0 0 25px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.rules-list li {
  margin-bottom: 10px;
}

.rules-example {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.rules-label {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.rules-cards {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.rules-scoring-example p {
  color: var(--text-secondary);
  line-height: 1.5;
}

.rules-modal .card {
  width: 54px;
  height: 76px;
  cursor: default;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.rules-modal .card:hover {
  transform: none;
}

.rules-modal .card-rank {
  font-size: 1.1rem;
}

.rules-modal .card-suit {
  font-size: 1.4rem;
}

.hands-reveal {
  display: flex;
  gap: 30px;
  margin-bottom: 25px;
  justify-content: center;
  flex-wrap: wrap;
}

.hand-reveal {
  background: var(--bg-lighter);
  padding: 15px;
  border-radius: 12px;
  flex: 1;
  min-width: 200px;
}

.hand-reveal h4 {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.revealed-cards {
  display: flex;
  gap: 4px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.revealed-cards .card {
  width: 45px;
  height: 65px;
  font-size: 0.7rem;
  cursor: default;
}

.revealed-cards .card .card-rank {
  font-size: 0.9rem;
}

.revealed-cards .card .card-suit {
  font-size: 1.1rem;
}

.hand-reveal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hand-reveal p span {
  color: var(--warning);
  font-weight: 600;
}

.scores-display {
  margin-bottom: 25px;
  font-size: 1.1rem;
}

.final-scores {
  font-size: 1.3rem;
  margin-bottom: 25px;
}

.final-scores p {
  margin: 5px 0;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  color: var(--text-primary);
  padding: 15px 30px;
  border-radius: 10px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  z-index: 1001;
}

.toast.show {
  opacity: 1;
  visibility: visible;
}

.toast.error {
  border-left: 4px solid var(--danger);
}

.toast.success {
  border-left: 4px solid var(--secondary);
}

/* Responsive */
@media (max-width: 768px) {
  .game-header {
    flex-direction: column;
    gap: 15px;
  }
  
  .player-info {
    flex-direction: row;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
  }

  .player-name-row {
    width: 100%;
  }

  #goLobbyBtn {
    width: 100%;
  }
  
  .game-table {
    gap: 30px;
    padding: 20px;
  }
  
  .card {
    width: 55px;
    height: 80px;
  }
  
  .card-rank {
    font-size: 1.1rem;
  }
  
  .card-suit {
    font-size: 1.4rem;
  }
  
  .table-meld .card {
    width: 40px;
    height: 58px;
  }
  
  .action-buttons {
    flex-direction: column;
  }
}
