:root {
  color-scheme: dark;
  --bg: #121312;
  --panel: #1f2421;
  --panel-strong: #29302b;
  --text: #f4f0e8;
  --muted: #b6b0a5;
  --line: #3b443e;
  --gold: #f4b860;
  --teal: #5bd6c7;
  --rose: #f28ca5;
  --green: #8fd694;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(91, 214, 199, 0.08), transparent 30%),
    radial-gradient(circle at 90% 12%, rgba(242, 140, 165, 0.08), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid #d1933e;
  border-radius: 6px;
  background: var(--gold);
  color: #261a0a;
  cursor: pointer;
  font-weight: 750;
  min-height: 40px;
  padding: 0 14px;
}

button:hover {
  filter: brightness(1.06);
}

input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #151815;
  color: var(--text);
  min-height: 40px;
  padding: 0 12px;
}

.auth-body {
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-shell {
  display: grid;
  width: min(100%, 920px);
  min-height: calc(100vh - 40px);
  align-items: center;
}

.auth-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(320px, 1fr);
  gap: 24px;
  align-items: center;
  border: 1px solid rgba(244, 240, 232, 0.11);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(91, 214, 199, 0.08), transparent 46%),
    rgba(31, 36, 33, 0.92);
  padding: 22px;
}

.auth-logo {
  justify-self: center;
}

.auth-copy,
.auth-form,
.auth-note {
  grid-column: 2;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1 {
  color: var(--gold);
  font-size: 32px;
}

.auth-copy p,
.auth-note span {
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 12px;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.auth-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-actions button:last-child {
  border-color: rgba(91, 214, 199, 0.38);
  background: rgba(91, 214, 199, 0.1);
  color: var(--teal);
}

.auth-message {
  min-height: 20px;
  color: var(--rose);
  font-size: 13px;
}

.auth-note {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: rgba(23, 27, 24, 0.68);
  padding: 10px;
}

.auth-note strong {
  color: var(--teal);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.world-panel,
.side-panel {
  min-width: 0;
}

.world-panel {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(320px, 1fr);
  gap: 12px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 126px;
  border-bottom: 1px solid rgba(244, 240, 232, 0.11);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1;
}

.brand-lockup {
  display: grid;
  align-content: center;
  gap: 6px;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: auto;
  height: 98px;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
}

.text-logo {
  color: var(--text);
  font-size: 52px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 0.9;
  text-shadow:
    0 3px 0 #20242a,
    0 0 18px rgba(91, 214, 199, 0.28);
}

.auth-logo.text-logo {
  font-size: clamp(48px, 9vw, 96px);
  text-align: center;
}

h2 {
  font-size: 15px;
  color: var(--teal);
  text-transform: uppercase;
  letter-spacing: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 12px;
}

.topbar p,
.hint {
  color: var(--muted);
  font-size: 14px;
  margin-top: 6px;
}

.room-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.room-tabs button {
  display: grid;
  grid-template-columns: auto minmax(18px, auto);
  align-items: center;
  gap: 8px;
  min-height: 36px;
  border-color: var(--line);
  background: #171b18;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.room-tabs small {
  display: grid;
  place-items: center;
  min-width: 20px;
  min-height: 20px;
  border-radius: 999px;
  background: rgba(91, 214, 199, 0.16);
  color: var(--teal);
  font-size: 12px;
}

.room-tabs button.active {
  border-color: var(--teal);
  background: var(--panel-strong);
  color: var(--teal);
}

.zoom-controls {
  display: grid;
  grid-template-columns: 34px 54px 34px;
  align-items: center;
  gap: 6px;
}

.zoom-controls button {
  min-height: 34px;
  padding: 0;
  border-color: var(--line);
  background: #171b18;
  color: var(--text);
}

.zoom-controls button:disabled {
  cursor: default;
  opacity: 0.45;
}

.zoom-controls span {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

#worldCanvas {
  width: 100%;
  height: calc(100vh - 156px);
  min-height: 460px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #233129;
  image-rendering: auto;
  touch-action: none;
}

.whiteboard-tools {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 4;
  display: grid;
  grid-template-columns: auto 42px auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(91, 214, 199, 0.5);
  border-radius: 8px;
  background: rgba(23, 27, 24, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.32);
  padding: 8px;
}

.whiteboard-tools span {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
}

.whiteboard-tools input {
  min-height: 34px;
  width: 42px;
  border-color: var(--line);
  padding: 3px;
}

.whiteboard-tools button {
  min-height: 34px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
}

.side-panel {
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 12px;
  height: calc(100vh - 32px);
}

.tool-section {
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 8px;
  background: rgba(31, 36, 33, 0.92);
  padding: 13px;
  backdrop-filter: blur(10px);
}

.upload-zone {
  display: grid;
  place-items: center;
  min-height: 48px;
  margin-top: 12px;
  border: 1px dashed rgba(244, 240, 232, 0.22);
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: center;
}

.studio-link,
.you-links button {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  margin-top: 10px;
  border: 1px solid rgba(91, 214, 199, 0.38);
  border-radius: 6px;
  background: rgba(91, 214, 199, 0.1);
  color: var(--teal);
  font-size: 13px;
  font-weight: 750;
  padding: 0 12px;
  text-decoration: none;
}

.you-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.you-links .studio-link,
.you-links button {
  margin-top: 0;
}

.secondary-link {
  border-color: rgba(244, 240, 232, 0.14);
  background: rgba(244, 240, 232, 0.06);
  color: var(--text);
}

.profile-summary {
  display: grid;
  gap: 4px;
  margin-top: 12px;
  border-left: 3px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: rgba(23, 27, 24, 0.68);
  padding: 10px;
}

.profile-summary strong {
  color: var(--gold);
  font-size: 16px;
}

.profile-summary span {
  color: var(--text);
  overflow-wrap: anywhere;
}

.profile-summary small {
  color: var(--muted);
}

.upload-zone input {
  display: none;
}

.mood-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.mood-chips button,
.profile-actions button {
  min-height: 32px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
  padding: 0 10px;
}

.chat-section {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 0;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: auto;
  padding: 12px 2px 6px;
  scrollbar-color: var(--line) transparent;
}

.typing-indicator {
  min-height: 20px;
  color: var(--muted);
  font-size: 13px;
  padding: 0 2px 6px;
}

.chat-message {
  border-left: 3px solid var(--rose);
  padding: 9px 10px;
  background: rgba(23, 27, 24, 0.86);
  border-radius: 0 8px 8px 0;
  overflow-wrap: anywhere;
}

.chat-message.system-message {
  border-left-color: var(--teal);
  color: var(--muted);
}

.chat-message.action-message {
  border-left-color: var(--gold);
  font-style: italic;
}

.chat-message.whisper-message {
  border-left-color: var(--teal);
  background: #13201f;
}

.chat-message strong {
  color: var(--gold);
  display: block;
  font-size: 13px;
  margin-bottom: 3px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.command-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.command-row button {
  min-height: 34px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.community-stats {
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}

.person-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
  min-height: 0;
  padding: 6px 10px;
}

.profile-popover {
  position: fixed;
  z-index: 5;
  display: grid;
  gap: 5px;
  width: min(260px, calc(100vw - 24px));
  border: 1px solid rgba(244, 184, 96, 0.65);
  border-radius: 8px;
  background: rgba(23, 27, 24, 0.97);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  padding: 12px;
}

.pose-menu {
  position: fixed;
  z-index: 6;
  display: grid;
  gap: 6px;
  width: min(200px, calc(100vw - 24px));
  border: 1px solid rgba(91, 214, 199, 0.65);
  border-radius: 8px;
  background: rgba(23, 27, 24, 0.98);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.38);
  padding: 8px;
}

.pose-menu button {
  justify-content: start;
  min-height: 34px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  text-align: left;
}

.pose-menu small {
  color: var(--muted);
  padding: 8px;
}

.arcade-modal {
  position: fixed;
  inset: 0;
  z-index: 7;
  display: grid;
  place-items: center;
  background: rgba(10, 12, 12, 0.38);
  padding: 16px;
}

.arcade-window {
  display: grid;
  gap: 12px;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid rgba(91, 214, 199, 0.62);
  border-radius: 8px;
  background: rgba(23, 27, 24, 0.98);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.48);
  padding: 14px;
}

.arcade-header,
.arcade-balance,
.arcade-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.arcade-header strong {
  display: block;
  color: var(--gold);
  font-size: 18px;
}

.arcade-header span,
.arcade-balance span,
.arcade-machine small,
.arcade-shop small {
  color: var(--muted);
  font-size: 13px;
}

#arcadeClose {
  min-width: 34px;
  min-height: 34px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  padding: 0;
}

.arcade-balance {
  border: 1px solid rgba(244, 240, 232, 0.09);
  border-radius: 8px;
  background: rgba(12, 15, 13, 0.45);
  padding: 10px;
}

.arcade-balance strong {
  color: var(--teal);
  font-size: 24px;
}

.arcade-game,
.arcade-machine,
.arcade-shop {
  display: grid;
  gap: 10px;
}

.arcade-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.arcade-tabs button {
  min-height: 34px;
  border-color: var(--line);
  background: #171b18;
  color: var(--text);
  font-size: 13px;
}

.arcade-tabs button.active {
  border-color: var(--teal);
  background: var(--panel-strong);
  color: var(--teal);
}

.arcade-machine {
  border: 1px solid rgba(244, 240, 232, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(91, 214, 199, 0.08), transparent 55%),
    rgba(12, 15, 13, 0.45);
  padding: 12px;
}

.slot-reels,
.dice-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.slot-machine {
  position: relative;
  overflow: hidden;
  border-color: rgba(244, 184, 96, 0.38);
  background:
    linear-gradient(180deg, rgba(244, 184, 96, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(242, 140, 165, 0.08), transparent 60%),
    rgba(12, 15, 13, 0.62);
}

.slot-marquee {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid rgba(244, 184, 96, 0.44);
  border-radius: 8px;
  background: #101412;
  color: var(--gold);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
  text-shadow: 0 0 12px rgba(244, 184, 96, 0.55);
}

.slot-reels {
  position: relative;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 8px;
  background: #070908;
  padding: 8px;
}

.slot-controls,
.slot-lever-row,
.slot-stop-row,
.slot-lines {
  display: grid;
  gap: 8px;
}

.slot-controls {
  grid-template-columns: auto repeat(3, 1fr);
  align-items: center;
}

.slot-controls span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.slot-controls button,
.slot-stop-row button {
  min-height: 34px;
  border-color: var(--line);
  background: #171b18;
  color: var(--text);
  font-size: 13px;
}

.slot-controls button.active {
  border-color: var(--gold);
  background: rgba(244, 184, 96, 0.18);
  color: var(--gold);
}

.slot-lever-row {
  grid-template-columns: minmax(0, 1fr);
}

.slot-pull {
  min-height: 46px;
  border-color: #d1933e;
  background: linear-gradient(180deg, #ffc46b, #d69235);
  color: #251705;
  font-size: 16px;
  text-transform: uppercase;
}

.slot-stop-row {
  grid-template-columns: repeat(3, 1fr);
}

.slot-lines {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.slot-lines span {
  display: grid;
  place-items: center;
  min-height: 26px;
  border: 1px solid rgba(244, 240, 232, 0.08);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.slot-lines span.active {
  border-color: rgba(91, 214, 199, 0.5);
  background: rgba(91, 214, 199, 0.1);
  color: var(--teal);
}

.slot-reels::after {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: calc(50% - 25px);
  height: 50px;
  border-top: 1px solid rgba(244, 184, 96, 0.65);
  border-bottom: 1px solid rgba(244, 184, 96, 0.65);
  pointer-events: none;
}

.slot-reels.bet-2::before,
.slot-reels.bet-3::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 28px;
  bottom: 28px;
  border-top: 1px solid rgba(91, 214, 199, 0.45);
  border-bottom: 1px solid rgba(91, 214, 199, 0.45);
  pointer-events: none;
}

.slot-reels.bet-3 {
  background:
    linear-gradient(32deg, transparent 48%, rgba(242, 140, 165, 0.22) 49%, rgba(242, 140, 165, 0.22) 51%, transparent 52%),
    linear-gradient(148deg, transparent 48%, rgba(242, 140, 165, 0.22) 49%, rgba(242, 140, 165, 0.22) 51%, transparent 52%),
    #070908;
}

.slot-reel {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.slot-symbol,
.dice-face {
  display: grid;
  place-items: center;
  min-height: 58px;
  border: 1px solid rgba(244, 184, 96, 0.36);
  border-radius: 8px;
  background: #101412;
  color: var(--gold);
  font-size: 26px;
  font-weight: 900;
}

.slot-symbol {
  position: relative;
  overflow: hidden;
}

.slot-symbol img {
  display: none;
  width: min(70%, 54px);
  height: min(70%, 54px);
  object-fit: contain;
}

.slot-symbol.has-image img {
  display: block;
}

.slot-symbol.has-image b {
  display: none;
}

.payline-symbol {
  background:
    radial-gradient(circle at 50% 20%, rgba(244, 184, 96, 0.16), transparent 54%),
    #101412;
}

.slot-reel:not(.stopped) .slot-symbol {
  animation: slot-roll 0.16s linear infinite;
  color: var(--teal);
}

.slot-reel:not(.stopped):nth-child(2) .slot-symbol {
  animation-delay: 0.05s;
}

.slot-reel:not(.stopped):nth-child(3) .slot-symbol {
  animation-delay: 0.1s;
}

.slot-payline {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

@keyframes slot-roll {
  0% {
    transform: translateY(-7px);
    filter: brightness(1.2);
  }

  50% {
    transform: translateY(7px);
    filter: brightness(0.82);
  }

  100% {
    transform: translateY(-7px);
    filter: brightness(1.2);
  }
}

.dice-machine .dice-row {
  grid-template-columns: repeat(2, 1fr);
}

.dice-face {
  gap: 3px;
  color: var(--text);
}

.dice-face strong {
  color: var(--gold);
  font-size: 34px;
}

.dice-face small {
  color: var(--muted);
  font-size: 12px;
}

.arcade-result {
  min-height: 40px;
  border-left: 3px solid var(--gold);
  background: rgba(23, 27, 24, 0.72);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  padding: 9px 10px;
}

.arcade-result:empty {
  display: none;
}

.arcade-result button,
.arcade-shop button {
  min-height: 32px;
  border-color: var(--line);
  background: var(--panel-strong);
  color: var(--text);
  font-size: 13px;
}

.arcade-shop {
  border-top: 1px solid rgba(244, 240, 232, 0.09);
  padding-top: 10px;
}

.arcade-shop strong {
  color: var(--gold);
}

.arcade-shop button {
  text-align: left;
}

.arcade-shop button:disabled {
  cursor: default;
  opacity: 0.55;
}

.profile-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.profile-actions button.danger {
  border-color: #7f3f4b;
  color: #ffc9d3;
}

.profile-popover strong {
  color: var(--gold);
}

.profile-popover span {
  color: var(--text);
  overflow-wrap: anywhere;
}

.profile-popover small {
  color: var(--muted);
}

.profile-meta {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.profile-meta b {
  color: var(--teal);
  font-weight: 750;
}

@media (max-width: 900px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-logo,
  .auth-copy,
  .auth-form,
  .auth-note {
    grid-column: 1;
  }

  .auth-logo.text-logo {
    font-size: clamp(46px, 18vw, 74px);
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  #worldCanvas {
    height: 58vh;
  }

  .side-panel {
    height: auto;
  }

  .topbar {
    align-items: stretch;
    grid-template-columns: 1fr;
    padding-bottom: 12px;
  }

  .brand-logo {
    height: 86px;
    max-width: min(280px, 78vw);
  }

  .text-logo {
    font-size: 46px;
  }

  .room-tabs {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .you-links {
    grid-template-columns: 1fr;
  }
}

.studio-body {
  min-height: 100vh;
}

.studio-shell {
  display: grid;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px;
}

.profile-shell {
  display: grid;
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
  padding: 20px;
}

.profile-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-card-large {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 18px;
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 8px;
  background: rgba(31, 36, 33, 0.92);
  padding: 16px;
}

.profile-avatar-frame {
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 240, 232, 0.09);
  border-radius: 8px;
  background: rgba(12, 15, 13, 0.45);
  min-height: 420px;
}

#profilePreview {
  width: min(100%, 340px);
  height: auto;
  border-radius: 8px;
}

.profile-details {
  display: grid;
  align-content: center;
  gap: 12px;
}

.profile-kicker {
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-details h2 {
  color: var(--gold);
  font-size: 34px;
  text-transform: none;
}

.profile-details p {
  color: var(--text);
  font-size: 18px;
}

.profile-details dl {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
}

.profile-details dl div {
  display: grid;
  gap: 4px;
  border-left: 3px solid var(--teal);
  background: rgba(23, 27, 24, 0.68);
  border-radius: 0 8px 8px 0;
  padding: 10px;
}

.profile-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.profile-details dd {
  margin: 0;
  color: var(--text);
}

.studio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(244, 240, 232, 0.11);
  padding-bottom: 16px;
}

.studio-header p {
  color: var(--muted);
  margin-top: 6px;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) 380px;
  gap: 16px;
}

.studio-preview-panel,
.studio-form-panel {
  border: 1px solid rgba(244, 240, 232, 0.1);
  border-radius: 8px;
  background: rgba(31, 36, 33, 0.92);
  padding: 14px;
}

.avatar-preview-stage {
  display: grid;
  place-items: center;
  min-height: 420px;
  margin-top: 12px;
  border: 1px solid rgba(244, 240, 232, 0.09);
  border-radius: 8px;
  background: rgba(12, 15, 13, 0.45);
}

#studioPreview {
  width: min(100%, 420px);
  height: auto;
  border-radius: 8px;
}

.studio-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

.custom-pose-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 10px;
}

.pose-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.pose-tabs button {
  display: grid;
  gap: 3px;
  min-height: 48px;
  border-color: var(--line);
  background: #171b18;
  color: var(--text);
  padding: 7px 8px;
}

.pose-tabs button.active {
  border-color: var(--teal);
  background: var(--panel-strong);
  color: var(--teal);
}

.pose-tabs small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.studio-upload {
  margin-top: 12px;
}

.studio-form-panel {
  display: grid;
  align-content: start;
  gap: 12px;
}

.studio-form-panel label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.studio-note {
  display: grid;
  gap: 5px;
  border-left: 3px solid var(--gold);
  background: rgba(23, 27, 24, 0.68);
  border-radius: 0 8px 8px 0;
  padding: 10px;
}

.studio-note strong {
  color: var(--gold);
  font-size: 13px;
}

.studio-note span {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.pose-checklist {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(244, 240, 232, 0.09);
  border-radius: 8px;
  background: rgba(23, 27, 24, 0.5);
  padding: 10px;
}

.pose-checklist > strong {
  color: var(--gold);
  font-size: 13px;
}

#poseChecklist {
  display: grid;
  gap: 6px;
}

#poseChecklist div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

#poseChecklist div.complete {
  color: var(--teal);
}

#poseChecklist span {
  color: var(--text);
  font-weight: 700;
}

@media (max-width: 850px) {
  .studio-header {
    align-items: stretch;
    flex-direction: column;
  }

  .studio-grid {
    grid-template-columns: 1fr;
  }

  .profile-card-large {
    grid-template-columns: 1fr;
  }

  .studio-actions {
    grid-template-columns: 1fr;
  }
}
