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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

/* Screens */
.screen {
  display: none;
}

.screen.active {
  display: block;
}

/* ===================== LOBBY ===================== */
.lobby-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 60px 24px 24px;
  text-align: center;
}

.lobby-title {
  font-size: 1.8rem;
  margin-bottom: 32px;
}

.lobby-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lobby-form input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid #ddd;
  border-radius: 12px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.lobby-form input[type="text"]:focus {
  border-color: #4a90d9;
}

.code-input {
  width: 100px !important;
  text-transform: uppercase;
  text-align: center;
  font-weight: 700;
  letter-spacing: 2px;
  flex-shrink: 0;
}

.lobby-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lobby-btn {
  padding: 14px 24px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s;
}

.lobby-btn:active {
  opacity: 0.8;
}

.create-btn {
  background: #4a90d9;
}

.join-btn {
  background: #27ae60;
  flex: 1;
}

.start-btn {
  background: #e67e22;
  width: 100%;
  margin-top: 16px;
}

.lobby-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #aaa;
  font-size: 0.85rem;
}

.lobby-divider::before,
.lobby-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #ddd;
}

.join-row {
  display: flex;
  gap: 10px;
}

.lobby-error {
  color: #e74c3c;
  font-size: 0.9rem;
  min-height: 20px;
}

/* ===================== WAITING ROOM ===================== */
.waiting-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 40px 24px;
  text-align: center;
}

.waiting-container h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.waiting-subtitle {
  color: #888;
  margin-bottom: 20px;
}

.room-code-badge {
  display: inline-block;
  background: #4a90d9;
  color: #fff;
  padding: 4px 12px;
  border-radius: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  font-size: 1.1rem;
}

.room-code-badge.small {
  font-size: 0.8rem;
  padding: 2px 8px;
  letter-spacing: 1px;
}

.waiting-players {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.waiting-player {
  background: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.waiting-player .player-name {
  font-weight: 600;
}

.waiting-player .host-badge {
  font-size: 0.75rem;
  background: #e67e22;
  color: #fff;
  padding: 2px 8px;
  border-radius: 8px;
  font-weight: 600;
}

/* ===================== HEADER / NAVIGATION ===================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 12px 16px 0;
}

.header h1 {
  text-align: center;
  font-size: 1.2rem;
}

.nav-tabs {
  display: flex;
}

.nav-tab {
  flex: 1;
  padding: 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  background: none;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  color: #888;
  transition: color 0.2s, border-color 0.2s;
}

.nav-tab.active {
  color: #333;
  border-bottom-color: #4a90d9;
}

.count-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  vertical-align: middle;
}

/* ===================== VIEWS ===================== */
.view {
  display: none;
  padding: 12px;
}

.view.active {
  display: block;
}

/* ===================== GAME TAB ===================== */
.game-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-title {
  font-size: 1rem;
  color: #555;
  border-bottom: 1px solid #eee;
  padding-bottom: 4px;
}

.active-card-container {
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.active-card-container .card {
  width: 100%;
}

.draw-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
}

.draw-btn {
  flex: 1;
  padding: 14px 12px;
  border: none;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  min-height: 56px;
  transition: opacity 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.draw-btn:active {
  opacity: 0.8;
}

.draw-btn.globaal {
  background: #4a90d9;
}

.draw-btn.actie {
  background: #e67e22;
}

.deck-count {
  font-size: 0.75rem;
  opacity: 0.85;
  font-weight: 400;
}

/* Player list */
.player-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.player-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.player-item .player-name {
  font-weight: 600;
}

.player-item .player-cards {
  font-size: 0.85rem;
  color: #888;
}

.player-item.disconnected {
  opacity: 0.5;
}

/* ===================== HAND TAB ===================== */
.hand-section {
  padding-top: 4px;
}

.hand-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hand-card {
  position: relative;
}

.hand-card .card {
  width: 100%;
}

.use-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: #e74c3c;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}

.use-btn:active {
  opacity: 0.8;
}

/* ===================== GALLERY (unchanged) ===================== */
.filters {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 16px;
  border: 2px solid #ddd;
  border-radius: 20px;
  background: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn.active {
  border-color: #4a90d9;
  background: #4a90d9;
  color: #fff;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===================== CARD STYLING ===================== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  border-left: 5px solid #ccc;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.card.globaal {
  border-left-color: #4a90d9;
}

.card.globaal.zeldzaam {
  border-left-color: #9b59b6;
}

.card.zwak {
  border-left-color: #27ae60;
}

.card.middel {
  border-left-color: #f39c12;
}

.card.sterk {
  border-left-color: #e74c3c;
}

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

.card-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.badge-globaal {
  background: #4a90d9;
}

.badge-zeldzaam {
  background: #9b59b6;
}

.badge-zwak {
  background: #27ae60;
}

.badge-middel {
  background: #f39c12;
}

.badge-sterk {
  background: #e74c3c;
}

.card-id {
  font-size: 0.8rem;
  color: #aaa;
}

.card-effect {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ===================== TOAST NOTIFICATION ===================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #333;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 0.9rem;
  z-index: 1000;
  transition: transform 0.3s ease;
  pointer-events: none;
  max-width: 90%;
  text-align: center;
}

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

/* ===================== ANIMATIONS ===================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-animate {
  animation: fadeIn 0.3s ease;
}
