/**
 * Deck Detail View Styles
 * Full-page deck view/edit with breadcrumb, editable title, and stats
 */

/* ==================== Publish Modal ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-container {
  background: var(--bg-primary);
  border-radius: 8px;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: 20px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  padding: 16px 20px;
  border-top: 1px solid var(--border-subtle);
}

.btn-primary,
.btn-secondary {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

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

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

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

/* ==================== Deck Detail Header Buttons ==================== */

.deck-header-publish-btn,
.deck-header-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-header-publish-btn:hover,
.deck-header-copy-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.deck-header-copy-btn {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.deck-header-copy-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent);
}

.deck-header-delete-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  background: transparent;
  color: #ef4444;
  border: 1px solid #ef4444;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.deck-header-delete-btn:hover {
  background: #ef4444;
  color: white;
  transform: translateY(-1px);
}

/* ==================== Deck Detail Container ==================== */

/* Deck Detail Container - Full Page, Left Aligned */
.deck-detail {
  position: absolute;
  inset: 0;
  background: var(--bg-primary);
  overflow-y: auto;
  padding: 12px 16px;
}

/* Cards Section - Multi-column layout on wide screens */
.deck-detail-cards {
  margin-bottom: 32px;
}

@media (min-width: 1200px) {
  .deck-detail-cards {
    column-count: 2;
    column-gap: 24px;
  }

  .deck-card-table-section {
    break-inside: avoid;
  }

  .deck-card-list-title {
    column-span: all;
  }
}

@media (min-width: 1800px) {
  .deck-detail-cards {
    column-count: 3;
  }
}

/* Compact Header Bar */
.deck-compact-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.deck-header-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.deck-header-back-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-primary);
}

.deck-header-back-btn svg {
  flex-shrink: 0;
}

.deck-header-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.deck-header-title-input {
  flex: 1;
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  padding: 6px 10px;
  outline: none;
}

.deck-header-title-input:focus {
  border-color: var(--accent);
}

.deck-detail-active-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.4);
  animation: pulse-active 2s ease-in-out infinite;
  flex-shrink: 0;
}

.deck-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.deck-vote-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 50px;
}

.deck-vote-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--border);
  color: var(--text-primary);
}

.deck-vote-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.deck-header-save-btn {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-primary);
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deck-header-save-btn:hover {
  filter: brightness(1.1);
}

/* Stats Micro-Bar */
.deck-stats-micro-bar {
  display: flex;
  gap: 20px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.micro-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: fit-content;
}

.micro-stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.micro-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.micro-stat-mana {
  flex: 1;
  min-width: 200px;
}

.micro-stat-mana-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.mana-symbol-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border: 1px solid;
}

.mana-symbol-count.mana-white {
  background: #f9f7f0;
  color: #3d3d3d;
  border-color: #e8e4d9;
}

.mana-symbol-count.mana-blue {
  background: #0e68ab;
  color: white;
  border-color: #0a4d7d;
}

.mana-symbol-count.mana-black {
  background: #150b00;
  color: white;
  border-color: #3e3528;
}

.mana-symbol-count.mana-red {
  background: #d3202a;
  color: white;
  border-color: #a01a21;
}

.mana-symbol-count.mana-green {
  background: #00733e;
  color: white;
  border-color: #00552e;
}

.mana-symbol-count.mana-colorless {
  background: #ccc2c0;
  color: #3d3d3d;
  border-color: #b0a6a4;
}

@media (max-width: 700px) {
  .deck-stats-micro-bar {
    gap: 12px;
    padding: 10px 12px;
  }

  .micro-stat-value {
    font-size: 13px;
  }

  .micro-stat-mana {
    min-width: 100%;
  }
}

/* Format Validator */
.deck-format-validator {
  margin-bottom: 16px;
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}

.format-validator-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.format-validator-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 100px;
}

.format-select {
  flex: 1;
  min-width: 200px;
  padding: 8px 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: var(--font-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.format-select:hover {
  border-color: var(--accent);
}

.format-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.format-validation-results {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.format-validation-success {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 4px;
  color: #16a34a;
  font-size: 13px;
  font-weight: 600;
}

.format-validation-success svg {
  flex-shrink: 0;
  color: #16a34a;
}

.format-validation-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 4px;
}

.format-validation-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}

.format-validation-summary svg {
  flex-shrink: 0;
  color: #dc2626;
}

.format-validation-errors {
  padding-left: 30px;
}

.format-errors-header {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.format-errors-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  color: var(--text-primary);
  line-height: 1.6;
}

.format-errors-list li {
  margin-bottom: 4px;
}

@media (max-width: 700px) {
  .deck-format-validator {
    padding: 10px 12px;
  }

  .format-validator-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .format-validator-label {
    min-width: auto;
  }

  .format-select {
    min-width: auto;
    width: 100%;
  }

  .format-validation-errors {
    padding-left: 10px;
  }
}

/* Deck Header */
.deck-detail-header {
  margin-bottom: 20px;
}

/* Title - Editable Input */
.deck-title-edit {
  margin-bottom: 12px;
}

.deck-title-input {
  width: 100%;
  max-width: 600px;
  padding: 8px 12px;
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-primary);
  background: var(--bg-tertiary);
  border: 2px solid var(--border-subtle);
  border-radius: 8px;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.deck-title-input:focus {
  border-color: var(--accent);
  background: var(--bg-card);
}

.deck-title-input::placeholder {
  color: var(--text-tertiary);
}

/* Title - Display Only */
.deck-title-display {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Creator Footer */
.deck-creator-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
  margin-top: 24px;
}

.deck-creator-text {
  font-weight: 500;
  color: var(--text-secondary);
}

.deck-creator-separator {
  color: var(--text-tertiary);
}

.deck-creator-date {
  color: var(--text-tertiary);
}

/* Stats Panel - Compact Horizontal */
.deck-stats-panel {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.deck-stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.deck-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deck-stat-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* Cards Section */
.deck-detail-cards {
  margin-top: 32px;
}

.deck-detail-cards h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.deck-card-list-placeholder {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
}

.deck-card-list-empty {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
  font-size: 14px;
  background: var(--bg-secondary);
  border: 1px dashed var(--border-subtle);
  border-radius: 8px;
}

/* Card Carousel (Swiper) */
.deck-carousel-wrapper {
  margin-bottom: 24px;
  padding: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  position: relative;
}

.deck-card-carousel {
  width: 100%;
  overflow: hidden;
  border-radius: 6px;
}

.deck-carousel-slide {
  width: 50px;
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.deck-carousel-slide:hover {
  transform: translateY(-4px);
  z-index: 10;
}

.deck-carousel-slide img,
.deck-carousel-slide .card-sprite {
  width: 100%;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  transition: box-shadow 0.2s ease;
}

.deck-carousel-slide:hover img,
.deck-carousel-slide:hover .card-sprite {
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
}

/* Swiper navigation - invisible hitzones */
.deck-card-carousel .swiper-button-next,
.deck-card-carousel .swiper-button-prev {
  width: 60px;
  height: 100%;
  top: 0;
  margin-top: 0;
  background: transparent;
  border: none;
  opacity: 0;
  cursor: pointer;
}

.deck-card-carousel .swiper-button-next::after,
.deck-card-carousel .swiper-button-prev::after {
  display: none;
}

.deck-card-carousel .swiper-button-next {
  right: 0;
}

.deck-card-carousel .swiper-button-prev {
  left: 0;
}

@media (max-width: 500px) {
  .deck-carousel-slide {
    width: 40px;
  }

  .deck-carousel-wrapper {
    padding: 8px;
  }
}

/* Charts Section - Side by Side */
.deck-charts-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 24px;
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

@media (max-width: 700px) {
  .deck-charts-section {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.deck-chart-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 16px;
}

.deck-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.deck-chart-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.deck-colorless-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.deck-colorless-toggle input[type="checkbox"] {
  cursor: pointer;
  width: 14px;
  height: 14px;
}

/* Stacked Bar Chart */
.deck-stacked-chart {
  display: flex;
  justify-content: space-around;
  gap: 4px;
  height: 140px;
  padding: 12px 8px 0 8px;
}

.stacked-bar-column {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
  height: 100%;
}

.stacked-bar-container {
  width: 100%;
  min-height: 4px;
  display: flex;
  flex-direction: column-reverse;
  border-radius: 6px 6px 0 0;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  position: relative;
  transition: transform 0.2s ease;
}

.stacked-bar-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Glossy gradient overlay for bars */
.stacked-bar-container::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: linear-gradient(to bottom, rgba(255,255,255,0.3), transparent);
  pointer-events: none;
  border-radius: 6px 6px 0 0;
}

.stacked-bar-segment {
  width: 100%;
  transition: opacity 0.2s ease;
}

.stacked-bar-segment:hover {
  opacity: 0.9;
}

/* Color-specific bar segments with vibrant, glossy colors */
.stacked-bar-w {
  background: linear-gradient(to bottom, #fffbeb 0%, #fef3c7 50%, #fde68a 100%);
}

.stacked-bar-u {
  background: linear-gradient(to bottom, #0ea5e9 0%, #0284c7 50%, #0369a1 100%);
}

.stacked-bar-b {
  background: linear-gradient(to bottom, #404040 0%, #262626 50%, #171717 100%);
}

.stacked-bar-r {
  background: linear-gradient(to bottom, #f87171 0%, #ef4444 50%, #dc2626 100%);
}

.stacked-bar-g {
  background: linear-gradient(to bottom, #4ade80 0%, #22c55e 50%, #16a34a 100%);
}

.stacked-bar-c {
  background: linear-gradient(to bottom, #d1d5db 0%, #9ca3af 50%, #6b7280 100%);
}

.stacked-bar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-align: center;
}

/* Pie Chart */
.deck-pie-chart {
  width: 100%;
  max-width: 200px;
  height: auto;
  margin: 0 auto 16px auto;
  display: block;
}

.pie-slice {
  cursor: pointer;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

.pie-slice:hover {
  opacity: 0.9;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
  transform: scale(1.05);
  transform-origin: center;
}

/* Pie slice colors - vibrant and glossy */
.pie-slice-w {
  fill: #fbbf24;
  stroke: #f59e0b;
  stroke-width: 1;
}

.pie-slice-u {
  fill: #3b82f6;
  stroke: #2563eb;
  stroke-width: 1;
}

.pie-slice-b {
  fill: #404040;
  stroke: #262626;
  stroke-width: 1;
}

.pie-slice-r {
  fill: #ef4444;
  stroke: #dc2626;
  stroke-width: 1;
}

.pie-slice-g {
  fill: #22c55e;
  stroke: #16a34a;
  stroke-width: 1;
}

.pie-slice-c {
  fill: #9ca3af;
  stroke: #6b7280;
  stroke-width: 1;
}

.deck-pie-chart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 13px;
  font-style: italic;
}

/* Pie Legend */
.deck-pie-legend {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.15s ease;
  cursor: pointer;
}

.pie-legend-item:hover {
  background: var(--bg-tertiary);
}

.pie-legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.pie-legend-dot-w {
  background: #fbbf24;
}

.pie-legend-dot-u {
  background: #3b82f6;
}

.pie-legend-dot-b {
  background: #404040;
}

.pie-legend-dot-r {
  background: #ef4444;
}

.pie-legend-dot-g {
  background: #22c55e;
}

.pie-legend-dot-c {
  background: #9ca3af;
}

.pie-legend-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  min-width: 12px;
}

.pie-legend-value {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

/* Draw Hand Button */
.deck-draw-hand-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-primary);
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deck-draw-hand-btn:hover {
  background: var(--accent);
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.deck-draw-hand-btn:active {
  transform: translateY(0);
}

/* Starting Hand Display - Full-Width Card Slivers */
.deck-starting-hand {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
}

.deck-hand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.deck-hand-header h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.deck-reshuffle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-primary);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.deck-reshuffle-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--accent);
}

.deck-hand-slivers {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 350px;
}

.deck-hand-sliver {
  position: relative;
  width: 100%;
  height: 60px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 15px 15px 0 0;
  border: 1px solid var(--border);
}

.deck-hand-sliver:hover {
  z-index: 10;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.deck-hand-sliver img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  object-position: top center;
  pointer-events: none;
}

.deck-hand-sliver-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.75));
  opacity: 0;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: flex-end;
  padding: 8px 12px;
}

.deck-hand-sliver:hover .deck-hand-sliver-overlay {
  opacity: 1;
}

.deck-hand-sliver-name {
  font-size: 13px;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* Card List Title */
.deck-card-list-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}

/* Compact Card Table - Ultra Tight Spreadsheet Style */
.deck-card-table-section {
  margin-bottom: 16px;
}

.deck-card-section-header {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
  padding-bottom: 2px;
  border-bottom: 1px solid var(--border-subtle);
}

.deck-card-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.deck-card-table-row {
  border-bottom: 1px solid var(--border-subtle);
  transition: background 0.1s ease;
}

.deck-card-table-row:hover {
  background: var(--bg-secondary);
}

.deck-card-table-row td {
  padding: 4px 8px;
  vertical-align: middle;
  line-height: 1.4;
}

.deck-card-table-thumb {
  width: 32px;
  padding: 2px 4px !important;
}

.deck-card-thumb-sprite,
.deck-card-thumb-img {
  width: 24px;
  height: 24px;
  display: block;
  border-radius: 2px;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.deck-card-thumb-sprite {
  background-repeat: no-repeat;
  /* JS sets background-size and background-position */
}

.deck-card-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.deck-card-table-qty {
  width: 40px;
  font-weight: 700;
  color: var(--text-secondary);
  font-family: monospace;
  font-size: 11px;
}

.deck-card-table-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.deck-card-table-mana {
  width: 80px;
  font-family: 'Courier New', monospace;
  font-size: 11px;
  color: var(--text-secondary);
}

.deck-card-table-type {
  width: 90px;
  font-size: 11px;
  color: var(--text-tertiary);
}

.deck-card-table-actions {
  width: 100px;
  text-align: right;
  white-space: nowrap;
}

.deck-card-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-left: 2px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--text-secondary);
  font-size: 16px;
  padding: 0;
  vertical-align: middle;
  flex-shrink: 0;
}

.deck-card-action-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.deck-card-action-btn:hover {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-primary);
}

.deck-card-action-btn.danger {
  color: #ef4444;
  font-size: 14px;
}

.deck-card-action-btn.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Hide eyeball on desktop, show on hover */
.deck-card-action-btn[data-action="view"] {
  opacity: 0;
  pointer-events: none;
}

.deck-card-table-row:hover .deck-card-action-btn[data-action="view"] {
  opacity: 1;
  pointer-events: auto;
}

/* Always show eyeball on mobile */
@media (max-width: 700px) {
  .deck-card-action-btn[data-action="view"] {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Bottom section (stats, gallery, etc.) */
.deck-detail-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}

/* Loading State */
.deck-detail-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  font-size: 16px;
  color: var(--text-secondary);
}

/* Error State */
.deck-detail-error {
  padding: 40px;
  text-align: center;
  max-width: 600px;
  margin: 60px auto;
}

.deck-detail-error h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 16px 0;
}

.deck-detail-error p {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.deck-error-hint {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
}

/* Mobile Adjustments */
@media (max-width: 700px) {
  .deck-detail {
    padding: 8px 12px;
  }

  .deck-compact-header {
    gap: 8px;
    padding: 6px 0;
    margin-bottom: 12px;
  }

  .deck-header-title {
    font-size: 16px;
  }

  .deck-header-title-input {
    font-size: 16px;
  }

  .deck-stats-panel {
    gap: 12px;
    padding: 12px;
  }

  .deck-stat-value {
    font-size: 16px;
  }

  /* Even tighter table on mobile */
  .deck-card-table {
    font-size: 11px;
  }

  .deck-card-table-row td {
    padding: 3px 6px;
  }

  .deck-card-table-thumb {
    width: 26px;
    padding: 2px 3px !important;
  }

  .deck-card-thumb-sprite,
  .deck-card-thumb-img {
    width: 20px;
    height: 20px;
  }

  .deck-card-table-qty {
    width: 35px;
    font-size: 10px;
  }

  .deck-card-table-name {
    font-size: 11px;
  }

  .deck-card-table-mana {
    width: 70px;
    font-size: 10px;
  }

  .deck-card-table-type {
    width: 75px;
    font-size: 10px;
  }

  .deck-card-action-btn {
    width: 22px;
    height: 22px;
    font-size: 14px;
  }

  .deck-card-action-btn svg {
    width: 12px;
    height: 12px;
  }
}

@media (max-width: 500px) {
  .deck-header-back-text {
    display: none; /* Just show arrow on mobile */
  }

  .deck-header-back-btn {
    padding: 6px;
  }

  .deck-vote-btn {
    min-width: 45px;
    padding: 6px 8px;
    font-size: 12px;
  }

  .deck-stats-panel {
    gap: 10px;
    padding: 10px;
  }

  .deck-stat-item {
    min-width: calc(50% - 5px);
  }

  /* Hide type column on very small screens to save space */
  .deck-card-table-type {
    display: none;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .breadcrumb-back,
  .deck-title-input {
    transition: none;
  }

  .breadcrumb-back:active {
    transform: none;
  }
}
