:root {
  --bg: #0d0d0d;
  --surface: #1a1a1a;
  --surface-hover: #262626;
  --text: #f5f5f5;
  --accent: #2d8f6f;
  --accent-hover: #3aa87d;
  --mood-accent: #a78bfa;
  --disabled: #555;
  --border: #333;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "header"
    "main";
}

.header {
  grid-area: header;
  padding: 1rem 1.5rem;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.game-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--accent);
}

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.stat-label {
  min-width: 3.5ch;
  color: #aaa;
}

.stat-bar-wrap {
  width: 60px;
  height: 10px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.stat-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.stat-bar-mood {
  background: var(--mood-accent);
}

.stat-value {
  min-width: 2.5ch;
  font-weight: 600;
}

.stat-money .stat-value {
  color: #86efac;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.lang-toggle {
  padding: 0.35rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.lang-toggle:hover {
  background: var(--surface-hover);
}

.reset-btn {
  padding: 0.35rem 0.75rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: #e57373;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s;
}

.reset-btn:hover {
  background: rgba(229, 115, 115, 0.1);
}

.main {
  grid-area: main;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.back-link {
  align-self: flex-start;
  margin-bottom: 1rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.95rem;
  transition: opacity 0.15s;
}

.back-link:hover {
  opacity: 0.85;
}

.room {
  width: 100%;
  max-width: 480px;
  padding: 1.5rem;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  text-align: center;
}

.room-prompt {
  margin: 0 0 1.25rem;
  font-size: 1.1rem;
  color: #bbb;
}

.room-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.room-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 1rem 1.25rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, border-color 0.15s;
}

.room-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent);
  transform: scale(1.03);
}

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

.room-btn-icon {
  font-size: 2rem;
  line-height: 1;
}

.room-btn-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.food-inventory {
  margin: 0;
  font-size: 0.9rem;
  color: #aaa;
}

.food-inventory #food-value {
  font-weight: 600;
  color: var(--text);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  max-width: 360px;
  width: 100%;
  animation: modalSlide 0.2s ease;
}

@keyframes modalSlide {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  padding: 0;
  background: transparent;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

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

.shop-desc {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  color: #aaa;
}

.shop-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shop-option {
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, border-color 0.15s;
}

.shop-option:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent);
}

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