* {
  box-sizing: border-box;
}

:root {
  --bg: #1a1a1a;
  --bg-card: #262220;
  --ember: #ff6a3d;
  --ember-dark: #c8431a;
  --text: #f4ede8;
  --text-muted: #b8a99e;
  --border: #3a3330;
}

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 2rem;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1rem 0.75rem;
  background: linear-gradient(180deg, var(--bg) 80%, transparent);
}

.topbar h1 {
  font-size: 1.4rem;
  margin: 0;
}

.btn-back {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.4rem;
  line-height: 1;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.content {
  padding: 0 1rem;
}

h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 1.5rem 0 0.6rem;
}

.grid-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.btn-big {
  background: linear-gradient(135deg, var(--ember), var(--ember-dark));
  border: none;
  color: #1a1a1a;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 1.1rem 0.8rem;
  border-radius: 0.9rem;
  min-height: 4.5rem;
}

.search {
  margin-top: 1.5rem;
}

#search-input {
  width: 100%;
  padding: 0.9rem 1rem;
  font-size: 1rem;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
}

#search-results {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.categories {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1.5rem;
}

.btn-cat, .btn-egen, .btn-item, .btn-choice {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.05rem;
  padding: 1rem;
  border-radius: 0.9rem;
  text-align: left;
  width: 100%;
}

.btn-egen {
  margin-top: 1.5rem;
  text-align: center;
  color: var(--ember);
  font-weight: 600;
}

.item-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.levels {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 1rem;
}

.level {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1rem 1.2rem;
}

.level-label {
  color: var(--text-muted);
  font-size: 1rem;
}

.level-temp {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ember);
}

.beskrivning {
  margin-top: 1.2rem;
  line-height: 1.5;
}

.vila {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  background: rgba(255, 106, 61, 0.1);
  border: 1px solid rgba(255, 106, 61, 0.3);
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.vila-extra {
  background: rgba(255, 106, 61, 0.18);
  border-color: var(--ember);
  color: var(--text);
  font-weight: 600;
}

.schema {
  margin-top: 1.5rem;
}

.schema-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0.9rem;
  border: 1px solid var(--border);
}

.schema-fallback {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.schema-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.schema-caption a {
  color: var(--text-muted);
  text-decoration: underline;
}

.muted {
  color: var(--text-muted);
}

.field-group {
  margin-top: 0.5rem;
}

.btn-choice.active {
  border-color: var(--ember);
  background: rgba(255, 106, 61, 0.15);
  color: var(--ember);
}

.tumregel {
  margin-top: 1.2rem;
  padding: 1rem 1.2rem;
  border-radius: 0.9rem;
  background: var(--bg-card);
  border: 1px solid var(--ember);
  font-size: 1.05rem;
  font-weight: 600;
}

.kallor {
  margin-top: 2.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}
