:root {
  --ivory: #fdfaf5;
  --warm-white: #fff8ee;
  --parchment: #f2ebd9;
  --dark: #1e1a14;
  --brown: #3d2e1e;
  --rose: #c4614a;
  --rose-soft: #f0c4b8;
  --rose-pale: #fdf0ec;
  --gold: #c9962a;
  --gold-pale: #fbf4e3;
  --sage: #6b7b5e;
  --sage-pale: #eef2eb;
  --muted: #8a7a6a;
  --line: #e2d8cc;
  --ok: #2f855a;
  --warn: #b7791f;
  --err: #b83250;
}

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

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

body {
  font-family: "Nunito", sans-serif;
  color: var(--dark);
  background:
    radial-gradient(circle at 8% 8%, rgba(196, 97, 74, 0.1), transparent 42%),
    radial-gradient(circle at 100% 0%, rgba(201, 150, 42, 0.12), transparent 45%),
    linear-gradient(180deg, var(--ivory), var(--warm-white));
}

body.login-page {
  background:
    radial-gradient(circle at 12% 15%, rgba(196, 97, 74, 0.2), transparent 38%),
    radial-gradient(circle at 88% 10%, rgba(201, 150, 42, 0.16), transparent 34%),
    radial-gradient(circle at 70% 95%, rgba(107, 123, 94, 0.12), transparent 36%),
    linear-gradient(180deg, #fffaf2, #fdf7ef);
}

a {
  color: inherit;
}

.page {
  width: min(1220px, calc(100% - 28px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.brand-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.brand-link {
  text-decoration: none;
  font-family: "Lora", serif;
  font-style: italic;
  color: var(--rose);
  font-size: 24px;
}

.brand-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.card {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff, #fff9f1);
  border-radius: 18px;
  box-shadow: 0 16px 44px rgba(61, 46, 30, 0.12);
}

.auth-wrap {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
}

.auth-wrap-login {
  align-content: center;
  gap: 14px;
}

.back-home-pill {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid #d8c8b7;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 8px 20px rgba(61, 46, 30, 0.08);
  text-decoration: none;
  color: var(--brown);
  font-weight: 700;
  font-size: 13px;
}

.back-home-pill:hover {
  border-color: var(--rose);
  color: var(--rose);
}

.auth-layout {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: minmax(300px, 1.05fr) minmax(340px, 0.95fr);
  gap: 14px;
}

.login-hero {
  padding: 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 8%, rgba(196, 97, 74, 0.16), transparent 42%),
    radial-gradient(circle at 8% 100%, rgba(201, 150, 42, 0.15), transparent 50%),
    linear-gradient(160deg, #fffaf5, #fff3e8);
}

.login-hero::after {
  content: "";
  position: absolute;
  width: 240px;
  height: 240px;
  right: -120px;
  bottom: -115px;
  border-radius: 999px;
  background: radial-gradient(circle at center, rgba(196, 97, 74, 0.18), transparent 66%);
}

.login-hero h2 {
  margin: 12px 0 8px;
  font-size: clamp(29px, 4.2vw, 43px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  font-family: "Lora", serif;
  color: var(--brown);
}

.login-hero p {
  margin: 0;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.75;
  color: #705f4d;
}

.login-feature-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
  max-width: 54ch;
}

.login-feature-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  color: #5f4f3f;
}

.login-feature-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--rose);
  font-weight: 800;
}

.auth-card {
  width: min(520px, 100%);
  padding: 24px;
}

.login-card {
  width: 100%;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), #fff8f0),
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 35px,
      rgba(196, 97, 74, 0.02) 35px,
      rgba(196, 97, 74, 0.02) 36px
    );
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--rose);
  font-size: 11px;
  font-weight: 800;
}

h1 {
  margin: 10px 0 8px;
  font-size: 33px;
  line-height: 1.1;
  font-family: "Lora", serif;
  font-weight: 600;
  color: var(--brown);
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.grid {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field label {
  font-size: 13px;
  color: var(--brown);
  font-weight: 700;
}

.field input {
  width: 100%;
  border: 1px solid #d8c8b7;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  font-family: "Nunito", sans-serif;
  background: #fff;
  color: var(--dark);
}

.field select {
  width: 100%;
  border: 1px solid #d8c8b7;
  border-radius: 10px;
  padding: 10px 11px;
  font-size: 14px;
  font-family: "Nunito", sans-serif;
  background: #fff;
  color: var(--dark);
}

.field input:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(196, 97, 74, 0.14);
}

.field select:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(196, 97, 74, 0.14);
}

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

.auth-actions .btn {
  width: 100%;
  justify-content: center;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font-family: "Nunito", sans-serif;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 800;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--rose);
  color: #fff;
}

.btn-primary:hover {
  background: #b05540;
}

.btn-secondary {
  background: #fff;
  border-color: #cfbea7;
  color: var(--brown);
}

.btn-danger {
  background: #fbe5e8;
  border-color: #efb6c3;
  color: #8c2345;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 12px;
}

.status {
  min-height: 18px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.status.ok {
  color: var(--ok);
}

.status.warn {
  color: var(--warn);
}

.status.err {
  color: var(--err);
}

.helper {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.helper-inline {
  margin-top: 0;
  text-align: right;
}

.helper a {
  color: var(--rose);
  font-weight: 700;
}

.muted {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.muted a {
  color: var(--rose);
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
  gap: 14px;
}

.panel {
  padding: 16px;
}

.panel h2 {
  margin: 0;
  font-family: "Lora", serif;
  color: var(--brown);
  font-size: 23px;
}

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

.stack {
  display: grid;
  gap: 10px;
}

.meta-strip {
  border: 1px dashed #dfcfbc;
  border-radius: 12px;
  background: #fffaf2;
  padding: 10px;
  display: grid;
  gap: 5px;
}

.meta-row {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

.game-panel {
  display: grid;
  gap: 10px;
}

.game-shell {
  border-radius: 16px;
  border: 1px solid #dbcab4;
  overflow: hidden;
  background: #2f2218;
  position: relative;
}

.game-iframe {
  width: 100%;
  height: min(78vh, 760px);
  border: 0;
  display: block;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1px solid #ddccb7;
  background: #fffaf4;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  color: #6e5c49;
}

.dashboard-page {
  background:
    linear-gradient(rgba(255, 255, 255, 0.55) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    radial-gradient(circle at 8% 12%, rgba(196, 97, 74, 0.13), transparent 34%),
    radial-gradient(circle at 92% 4%, rgba(107, 123, 94, 0.16), transparent 32%),
    linear-gradient(180deg, #fff9f1, #f8eee3);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
}

.dashboard-page-shell {
  width: min(1500px, calc(100% - 32px));
  padding-top: 18px;
}

.dashboard-page .brand-topbar {
  padding: 10px 0 14px;
  margin-bottom: 10px;
}

.brand-stack {
  display: grid;
  gap: 1px;
}

.brand-stack span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-page .card {
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(61, 46, 30, 0.13);
}

.dashboard-page .btn,
.dashboard-page .field input,
.dashboard-page .field select {
  border-radius: 8px;
}

.dashboard-page .btn {
  min-height: 38px;
}

.dashboard-page .dashboard-grid {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.creator-panel {
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.creator-panel::-webkit-scrollbar {
  width: 8px;
}

.creator-panel::-webkit-scrollbar-track {
  background: rgba(226, 216, 204, 0.4);
  border-radius: 999px;
}

.creator-panel::-webkit-scrollbar-thumb {
  background: rgba(196, 97, 74, 0.45);
  border-radius: 999px;
}

.creator-panel .panel-head {
  margin-bottom: 0;
}

.control-group {
  border: 1px solid rgba(226, 216, 204, 0.9);
  background: rgba(255, 252, 246, 0.78);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 10px;
}

.control-group-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(226, 216, 204, 0.85);
}

.control-group-head span {
  color: var(--brown);
  font-size: 13px;
  font-weight: 900;
}

.control-group-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.actions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 2px;
}

.actions-grid .btn {
  width: 100%;
}

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

.publish-summary {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(107, 123, 94, 0.2);
  background: rgba(238, 242, 235, 0.6);
  border-radius: 8px;
  padding: 10px;
}

.compact-copy {
  line-height: 1.55;
}

.dashboard-page .meta-strip {
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 250, 242, 0.92), rgba(238, 242, 235, 0.68));
}

.dashboard-page .chip {
  border-radius: 8px;
  background: #fff;
}

.game-panel {
  min-width: 0;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 249, 241, 0.98)),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 38px,
      rgba(107, 123, 94, 0.035) 38px,
      rgba(107, 123, 94, 0.035) 39px
    );
}

.game-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  padding: 2px 2px 4px;
}

.game-panel-head h2 {
  margin: 5px 0 0;
  font-family: "Lora", serif;
  color: var(--brown);
  font-size: clamp(24px, 2.5vw, 36px);
  line-height: 1;
}

.game-hints {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.game-hints span {
  border: 1px solid rgba(107, 123, 94, 0.26);
  background: rgba(238, 242, 235, 0.88);
  border-radius: 8px;
  color: #4d5e43;
  font-size: 12px;
  font-weight: 900;
  padding: 7px 9px;
}

.dashboard-page .game-shell {
  border-radius: 8px;
  border: 1px solid rgba(61, 46, 30, 0.22);
  background: #19140f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 42px rgba(61, 46, 30, 0.18);
}

.game-shell-topbar {
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, #2b2118, #1e1712);
  color: rgba(255, 248, 238, 0.78);
  font-size: 12px;
}

.game-shell-topbar strong {
  margin-left: 4px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.window-dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
  background: #d36c58;
}

.window-dot:nth-child(2) {
  background: #d8a43a;
}

.window-dot:nth-child(3) {
  background: #7f9a6b;
}

.dashboard-page .game-iframe {
  height: clamp(560px, calc(100vh - 178px), 820px);
  background: #202020;
}

@media (max-width: 1040px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-page .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .creator-panel {
    position: static;
    max-height: none;
  }

  .auth-layout {
    grid-template-columns: 1fr;
  }

  .game-iframe {
    height: min(72vh, 640px);
  }

  .dashboard-page .game-iframe {
    height: min(72vh, 680px);
  }
}

@media (max-width: 680px) {
  .page {
    width: min(1220px, calc(100% - 18px));
    padding-top: 16px;
  }

  .brand-link {
    font-size: 20px;
  }

  .brand-topbar {
    flex-wrap: wrap;
  }

  .dashboard-page-shell {
    width: min(1220px, calc(100% - 18px));
    padding-top: 12px;
  }

  .dashboard-page .brand-topbar {
    align-items: flex-start;
  }

  .login-hero,
  .login-card {
    padding: 22px;
  }

  .back-home-pill {
    width: 100%;
    justify-content: center;
  }

  h1 {
    font-size: 28px;
  }

  .actions,
  .brand-actions {
    width: 100%;
  }

  .actions .btn,
  .brand-actions .btn {
    flex: 1;
  }

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

  .game-panel {
    padding: 10px;
  }

  .game-panel-head {
    align-items: start;
    flex-direction: column;
    gap: 10px;
  }

  .game-hints {
    justify-content: flex-start;
  }

  .game-iframe {
    height: min(68vh, 560px);
  }

  .dashboard-page .game-iframe {
    height: min(68vh, 560px);
  }
}
