:root {
  --bg: #050816;
  --bg-elevated: #0b1220;
  --bg-softer: #111827;
  --border-subtle: rgba(148,163,184,0.3);
  --fg: #e5e7eb;
  --muted: #9ca3af;
  --accent: #38bdf8;
  --accent-soft: rgba(56,189,248,0.12);
  --danger: #f97373;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 18px 40px rgba(0,0,0,0.55);
  --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-main);
  background: radial-gradient(circle at top, #1f2937 0, #020617 55%, #000 100%);
  color: var(--fg);
}
/* --- Christmas / Holiday category styling --- */

.nav-link .nav-icon {
    margin-left: 6px;
    font-size: 0.9rem;
}
/* --- Glowing AI Analyzer Button (Public AI Link) --- */
.nav-link.nav-ai {
    font-size: 1rem;
    font-weight: 700;

    padding: 0.45rem 1.2rem;
    border-radius: 999px;

    color: #101010;
    background: linear-gradient(145deg, #eaff00 0%, #c7ff00 100%);
    border: 1px solid rgba(200, 255, 0, 0.8);

    box-shadow:
        0 0 8px rgba(235, 255, 0, 1),
        0 0 18px rgba(210, 255, 0, 0.7),
        inset 0 0 6px rgba(255, 255, 255, 0.4);

    transition: 0.2s ease-in-out;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.nav-link.nav-ai:hover {
    color: #000;
    background: linear-gradient(145deg, #ffff66 0%, #e7ff00 100%);

    box-shadow:
        0 0 14px rgba(255, 255, 132, 1),
        0 0 24px rgba(225, 255, 0, 0.9),
        inset 0 0 8px rgba(255,255,255,0.55);

    transform: translateY(-1px) scale(1.05);
}


/* Any item with category "xmas" gets this styling */
.coin-card.xmas {
    border: 2px solid #c62828;
    background: linear-gradient(135deg, #fff5f5 0%, #ffecec 100%);
    box-shadow: 0 0 12px rgba(198, 40, 40, 0.35);
}

/* Optional: subtle "holiday mode" background for the Xmas category page */
body.xmas-mode {
    background: radial-gradient(circle at top, #ffebee 0, #fafafa 40%, #eee 100%);
}
/* Holiday mode override */
.holiday-mode .site-bg {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.15), transparent 55%),
        radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.4), transparent 60%),
        linear-gradient(135deg, #0b1c22 0%, #144030 35%, #1b2c4a 70%, #0b1118 100%);
}


.site-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    /* Middle style 1: deep blue to teal with a faint vignette */
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.06), transparent 55%),
        radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.35), transparent 60%),
        linear-gradient(135deg, #0b1020 0%, #122a4a 40%, #0c3940 75%, #07151c 100%);
}
/* Theme variants controlled by body class (SITE_THEME) */
body.default .site-bg {
    /* Default look. We leave this empty so it uses the base .site-bg styles. */
}
body.default .site-bg { /* current background */ }
body.garage_night .site-bg { /* darker garage */ }
body.concrete_wall .site-bg { /* alternate texture */ }

body.garage_night .site-bg {
    background:
        radial-gradient(circle at top, rgba(255, 255, 255, 0.10), transparent 55%),
        radial-gradient(circle at bottom, rgba(255, 140, 0, 0.25), transparent 60%),
        linear-gradient(135deg, #050509, #0b0f17 45%, #141821);
}

body.concrete_wall .site-bg {
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 55%),
        radial-gradient(circle at bottom right, rgba(0, 0, 0, 0.35), transparent 55%),
        linear-gradient(135deg, #6e6e6e, #4a4a4a 45%, #2a2a2a);
}

.site-glow {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(15,23,42,0.9), #020617 65%, #000 100%);
  pointer-events: none;
  z-index: -1;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: linear-gradient(to bottom, rgba(15,23,42,0.92), rgba(15,23,42,0.7), transparent);
  border-bottom: 1px solid rgba(148,163,184,0.2);
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
}

.logo {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  text-decoration: none;
}

.logo-main {
  font-weight: 650;
  letter-spacing: 0.03em;
  font-size: 1.1rem;
  color: #e5e7eb;
}

.logo-sub {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-size: 0.72rem;
  color: var(--muted);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.6), rgba(15,23,42,0.95));
  transition: all 140ms ease-out;
}
.nav-link .nav-icon {
    margin-left: 6px;
    font-size: 0.9rem;
}

.nav-link:hover {
  border-color: rgba(148,163,184,0.6);
  color: #f9fafb;
  background: radial-gradient(circle at top left, rgba(31,41,55,0.7), rgba(15,23,42,0.98));
}

.nav-admin {
  border-color: rgba(56,189,248,0.6);
  color: #e0f2fe;
  background: radial-gradient(circle at top left, rgba(8,47,73,0.9), rgba(15,23,42,0.95));
}

.nav-count {
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(15,23,42,0.9);
  font-size: 0.65rem;
}

.main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 3rem;
}

.flash-container {
  margin-bottom: 0.8rem;
}

.flash {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(148,163,184,0.4);
  background: rgba(15,23,42,0.95);
}

.flash-success {
  border-color: rgba(52,211,153,0.6);
}

.flash-error {
  border-color: rgba(248,113,113,0.8);
}

/* HERO */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2.5fr);
  gap: 1.8rem;
  align-items: center;
  margin-top: 0.6rem;
}

.hero-title {
  font-size: clamp(1.8rem, 3vw, 2.15rem);
  line-height: 1.1;
  margin: 0 0 0.6rem;
}

.hero-title span {
  color: var(--accent);
}

.hero-text {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.42rem 0.9rem;
  font-size: 0.82rem;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  color: #e5e7eb;
  background: rgba(15,23,42,0.96);
  transition: all 130ms ease-out;
}

.btn-sm {
  padding: 0.3rem 0.7rem;
  font-size: 0.78rem;
}

.btn-primary {
  background: radial-gradient(circle at top left, #0ea5e9, #0369a1);
  border-color: rgba(56,189,248,0.75);
  box-shadow: 0 12px 30px rgba(59,130,246,0.45);
}

.btn-primary:hover {
  filter: brightness(1.06);
  transform: translateY(-0.5px);
}

.btn-ghost {
  background: rgba(15,23,42,0.2);
  border-color: rgba(148,163,184,0.5);
}

.btn-ghost:hover {
  background: rgba(15,23,42,0.6);
}

.btn.full-width {
  width: 100%;
}

/* ORBIT VISUAL */

.hero-right {
  display: flex;
  justify-content: center;
}

.vault-orbit {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 10%, rgba(56,189,248,0.24), transparent 55%),
              radial-gradient(circle at 80% 90%, rgba(129,140,248,0.18), transparent 55%);
  box-shadow: 0 18px 60px rgba(15,23,42,0.9);
  overflow: hidden;
}

.vault-item {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(15,23,42,0.9);
  backdrop-filter: blur(8px);
}

.vault-lg {
  width: 90px;
  height: 90px;
  top: 30px;
  left: 40px;
  box-shadow: 0 12px 35px rgba(56,189,248,0.45);
}

.vault-md {
  width: 52px;
  height: 52px;
  bottom: 48px;
  right: 38px;
}

.vault-sm {
  width: 34px;
  height: 34px;
  top: 45%;
  right: 24px;
}

.orbit-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px dashed rgba(148,163,184,0.3);
}

.orbit-1 {
  inset: 16%;
}

.orbit-2 {
  inset: 30%;
}

.orbit-3 {
  inset: 44%;
}

/* SECTIONS */

.section-title {
  margin: 1.6rem 0 0.1rem;
  font-size: 1.05rem;
}

.section-subtitle {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* CATEGORY GRID */

.category-grid-section {
  margin-top: 1rem;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
}

.category-card {
  text-decoration: none;
  color: var(--fg);
}

.category-inner {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(15,23,42,0.96));
  padding: 0.65rem 0.8rem;
  box-shadow: var(--shadow-soft);
  display: grid;
  row-gap: 0.3rem;
}

.category-label {
  font-size: 0.88rem;
}

.category-count {
  font-size: 0.8rem;
  color: var(--muted);
}

.category-chip {
  font-size: 0.72rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0.16rem 0.45rem;
  display: inline-flex;
  align-items: center;
}

/* FEATURED ROW */

.featured-section {
  margin-top: 1.6rem;
}

.featured-row {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.featured-coin-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1.8fr) auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  text-decoration: none;
  color: var(--fg);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.88), rgba(15,23,42,0.98));
}

.featured-thumb img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.7);
}

.thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  border: 1px dashed rgba(148,163,184,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--muted);
}

.featured-main {
  font-size: 0.9rem;
}

.featured-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.featured-grade {
  font-size: 0.8rem;
  color: var(--accent);
}

/* PAGE HEADER */

.page-header {
  margin: 0.4rem 0 0.5rem;
}

.page-header-inner {
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(30,64,175,0.75));
  box-shadow: var(--shadow-soft);
}

.page-title {
  margin: 0;
  font-size: 1rem;
}

.page-subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.8rem;
  color: #e5e7eb;
}

/* SUBTAG FILTER (coins) */

.subtag-filter {
  margin: 0.4rem 0 0.8rem;
}

.subtag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
}

.subtag-label {
  color: var(--muted);
  margin-right: 0.1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  font-size: 0.72rem;
  color: var(--muted);
  background: rgba(15,23,42,0.8);
  text-decoration: none;
}
.chip-xmas {
    background: #c62828;
    color: #fff;
    border-color: #b71c1c;
    font-weight: 600;
}

.chip-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(56,189,248,0.9);
}

/* GRID OF ITEMS */

.coins-grid-section {
  margin-top: 0.5rem;
}

.coins-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.7rem;
}

.coin-card {
  text-decoration: none;
  color: var(--fg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(15,23,42,0.96), rgba(15,23,42,0.98));
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.coin-card-thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
}

.coin-card-body {
  padding: 0.6rem 0.7rem 0.65rem;
}

.coin-card-title {
  margin: 0;
  font-size: 0.94rem;
}

.coin-card-meta {
  margin: 0.3rem 0 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.coin-meta-pill {
  font-size: 0.72rem;
  padding: 0.14rem 0.45rem;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.5);
  color: var(--muted);
}

.coin-card-value {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.coin-card-value span {
  color: var(--accent);
}

.coin-card-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.empty-state {
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  background: rgba(15,23,42,0.9);
  text-align: center;
}

/* DETAIL PAGE */

.coin-detail {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.coin-detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.5fr);
  gap: 1rem;
}

.coin-detail-image-wrapper {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.6rem;
}

.coin-dual {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.6rem;
}

.coin-side {
  position: relative;
}

.coin-detail-image {
  width: 100%;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148,163,184,0.6);
  cursor: zoom-in;
}

.image-hint {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 0.7rem;
  background: rgba(15,23,42,0.85);
  border-radius: 999px;
  padding: 0.08rem 0.4rem;
  color: var(--muted);
}

.coin-detail-info {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.7rem 0.9rem;
}

.coin-detail-title {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.coin-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}

.chip-denom {
  background: var(--accent-soft);
  color: var(--accent);
}

.chip-tag {
  border-style: dashed;
}

.coin-detail-value {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.coin-detail-value span {
  color: var(--accent);
}

.coin-detail-description {
  font-size: 0.86rem;
  color: var(--fg);
}

.coin-detail-notes {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.coin-detail-notes h2 {
  font-size: 0.86rem;
  margin: 0 0 0.2rem;
}

/* BIDDING */

.coin-detail-bidding {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr);
  gap: 0.8rem;
}

.bid-panel,
.bid-history {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.7rem 0.8rem;
}

.bid-panel h2,
.bid-history h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.bid-text {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.form-row {
  margin-bottom: 0.45rem;
}

.form-row label {
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.18rem;
}

input[type="text"],
input[type="email"],
textarea,
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
  padding: 0.32rem 0.45rem;
  font-size: 0.8rem;
  background: rgba(15,23,42,0.95);
  color: var(--fg);
}

textarea {
  resize: vertical;
}

.help-text {
  font-size: 0.75rem;
  color: var(--muted);
}

.bid-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.bid-item {
  padding: 0.35rem 0.45rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(15,23,42,0.9);
}

.bid-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.8rem;
}

.bid-name {
  font-weight: 500;
}

.bid-amount {
  color: var(--accent);
}

.bid-message {
  margin: 0.2rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.bid-empty {
  font-size: 0.8rem;
  color: var(--muted);
}

/* ADMIN */

.admin-section {
  margin-top: 0.6rem;
}

.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.inline-form {
  display: inline;
}

.admin-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.4rem 0.6rem 0.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.admin-table th,
.admin-table td {
  padding: 0.28rem 0.35rem;
  border-bottom: 1px solid rgba(31,41,55,0.9);
}

.admin-table th {
  text-align: left;
  font-weight: 500;
  color: var(--muted);
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.admin-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.1fr);
  gap: 1rem;
}

.admin-edit-form {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.6rem 0.8rem 0.7rem;
}

.admin-edit-side {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.admin-preview-card,
.admin-bid-summary {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  padding: 0.6rem 0.75rem;
  font-size: 0.8rem;
}

.preview-dual {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.preview-dual img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(148,163,184,0.6);
}

/* UPLOAD ZONES */

.upload-zone {
  margin-top: 0.25rem;
  border-radius: 10px;
  border: 1px dashed rgba(148,163,184,0.7);
  padding: 0.4rem 0.45rem;
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.upload-zone.dragover {
  background: rgba(56,189,248,0.08);
  border-color: rgba(56,189,248,0.9);
  color: var(--accent);
}

/* LIGHTBOX */

.lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.85);
  z-index: 50;
}

.lightbox.open {
  display: flex;
}

.lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.7);
}

/* FOOTER */

.site-footer {
  border-top: 1px solid rgba(15,23,42,0.9);
  margin-top: 1.8rem;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.5rem 1.2rem 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ERROR */

.error-page {
  margin-top: 1.4rem;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: rgba(15,23,42,0.96);
  text-align: center;
}

.error-page h1 {
  margin: 0 0 0.4rem;
}

/* RESPONSIVE */

@media (max-width: 800px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .hero-right {
    order: -1;
  }
  .hero {
    margin-top: 0.2rem;
  }
  .coin-detail-main {
    grid-template-columns: minmax(0, 1fr);
  }
  .coin-detail-bidding {
    grid-template-columns: minmax(0, 1fr);
  }
  .admin-edit-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 600px) {
  .header-inner {
    align-items: flex-start;
  }
  .nav {
    justify-content: flex-start;
  }
}
