:root {
  color-scheme: dark;
  --cyan: #00ffff;
  --blue: #042035;
  --purple: #4d2f98;
  --green: #53fc18;
  --red: #ff4567;
  --bg: #061019;
  --panel: rgba(9, 25, 38, 0.82);
  --panel-2: rgba(14, 36, 53, 0.88);
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(0, 255, 255, 0.34);
  --text: #eefaff;
  --muted: #9bb8c8;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(0, 255, 255, 0.18), transparent 30rem),
    radial-gradient(circle at 88% 12%, rgba(77, 47, 152, 0.28), transparent 34rem),
    linear-gradient(135deg, #03080d 0%, var(--blue) 50%, #10111c 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.auth-screen,
.access-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: clamp(22px, 5vw, 72px);
}

.auth-card,
.access-card {
  position: relative;
  width: min(940px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(77, 47, 152, 0.12)),
    rgba(4, 16, 26, 0.76);
  box-shadow: var(--shadow);
  padding: clamp(28px, 6vw, 66px);
  overflow: hidden;
}

.auth-card::after,
.access-card::after {
  content: "";
  position: absolute;
  right: -90px;
  top: 50%;
  width: 360px;
  height: 360px;
  transform: translateY(-50%);
  background: url("/assets/tntstudios-icon.png") center / contain no-repeat;
  opacity: 0.08;
  pointer-events: none;
}

.auth-brandline {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 46px;
}

.auth-icon {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  object-fit: contain;
  box-shadow: 0 0 34px rgba(0, 255, 255, 0.16);
}

.auth-brandline strong,
.auth-brandline span {
  display: block;
}

.auth-brandline strong {
  font-size: 22px;
  font-weight: 950;
}

.auth-brandline span {
  color: var(--muted);
  font-size: 13px;
}

.auth-card h1,
.access-card h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 780px;
  font-size: clamp(42px, 6.5vw, 86px);
  line-height: 0.95;
  letter-spacing: 0;
}

.access-card h1 {
  max-width: 680px;
  font-size: clamp(30px, 5vw, 56px);
}

.auth-actions,
.header-actions,
.toolbar-actions,
.stack-actions,
.simulator-bar,
.overlay-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.auth-actions {
  position: relative;
  z-index: 1;
  margin-top: 26px;
}

.button {
  border: 1px solid rgba(255, 255, 255, 0.12);
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  font-weight: 800;
  cursor: pointer;
}

.button.primary {
  color: #001015;
  background: var(--cyan);
  border-color: transparent;
  box-shadow: 0 0 28px rgba(0, 255, 255, 0.2);
}

.button.soft {
  background: rgba(255, 255, 255, 0.08);
}

.button.danger {
  background: rgba(255, 69, 103, 0.16);
  border-color: rgba(255, 69, 103, 0.42);
}

.button.twitch {
  background: #9146ff;
  border-color: transparent;
}

.button.kick {
  color: #051605;
  background: var(--green);
  border-color: transparent;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--cyan);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.muted {
  color: var(--muted);
}

.auth-card > .muted,
.access-card > .muted,
.auth-card > .eyebrow,
.access-card > .eyebrow {
  position: relative;
  z-index: 1;
}

.auth-card > .muted,
.access-card > .muted {
  max-width: 680px;
  font-size: 18px;
  line-height: 1.55;
}

.studio-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.studio-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 24px;
  padding: 22px;
  border-right: 1px solid var(--line);
  background: rgba(2, 10, 17, 0.76);
  backdrop-filter: blur(16px);
}

.studio-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.studio-brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
}

.studio-nav {
  display: grid;
  gap: 8px;
  align-content: start;
}

.nav-item {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  padding: 12px;
  cursor: pointer;
}

.nav-item.active,
.nav-item:hover {
  color: var(--text);
  border-color: rgba(0, 255, 255, 0.18);
  background: rgba(0, 255, 255, 0.08);
}

.sidebar-profile {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-profile span {
  font-weight: 900;
}

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

.studio-main {
  padding: 28px clamp(18px, 4vw, 44px) 54px;
}

.studio-header,
.panel-heading,
.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.studio-header {
  margin-bottom: 22px;
}

.studio-header h1,
.panel h2,
.workband h2,
.preview-toolbar h2,
.empty-state h2 {
  margin: 0;
  letter-spacing: 0;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.metric-card,
.panel,
.workband {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  padding: 18px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
}

.metric-card strong {
  font-size: 28px;
}

.workband {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  margin-bottom: 18px;
  background:
    linear-gradient(135deg, rgba(0, 255, 255, 0.12), rgba(77, 47, 152, 0.18)),
    var(--panel);
}

.panel {
  padding: 20px;
  margin-bottom: 18px;
}

.hero-panel-flat {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.provider-list,
.overlay-library,
.admin-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.provider-row,
.overlay-card,
.admin-row,
.empty-inline {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 14px;
}

.overlay-card,
.admin-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.overlay-card h3 {
  margin: 0 0 8px;
  font-size: 21px;
}

.url {
  margin: 0;
  color: var(--cyan);
  overflow-wrap: anywhere;
}

.import-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.import-grid .panel:last-child {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.compact-field {
  margin-top: 0;
}

.field span {
  color: var(--muted);
  font-size: 14px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(3, 14, 23, 0.84);
  padding: 11px 12px;
  outline: none;
}

.field input:focus,
.field textarea:focus,
.code-editor:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(0, 255, 255, 0.12);
}

.field textarea {
  min-height: 220px;
  resize: vertical;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
}

.file-button {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  cursor: pointer;
}

.file-button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.bookmarklet-box {
  display: grid;
  gap: 10px;
  margin: 16px 0;
  padding: 12px;
  border: 1px dashed rgba(0, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(0, 255, 255, 0.06);
}

.bookmarklet-box[hidden] {
  display: none;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas:
    "preview inspector"
    "code code";
  gap: 18px;
}

.preview-column {
  grid-area: preview;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 16px;
}

.preview-frame-wrap {
  margin-top: 16px;
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.06) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.06) 75%),
    linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.06) 75%);
  background-size: 28px 28px;
  background-position: 0 0, 0 14px, 14px -14px, -14px 0;
  overflow: hidden;
}

.preview-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
}

.simulator-bar {
  margin-top: 12px;
}

.inspector-column {
  grid-area: inspector;
}

.inspector-panel {
  margin: 0;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.code-panel {
  grid-area: code;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.code-tabs {
  display: flex;
  gap: 6px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.code-tab {
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  padding: 9px 14px;
  cursor: pointer;
}

.code-tab.active {
  color: var(--text);
  border-color: rgba(0, 255, 255, 0.26);
  background: rgba(0, 255, 255, 0.1);
}

.code-editor {
  display: none;
  width: 100%;
  min-height: 380px;
  border: 0;
  color: #e8fbff;
  background: rgba(3, 10, 17, 0.94);
  padding: 16px;
  resize: vertical;
  outline: none;
  font-family: "Cascadia Code", Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.active-code {
  display: block;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 30px;
}

.status-badge {
  display: inline-flex;
  margin-left: 8px;
  border-radius: 8px;
  padding: 4px 8px;
  color: #001015;
  background: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.status-badge.pending {
  color: #2b2200;
  background: #ffd166;
}

.status-badge.denied {
  color: #25000a;
  background: #ff8aa0;
}

.status-badge.approved {
  color: #031703;
  background: var(--green);
}

@media (max-width: 1120px) {
  .studio-shell,
  .editor-layout,
  .import-grid {
    grid-template-columns: 1fr;
  }

  .editor-layout {
    grid-template-areas:
      "preview"
      "inspector"
      "code";
  }

  .studio-sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 720px) {
  .studio-main {
    padding: 18px;
  }

  .studio-header,
  .panel-heading,
  .workband,
  .hero-panel-flat,
  .preview-toolbar,
  .overlay-card,
  .admin-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .metric-grid,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .button {
    width: 100%;
  }
}
