:root {
  --green-50: #e8f7ee;
  --green-100: #c9ecd5;
  --green-300: #57c184;
  --green-500: #1f9d55;
  --green-600: #178a47;
  --green-700: #0e6e36;
  --green-800: #0a5a2c;
  --green-900: #0a4a25;
  --ink: #102a1a;
  --muted: #6f8b78;
  --card: #ffffff;
  --card-soft: #eef7f1;
  --shadow: 0 18px 40px rgba(0, 30, 12, 0.18);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 800px at 20% 10%, #2bbd6c 0%, #1f9d55 40%, #137a3f 75%, #0a5a2c 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

#particles {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1024px;
  margin: 0 auto;
  padding: 36px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.page-title {
  text-align: center;
  margin: 8px 0 14px;
  color: #fff;
  font-size: clamp(36px, 5vw, 52px);
  letter-spacing: 0.5px;
  text-shadow: 0 4px 22px rgba(0, 0, 0, 0.25);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}

.account-card {
  display: flex;
  align-items: center;
  min-height: 64px;
}

.signed-in-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  flex-wrap: wrap;
}

.signed-in-text { font-size: 16px; }
.username { color: var(--green-600); font-weight: 700; margin: 0 6px; }

.auth-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  flex-wrap: wrap;
}

.auth-tabs { display: flex; gap: 6px; }

.tab {
  border: none;
  background: var(--card-soft);
  color: var(--green-700);
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tab.active { background: var(--green-600); color: #fff; }

.auth-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
}

.auth-form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.auth-form input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6e6dc;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.auth-form input:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.18);
}

/* Two-column layout for Desktop Signup */
@media (min-width: 600px) {
  .auth-form-grid:has(input:not(.hidden) + input:not(.hidden) + input:not(.hidden)) {
    grid-template-columns: 1fr 1fr;
    max-width: 600px;
  }
}

.announcement-bar {
  background: linear-gradient(90deg, #5865F2, #4752C4); /* Discord-inspired Blurple */
  color: white;
  padding: 10px 20px;
  text-align: center;
  width: 100%;
  box-sizing: border-box;
  font-family: sans-serif;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  z-index: 9999;
}

.announcement-content {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.announcement-text {
  font-weight: 600;
  font-size: 14px;
  letter-spacing: 0.5px;
}

.announcement-btn {
  background: white;
  color: #5865F2;
  text-decoration: none;
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: bold;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.announcement-btn:hover {
  background: #f0f0f0;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .announcement-content {
    flex-direction: column;
    gap: 8px;
  }
}

.btn {
  border: none;
  cursor: pointer;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 10px;
  transition: transform 0.05s ease, background 0.15s, color 0.15s, opacity 0.15s;
  font-size: 14px;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-primary {
  background: var(--green-600);
  color: #fff;
  box-shadow: 0 6px 14px rgba(14, 110, 54, 0.35);
}
.btn-primary:hover { background: var(--green-700); }

.btn-ghost {
  background: #4a5a52;
  color: #fff;
}
.btn-ghost:hover { background: #3a4842; }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

.btn-admin {
  background: #b13a2e;
  color: #fff;
  box-shadow: 0 4px 10px rgba(177, 58, 46, 0.3);
}
.btn-admin:hover { background: #8f2d24; }

.btn-reset {
  background: #4a78c8;
  color: #fff;
  box-shadow: 0 4px 10px rgba(74, 120, 200, 0.3);
}
.btn-reset:hover { background: #355a99; }

.btn-promote {
  background: #b27a18;
  color: #fff;
  box-shadow: 0 4px 10px rgba(178, 122, 24, 0.3);
}
.btn-promote:hover { background: #8a5d10; }

.btn-demote {
  background: #6b4f8c;
  color: #fff;
  box-shadow: 0 4px 10px rgba(107, 79, 140, 0.3);
}
.btn-demote:hover { background: #4f3a6b; }

.owner-pill {
  display: inline-block;
  background: linear-gradient(135deg, #ffd770, #c47514);
  color: #2a1700;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  letter-spacing: 0.5px;
  box-shadow: 0 0 0 2px #fff inset, 0 2px 6px rgba(196, 117, 20, 0.4);
}

.admin-badge.owner-badge {
  background: linear-gradient(135deg, #ffd770, #c47514);
  color: #2a1700;
  box-shadow: 0 0 0 2px #fff inset, 0 4px 12px rgba(196, 117, 20, 0.45);
}

.admin-user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.admin-badge {
  display: inline-block;
  background: linear-gradient(135deg, #f6c552, #e09a1f);
  color: #4a2e00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: 2px;
  box-shadow: 0 2px 6px rgba(224, 154, 31, 0.4);
}

.meta-pill {
  background: #fde8c7;
  color: #6a4200;
  font-size: 11.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.action-btn-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}

.auctions-card { padding-top: 14px; }
.auctions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.filter-tabs { display: flex; gap: 6px; }
.filter {
  border: none;
  background: #c8d6cd;
  color: #3a4842;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
}
.filter.active {
  background: var(--green-600);
  color: #fff;
}

.auctions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 80px;
}

.auction {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #e1eee6;
  border-radius: 12px;
  background: #fbfefb;
  align-items: center;
}
.auction.ended { opacity: 0.85; }

.auction-info { min-width: 0; }
.auction-title {
  font-weight: 700;
  color: var(--green-800);
  font-size: 16px;
  margin-bottom: 2px;
  word-wrap: break-word;
}
.auction-desc {
  font-size: 13px;
  color: #4a5a52;
  margin-bottom: 4px;
  word-wrap: break-word;
}
.auction-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.auction-meta b { color: var(--ink); }

.auction-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
}
.timer {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--green-700);
  font-size: 13px;
}
.timer.ending { color: #c0392b; }
.timer.ended-text { color: var(--muted); }

.admin-card {
  background: #fff7ed;
  border: 2px solid #f6c552;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}
.admin-header h2 {
  margin: 0;
  color: #6a4200;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-users-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-user-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: #fffdf8;
  border: 1px solid #f1deb1;
  border-radius: 10px;
}
.admin-user-info { min-width: 0; }
.admin-user-name {
  font-weight: 700;
  color: #4a2e00;
  font-size: 15px;
}
.admin-user-meta {
  font-size: 12.5px;
  color: #8a6a2c;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.admin-self-pill {
  display: inline-block;
  background: #ffe9b8;
  color: #6a4200;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  margin-left: 6px;
}

.info-card { background: #f1faf4; }
.info-card h2 {
  margin: 4px 0 8px;
  text-align: center;
  color: var(--green-600);
}
.info-card p {
  margin: 0;
  text-align: center;
  color: #2a4a35;
  line-height: 1.5;
  font-size: 14px;
}

.page-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 13px;
  margin-top: 6px;
  padding-bottom: 24px;
}

.discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865F2;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.3px;
  box-shadow: 0 6px 16px rgba(88, 101, 242, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.discord-btn:hover {
  background: #4752c4;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(88, 101, 242, 0.55);
}
.discord-btn svg { display: block; }

.footer-credit {
  opacity: 0.85;
}

.payments-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.payment-tab {
  background: #eef5ee;
  color: #2a4a35;
  border: none;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
}
.payment-tab.active {
  background: var(--green);
  color: #fff;
  box-shadow: 0 3px 8px rgba(28, 117, 60, 0.3);
}

.admin-payments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  gap: 14px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid #e6efe7;
  border-radius: 12px;
  flex-wrap: wrap;
}
.payment-row.paid {
  background: #f0faf3;
  border-color: #c8e8d2;
}
.payment-row.unpaid {
  border-color: #f6c552;
  background: #fffdf3;
}

.payment-main { flex: 1; min-width: 240px; }
.payment-title {
  font-weight: 800;
  font-size: 16px;
  color: #1c2a20;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.payment-amount {
  font-variant-numeric: tabular-nums;
  background: #1c753c;
  color: #fff;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 14px;
}
.payment-parties {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.payment-party {
  flex: 1;
  min-width: 140px;
  background: #f7faf7;
  border: 1px solid #e1ece2;
  border-radius: 10px;
  padding: 8px 10px;
}
.party-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4a6a55;
  margin-bottom: 4px;
  font-weight: 700;
}
.pay-user .pay-username {
  font-weight: 700;
  color: #1c2a20;
  font-size: 14px;
}
.pay-sub {
  font-size: 12px;
  color: #4a6a55;
}
.payment-arrow {
  font-size: 20px;
  color: #1c753c;
  font-weight: 800;
}
.pay-stamp {
  font-size: 12px;
  color: #4a6a55;
  margin-top: 4px;
}
.pay-notes {
  font-size: 12px;
  color: #2a4a35;
  background: #fff7e0;
  padding: 6px 8px;
  border-radius: 6px;
  margin-top: 6px;
}
.payment-actions {
  display: flex;
  align-items: center;
}

.muted { color: var(--muted); }
.center { text-align: center; padding: 16px; }
.error { color: #c0392b; font-size: 13px; min-height: 18px; }
.success { color: #178a47; font-size: 13px; min-height: 18px; font-weight: 600; }
.hidden { display: none !important; }

.admin-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  z-index: 40;
  background: #fff7ed;
  border-left: 3px solid #f6c552;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  padding: 14px 14px 12px;
  gap: 10px;
}
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-header h2 {
  margin: 0;
  color: #6a4200;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pending-count {
  background: #b13a2e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  min-width: 22px;
  text-align: center;
}
.pending-count.empty {
  background: #c9b78a;
}
.pending-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pending-row {
  background: #fffdf8;
  border: 1px solid #f1deb1;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pending-name {
  font-weight: 700;
  color: #4a2e00;
  font-size: 14px;
}
.pending-discord {
  color: #8a6a2c;
  font-size: 12.5px;
  word-break: break-all;
}
.pending-when {
  color: #b89358;
  font-size: 11.5px;
}
.pending-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.btn-approve {
  background: var(--green-600);
  color: #fff;
  flex: 1;
}
.btn-approve:hover { background: var(--green-700); }
.btn-reject {
  background: #b13a2e;
  color: #fff;
  flex: 1;
}
.btn-reject:hover { background: #8f2d24; }

.sidebar-footer {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #f1deb1;
  padding-top: 8px;
}

.sidebar-show {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  z-index: 39;
  background: #b13a2e;
  color: #fff;
  border: none;
  border-radius: 12px 0 0 12px;
  padding: 10px 12px;
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  box-shadow: -4px 4px 12px rgba(0, 0, 0, 0.2);
}
.sidebar-show:hover { background: #8f2d24; }

body.has-admin-sidebar .page { padding-right: 340px; }

@media (max-width: 900px) {
  .admin-sidebar {
    width: 280px;
  }
  body.has-admin-sidebar .page { padding-right: 24px; }
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 36, 22, 0.55);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  width: min(480px, 100%);
  background: #fff;
  border-radius: 16px;
  padding: 18px 20px 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  z-index: 1;
  max-height: 92vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.modal-header h2 { margin: 0; color: var(--green-700); font-size: 20px; }
.modal-close {
  border: none;
  background: transparent;
  font-size: 24px;
  cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

.list-form { display: flex; flex-direction: column; gap: 12px; }
.list-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: #3a4842;
  font-weight: 600;
}
.list-form input,
.list-form select,
.list-form textarea {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid #d6e6dc;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.list-form input:focus,
.list-form select:focus,
.list-form textarea:focus {
  border-color: var(--green-500);
  box-shadow: 0 0 0 3px rgba(31, 157, 85, 0.18);
}
.list-form textarea { resize: vertical; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 6px;
}

.bid-summary {
  background: var(--card-soft);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bid-summary .bid-title { font-weight: 700; color: var(--green-800); font-size: 15px; }

@media (max-width: 600px) {
  .row-2 { grid-template-columns: 1fr; }
  .auction { grid-template-columns: 1fr; }
  .auction-actions { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .auth-form { flex-direction: column; }
}
