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

:root {
  --amber:       #ffbf47;
  --amber-glow:  #ff9500;
  --amber-dim:   #c4922e;
  --cream:       #f5e6c8;
  --cream-dim:   #b8a88c;
  --bg-top:      #1a1209;
  --bg-bottom:   #0d0906;
  --panel:       rgba(30, 22, 15, 0.85);
  --panel-solid: #1e160f;
  --surface:     rgba(40, 30, 18, 0.7);
  --border:      rgba(255, 191, 71, 0.12);
  --border-h:    rgba(255, 191, 71, 0.25);
  --input-bg:    rgba(20, 14, 8, 0.8);
  --input-bd:    rgba(255, 191, 71, 0.15);
  --green:       #6e9a2a;
  --green-txt:   #d2e885;
  --red:         #c0392b;
  --radius:      4px;
  --radius-lg:   8px;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

html { 
  font-size: 15px; 
}

body {
  font-family: var(--font);
  background: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--cream);
  min-height: 100vh;
  line-height: 1.55;
  overflow-x: hidden;
}

/* ── Dust particles ────────────────────────────────────── */
.dust-container {
  position: fixed; 
  top: 0; 
  left: 0;
  width: 100%; 
  height: 100%;
  pointer-events: none; 
  z-index: 100; 
  overflow: hidden;
}

.dust {
  position: absolute; 
  width: 2px; 
  height: 2px;
  background: rgba(255, 220, 150, 0.2);
  border-radius: 50%;
  animation: float-dust 18s infinite linear;
}

.dust:nth-child(1) { left: 15%; animation-delay: 0s; }
.dust:nth-child(2) { left: 35%; animation-delay: 4s; }
.dust:nth-child(3) { left: 60%; animation-delay: 2s; }
.dust:nth-child(4) { left: 85%; animation-delay: 6s; }

@keyframes float-dust {
  0%   { transform: translateY(100vh); opacity: 0; }
  10%  { opacity: 0.4; }
  90%  { opacity: 0.4; }
  100% { transform: translateY(-50px); opacity: 0; }
}

/* ── Layout ────────────────────────────────────────────── */
.page { 
  position: relative; 
  z-index: 1; 
  min-height: 100vh; 
}

.container { 
  max-width: 920px; 
  margin: 0 auto; 
  padding: 0 20px; 
}

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
  position: sticky; 
  top: 0; 
  z-index: 200;
  background: linear-gradient(180deg, rgba(26,18,9,.97), rgba(13,9,6,.95));
  border-bottom: 1px solid var(--border);
  padding: 13px 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.topbar-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 0;
}

.topbar-left { 
  display: flex; 
  align-items: center; 
  gap: 14px; 
}

.topbar-home {
  display: inline-flex; 
  align-items: center; 
  gap: 7px;
  font-size: .82rem; 
  color: var(--cream-dim); 
  text-decoration: none;
  padding: 5px 11px; 
  border-radius: var(--radius);
  border: 1px solid transparent; 
  transition: all .2s;
}

.topbar-home:hover { 
  color: var(--amber); 
  border-color: var(--border-h); 
}

.topbar-home svg { 
  width: 14px; 
  height: 14px; 
}

.topbar-title {
  font-family: 'Lobster', cursive;
  font-size: 1.25rem; 
  color: var(--amber);
  text-shadow: 0 0 8px rgba(255,159,0,.3);
}

.topbar-sub { 
  font-size: .73rem; 
  color: var(--cream-dim); 
  margin-top: 1px; 
}

.topbar-right { 
  display: flex; 
  align-items: center; 
  gap: 10px; 
}

/* Quality bar inline with topbar */
.topbar-quality-bar {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 80%;
  max-width: 736px; /* 80% of 920px container */
  pointer-events: none;
}

.topbar-quality-bar.hidden {
  display: none;
}

.topbar-quality-bar .quality-bar {
  width: 100%;
  height: 14px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255, 191, 71, 0.1);
}

.topbar-quality-bar .quality-text {
  font-size: 0.85rem;
  color: var(--cream-dim);
  text-align: center;
  transition: color 0.3s;
}

.steam-user-badge {
  display: inline-flex; 
  align-items: center; 
  gap: 8px;
  padding: 5px 11px; 
  background: rgba(102,192,244,.08);
  border: 1px solid rgba(102,192,244,.25); 
  border-radius: var(--radius);
  font-size: .78rem; 
  color: #66c0f4;
}

.steam-user-badge svg { 
  width: 14px; 
  height: 14px; 
}

.steam-user-name { 
  font-weight: 600; 
}

.sign-out-link {
  font-size: .76rem; 
  color: var(--cream-dim); 
  text-decoration: underline;
  cursor: pointer; 
  display: inline;
  border: none; 
  background: none; 
  padding: 0;
  font-family: inherit;
}

.sign-out-link:hover { 
  color: var(--amber); 
}

.hidden { 
  display: none !important; 
}

/* ═══════════════════════════════════════════════════════════
   HUB — PROJECT PICKER GRID
   ═══════════════════════════════════════════════════════════ */

#view-hub, 
#view-form { 
  display: none; 
}

#view-hub.active, 
#view-form.active { 
  display: block; 
}

.hub-header { 
  text-align: center; 
  padding: 44px 0 32px; 
}

.hub-header h1 {
  font-family: 'Lobster', cursive;
  font-size: 2.2rem; 
  color: var(--amber);
  text-shadow: 0 0 5px rgba(255,204,102,.4), 0 0 15px rgba(255,149,0,.2);
}

.hub-header p { 
  font-size: .92rem; 
  color: var(--cream-dim); 
  margin-top: 6px; 
}

.loading-msg {
  text-align: center; 
  padding: 40px; 
  color: var(--cream-dim);
  font-size: .9rem;
}

/* ── Mod cards ─────────────────────────────────────────── */
.mod-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  padding-bottom: 50px;
}

.mod-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, border-color .25s, box-shadow .25s;
  text-decoration: none; 
  color: inherit; 
  display: block;
}

.mod-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-h);
  box-shadow: 0 10px 35px rgba(0,0,0,.5), 0 0 20px rgba(255,191,71,.06);
}

.mod-card-banner {
  height: 65px;
  background: var(--surface);
  background-size: 110%;
  background-position: center;
  position: relative;
}

.mod-card-banner::after {
  content: '';
  position: absolute; 
  inset: 0;
  background: linear-gradient(0deg, var(--panel-solid) 0%, transparent 55%);
}

.mod-card-body { 
  padding: 14px 18px 18px; 
}

.mod-card-name {
  font-size: 1rem; 
  font-weight: 700; 
  color: var(--cream);
  white-space: nowrap; 
  overflow: hidden; 
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.mod-card-meta {
  font-size: .78rem; 
  color: var(--cream-dim);
  display: flex; 
  align-items: center; 
  gap: 12px;
}

.mod-card-subs {
  display: inline-flex; 
  align-items: center; 
  gap: 4px;
}

.mod-card-subs svg { 
  width: 12px; 
  height: 12px; 
  opacity: .6; 
}

.mod-card-issues {
  display: inline-flex; 
  align-items: center; 
  gap: 4px;
}

.mod-card-issues svg { 
  width: 12px; 
  height: 12px; 
  opacity: .6; 
}

.mod-card-arrow {
  position: absolute; 
  bottom: 16px; 
  right: 16px;
  width: 26px; 
  height: 26px; 
  border-radius: 50%;
  background: rgba(255,191,71,.06); 
  border: 1px solid var(--border);
  display: flex; 
  align-items: center; 
  justify-content: center;
  color: var(--cream-dim); 
  transition: all .25s;
}

.mod-card:hover .mod-card-arrow {
  background: var(--amber); 
  border-color: var(--amber); 
  color: var(--bg-top);
}

/* ═══════════════════════════════════════════════════════════
   FORM VIEW — ISSUE SUBMISSION
   ═══════════════════════════════════════════════════════════ */

.form-content { 
  padding: 24px 0 50px; 
}

/* ── Mod header on form page ───────────────────────────── */
.form-mod-header {
  display: flex; 
  align-items: center; 
  gap: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
}

.form-mod-banner {
  width: 72px; 
  height: 72px; 
  border-radius: var(--radius);
  background: var(--surface); 
  background-size: cover;
  background-position: center; 
  flex-shrink: 0;
  border: 1px solid var(--border);
}

.form-mod-info h2 { 
  font-size: 1.1rem; 
  font-weight: 700; 
  color: var(--cream); 
}

.form-mod-info p { 
  font-size: .82rem; 
  color: var(--cream-dim); 
  margin-top: 2px; 
}

.form-mod-info a {
  color: var(--amber); 
  text-decoration: none; 
  font-size: .82rem;
}

.form-mod-info a:hover { 
  color: #fff; 
}

/* ── Tabs ──────────────────────────────────────────────── */
.tabs {
  display: flex; 
  gap: 2px; 
  margin-bottom: 20px;
  background: rgba(0,0,0,.3); 
  border-radius: var(--radius-lg); 
  padding: 4px;
}

.tab {
  flex: 1; 
  padding: 10px 16px; 
  background: transparent; 
  border: none;
  border-radius: 6px; 
  font-family: var(--font);
  font-size: .88rem; 
  font-weight: 600; 
  color: var(--cream-dim);
  cursor: pointer; 
  transition: all .2s;
  position: relative;
}

.tab-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 6px;
  height: 6px;
  background: var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(255, 191, 71, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.2); }
}

.tab:hover { 
  background: rgba(255,191,71,.06); 
  color: var(--cream); 
}

.tab.active { 
  background: var(--surface); 
  color: var(--amber); 
}

/* ── Quality Bar Fill (shared styles) ──────────────────── */
.quality-bar-container {
  margin-bottom: 8px;
}

.quality-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 12px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(90deg, var(--red) 0%, var(--red) 100%);
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.6);
}

/* Quality level color classes */
.quality-bar-fill.terrible {
  background: linear-gradient(90deg, #8b0000 0%, var(--red) 100%);
  box-shadow: 0 0 12px rgba(139, 0, 0, 0.7);
}

.quality-bar-fill.poor {
  background: linear-gradient(90deg, var(--red) 0%, #e67e22 100%);
  box-shadow: 0 0 12px rgba(192, 57, 43, 0.6);
}

.quality-bar-fill.fair {
  background: linear-gradient(90deg, #e67e22 0%, #f39c12 100%);
  box-shadow: 0 0 12px rgba(230, 126, 34, 0.6);
}

.quality-bar-fill.good {
  background: linear-gradient(90deg, #f39c12 0%, var(--amber) 100%);
  box-shadow: 0 0 12px rgba(243, 156, 18, 0.6);
}

.quality-bar-fill.great {
  background: linear-gradient(90deg, var(--amber) 0%, #a8c256 100%);
  box-shadow: 0 0 12px rgba(255, 191, 71, 0.6);
}

.quality-bar-fill.excellent {
  background: linear-gradient(90deg, #a8c256 0%, var(--green) 100%);
  box-shadow: 0 0 12px rgba(168, 194, 86, 0.7);
}

.quality-text {
  font-weight: 700;
  transition: color 0.3s ease;
  text-align: center;
}

/* Quality text color classes */
.quality-text.terrible {
  color: #ff6b6b;
  text-shadow: 0 0 10px rgba(139, 0, 0, 0.4);
}

.quality-text.poor {
  color: #ff8787;
  text-shadow: 0 0 10px rgba(192, 57, 43, 0.4);
}

.quality-text.fair {
  color: #ffa94d;
  text-shadow: 0 0 10px rgba(230, 126, 34, 0.4);
}

.quality-text.good {
  color: #ffd43b;
  text-shadow: 0 0 10px rgba(243, 156, 18, 0.4);
}

.quality-text.great {
  color: var(--amber);
  text-shadow: 0 0 10px rgba(255, 191, 71, 0.4);
}

.quality-text.excellent {
  color: var(--green-txt);
  text-shadow: 0 0 10px rgba(110, 154, 42, 0.4);
}

/* ── Info banner ───────────────────────────────────────── */
.info-banner {
  display: flex;
  gap: 14px;
  background: rgba(110, 154, 42, 0.08);
  border: 1px solid rgba(110, 154, 42, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}

.info-banner-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  color: var(--green-txt);
}

.info-banner-icon svg {
  width: 100%;
  height: 100%;
}

.info-banner-content {
  flex: 1;
}

.info-banner-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-txt);
  margin-bottom: 6px;
}

.info-banner-text {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--cream);
}

.info-banner-text a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
}

.info-banner-text a:hover {
  text-decoration: underline;
}

.info-banner-text strong {
  color: var(--cream);
  font-weight: 600;
}

.console-path {
  display: inline-block;
  margin-left: 8px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--cream-dim);
}

.console-path strong {
  color: var(--green-txt);
  margin-right: 4px;
}

/* ── Form panel ────────────────────────────────────────── */
.form-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
}

.form-group {
  margin-bottom: 18px;
}

.label-container {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.form-group label {
  display: inline-block;
  font-size: .88rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 0;
}

.required-indicator {
  color: var(--red);
  font-weight: 700;
}

.form-input,
.form-select {
  width: 100%;
  padding: 10px 12px;
  background: var(--input-bg);
  border: 1px solid var(--input-bd);
  border-radius: var(--radius);
  color: var(--cream);
  font-family: var(--font);
  font-size: .92rem;
  transition: border-color .2s, box-shadow .2s;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(255,191,71,.08);
}

.form-input::placeholder {
  color: var(--cream-dim);
  opacity: .5;
}

textarea.form-input {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.error-message {
  color: var(--red);
  font-size: .8rem;
  margin-top: 4px;
  min-height: 1.2em;
}

.required-message {
  color: var(--cream-dim);
  font-size: .72rem;
  opacity: 0.5;
  transition: color 0.2s, opacity 0.2s;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.required-message.error {
  color: var(--red);
  opacity: 1;
}

.form-input.invalid {
  border-color: var(--red);
}

.form-input.touched {
  /* Just a marker class, no styles needed */
}

/* ── File input ────────────────────────────────────────── */
.file-input-container {
  margin-top: 8px;
}

.form-file-input {
  display: none;
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--cream);
  font-size: .88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
}

.file-input-label:hover {
  background: rgba(255,191,71,.08);
  border-color: var(--border-h);
}

.file-input-label svg {
  width: 18px;
  height: 18px;
  stroke: var(--amber);
}

.file-input-text {
  color: var(--cream-dim);
}

.file-input-info {
  margin-top: 8px;
  font-size: .85rem;
  color: var(--cream-dim);
}

.file-input-info.success {
  color: var(--green-txt);
}

.file-input-info.error {
  color: var(--red);
}

.file-input-help {
  margin-top: 4px;
  font-size: .78rem;
  color: var(--cream-dim);
  opacity: .7;
}

/* ── Submit buttons ────────────────────────────────────── */
.submit-section {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.submit-section > div {
  flex: 1;
}

.submit-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 2px solid;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .25s;
}

.btn-github {
  background: linear-gradient(135deg, rgba(110,154,42,.12), rgba(110,154,42,.08));
  border-color: var(--green);
  color: var(--green-txt);
}

.btn-github:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-github.enabled:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(110,154,42,.2), rgba(110,154,42,.15));
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(110,154,42,.2);
}

.btn-steam {
  background: linear-gradient(135deg, rgba(102,192,244,.12), rgba(102,192,244,.08));
  border-color: #66c0f4;
  color: #66c0f4;
}

.btn-steam:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

.btn-steam.enabled:not(:disabled):hover {
  background: linear-gradient(135deg, rgba(102,192,244,.2), rgba(102,192,244,.15));
  transform: translateY(-2px);
  box-shadow: 0 5px 18px rgba(102,192,244,.2);
}

.btn-icon {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.submit-hint {
  font-size: .77rem;
  color: var(--cream-dim);
  margin-top: 6px;
  text-align: center;
}

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--panel-solid);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  font-size: .9rem;
  color: var(--cream);
  box-shadow: 0 8px 30px rgba(0,0,0,.6);
  z-index: 1000;
  opacity: 0;
  transition: all .3s ease;
  max-width: 90%;
  text-align: center;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast.error {
  border-color: var(--red);
  background: rgba(192, 57, 43, 0.15);
  color: #ff6b6b;
}

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
  .topbar {
    padding: 10px 15px;
  }

  .topbar-content {
    flex-direction: column;
    gap: 8px;
  }

  .topbar-left,
  .topbar-right {
    width: 100%;
    justify-content: center;
  }
  
  .topbar-title-area {
    text-align: center;
  }
  
  /* Move quality bar below topbar content on mobile */
  .topbar-quality-bar {
    position: relative;
    left: 0;
    transform: none;
    width: 100%;
    max-width: 100%;
    margin-top: 8px;
    order: 10; /* Move to bottom */
  }

  .hub-header h1 {
    font-size: 1.8rem;
  }

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

  .submit-section {
    flex-direction: column;
    gap: 16px;
  }

  .form-mod-header {
    flex-direction: column;
    text-align: center;
    padding: 16px 18px;
  }
  
  .form-mod-banner {
    width: 64px;
    height: 64px;
  }
  
  /* Better touch targets for tabs */
  .tabs {
    gap: 8px;
  }
  
  .tab {
    padding: 12px 20px;
    font-size: 0.9rem;
  }
  
  /* Optimize form inputs for mobile */
  .form-input,
  .form-select {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px;
  }
  
  textarea.form-input {
    min-height: 120px; /* Larger on mobile for easier typing */
  }
  
  /* Better info banner on mobile */
  .info-banner {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
  }
  
  .console-path {
    display: block;
    margin-left: 0;
    margin-top: 4px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 12px;
  }
  
  .topbar {
    padding: 8px 12px;
  }

  .form-panel {
    padding: 16px;
  }
  
  .form-content {
    padding: 16px 0 40px;
  }
  
  .topbar-quality-bar .quality-bar {
    height: 12px;
  }
  
  .topbar-quality-bar .quality-text {
    font-size: 0.75rem;
  }
  
  .topbar-title {
    font-size: 1.1rem;
  }
  
  .topbar-sub {
    font-size: 0.7rem;
  }
  
  /* Compact home link on very small screens */
  .topbar-home {
    font-size: 0.75rem;
    padding: 4px 8px;
  }
  
  .topbar-home svg {
    width: 12px;
    height: 12px;
  }
  
  /* Better submit buttons on small screens */
  .submit-btn {
    padding: 12px 16px;
    font-size: 0.85rem;
  }
  
  .btn-icon {
    width: 16px;
    height: 16px;
  }
  
  /* Compact Steam badge */
  .steam-user-badge {
    font-size: 0.72rem;
    padding: 4px 8px;
  }
  
  .steam-user-badge svg {
    width: 12px;
    height: 12px;
  }
  
  /* Better file input on mobile */
  .file-input-label {
    padding: 12px 14px;
    font-size: 0.85rem;
  }
  
  /* Adjust info banner text for small screens */
  .info-banner-text {
    font-size: 0.8rem;
  }
  
  .info-banner-title {
    font-size: 0.85rem;
  }
}

/* ============================================================
   FORM LAYOUT — Two-column layout for form + issues sidebar
   ============================================================ */

.form-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

/* On tablets and below, stack the layout */
@media (max-width: 1200px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
}
