:root {
  color-scheme: dark;
  --bg: #07100b;
  --panel: #0f1811;
  --panel-soft: #172216;
  --slot: #0b120d;
  --ink: #fff3d7;
  --muted: #b9b196;
  --line: #33472d;
  --leaf: #82d173;
  --gold: #e6b54f;
  --amber: #f07839;
  --water: #67c9bd;
  --danger: #ef5350;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(6, 16, 10, 0.78), var(--bg) 74%),
    radial-gradient(circle at 16% 4%, rgba(130, 209, 115, 0.17), transparent 26%),
    radial-gradient(circle at 88% 14%, rgba(230, 181, 79, 0.16), transparent 31%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 76px),
    var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  letter-spacing: 0;
}

button {
  min-height: 42px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--ink);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

button:hover:not(:disabled) {
  border-color: var(--leaf);
}

button:disabled {
  cursor: default;
  opacity: 0.48;
}

.app-shell {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 36px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.studio-link {
  color: var(--muted);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
}

.studio-link:hover {
  color: var(--ink);
}

.game-title {
  text-align: center;
}

.game-title p,
.expedition-panel p,
.object-panel p,
.journal-panel p,
.stats span,
.scene-toolbar span {
  margin: 0 0 6px;
  color: var(--leaf);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.9;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-self: end;
  justify-content: flex-end;
  gap: 8px;
}

.audio-button.on {
  border-color: rgba(103, 201, 189, 0.78);
  background: rgba(103, 201, 189, 0.18);
  color: #d8fffa;
}

.game-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 16px;
  border: 1px solid var(--line);
  background: rgba(15, 24, 17, 0.94);
  padding: 16px;
}

.expedition-panel,
.object-panel,
.journal-panel {
  margin-bottom: 14px;
  border: 1px solid rgba(130, 209, 115, 0.35);
  background:
    linear-gradient(135deg, rgba(130, 209, 115, 0.1), transparent 58%),
    var(--slot);
  padding: 13px;
}

.expedition-panel h2 {
  margin-bottom: 8px;
  font-size: 25px;
  line-height: 1.05;
}

.expedition-panel span,
.journal-panel div {
  color: #ded5bc;
  line-height: 1.38;
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.stats div {
  min-height: 68px;
  border: 1px solid var(--line);
  background: var(--slot);
  padding: 11px;
}

.stats strong {
  font-size: 22px;
}

.room-tabs {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.room-tab {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  min-height: 46px;
  padding: 0 12px;
  text-align: left;
}

.room-tab.active {
  border-color: var(--gold);
  background: rgba(230, 181, 79, 0.16);
}

.room-tab.locked {
  color: var(--muted);
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#hint-button {
  min-height: 34px;
  padding: 0 12px;
}

#object-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#object-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid rgba(255, 243, 215, 0.12);
  background: rgba(255, 243, 215, 0.04);
  padding: 9px 10px;
  color: #eee3c9;
}

#object-list li span {
  min-width: 0;
}

#object-list li strong {
  flex: 0 0 auto;
}

#object-list li.found {
  border-color: rgba(130, 209, 115, 0.46);
  color: var(--leaf);
  text-decoration: line-through;
}

.scene-wrap {
  min-width: 0;
  border: 1px solid rgba(230, 181, 79, 0.36);
  background:
    linear-gradient(135deg, rgba(230, 181, 79, 0.12), transparent 60%),
    #0a0f0b;
  padding: 12px;
}

.scene-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.scene-toolbar strong {
  display: block;
  font-size: 23px;
}

.zoom-controls {
  display: grid;
  grid-template-columns: 42px 68px 42px;
  align-items: center;
  gap: 7px;
}

.zoom-controls strong {
  font-size: 15px;
  text-align: center;
}

#scene {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 1px solid #2d3b25;
  background: #050806;
  cursor: crosshair;
}

.hint-strip {
  min-height: 44px;
  margin-top: 10px;
  border: 1px solid rgba(103, 201, 189, 0.34);
  background: rgba(103, 201, 189, 0.08);
  padding: 12px 14px;
  color: #d8fffa;
  line-height: 1.35;
}

dialog {
  width: min(520px, calc(100% - 32px));
  border: 1px solid var(--gold);
  background: #0e1710;
  color: var(--ink);
  padding: 22px;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

.help-dialog ol {
  padding-left: 22px;
  color: #ded5bc;
  line-height: 1.5;
}

.setting-row {
  display: grid;
  grid-template-columns: 80px 1fr 58px;
  align-items: center;
  gap: 12px;
  margin: 14px 0;
}

@media (min-width: 1500px) {
  .app-shell {
    width: min(1760px, calc(100% - 64px));
  }

  .game-layout {
    grid-template-columns: 360px minmax(0, 1fr);
    gap: 32px;
  }

  .side-panel,
  .scene-wrap {
    padding: 18px;
  }
}

@media (min-width: 2600px) and (min-height: 1400px) {
  .app-shell {
    width: min(2120px, calc(100% - 96px));
  }

  .game-layout {
    grid-template-columns: 390px minmax(0, 1fr);
    gap: 40px;
  }

  .side-panel,
  .scene-wrap {
    padding: 20px;
  }
}

@media (max-width: 900px) {
  .topbar,
  .game-layout {
    grid-template-columns: 1fr;
  }

  .top-actions {
    justify-self: stretch;
    justify-content: center;
  }

  .side-panel {
    position: static;
  }
}
