:root {
  --bg: #f3efe3;
  --paper: #eee8d6;
  --ink: #1f241c;
  --ink-soft: #3a4034;
  --green: #2c4a32;
  --green-deep: #1e3524;
  --olive: #6b7a3a;
  --leaf: #4a7a3a;
  --line: #d9d1ba;
  --focus: #2c4a32;
  --modal: #121410;
  --radius: 14px;
  --page: 26rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  font-family: ui-sans-serif, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #d8d2c0;
  color: var(--ink);
  line-height: 1.45;
}

.shell {
  min-height: 100dvh;
  max-width: var(--page);
  margin: 0 auto;
  background: var(--bg);
  padding: 0.75rem 1.1rem 2rem;
  position: relative;
  overflow-x: hidden;
}

.leaf {
  position: absolute;
  top: 0.35rem;
  right: 0.4rem;
  width: 4.4rem;
  height: auto;
  pointer-events: none;
}

.topbar {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: start;
  min-height: 2.75rem;
  margin-bottom: 0.35rem;
}

.back {
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--green);
  cursor: pointer;
  border-radius: 8px;
}

.back svg {
  width: 1.15rem;
  height: 1.15rem;
}

.titles {
  text-align: center;
  padding-top: 0.35rem;
}

.titles h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.01em;
}

.titles p {
  margin: 0.15rem 0 0;
  font-size: 0.82rem;
  font-style: italic;
  color: var(--ink-soft);
}

.badge {
  display: inline-block;
  margin: 0.55rem 0 0.85rem;
  padding: 0.28rem 0.7rem;
  background: var(--olive);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 8px;
}

.photo {
  display: block;
  width: 100%;
  height: 11.5rem;
  object-fit: cover;
  border-radius: var(--radius);
  background: #cfc6b0;
}

.view-3d {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.75rem;
  margin: 0.85rem 0 1rem;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: #f4f0e4;
  font: inherit;
  font-weight: 650;
  font-size: 0.95rem;
  cursor: pointer;
}

.view-3d svg {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
}

.specs {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin: 0;
}

.specs div {
  display: grid;
  grid-template-columns: 5.4rem 1fr;
  gap: 0.75rem;
  padding: 0.42rem 0;
  font-size: 0.9rem;
}

.specs dt {
  margin: 0;
  color: var(--ink);
  font-weight: 500;
}

.specs dd {
  margin: 0;
  color: var(--ink-soft);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.15rem;
  margin: 1.15rem 0 0.9rem;
  padding: 0;
  list-style: none;
}

.tab {
  min-height: 4.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  border: 0;
  background: transparent;
  color: #8a9178;
  font: inherit;
  font-size: 0.68rem;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.2rem 0;
}

.tab svg {
  width: 1.7rem;
  height: 1.7rem;
}

.tab[aria-selected="true"] {
  color: var(--green);
  font-weight: 650;
}

.panel {
  font-size: 0.92rem;
  color: var(--ink-soft);
}

.panel[hidden] {
  display: none;
}

.panel p {
  margin: 0 0 0.65rem;
}

.back:focus-visible,
.tab:focus-visible,
.view-3d:focus-visible,
.close-3d:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: var(--modal);
  display: flex;
  flex-direction: column;
}

.modal[hidden] {
  display: none;
}

.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem;
  color: #ece8dc;
  background: #1a1c18;
}

.modal-bar h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 650;
}

.close-3d {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #ece8dc;
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
}

#viewport {
  display: block;
  width: 100%;
  height: 100%;
}

.status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.5rem;
  text-align: center;
  color: #ece8dc;
  font-size: 0.95rem;
  pointer-events: none;
}

.status[hidden] {
  display: none;
}

.hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 1rem;
  text-align: center;
  color: #cfc8b4;
  font-size: 0.8rem;
  pointer-events: none;
}

body.modal-open {
  overflow: hidden;
}

@media (min-width: 40rem) {
  body {
    padding: 1.5rem 0;
  }

  .shell {
    min-height: calc(100dvh - 3rem);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgb(40 36 24 / 0.18);
  }

  .photo {
    height: 13.5rem;
  }
}
