/* ==========================================================================
   Noble Kennel Modal - Full-screen game area coverage
   Aligns with Competition/Academy modal visual language
   ========================================================================== */

/* Modal container sizing: occupy the main game viewport under header */
.modal.noble-kennel-modal {
  position: relative !important;
  width: auto !important;
  /* height: calc(100vh - var(--header-height, 50px)) !important; */
  max-height: 100% !important;
  max-width: none !important;
  margin-top: calc(var(--header-height, 50px) / 2) !important;
  margin-left: 8vw;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  align-self: flex-start !important;
  overflow-y: auto;
}

.modal.noble-kennel-modal .modal-content {
  /* Fill available height with internal scroll */
  display: block;
  min-width: 70vw;
  height: calc(100% - 16px);
  margin: 8px auto;
  padding: 0.75rem 1rem;
  box-sizing: border-box;

  background: var(--color-grey-300) !important;
  border: 3px solid var(--color-primary-800) !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2) !important;

  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.nk-modal-content {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}

/* Header (Sir Edward + dialog + quest/reputation) */
.nk-header {
  display: flex;
  flex-direction: column;
  background: var(--color-primary-800);
  border-radius: 8px 8px 0 0;
  padding: .75rem 1rem 0 !important;
  color: var(--color-grey-100);
  margin: -16px 0 0 -16px;
  width: calc(100% + 32px);
  border-bottom: 3px solid var(--color-primary-800);
}

.nk-header-main {
    display: grid;
    grid-template-columns: 140px 1fr 320px;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.nk-header-left,
.nk-header-center,
.nk-header-right {
  min-width: 0;
}

.sir-edward-avatar {
  width: 90%;
  height: 120px;
  border-radius: 8px;
  background:
    radial-gradient(100px 60px at 50% 30%, rgba(255,255,255,0.15), transparent),
    linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
  display: block;
  position: relative;
  border: 2px solid var(--color-secondary-300);
}

.sir-edward-avatar::after {
  /* Silhouette placeholder */
  content: '';
  background-image: url('../images/siredward.jpg');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  position: absolute;
  inset: 0;
  display: grid;
  opacity: 0.9;
}

.nk-header-center h2 {
  margin: 0 0 0.25rem 0;
  color: var(--color-secondary-200);
}

.nk-dialog {
  font-size: 0.95rem;
  color: var(--color-grey-100);
  opacity: 0.95;
  line-height: 1.35;
  padding: 0.25rem 0;
}

.nk-header-right {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.5rem;
}

.nk-quest,
.nk-reputation {
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
}

.nk-quest .label,
.nk-reputation .label {
  font-size: 0.75rem;
  color: var(--color-grey-200);
  margin-bottom: 0.25rem;
}

.nk-quest .value,
.nk-reputation .value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-secondary-200);
}

/* Tabs */
.nk-tabs {
  display: flex;
  gap: 0.2rem;
  flex-wrap: wrap;
  padding-left: 0.5rem;
}

.nk-tab {
    appearance: none;
    border: 1px solid var(--color-primary-900);
    border-bottom: none;
    background: var(--color-primary-600);
    color: var(--color-grey-200);
    border-radius: 8px 8px 0 0;
    padding: 0.5rem 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    bottom: -3px;
}

button.nk-tab {
    margin: 1rem 0 0 0;
}

.nk-tab:hover {
  background: var(--color-primary-500);
}

.nk-tab.active {
  background: var(--background-color, var(--color-grey-200));
  color: var(--color-primary-900);
  border-color: var(--color-primary-800);
  border-bottom: 1px solid var(--background-color, var(--color-grey-200));
}

/* Sections */
.nk-section {
  display: none;
}

.nk-section.active {
  display: block;
}

/* Kennel grid */
.nk-kennel-grid {
  display: grid;
  grid-template-rows: auto auto;
  gap: 1rem;
  background: var(--color-white);
    border: 1px solid var(--color-grey-300);
    border-radius: 10px;
    padding: 0.75rem;
}

.nk-row.standard-row {
  /* Responsive slots that shrink and wrap */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.75rem;
}

.nk-row.premium-row {
  /* Responsive premium slots that shrink and wrap */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 0.75rem;
}

/* Slot cards */
.nk-slot-card {
  background: var(--color-secondary-50);
  border: 1px solid var(--color-grey-300);
  border-radius: 10px;
  padding: 0.6rem;
  min-height: 150px;
  display: flex;
  align-items: stretch;
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.nk-slot-card.unlocked:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}

.nk-slot-card.locked {
  background: linear-gradient(180deg, rgba(0,0,0,0.015), rgba(0,0,0,0.03));
  opacity: 0.9;
}

.nk-slot-locked {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--color-grey-700);
  gap: 0.25rem;
}

.nk-slot-locked .small {
  font-size: 0.8rem;
.lock-icon {
  font-size: 1.25rem;
}

/* Empty slot styling */
.nk-empty-slot {
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--color-grey-700);
  gap: 0.25rem;
}

.nk-empty-slot .empty-icon {
  font-size: 1.25rem;
}

.nk-empty-slot .small {
  font-size: 0.8rem;
  color: var(--color-grey-600);
}
  color: var(--color-grey-600);
}

.lock-icon {
  font-size: 1.25rem;
}

/* Puppy content */
.nk-puppy {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 0.6rem;
  width: 100%;
  align-items: center;
}

.nk-puppy-image {
  width: 84px;
  height: 84px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ececec 0%, #dcdcdc 100%);
  border: 1px solid var(--color-grey-300);
}

.nk-puppy-image.placeholder.premium {
  background: linear-gradient(135deg, #fff4cc 0%, #f8e9a1 100%);
  border-color: var(--color-secondary-300);
}

.nk-puppy-info .name {
  font-weight: 700;
  color: var(--color-grey-900);
  margin-bottom: 0.15rem;
}

.nk-puppy-info .stats {
  font-size: 0.85rem;
  color: var(--color-grey-700);
}

.nk-puppy-info .price {
  margin-top: 0.15rem;
  font-weight: 600;
  color: var(--color-primary-900);
}

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

/* Premium cards */
.nk-slot-card.premium .nk-premium .title {
  font-weight: 700;
  color: var(--color-grey-900);
  margin-bottom: 0.25rem;
}

.nk-slot-card.premium .nk-premium .subtitle {
  font-size: 0.85rem;
  color: var(--color-grey-700);
  margin-bottom: 0.4rem;
}

.nk-slot-card.premium.locked {
  border-style: dashed;
}

/* Wing panels (Work/Socialization/Genetics/Breeding/Expansion) */
.nk-wing-panel {
  background: var(--color-white);
  border: 1px solid var(--color-grey-300);
  border-radius: 10px;
  padding: 0.75rem;
}

.nk-wing-panel h3 {
  margin: 0 0 0.4rem 0;
  color: var(--color-grey-900);
}

.nk-wing-panel p {
  margin: 0 0 0.5rem 0;
  color: var(--color-grey-700);
}

/* Work panel specifics */
.nk-work-panel {
  background: var(--color-white);
    border: 1px solid var(--color-grey-300);
    border-radius: 10px;
    padding: 0.75rem; 
}

.nk-work-panel .job-title {
  font-weight: 700;
  color: var(--color-grey-900);
  margin-bottom: 0.25rem;
}

.nk-work-panel .job-flavor {
  font-size: 0.9rem;
  color: var(--color-grey-700);
  margin-bottom: 0.25rem;
}

.nk-work-panel .job-salary {
  font-weight: 600;
  color: var(--color-primary-900);
  margin-bottom: 0.4rem;
}

.nk-work-panel .progress {
  font-size: 0.9rem;
  color: var(--color-grey-800);
  margin-bottom: 0.5rem;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .nk-row.standard-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (max-width: 992px) {
  .nk-header {
    grid-template-columns: 120px 1fr;
  }
  .nk-header-right {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
  }
  .nk-row.standard-row {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
  .nk-row.premium-row {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
}

@media (max-width: 768px) {
  .modal.noble-kennel-modal .modal-content {
    width: 98vw;
    height: calc(100% - 8px);
    margin: 4px auto;
    border-radius: 12px;
    padding: 0.5rem;
  }
  .nk-header {
    grid-template-columns: 90px 1fr;
    gap: 0.6rem;
  }
  .sir-edward-avatar { height: 90px; }
  .nk-row.standard-row {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
  .nk-row.premium-row {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  .nk-puppy {
    grid-template-columns: 64px 1fr;
    grid-auto-flow: row;
  }
  .nk-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .nk-row.standard-row {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
  .nk-row.premium-row {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}
/* Progress bars for NK wings */
.nk-wing-panel .progress-bar {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.12);
  border-radius: 6px;
  overflow: hidden;
  margin: 0.35rem 0;
  border: 1px solid var(--color-grey-300);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.nk-wing-panel .progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-secondary-300) 0%, #ffd86b 100%);
  border-radius: 6px;
  transition: width 240ms ease-in-out;
}

/* Variant colors if needed later */
.nk-wing-panel .progress-fill.success {
  background: linear-gradient(90deg, #48BB78 0%, #9AE6B4 100%);
}
.nk-wing-panel .progress-fill.info {
  background: linear-gradient(90deg, #4299E1 0%, #90CDF4 100%);
}

/* Tighten spacing inside wing panels around progress */
.nk-wing-panel .small + .progress-bar {
  margin-top: 0.25rem;
}

/* Genetics slots */
.nk-genetics-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.nk-genetics-slot {
  background: var(--color-secondary-50);
  border: 1px solid var(--color-grey-300);
  border-radius: 10px;
  padding: 0.75rem;
}

.nk-genetics-mini-puppy {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--color-grey-200);
}

.nk-genetics-mini-puppy .nk-puppy-image {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.nk-genetics-mini-puppy .nk-puppy-info {
  flex: 1;
  font-size: 0.9rem;
}

.nk-genetics-slot h4 {
  margin: 0 0 0.5rem 0;
  color: var(--color-grey-900);
}

.nk-genetics-slot label {
  display: block;
  margin: 0.5rem 0 0.25rem 0;
  font-weight: 600;
  color: var(--color-grey-800);
}

.nk-genetics-slot select {
  width: 100%;
  padding: 0.25rem;
  border: 1px solid var(--color-grey-400);
  border-radius: 4px;
}

/* Pregnant dog kennel layout - spans 2 columns */
.nk-slot-card.pregnant {
  grid-column: span 2;
}

/* Mobile fallback for pregnant cards (>768px uses 1 column) */
@media (max-width: 768px) {
  .nk-slot-card.pregnant {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 200px; /* Approximately double standard card height */
  }
}