:root {
  --coffee-900: #2b1b14;
  --coffee-700: #5a3929;
  --cream: #f7efe3;
  --beige: #dfc7a8;
  --green: #465f3d;
  --terracotta: #a45f3d;
  --white: #fffaf2;
  --black: #000000;
  --line: #d7c0a2;
  --muted: #6b5a4d;
  --shadow: 0 18px 42px rgba(43, 27, 20, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--coffee-900);
  background: var(--cream);
  font-family: "Aptos", "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 3px solid var(--black);
  outline-offset: 4px;
}

.badges,
.modal-body,
.summary-content {
  color: var(--coffee-700);
  font-size: 0.95rem;
}

.scene-card,
.modal-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 34px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  color: var(--white);
  background: var(--green);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.prototype-only,
.scene-card.fullscreen {
  width: 100vw;
  height: 100vh;
}

.scene-card.fullscreen {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

a-scene {
  width: 100%;
  height: 100%;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  color: var(--white);
  background: var(--coffee-900);
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, background-color 180ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--green);
}

.button-danger {
  background: var(--terracotta);
}

.button-light {
  color: var(--coffee-900);
  background: var(--cream);
  border-color: var(--line);
}

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
}

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

.modal-panel {
  position: relative;
  width: min(760px, 100%);
  max-height: min(90vh, 840px);
  overflow: auto;
  padding: 24px;
}

.modal-panel.compact {
  width: min(880px, 100%);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.modal-label {
  margin: 0 0 6px;
  color: var(--terracotta);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.modal-header h2 {
  margin: 0;
  color: var(--coffee-900);
  font-family: "Sora", "Aptos Display", "Segoe UI", sans-serif;
  font-size: clamp(1.5rem, 4vw, 2.35rem);
  line-height: 1.05;
}

.close-button {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: var(--white);
  background: var(--coffee-900);
  border: 1px solid var(--coffee-900);
  border-radius: 999px;
  font-size: 1.6rem;
  line-height: 1;
}

.emotion {
  padding: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.options {
  display: grid;
  gap: 10px;
  margin: 18px 0;
}

.option-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.option-row input {
  accent-color: var(--green);
}

.feedback {
  min-height: 28px;
  margin: 0;
  color: var(--coffee-900);
  font-weight: 800;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.summary-content {
  display: grid;
  gap: 10px;
}

.summary-content p {
  margin: 0;
}

body.modal-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  .modal {
    padding: 10px;
  }

  .modal-panel {
    padding: 18px;
    border-radius: 18px;
  }

  .button,
  .modal-actions .button {
    width: 100%;
  }
}
