@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap");

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  background: #0d1117;
  color: #e8ecf5;
  min-height: 100vh;
}

#app {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 22px 60px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: #111827;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}
.brand .dot {
  width: 12px;
  height: 12px;
  background: #5b8def;
  border-radius: 50%;
}
.auth {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 18px 18px 20px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel h2 {
  margin: 2px 0 0;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9ab0d6;
}

.hidden {
  display: none !important;
}

#banner {
  background: rgba(255, 97, 97, 0.1);
  border: 1px solid rgba(255, 97, 97, 0.35);
  color: #ffcaca;
  padding: 10px 12px;
  border-radius: 10px;
  margin: 8px 0 14px;
}

.landing {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px 20px 40px;
  text-align: center;
}
.landing-content {
  max-width: 620px;
  background: #0f1624;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 32px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.32);
}
.landing .pill {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(108, 123, 255, 0.12);
  color: #c7d3ff;
  border: 1px solid rgba(108, 123, 255, 0.3);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.landing h1 {
  margin: 0 0 10px;
  font-size: 28px;
  letter-spacing: -0.02em;
}
.landing p {
  color: #c4ccda;
  margin: 0 0 18px;
}
.landing .primary.large {
  padding: 14px 20px;
  font-size: 16px;
}

button {
  background: #5b8def;
  color: #fff;
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  box-shadow: 0 8px 16px rgba(91, 141, 239, 0.28);
}
button.primary {
  background: #5b8def;
}
button.twitch {
  background: #9146ff;
}
button.twitch:hover{
  background: #7e3fde;
}
button.twitch {
  background: #9146ff;
}
button.secondary {
  background: rgba(255, 255, 255, 0.08);
  box-shadow: none;
}
button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: none;
}
button:hover {
  transform: translateY(-1px);
}

input[type="text"],
input[type="number"],
input[type="color"],
input[type="file"],
select,
input[readonly] {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f5f6f8;
  padding: 9px 10px;
  border-radius: 10px;
  width: 100%;
}
input[type="range"] {
  width: 100%;
}
label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.grid {
  display: grid;
  gap: 12px 16px;
}
.grid.cols-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.providers label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.theme-tabs {
  display: flex;
  gap: 8px;
  margin: 14px 0;
}
.theme-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid transparent;
}
.theme-tab.active {
  border-color: #5b8def;
  box-shadow: 0 6px 16px rgba(91, 141, 239, 0.25);
}

.theme-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.switch {
  position: relative;
  padding-right: 56px;
}
.switch input {
  position: absolute;
  opacity: 0;
}
.switch .slider {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.switch .slider::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: all 0.2s ease;
}
.switch input:checked + .slider {
  background: #6c7bff;
}
.switch input:checked + .slider::after {
  transform: translateX(18px);
}

.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.row .full {
  flex: 1 1 100%;
}
.actions.compact {
  gap: 8px;
}

#user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
}
#user-chip img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
}

#preview-area {
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
}
#preview-scene {
  position: relative;
  height: 220px;
  overflow: hidden;
}
#preview-train {
  position: absolute;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  transform: translateX(120%);
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3));
}
#preview-train.active {
  animation: preview-wobble 1s ease-in-out infinite alternate;
}
#preview-train.enter {
  animation: preview-enter 1s ease-out forwards;
}
#preview-train.leave {
  animation: preview-leave 1s ease-in forwards;
}
.preview-engine,
.preview-wagon {
  width: 200px;
  height: 120px;
  background: #ff6b6b;
  border-radius: 12px 12px 0 0;
  border: 5px solid rgba(255, 255, 255, 0.15);
  padding: 10px;
  position: relative;
}
.engine-face,
.wagon-face {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  height: 50px;
}
.engine-level {
  color: #fff;
  font-weight: 700;
  padding: 6px;
}
.engine-wheels,
.wagon-wheels {
  display: flex;
  gap: 8px;
  position: absolute;
  bottom: -22px;
  left: 18px;
}
.wheel {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #111;
  border: 4px solid #333;
  animation: spin 1s linear infinite;
}
.wheel.small {
  width: 26px;
  height: 26px;
}

@keyframes preview-enter {
  from {
    transform: translateX(120%);
  }
  to {
    transform: translateX(0);
  }
}
@keyframes preview-leave {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-140%);
  }
}
@keyframes preview-wobble {
  from {
    transform: translateX(0) translateY(0);
  }
  to {
    transform: translateX(0) translateY(-4px);
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
