:root {
  --bg-dark: #f5f6fc; /* Playful soft blue-gray background */
  --bg-card: #ffffff; /* Pure white cards */
  --bg-input: #f8fafc; /* Very light slate for input background */
  --text-main: #1e293b; /* Deep slate-800 for readability */
  --text-muted: #64748b; /* Soft slate-500 for captions */
  --border-color: #e2e8f0; /* Gentle slate-200 borders */
  
  /* Playful, Magical Brand Colors */
  --color-disney: #4f46e5;
  --color-disney-glow: rgba(79, 70, 229, 0.1);
  
  --color-marvel: #f43f5e;
  --color-marvel-glow: rgba(244, 63, 94, 0.1);
  
  --color-pixar: #fb923c;
  --color-pixar-glow: rgba(251, 146, 60, 0.1);
  
  --color-starwars: #10b981;
  --color-starwars-glow: rgba(16, 185, 129, 0.1);
  
  /* Primary & UI Accents */
  --primary: #8b5cf6; /* Magical Disney-esque Purple */
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.15);
  
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 60px;
}

/* Header & Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 30px;
}

.logo-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  animation: float-logo 3s ease-in-out infinite;
}

@keyframes float-logo {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(5deg); }
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--primary) 0%, #ec4899 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-sub {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-top: -2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  letter-spacing: -0.01em;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

a:hover {
  color: var(--primary-hover);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 30px; /* Highly rounded, friendly buttons */
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  text-align: center;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
  color: white;
}

.btn-secondary {
  background-color: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: #e2e8f0;
  transform: translateY(-1px);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-danger:hover {
  background-color: #dc2626;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.25);
  color: white;
}

.btn-sm {
  padding: 6px 16px;
  font-size: 0.8rem;
}

/* Cards & Layouts */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
}

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

.card {
  background-color: var(--bg-card);
  border-radius: 20px; /* Playful soft corners */
  border: 1px solid var(--border-color);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.05), 0 8px 16px -8px rgba(0, 0, 0, 0.05);
}

.card-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Profile / Collections List */
.collection-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  margin-bottom: 12px;
  transition: all 0.2s ease;
}

.collection-list-item:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  background-color: #f1f5f9;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.05);
}

.collection-info h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.collection-info p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  outline: none;
  background-color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

/* Auth Pages Style */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 20px;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background-color: var(--bg-card);
  border-radius: 24px;
  border: 1px solid var(--border-color);
  padding: 40px 30px;
  box-shadow: 0 20px 40px -15px rgba(99, 102, 241, 0.08), 0 15px 25px -10px rgba(0, 0, 0, 0.05);
}

.auth-header {
  text-align: center;
  margin-bottom: 30px;
}

.auth-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 12px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  border: 1px solid transparent;
  font-weight: 600;
}

.alert-success {
  background-color: #f0fdf4;
  color: #16a34a;
  border-color: #bbf7d0;
}

.alert-error {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.alert-info {
  background-color: #f5f3ff;
  color: var(--primary);
  border-color: #ddd6fe;
}

/* Sharing Page Widget */
.share-widget {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.share-url {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  font-weight: 700;
}

/* Interactive Ooshies Grid Grouping */
.set-section {
  margin-bottom: 40px;
}

.set-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

.set-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 6px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Grid & Cards */
.ooshies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

@media (max-width: 480px) {
  .ooshies-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
  }
}

.ooshie-card {
  position: relative;
  background-color: var(--bg-card);
  border-radius: 20px; /* Rounder card styling */
  border: 2px solid var(--border-color);
  padding: 20px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
}

/* Status: Unowned (not collected yet) */
.ooshie-card.unowned {
  opacity: 0.55;
  background-color: #f8fafc;
}

.ooshie-card.unowned .ooshie-icon {
  filter: grayscale(100%);
  opacity: 0.7;
}

.ooshie-card.owned {
  background-color: #ffffff;
  border-color: #cbd5e1;
}

/* Sprite Icon Slices */
.ooshie-icon {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background-repeat: no-repeat;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background-color: #f1f5f9;
  border: 3px solid #cbd5e1;
  box-shadow: 0 4px 8px rgba(0,0,0,0.05);
}

.ooshie-card.owned .ooshie-icon {
  transform: scale(1.05);
  border-color: var(--primary);
  box-shadow: 0 6px 12px var(--primary-glow);
}

.ooshie-card:hover .ooshie-icon {
  transform: scale(1.1) rotate(5deg);
}

.ooshie-name {
  margin-top: 12px;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
}

/* Quantity Widget */
.qty-widget {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 2px;
  z-index: 10;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background-color: transparent;
  color: var(--text-main);
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s;
}

.qty-btn:hover {
  background-color: #cbd5e1;
}

.qty-val {
  min-width: 28px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 800;
}

.owned-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  background-color: var(--primary);
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  box-shadow: 0 4px 8px var(--primary-glow);
  z-index: 5;
}

/* Public Share Filters */
.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 20px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.filter-tab.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 6px 15px var(--primary-glow);
}

.filter-tab:hover:not(.active) {
  border-color: var(--text-muted);
  color: var(--text-main);
  background-color: #f8fafc;
}

/* Overlay dialog styles using native popovers/dialogs */
dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
}

dialog {
  background-color: var(--bg-card);
  border: none;
  border-radius: 24px;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  color: var(--text-main);
  margin: auto;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.15);
}

dialog h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
}

/* Dynamic CSS Sprites will be outputted inline by PHP pages from the database */
