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

:root {
  --bg-dark: #050810;
  --bg-card: #0d1220;
  --bg-surface: #111828;
  --text-primary: #edf0f7;
  --text-secondary: #7a8599;
  --accent: #e8c547;
  --accent-hover: #d4b030;
  --red-fire: #ff1744;
  --blue-ice: #2979ff;
  --bronze: #cd7f32;
  --silver: #c0c0c0;
  --gold: #ffd700;
  --gold-foil: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
  --limited: linear-gradient(135deg, #ff0080, #7928ca);
  --hundred-club: linear-gradient(135deg, #00d4ff, #0066ff);
  --motm: linear-gradient(135deg, #ff6b35, #ff0000);
  --danger: #e74c3c;
  --success: #00e676;
  --radius: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

body {
  font-family: -apple-system, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: calc(80px + var(--safe-bottom));
}

/* Header - FIFA World Cup 2026 Duel Theme */
header {
  background: #050810;
  padding: 0.6rem 0.5rem 0.5rem;
  text-align: center;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--red-fire), var(--accent), var(--blue-ice)) 1;
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
}

.header-stadium-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 15% 60%, rgba(255, 23, 68, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 85% 60%, rgba(41, 121, 255, 0.12) 0%, transparent 45%),
    radial-gradient(ellipse at 50% 0%, rgba(232, 197, 71, 0.06) 0%, transparent 60%);
  pointer-events: none;
}

.header-duel {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.duel-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  width: 58px;
  flex-shrink: 0;
}

.duel-silhouette {
  width: 44px;
  height: 54px;
  border-radius: 10px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.duel-silhouette.ronaldo {
  background: linear-gradient(160deg, rgba(255, 23, 68, 0.25) 0%, rgba(255, 23, 68, 0.05) 100%);
  border: 1.5px solid rgba(255, 23, 68, 0.5);
}

.duel-silhouette.messi {
  background: linear-gradient(160deg, rgba(41, 121, 255, 0.25) 0%, rgba(41, 121, 255, 0.05) 100%);
  border: 1.5px solid rgba(41, 121, 255, 0.5);
}

.duel-number {
  font-size: 1.8rem;
  font-weight: 900;
  font-style: italic;
  line-height: 1;
  position: relative;
  z-index: 1;
}

.ronaldo .duel-number {
  color: rgba(255, 23, 68, 0.8);
  text-shadow: 0 0 20px rgba(255, 23, 68, 0.4);
}

.messi .duel-number {
  color: rgba(41, 121, 255, 0.8);
  text-shadow: 0 0 20px rgba(41, 121, 255, 0.4);
}

.duel-energy {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 8px;
  border-radius: 4px;
  filter: blur(4px);
}

.red-energy { background: var(--red-fire); opacity: 0.5; }
.blue-energy { background: var(--blue-ice); opacity: 0.5; }

.duel-name {
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.duel-left .duel-name { color: var(--red-fire); }
.duel-right .duel-name { color: var(--blue-ice); }

.header-center {
  flex: 1;
  position: relative;
  padding: 0 0.3rem;
}

.header-badge {
  font-size: 0.5rem;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 0.1rem;
}

header h1 {
  font-size: 1.3rem;
  font-weight: 900;
  background: linear-gradient(90deg, var(--red-fire), var(--accent), var(--accent), var(--blue-ice));
  background-size: 300% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 4px;
  animation: shimmer 4s linear infinite;
  line-height: 1.2;
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 300% center; }
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.55rem;
  margin-top: 0;
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 600;
}

.header-vs-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.2rem;
}

.vs-line {
  height: 1px;
  width: 30px;
}

.vs-line.left {
  background: linear-gradient(90deg, transparent, var(--red-fire));
}

.vs-line.right {
  background: linear-gradient(90deg, var(--blue-ice), transparent);
}

.header-vs {
  font-size: 0.7rem;
  font-weight: 900;
  font-style: italic;
  color: var(--accent);
  opacity: 0.5;
  letter-spacing: 2px;
}

.card-count-header {
  position: absolute;
  right: 0.5rem;
  bottom: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.65rem;
  background: rgba(255,255,255,0.04);
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 1;
}

/* Toolbar */
.toolbar {
  background: var(--bg-surface);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: sticky;
  top: 95px;
  z-index: 99;
}

.search-bar {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  pointer-events: none;
}

.search-bar input {
  width: 100%;
  padding: 0.6rem 0.8rem 0.6rem 2.2rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 0.95rem;
}

.search-bar input::placeholder {
  color: var(--text-secondary);
}

.filter-row {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar { display: none; }

.filter-row select {
  flex-shrink: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

/* Buttons */
.btn {
  padding: 0.7rem 1.2rem;
  border-radius: 10px;
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-small {
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  border-radius: 8px;
}

.btn-primary {
  background: var(--accent);
  color: #000;
}

.btn-primary:hover, .btn-primary:active {
  background: var(--accent-hover);
}

.btn-camera {
  background: linear-gradient(135deg, #00d4ff, #0066ff);
  color: #fff;
}

.btn-camera:active {
  background: linear-gradient(135deg, #00b0dd, #0055dd);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:active {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:active {
  background: #c0392b;
}

/* Card Grid */
.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  max-width: 1400px;
  margin: 0 auto;
  background:
    repeating-linear-gradient(0deg, rgba(0, 80, 0, 0.02) 0px, rgba(0, 80, 0, 0.02) 1px, transparent 1px, transparent 20px);
}

/* Card Tile */
.card-tile {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
  border: 2px solid transparent;
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.card-tile:active {
  transform: scale(0.97);
}

.card-tile.rarity-Bronze { border-color: var(--bronze); }
.card-tile.rarity-Silver { border-color: var(--silver); }
.card-tile.rarity-Gold { border-color: var(--gold); }
.card-tile.rarity-Gold-Foil { border-image: var(--gold-foil) 1; }
.card-tile.rarity-Limited-Edition { border-image: var(--limited) 1; }
.card-tile.rarity-100-Club { border-image: var(--hundred-club) 1; }
.card-tile.rarity-Man-of-the-Match { border-image: var(--motm) 1; }

.card-image-wrapper {
  width: 100%;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: linear-gradient(135deg, #1a2035, #0f1525);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.card-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-placeholder {
  font-size: 3rem;
  opacity: 0.3;
}

.card-rating-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: var(--accent);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 2px 8px;
  border-radius: 6px;
}

.card-rarity-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.rarity-badge-Bronze { background: var(--bronze); color: #fff; }
.rarity-badge-Silver { background: var(--silver); color: #000; }
.rarity-badge-Gold { background: var(--gold); color: #000; }
.rarity-badge-Gold-Foil { background: var(--gold-foil); color: #000; }
.rarity-badge-Limited-Edition { background: var(--limited); color: #fff; }
.rarity-badge-100-Club { background: var(--hundred-club); color: #fff; }
.rarity-badge-Man-of-the-Match { background: var(--motm); color: #fff; }

.card-info {
  padding: 0.6rem;
}

.card-info h3 {
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .card-team {
  color: var(--text-secondary);
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-info .card-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 0.3rem;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

.card-position-tag {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.7rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1.5rem;
}

.empty-icon {
  font-size: 4rem;
  margin-bottom: 0.8rem;
}

.empty-state h2 {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.empty-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.empty-actions .btn {
  width: 100%;
  max-width: 260px;
  justify-content: center;
  padding: 0.9rem;
  font-size: 1rem;
}

/* FAB */
.fab-container {
  position: fixed;
  bottom: calc(20px + var(--safe-bottom));
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 0.75rem;
}

.fab {
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}

.fab-main {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff0040, var(--accent), #0066ff);
  background-size: 200% auto;
  animation: shimmer 3s ease-in-out infinite;
  color: #000;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(245, 197, 24, 0.35), 0 0 40px rgba(255, 0, 64, 0.15), 0 0 40px rgba(0, 102, 255, 0.15);
  transition: transform 0.2s;
}

.fab-main:active {
  transform: scale(0.92);
}

.fab-main.open {
  transform: rotate(45deg);
  background: var(--text-secondary);
}

.fab-main.open:active {
  transform: rotate(45deg) scale(0.92);
}

.fab-menu {
  display: flex;
  flex-direction: column-reverse;
  gap: 0.6rem;
  align-items: flex-end;
}

.fab-menu.hidden {
  display: none;
}

.fab-option {
  background: var(--bg-surface);
  color: var(--text-primary);
  padding: 0.6rem 1rem;
  border-radius: 28px;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  white-space: nowrap;
  animation: fabSlideIn 0.2s ease-out;
}

@keyframes fabSlideIn {
  from { opacity: 0; transform: translateY(10px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.fab-option:active {
  background: rgba(255,255,255,0.12);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-surface);
  border-radius: 20px 20px 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  max-height: 92dvh;
  overflow-y: auto;
  z-index: 1;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

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

.modal-header h2 {
  font-size: 1.2rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 0.3rem;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Form */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.stats-row {
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 0.75rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input,
.form-group select {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--bg-dark);
  color: var(--text-primary);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  min-height: 44px;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-group input[type="file"] {
  display: none;
}

.image-capture-area {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

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

.image-capture-buttons .btn {
  flex: 1;
  justify-content: center;
}

.image-preview {
  margin: 0.75rem 0;
  text-align: center;
}

.image-preview img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.btn-remove-img {
  display: block;
  margin: 0.5rem auto 0;
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 0.85rem;
  min-height: 44px;
}

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-actions .btn {
  flex: 1;
  justify-content: center;
  padding: 0.8rem;
}

/* Scan Modal */
.scan-modal-content {
  max-height: 95vh;
  max-height: 95dvh;
}

.scan-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.scan-image-area {
  width: 100%;
  max-height: 35vh;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-image-area img {
  width: 100%;
  height: 100%;
  max-height: 35vh;
  object-fit: contain;
}

.scan-stats-toggle {
  justify-content: flex-end;
}

/* Bulk Modal */
.bulk-modal-content {
  max-height: 90vh;
  max-height: 90dvh;
}

.bulk-queue {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 60vh;
  overflow-y: auto;
}

.bulk-item {
  display: flex;
  gap: 0.75rem;
  background: var(--bg-dark);
  border-radius: 10px;
  padding: 0.75rem;
  align-items: flex-start;
}

.bulk-item-thumb {
  width: 70px;
  height: 90px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-surface);
}

.bulk-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bulk-item-fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bulk-item-fields input,
.bulk-item-fields select {
  padding: 0.4rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.1);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.85rem;
  min-height: 36px;
}

.bulk-item-row {
  display: flex;
  gap: 0.4rem;
}

.bulk-item-row > * {
  flex: 1;
}

.bulk-item-actions {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.bulk-item .btn-save-item {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  min-height: 36px;
}

.bulk-item .btn-skip-item {
  background: none;
  border: 1px solid rgba(255,255,255,0.15);
  color: var(--text-secondary);
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  min-height: 36px;
}

.bulk-item.saved {
  opacity: 0.5;
  pointer-events: none;
}

.bulk-item.saved::after {
  content: 'Saved';
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--success);
  font-weight: 700;
}

.bulk-item {
  position: relative;
}

.bulk-progress {
  text-align: center;
  padding: 0.75rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* View Card Modal */
.view-card-container {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.view-close {
  position: absolute;
  top: -40px;
  right: 0;
  font-size: 2rem;
  z-index: 2;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Card Flip */
.card-flip-wrapper {
  width: 280px;
  height: 400px;
  perspective: 1200px;
  cursor: pointer;
}

.card-flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-flip-inner.flipped {
  transform: rotateY(180deg);
}

.card-flip-front,
.card-flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 16px;
  overflow: hidden;
}

.card-flip-back {
  transform: rotateY(180deg);
}

.card-back-design {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 30% 40%, rgba(255, 0, 40, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(0, 100, 255, 0.1) 0%, transparent 50%),
    linear-gradient(135deg, #0a0a1a, #0f1525, #0a1a2a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 3px solid;
  border-image: linear-gradient(135deg, #ff0040, var(--accent), #0066ff) 1;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}

.card-back-pattern {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent, transparent 15px, rgba(245, 197, 24, 0.02) 15px, rgba(245, 197, 24, 0.02) 30px),
    repeating-linear-gradient(-45deg, transparent, transparent 15px, rgba(0, 100, 255, 0.02) 15px, rgba(0, 100, 255, 0.02) 30px);
}

.card-back-logo {
  font-size: 2.2rem;
  font-weight: 900;
  text-align: center;
  background: linear-gradient(135deg, #ff0040, var(--accent), #0066ff);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.1;
  position: relative;
  z-index: 1;
  animation: shimmer 3s ease-in-out infinite;
  letter-spacing: 3px;
}

.card-back-year {
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: rgba(245, 197, 24, 0.3);
  position: relative;
  z-index: 1;
  margin-bottom: 0.3rem;
}

.card-back-text {
  color: var(--text-secondary);
  font-size: 0.75rem;
  margin-top: 1.2rem;
  position: relative;
  z-index: 1;
  animation: pulse 2s infinite;
  letter-spacing: 3px;
  font-weight: 600;
}

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

/* Full Card View */
.full-card {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  overflow: hidden;
}

.full-card-header {
  position: relative;
  height: 55%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
}

.full-card-header img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-card-header .card-placeholder {
  font-size: 5rem;
}

.full-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.8rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
}

.full-card-rating {
  font-size: 2.2rem;
  font-weight: 900;
  color: var(--accent);
  line-height: 1;
}

.full-card-body {
  flex: 1;
  padding: 0.8rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.full-card-name {
  font-size: 1.2rem;
  font-weight: 800;
}

.full-card-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.full-card-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-top: auto;
}

.stat-item {
  text-align: center;
  padding: 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}

.stat-label {
  font-size: 0.6rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.stat-value {
  font-size: 1rem;
  font-weight: 800;
}

.stat-value.high { color: var(--success); }
.stat-value.mid { color: var(--accent); }
.stat-value.low { color: var(--text-secondary); }

.view-actions {
  display: flex;
  gap: 0.75rem;
}

.view-actions .btn {
  min-width: 100px;
  justify-content: center;
}

/* Rarity full card backgrounds */
.full-card.rarity-bg-Bronze { background: linear-gradient(135deg, #3d2b1f, #2a1f15); }
.full-card.rarity-bg-Silver { background: linear-gradient(135deg, #2a2a35, #1e1e28); }
.full-card.rarity-bg-Gold { background: linear-gradient(135deg, #2a2510, #1e1a0a); }
.full-card.rarity-bg-Gold-Foil { background: linear-gradient(135deg, #2a2000, #1a1500); }
.full-card.rarity-bg-Limited-Edition { background: linear-gradient(135deg, #1a0a2a, #0a0515); }
.full-card.rarity-bg-100-Club { background: linear-gradient(135deg, #0a1a2a, #050f1a); }
.full-card.rarity-bg-Man-of-the-Match { background: linear-gradient(135deg, #2a0a0a, #1a0505); }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(90px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: var(--success);
  color: #fff;
  padding: 0.7rem 1.4rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  animation: toastIn 0.3s ease-out;
}

.toast.hidden { display: none; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Desktop breakpoints */
@media (min-width: 600px) {
  header {
    padding: 1rem 2rem 0.8rem;
  }

  header h1 {
    font-size: 2.2rem;
    letter-spacing: 8px;
  }

  .subtitle {
    font-size: 0.7rem;
    letter-spacing: 6px;
  }

  .header-badge {
    font-size: 0.6rem;
    letter-spacing: 5px;
  }

  .duel-player {
    width: 80px;
  }

  .duel-silhouette {
    width: 56px;
    height: 68px;
  }

  .duel-number { font-size: 2.2rem; }
  .duel-name { font-size: 0.65rem; letter-spacing: 2px; }
  .vs-line { width: 50px; }

  .toolbar {
    flex-direction: row;
    align-items: center;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
    top: 105px;
  }

  .search-bar {
    max-width: 300px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
    padding: 1.5rem;
  }

  .modal-content {
    border-radius: 20px;
    max-width: 550px;
    margin: auto;
  }

  .modal {
    align-items: center;
  }

  .stats-row {
    grid-template-columns: repeat(6, 1fr);
  }

  .card-flip-wrapper {
    width: 320px;
    height: 460px;
  }
}

@media (min-width: 900px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
  }

  .card-tile:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow);
  }

  .card-tile:hover.rarity-Bronze { box-shadow: 0 8px 32px rgba(205, 127, 50, 0.3); }
  .card-tile:hover.rarity-Silver { box-shadow: 0 8px 32px rgba(192, 192, 192, 0.3); }
  .card-tile:hover.rarity-Gold { box-shadow: 0 8px 32px rgba(255, 215, 0, 0.3); }
  .card-tile:hover.rarity-Gold-Foil { box-shadow: 0 8px 32px rgba(255, 140, 0, 0.4); }
  .card-tile:hover.rarity-Limited-Edition { box-shadow: 0 8px 32px rgba(121, 40, 202, 0.4); }
  .card-tile:hover.rarity-100-Club { box-shadow: 0 8px 32px rgba(0, 212, 255, 0.4); }
  .card-tile:hover.rarity-Man-of-the-Match { box-shadow: 0 8px 32px rgba(255, 0, 0, 0.4); }
}

/* Scan Overlay */
.scan-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(5, 8, 16, 0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-overlay-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.scan-spinner {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

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

.scan-progress-text {
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 1px;
}

/* Auto-filled field highlight */
.field-auto-filled {
  border-color: var(--success) !important;
  box-shadow: 0 0 0 1px rgba(0, 230, 118, 0.2);
}

.hidden {
  display: none !important;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.12); border-radius: 3px; }
