:root {
  --primary-green: #4a5d4c;
  --secondary-green: #374b39;
  --primary-beige: #d5cdb6;
  --secondary-beige: #a39b84;
  --dark-bg: #1f2321;
  --shadow: rgba(0, 0, 0, 0.2);
}

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

body {
  background-color: var(--dark-bg);
  color: var(--primary-beige);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

@media (max-width: 768px) {
  body {
    padding: 10px;
  }
}

.game-container {

.card-count {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-weight: bold;
  font-size: 0.9em;
}

  width: 100vw;
  height: 100vh;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0;
  backdrop-filter: blur(10px);
  padding: 85px 25px 25px;
  box-shadow: 0 8px 32px var(--shadow);
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
}

.fixed-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--dark-bg);
  padding: 15px 0;
  box-shadow: 0 2px 10px var(--shadow);
}

.resources-bar {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 15px;
  padding: 10px 30px;
  background: rgba(255, 255, 255, 0.05);
}

.resource {
  color: var(--primary-beige);
  font-size: 0.9em;
}

.resource span {
  color: var(--secondary-beige);
  margin-right: 5px;
}

.timer-display {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
}

.timer-display {
  margin-left: auto;
  padding-right: 10px;
}

.heal-all-btn {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 10px;
}

.heal-all-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

#depletion-preview {
  color: #ff4444;
}

.tabs {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 25px;
}

@media (max-width: 480px) {
  .tabs {
    gap: 8px;
  }
  .game-container {
    padding: 15px;
  }
}

.tab-btn {
  background-color: var(--secondary-green);
  color: var(--primary-beige);
  border: none;
  padding: 14px 28px;
  cursor: pointer;
  font-size: 1.1em;
  transition: all 0.3s ease;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  min-width: 120px;
}

.tab-btn:hover {
  background-color: var(--primary-green);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow);
}

.tab-btn.active {
  background-color: var(--primary-green);
  box-shadow: 0 5px 15px var(--shadow);
  position: relative;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40%;
  height: 3px;
  background-color: var(--primary-beige);
  border-radius: 2px;
}

.tab-content {
  display: none;
  padding: 25px;
  background-color: rgba(74, 93, 76, 0.05);
  border-radius: 12px;
  box-shadow: inset 0 2px 10px var(--shadow);
}

@media (max-width: 480px) {
  .tab-btn {
    padding: 10px 20px;
    font-size: 0.9em;
    min-width: 100px;
  }
}

.tab-content.active {
  display: block;
}

.card-subtabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  justify-content: center;
}

.subtab-btn {
  background-color: var(--secondary-green);
  color: var(--primary-beige);
  border: none;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.subtab-btn.active {
  background-color: var(--primary-green);
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
}

.setting-btn.danger {
  background-color: #8B0000;
  margin-top: 10px;
}

.setting-btn.danger:hover {
  background-color: #A00000;
}

.setting-item h3 {
  color: var(--primary-beige);
  margin-bottom: 15px;
  margin-top: 10px;
  font-size: 1.1em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 5px;
}

.imported-expansions {
  margin-top: 15px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.expansion-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 8px 12px;
  margin: 5px 0;
  border-radius: 6px;
  border-left: 4px solid var(--primary-green);
}

.expansion-name {
  font-weight: bold;
  color: var(--primary-beige);
}

.expansion-details {
  font-size: 0.9em;
  color: var(--secondary-beige);
  margin-top: 4px;
}

.card-grid, .pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
  margin: 25px 0;
  width: 100%;
}

.powerup-grid {
  display: grid;
  grid-template-columns: repeat(5, 100px);
  gap: 10px;
  margin: 25px auto;
  width: fit-content;
  padding: 20px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  box-shadow: 0 4px 12px var(--shadow);
}

.powerup-info {
  text-align: center;
  margin-top: 20px;
  padding: 15px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
}

.powerup-cell {
  aspect-ratio: 1;
  background: var(--secondary-green);
  border-radius: 8px;
  cursor: not-allowed;
  opacity: 0.5;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  position: relative;
  padding: 5px;
}

.health-bar {
  position: absolute;
  bottom: 5px;
  left: 5px;
  right: 5px;
  height: 4px;
  background: rgba(255, 0, 0, 0.3);
  border-radius: 2px;
  overflow: hidden;
}

.health-fill {
  height: 100%;
  background: #ff3333;
  width: 100%;
  transition: width 0.3s ease;
}

.powerup-cell.available {
  cursor: pointer;
  opacity: 1;
  background: var(--primary-green);
}

.powerup-cell.unlocked {
  background: #4CAF50;
  opacity: 1;
}

.powerup-cell.center {
  background: linear-gradient(45deg, #4CAF50, #45a049);
  color: white;
  font-weight: bold;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2px;
}

.core-label {
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 2px;
}

.core-health {
  font-size: 10px;
  text-align: center;
}

.powerup-cell.outermost {
  border: 2px solid #ff6b6b;
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
}

.powerup-cell.outermost.unlocked {
  background: linear-gradient(135deg, #e8f5e8, #c8e6c9);
  border-color: #4caf50;
}

.powerup-info {
  text-align: center;
  margin-top: 20px;
}

.cost-display {
  color: #4CAF50;
  font-size: 1.2em;
  margin-top: 10px;
}

.upgrade-container {
  position: absolute;
  top: 2px;
  right: 2px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.repair-btn, .upgrade-btn {
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.repair-btn {
  background: #2196F3;
  color: white;
}

.repair-btn:hover {
  background: #1976D2;
  transform: scale(1.1);
}

.upgrade-btn {
  background: #FF9800;
  color: white;
}

.upgrade-btn:hover {
  background: #F57C00;
  transform: scale(1.1);
}

.placeholder-card, .pack, .base-building {
  background-color: var(--secondary-green);
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px var(--shadow);
  position: relative;
  overflow: hidden;
}

.placeholder-card:hover, .pack:hover, .base-building:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--shadow);
  background-color: var(--primary-green);
}

.placeholder-card::before, .pack::before, .base-building::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.placeholder-card:hover::before, .pack:hover::before, .base-building:hover::before {
  transform: translateX(100%);
}

.pack.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pack.disabled:hover {
  transform: none;
  background-color: var(--secondary-green);
}

.expansion-pack {
  border: 2px solid var(--primary-green);
  background: linear-gradient(135deg, var(--secondary-green), var(--primary-green));
}

.expansion-pack:hover {
  border-color: var(--primary-beige);
  box-shadow: 0 8px 20px var(--shadow), 0 0 10px rgba(74, 93, 76, 0.5);
}

.pack-cost {
  color: var(--primary-beige);
  font-weight: bold;
  margin: 8px 0;
}

.expansion-version {
  color: var(--secondary-beige);
  font-size: 0.8em;
  font-style: italic;
  margin-top: 5px;
}

@media (max-width: 480px) {
  .card-grid, .pack-grid, .base-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }

  .placeholder-card, .pack, .base-building {
    padding: 15px;
  }
}

.pull-results {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.pack-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 800px;
}

@media (max-width: 850px) {
  .pack-results {
    min-width: 90%;
  }

  .pull-results {
    gap: 15px;
  }
}

.pulled-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid;
  border-radius: 10px;
  padding: 15px;
  text-align: center;
  animation: cardReveal 0.5s ease-out;
  width: 220px;
  height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

@keyframes cardReveal {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.pulled-card h3 {
  margin-bottom: 10px;
  font-size: 1.2em;
}

.pulled-card .rarity {
  font-weight: bold;
  margin-bottom: 5px;
}

.pulled-card .category {
  color: var(--secondary-beige);
  font-size: 0.9em;
  text-transform: capitalize;
  margin-bottom: 5px;
}

.pulled-card .resource-info,
.pulled-card .stats-info {
  color: var(--primary-beige);
  font-size: 0.9em;
  padding: 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  margin-top: 8px;
}

.pulled-card .occupation {
  color: var(--secondary-beige);
  font-style: italic;
  margin: 5px 0;
}

.pulled-card .stats-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px;
  padding: 8px 5px;
}

.pulled-card .stats-info span {
  font-weight: bold;
}

.modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.action-btn, .use-item, .close-modal {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: var(--secondary-beige);
  color: #000;
  font-weight: bold;
}

.action-btn:hover, .use-item:hover {
  opacity: 0.9;
}

.close-modal {
  background: #666;
  color: white;
}

.modal-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
}

.use-item {
  background-color: var(--primary-green);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.use-item:hover {
  background-color: var(--secondary-green);
}

.expedition-info {
  text-align: left;
  margin-top: 10px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  font-size: 0.85em;
  max-height: 150px;
  overflow-y: auto;
}

.expedition-info p {
  color: var(--secondary-beige);
  margin-bottom: 5px;
}

.expedition-info ul {
  margin: 0;
  padding-left: 8px;
}

.expedition-info li {
  margin: 2px 0;
}

.clickable {
  cursor: pointer;
  transition: transform 0.2s ease;
}

.clickable:hover {
  transform: scale(1.05);
}

.card-details-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(31, 35, 33, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(3px);
}

.modal-content {
  background: var(--background);
  padding: 20px;
  border-radius: 15px;
  max-width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: flex;
  gap: 20px;
}

.modal-content .pulled-card {
  flex-shrink: 0;
}

.modal-content .survivor-selection {
  flex-grow: 1;
  margin-top: 0;
}

.close-modal, .open-another-pack {
  margin-top: 15px;
  padding: 8px 16px;
  background: var(--primary-green);
  border: none;
  border-radius: 5px;
  color: var(--primary-beige);
  cursor: pointer;
  width: 100%;
}

.open-another-pack {
  background: #4CAF50;
}

.open-another-pack:disabled {
  background: #666;
  cursor: not-allowed;
}

.close-modal:hover {
  background: var(--secondary-green);
}

.expedition-info ul {
  list-style: none;
  margin-bottom: 10px;
}

.expedition-info li {
  color: var(--primary-beige);
  font-size: 0.9em;
  text-transform: capitalize;
  margin: 2px 0;
}

.action-summary {
  background: rgba(255, 255, 255, 0.08);
  padding: 20px;
  border-radius: 12px;
  margin: 10px 0;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.action-summary p {
  color: var(--primary-beige);
  margin: 5px 0;
  font-size: 1.1em;
}

.survivor-status {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.survivor-status-entry {
  background: rgba(255, 255, 255, 0.05);
  padding: 15px;
  border-radius: 8px;
  position: relative;
  margin-bottom: 10px;
}

.survivor-status-entry .health-bar {
  height: 6px;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 3px;
  margin-top: 10px;
  overflow: hidden;
}

.survivor-status-entry .health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3333, #ff6666);
  transition: width 0.3s ease;
}

.survivor-name {
  font-weight: bold;
  color: var(--primary-beige);
}

.hp-loss {
  color: #ff4444;
}

.hp-remaining {
  color: #4CAF50;
}

.health-status {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.stats-info .health-bar {
  height: 4px;
  background: rgba(255, 0, 0, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.stats-info .health-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff3333, #ff6666);
  transition: width 0.3s ease;
}

.death-notice {
  color: #ff4444;
  text-align: center;
  font-size: 1.2em;
  margin: 15px 0;
  font-weight: bold;
}

.survivor-selection {
  margin-top: 20px;
}

.survivors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 15px;
  margin: 15px 0;
  max-height: 300px;
  overflow-y: auto;
}

.survivor-card {
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.survivor-card.selected {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(0.95);
}

.assignment-summary {
  margin: 15px 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  text-align: center;
}

#start-expedition {
  background: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
}

#start-expedition:disabled {
  background: #666;
  cursor: not-allowed;
}

.heal-btn {
  background: #4CAF50 !important;
  color: white !important;
}

.survivor-portrait {
  margin: 8px 0;
  text-align: center;
}

.survivor-portrait img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary-beige);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.settings-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 0 15px;
}

.setting-item {
  margin: 20px 0;
  width: 100%;
  overflow: visible;
}

.setting-item label {
  display: block;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: visible;
}

input[type="range"] {
  width: 100%;
  height: 8px;
  background: var(--secondary-green);
  border-radius: 4px;
  outline: none;
}

select, .setting-btn {
  width: 100%;
  padding: 8px;
  margin: 5px 0;
  background: var(--secondary-green);
  color: var(--primary-beige);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.setting-btn:hover {
  background: var(--primary-green);
}

#importExpansion {
  background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
  border: 2px solid var(--primary-beige);
  color: var(--primary-beige);
  font-weight: bold;
  margin-bottom: 10px;
  transition: all 0.3s ease;
}

#importExpansion:hover {
  background: linear-gradient(135deg, var(--secondary-green), var(--primary-green));
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

#fontSizeValue, #volumeValue {
  margin-left: 10px;
  color: var(--secondary-beige);
}

.audio-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 10px 0;
}

.audio-controls label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-controls input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

h2 {
  color: var(--primary-beige);
  margin-bottom: 20px;
  text-align: center;
}
.setting-btn {
  background-color: var(--secondary-green);
  color: var(--primary-beige);
  border: none;
  padding: 12px 24px;
  margin: 8px 0;
  cursor: pointer;
  border-radius: 6px;
  font-size: 1em;
  transition: all 0.3s ease;
  width: 100%;
  text-align: center;
  display: block;
}

#importExpansion {
  background-color: #6a4c93;
  margin-bottom: 16px;
}

#importExpansion:hover {
  background-color: #7b5aa6;
  transform: translateY(-1px);
}