:root {
  color-scheme: dark;
  --ink: #101716;
  --ink-soft: #1a2321;
  --paper: #f4f1e9;
  --paper-strong: #fffdf8;
  --line-dark: #303a37;
  --line-light: #d6d1c6;
  --text: #f6f4ee;
  --muted-dark: #aab3b0;
  --muted-light: #68706d;
  --accent: #f4a62f;
  --accent-strong: #ffbd58;
  --danger: #b23b2e;
  --success: #167b55;
  --radius: 18px;
  font-family: "Segoe UI Variable", "Aptos", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font-size: 16px; }
button, textarea, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 3vw, 42px);
  border-bottom: 1px solid var(--line-dark);
  background: rgba(16, 23, 22, .96);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 760;
  font-size: 1.08rem;
  letter-spacing: -.025em;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border: 3px solid var(--accent);
  border-radius: 4px 11px 4px 4px;
  transform: rotate(-4deg);
  box-shadow: inset 7px -7px 0 rgba(244, 166, 47, .2);
}

.top-actions { display: flex; align-items: center; gap: 18px; }
.status { color: var(--muted-dark); font-size: .9rem; display: flex; align-items: center; gap: 9px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #78817e; }
.status.online .status-dot { background: #55d498; box-shadow: 0 0 0 4px rgba(85, 212, 152, .12); }
.status.offline .status-dot { background: #ff7d69; }

.experience-shell {
  min-height: calc(100vh - 72px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(420px, .72fr);
}

.visual-column {
  min-width: 0;
  padding: clamp(22px, 3vw, 42px);
  background:
    radial-gradient(circle at 35% 35%, rgba(69, 87, 80, .28), transparent 42%),
    var(--ink);
}

.creation-panel {
  color: var(--ink);
  background: var(--paper);
  border-left: 1px solid #050706;
  padding: clamp(24px, 3vw, 38px);
  overflow-y: auto;
}

.section-title {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title.compact { margin-bottom: 20px; }
.step-number {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #15120c;
  font-weight: 800;
  font-size: .9rem;
}

h1, h2 { margin: 0; letter-spacing: -.035em; line-height: 1.12; }
h1 { font-size: clamp(1.35rem, 2vw, 1.8rem); }
h2 { font-size: clamp(1.45rem, 2.2vw, 2rem); }
.section-title p { margin: 6px 0 0; line-height: 1.45; }
.visual-column .section-title p { color: var(--muted-dark); }
.creation-panel .section-title p { color: var(--muted-light); }

.room-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.room-card {
  position: relative;
  min-width: 0;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #070a09;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: border-color .18s, transform .18s;
}

.room-card:hover { transform: translateY(-2px); border-color: #52605b; }
.room-card img { display: block; width: 100%; height: 96px; object-fit: cover; opacity: .75; }
.room-card span { display: block; padding: 10px 12px; font-size: .9rem; font-weight: 650; }
.room-card.active { border-color: var(--accent); }
.room-card.active img { opacity: 1; }
.room-card.active::after {
  content: "";
  position: absolute;
  top: 10px;
  right: 10px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(16, 23, 22, .72);
}

.empty-card {
  grid-column: 1 / -1;
  min-height: 118px;
  padding: 20px;
  border: 1px dashed #45504c;
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
  color: var(--muted-dark);
}

.empty-card strong { color: var(--text); }

.stage-card {
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  overflow: hidden;
  background: #080b0a;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
}

.stage-toolbar {
  min-height: 66px;
  padding: 13px 16px 13px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line-dark);
}

.stage-toolbar > div:first-child { display: grid; gap: 2px; }
.stage-kicker { color: var(--muted-dark); font-size: .78rem; }
.stage-toolbar strong { font-size: 1rem; }

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line-dark);
  border-radius: 11px;
  background: #131817;
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  padding: 0 15px;
  color: var(--muted-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 650;
}

.segmented button.active { color: #17120b; background: var(--accent); }
.segmented button:disabled { opacity: .35; cursor: not-allowed; }

.image-stage {
  min-height: 500px;
  height: calc(100vh - 330px);
  max-height: 760px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  background-color: #090c0b;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 32px 32px;
}

.image-wrap { width: 100%; height: 100%; }
.image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.stage-empty, .generating {
  max-width: 430px;
  padding: 34px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--muted-dark);
  line-height: 1.45;
}

.stage-empty strong, .generating strong { color: var(--text); font-size: 1.12rem; }
.spinner {
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  border-radius: 50%;
  border: 3px solid #38423f;
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.concept-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.concept-grid button {
  min-height: 70px;
  padding: 12px 13px;
  border: 2px solid var(--line-light);
  border-radius: 12px;
  background: var(--paper-strong);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}

.concept-grid button:hover { border-color: #989d97; transform: translateY(-1px); }
.concept-grid button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--text);
  box-shadow: inset 5px 0 0 var(--accent);
}

.concept-grid strong, .concept-grid span { display: block; }
.concept-grid strong { font-size: .92rem; line-height: 1.2; }
.concept-grid span { margin-top: 5px; color: var(--muted-light); font-size: .76rem; line-height: 1.25; }
.concept-grid button.active span { color: #c6cecb; }
.selection-count { margin: 10px 2px 20px; min-height: 21px; color: var(--muted-light); font-size: .84rem; }

.mood-picker { border: 0; margin: 0 0 20px; padding: 0; }
.mood-picker legend, .field-group label { margin-bottom: 9px; color: var(--ink); font-weight: 720; font-size: .95rem; }
.mood-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mood-options button {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line-light);
  border-radius: 10px;
  color: var(--ink);
  background: var(--paper-strong);
  cursor: pointer;
  font-weight: 650;
}
.mood-options button.active { color: var(--paper-strong); background: #3b514a; border-color: #3b514a; }

.field-group { display: grid; }
.field-group label { display: flex; justify-content: space-between; }
.field-group label span { color: var(--muted-light); font-weight: 500; font-size: .8rem; }
textarea {
  width: 100%;
  min-height: 94px;
  resize: vertical;
  padding: 13px 14px;
  color: var(--ink);
  background: var(--paper-strong);
  border: 1px solid var(--line-light);
  border-radius: 11px;
  line-height: 1.45;
  outline: none;
}
textarea:focus { border-color: #537166; box-shadow: 0 0 0 3px rgba(59, 81, 74, .14); }
textarea::placeholder { color: #8a8f8c; }

.third-place-note {
  margin: 16px 0 18px;
  padding: 12px 14px;
  border-left: 4px solid var(--accent);
  color: #4d5753;
  background: rgba(255, 255, 255, .45);
  line-height: 1.45;
  font-size: .86rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-dark);
  text-decoration: none;
  color: var(--text);
  cursor: pointer;
  background: var(--ink-soft);
  font-weight: 720;
}

.button.ghost:hover { border-color: #66716d; }
.button.primary {
  min-height: 56px;
  color: #15120c;
  background: var(--accent);
  border-color: var(--accent);
  font-size: 1rem;
}
.button.primary:hover { background: var(--accent-strong); }
.button.primary:disabled { opacity: .42; cursor: not-allowed; }
.button.save {
  min-height: 52px;
  margin-top: 10px;
  color: var(--ink);
  border-color: #8b7350;
  background: transparent;
}
.button.save:hover { background: rgba(244, 166, 47, .14); }
.wide { width: 100%; }
.prompt-review { width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 28px; border: 1px solid #c9c4b8; border-radius: 18px; background: #f5f2e9; color: #15211d; box-shadow: 0 24px 90px #0007; }
.prompt-review::backdrop { background: #07100dcc; }
.review-heading { display: flex; align-items: center; gap: 14px; }
.review-heading h2 { margin: 0; font-size: 1.65rem; }
.prompt-review p { line-height: 1.5; }
.prompt-review label { display: block; margin: 18px 0 8px; font-weight: 700; }
.prompt-review textarea { width: 100%; min-height: 280px; padding: 16px; background: white; color: #15211d; border: 2px solid #b6beb8; border-radius: 10px; font: inherit; line-height: 1.55; resize: vertical; }
.review-ideas { font-weight: 700; }
#review-help { font-size: .86rem; color: #53605b; }
.review-protection { font-size: .9rem; padding: 12px; border-left: 3px solid #efa839; background: #fff8; }
.review-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 20px; }
.review-actions .ghost { color: #15211d; border-color: #8e9993; background: white; }
.more-ideas { margin: 8px 0 20px; }
.more-ideas summary { cursor: pointer; min-height: 44px; padding: 12px 0; font-weight: 700; }
.more-ideas[open] summary { margin-bottom: 8px; }

.message { min-height: 24px; margin: 11px 2px 0; color: var(--muted-light); font-size: .86rem; line-height: 1.4; }
.message.error { color: var(--danger); }
.message.success { color: var(--success); }
.message.notice { color: #8a5811; }

@media (max-width: 1250px) {
  .experience-shell { grid-template-columns: minmax(0, 1fr) 430px; }
  .room-list { grid-template-columns: repeat(3, minmax(120px, 1fr)); }
  .image-stage { min-height: 470px; height: 62vh; }
}

@media (max-width: 920px) {
  .experience-shell { display: block; }
  .creation-panel { border-left: 0; border-top: 1px solid #050706; }
  .image-stage { height: 58vh; min-height: 410px; }
  .room-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar { align-items: flex-start; }
  .status { display: none; }
  .button.ghost { min-height: 40px; font-size: .84rem; padding: 0 11px; }
  .visual-column, .creation-panel { padding: 20px 16px; }
  .room-list { display: flex; overflow-x: auto; padding-bottom: 5px; }
  .room-card { flex: 0 0 145px; }
  .image-stage { min-height: 340px; height: 50vh; }
  .stage-toolbar { align-items: flex-start; }
  .concept-grid { grid-template-columns: 1fr; }
  .concept-grid button { min-height: 64px; }
}
