:root {
  --bg: #0a0a0a;
  --surface: #1d1d1d;
  --surface-alt: #2d2d2d;
  --accent: #ffffff;
  --accent-soft: #bbbbbb;
  --text: #f6f6f6;
  --muted: #c0c0c0;
  --border: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  direction: unset;
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(160deg, #060606 0%, #101010 45%, #080808 100%);
}

img {
  max-width: 100%;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 2rem;
  gap: 1rem;
  position: sticky;
  top: 0;
  background: rgba(20, 20, 20, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(14px);
  z-index: 10;
}

.brand span {
  display: block;
  font-size: 1.1rem;
  font-weight: 700;
}

.brand small {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

nav a {
  text-decoration: none;
  color: var(--muted);
  transition: color 0.2s ease;
}

nav a:hover {
  color: var(--accent);
}

.profile-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), rgba(37, 37, 37, 0.8));
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  text-transform: uppercase;
  overflow: hidden;
  background-size: cover;
}

main {
  padding: 0 2rem 3rem;
  max-width: 1240px;
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  align-items: center;
  min-height: 70vh;
  padding-top: 3rem;
}

.hero-copy .eyebrow {
  color: var(--accent);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

.hero-copy h1 {
  font-size: clamp(2.8rem, 4vw, 4.5rem);
  line-height: 1.05;
  margin: 0;
}

.hero-copy p {
  font-size: 1.05rem;
  line-height: 1.8;
  max-width: 46rem;
  margin-top: 1.3rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  padding: 0.92rem 1.6rem;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 255, 255, 0.08);
}
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.button-primary {
  background: #ffffff;
  color: #111111;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.button-google {
  background: #dadada;
  color: #111111;
}

.button-small {
  padding: 0.7rem 1rem;
  font-size: 0.88rem;
}

.panel {
  margin-top: 3rem;
  padding: 2.5rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

.section-light {
  background: rgba(255, 255, 255, 0.04);
}

.section-grid,
.account-grid,
.steam-grid,
.builder-grid,
.admin-grid {
  display: grid;
  gap: 1.5rem;
}

.section-grid {
  grid-template-columns: 1.4fr 1fr;
}

.feature-cards {
  display: grid;
  gap: 1rem;
}

.feature-cards article,
.panel-card,
.auth-card,
.canvas-card,
.palette-card {
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1.2rem;
  border: 1px solid var(--border);
}

.feature-cards article h3,
.panel-card h3,
.auth-card h3,
.canvas-card h3,
.palette-card h3 {
  margin-top: 0;
}

.auth-card form {
  display: grid;
  gap: 0.85rem;
}

.auth-card label {
  font-size: 0.9rem;
  color: var(--muted);
}

.auth-card input,
.auth-card textarea,
.panel-card input,
.panel-card textarea,
#steamForm input,
#steamForm button {
  width: 100%;
}

input,
textarea {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  outline: none;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: rgba(117, 117, 117, 0.45);
}

.status-card,
.game-list,
.owned-list,
.block-canvas {
  margin-top: 1.5rem;
}

.status-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.6rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 1rem;
}

.hidden {
  display: none;
}

.badge {
  display: inline-flex;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.badge-primary {
  background: rgba(102, 102, 102, 0.15);
  color: #dddbd7;
}

.game-list {
  display: grid;
  gap: 1rem;
}

.game-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.game-card p {
  margin: 0.7rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.game-card button {
  margin-top: 1rem;
}

.block-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.block-canvas {
  min-height: 180px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 1rem;
}

.script-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 0.95rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 0.8rem;
}

.script-block span {
  flex: 1;
}

.script-block button {
  min-width: 3.2rem;
}

.code-preview {
  margin-top: 1rem;
  overflow-x: auto;
  padding: 1.4rem;
  border-radius: 1rem;
  background: #0f0f0f;
  color: #f5f5f5;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.6;
  min-height: 280px;
}

.canvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.note {
  color: var(--muted);
  font-size: 0.95rem;
  margin-top: 0.75rem;
}

.footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .section-grid,
  .steam-grid,
  .account-grid,
  .builder-grid,
  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .button {
    width: 100%;
  }
}