/* 420 Bizness — UI “underground neon” */
:root {
  --bg-deep: #08080c;
  --bg-panel: #12121a;
  --bg-panel2: #0e0e14;
  --border: rgba(255, 255, 255, 0.08);
  --neon-green: #39ff14;
  --neon-green-dim: rgba(57, 255, 20, 0.45);
  --neon-violet: #bf5fff;
  --neon-violet-dim: rgba(191, 95, 255, 0.4);
  --text: #ececf4;
  --muted: #8b8b9e;
  --warn: #ff6b8a;
  --font-display: "Outfit", system-ui, sans-serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-panel: 0 8px 32px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

html,
body.app-page {
  height: 100%;
  overflow: hidden;
}

body.app-page {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15px;
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.5;
}

/* Fond atmosphère */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 120% 80% at 50% -20%, rgba(57, 255, 20, 0.12), transparent 50%),
    radial-gradient(ellipse 80% 50% at 100% 50%, rgba(191, 95, 255, 0.08), transparent 45%),
    radial-gradient(ellipse 60% 40% at 0% 80%, rgba(57, 255, 20, 0.05), transparent 40%),
    var(--bg-deep);
  pointer-events: none;
}

/* Colonne pleine hauteur : pas de scroll page */
.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.5rem 0.85rem 0.65rem;
  min-height: 0;
  box-sizing: border-box;
}

/* Header */
.site-header {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
}

.site-header--row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.site-header--row .brand {
  flex: 1;
  min-width: 12rem;
}

.btn-shop {
  flex-shrink: 0;
  align-self: center;
  padding: 0.55rem 1.15rem;
  font-size: 0.92rem;
  font-weight: 700;
  border-color: var(--neon-violet);
  color: var(--neon-violet);
  background: rgba(191, 95, 255, 0.12);
  box-shadow: 0 0 22px rgba(191, 95, 255, 0.12);
}

.btn-shop:hover {
  background: rgba(191, 95, 255, 0.2);
}

.brand-badge {
  display: inline-block;
  margin: 0 0 0.35rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--neon-violet);
  border: 1px solid var(--neon-violet-dim);
  border-radius: 999px;
  background: rgba(191, 95, 255, 0.08);
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  margin: 0 0 0.35rem;
  color: var(--neon-green);
  letter-spacing: -0.02em;
  text-shadow: 0 0 24px var(--neon-green-dim);
}

.tagline {
  margin: 0;
  max-width: 36rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Auth */
.auth-strip {
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  padding: 0.65rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
}

.auth-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

#auth-status {
  flex: 1;
  min-width: 12rem;
  font-size: 0.88rem;
}

.auth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

/* Sinon display:flex l’emporte sur l’attribut hidden (tuiles auth visibles quand connecté) */
.auth-buttons[hidden],
#btn-logout[hidden],
#btn-open-saves[hidden],
#btn-open-admin[hidden],
#btn-back-to-game[hidden] {
  display: none !important;
}

#hud-strip[hidden] {
  display: none !important;
}

/* Comme .production { display: flex } écrase [hidden] sur <main> */
#grow-room[hidden],
main.production[hidden] {
  display: none !important;
}

/* HUD ressources */
.hud-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  padding: 0.55rem 0.65rem;
  margin-bottom: 0.5rem;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(18, 18, 26, 0.95), rgba(12, 12, 18, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
}

.hud-chip {
  flex: 1 1 auto;
  min-width: 5.5rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  font-size: 0.82rem;
  font-weight: 600;
}

.hud-chip .res-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.hud-ico {
  opacity: 0.7;
  margin-right: 0.15rem;
  font-weight: 700;
}

.hud-cash {
  border-color: rgba(57, 255, 20, 0.25);
  box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.06);
}

.hud-muted {
  opacity: 0.95;
}

.hud-warn {
  border-color: rgba(255, 107, 138, 0.35);
}

.hud-seeds {
  flex: 2 1 12rem;
  min-width: 9rem;
}

.res-seeds-line {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
  word-break: break-word;
}

.hud-level {
  flex: 2 1 14rem;
  min-width: 10rem;
}

.hud-level-track {
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  margin: 0.35rem 0 0.25rem;
  overflow: hidden;
}

.hud-level-bar {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 200, 80, 0.85), rgba(57, 255, 20, 0.75));
  transition: width 0.25s ease;
}

.res-level-hint {
  display: block;
  font-size: 0.72rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--muted);
  margin-top: 0.1rem;
}

.admin-levels-scroll {
  max-height: min(55vh, 420px);
  overflow: auto;
}

/* Même largeur que les autres tuiles (pas de pleine ligne) */
button.hud-chip--click {
  display: block;
  flex: 1 1 auto;
  min-width: 5.5rem;
  max-width: 100%;
  width: auto;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  box-sizing: border-box;
  transition:
    border-color 0.2s,
    box-shadow 0.2s,
    background 0.2s;
}

button.hud-chip--click:hover {
  border-color: rgba(57, 255, 20, 0.35);
  background: rgba(57, 255, 20, 0.06);
}

button.hud-chip--click:focus-visible {
  outline: 2px solid rgba(57, 255, 20, 0.45);
  outline-offset: 2px;
}

/* Zone production (prend le reste de l’écran) */
.production {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.85rem 0.65rem;
  box-shadow: var(--shadow-panel);
}

.production-head {
  flex-shrink: 0;
  margin-bottom: 0.35rem;
}

.production-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--neon-violet);
  letter-spacing: -0.02em;
}

.production-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0.2rem;
  margin-top: 0.35rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 255, 20, 0.3) transparent;
}

.production-scroll::-webkit-scrollbar {
  width: 8px;
}

.production-scroll::-webkit-scrollbar-thumb {
  background: rgba(57, 255, 20, 0.22);
  border-radius: 999px;
}

/* Sélecteur de variété (dans les cartes pot) */
.variety-select {
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(57, 255, 20, 0.35);
  background: #0a0a10;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  min-width: 11rem;
  cursor: pointer;
}

.variety-select:focus {
  outline: 2px solid rgba(57, 255, 20, 0.35);
}

/* Slots */
.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.slot-card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  min-height: 168px;
  background: linear-gradient(165deg, #14141c, #0c0c12);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s;
  display: flex;
  flex-direction: column;
}

.slot-card__actions {
  position: relative;
  margin-top: auto;
  padding-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.slot-card__actions--single {
  margin-top: 0.5rem;
  padding-top: 0;
}

.slot-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.slot-variety-select,
.slot-card .variety-select {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
}

.btn-slot-plant,
.btn-slot-harvest {
  width: 100%;
  padding: 0.48rem 0.65rem;
  font-size: 0.86rem;
}

.slot-card:hover {
  transform: translateY(-2px);
  border-color: rgba(57, 255, 20, 0.25);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.slot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 0%, rgba(57, 255, 20, 0.08), transparent 55%);
  pointer-events: none;
}

.slot-title {
  position: relative;
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--neon-green);
}

.slot-empty,
.slot-ready,
.slot-progress {
  position: relative;
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.35;
}

.slot-ready {
  color: var(--neon-violet);
  font-weight: 600;
}

.grow-bar {
  position: relative;
  height: 9px;
  background: #1a1a22;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.5rem;
  border: 1px solid var(--border);
}

.grow-bar-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-violet), var(--neon-green));
  border-radius: 999px;
  transition: width 0.45s ease;
}

.slot-visual {
  position: relative;
  flex-shrink: 0;
  align-self: center;
  margin: 0 0 0.35rem;
  line-height: 0;
}

.slot-visual__img {
  display: block;
  width: min(100%, 140px);
  height: auto;
  max-height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
  transition:
    filter 0.35s ease,
    opacity 0.35s ease;
}

.slot-card--ready .slot-visual__img {
  filter:
    drop-shadow(0 0 8px rgba(57, 255, 20, 0.45)) drop-shadow(0 4px 12px rgba(0, 0, 0, 0.35));
}

/* Boutique */
.shop-block {
  margin-bottom: 1.15rem;
}

.shop-block:last-child {
  margin-bottom: 0;
}

.shop-block-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.shop-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--neon-violet);
  box-shadow: 0 0 10px var(--neon-violet-dim);
}

.shop-dot--violet {
  background: var(--neon-violet);
}

.shop-dot--green {
  background: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green-dim);
}

.shop-intro {
  font-size: 0.82rem;
  color: var(--muted);
  margin: -0.25rem 0 0.65rem;
  line-height: 1.4;
}

.shop-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shop-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.2s, background 0.2s;
  overflow: visible;
  flex-shrink: 0;
}

.shop-card:hover {
  border-color: rgba(191, 95, 255, 0.35);
  background: rgba(191, 95, 255, 0.05);
}

.shop-card--feature {
  flex-direction: column;
  align-items: stretch;
  padding: 0.85rem 1rem;
  border-color: rgba(57, 255, 20, 0.2);
  background: linear-gradient(145deg, rgba(57, 255, 20, 0.06), transparent);
}

.shop-card--poto {
  border-color: rgba(191, 95, 255, 0.2);
}

.shop-card-thumb {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.shop-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.shop-card-thumb--lg {
  width: 80px;
  height: 80px;
  margin: 0 auto 0.45rem;
}

.shop-card-body {
  flex: 1;
  min-width: 0;
  overflow: visible;
}

.shop-card-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
}

.shop-card-desc {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.shop-card-price {
  margin: 0.35rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--neon-green);
}

.shop-card--feature .shop-card-price {
  font-size: 1rem;
}

/* Boutons */
button {
  cursor: pointer;
  font-family: inherit;
  border: 1px solid var(--neon-green);
  background: transparent;
  color: var(--neon-green);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

button:hover {
  background: rgba(57, 255, 20, 0.12);
}

button:active {
  transform: scale(0.98);
}

button.secondary {
  border-color: var(--neon-violet);
  color: var(--neon-violet);
}

button.secondary:hover {
  background: rgba(191, 95, 255, 0.12);
}

.btn-primary {
  padding: 0.55rem 1.1rem;
  background: rgba(57, 255, 20, 0.15);
  box-shadow: 0 0 20px rgba(57, 255, 20, 0.15);
}

.btn-primary:hover {
  background: rgba(57, 255, 20, 0.22);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.08);
}

.btn-sell {
  border-color: rgba(191, 95, 255, 0.45);
  color: var(--neon-violet);
}

.btn-block {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.55rem;
}

.btn-tiny {
  flex-shrink: 0;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  min-width: 2.75rem;
}

/* Modales */
body.modal-open {
  overflow: hidden;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal[hidden] {
  display: none !important;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.modal-box {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  max-height: min(90vh, 520px);
  overflow-y: auto;
  padding: 1.35rem 1.4rem;
  background: var(--bg-panel);
  border: 1px solid rgba(57, 255, 20, 0.2);
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(191, 95, 255, 0.12);
}

/* Modales boutique / stock */
.modal--shop,
.modal--stock {
  z-index: 210;
}

.modal-box--shop {
  box-sizing: border-box;
  /* Fenêtre large : occupe une bonne partie de l’écran (sans coller aux bords) */
  width: min(96vw, 920px);
  max-width: min(96vw, 920px);
  /* Hauteur suivant le contenu, plafonnée */
  height: auto;
  max-height: min(92dvh, 900px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1rem 1.25rem 0.85rem;
}

.modal-title--shop {
  margin-bottom: 0.15rem;
}

.modal-shop-tagline {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
  flex-shrink: 0;
}

.modal-shop-cash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0 0 0.65rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  background: rgba(57, 255, 20, 0.08);
  border: 1px solid rgba(57, 255, 20, 0.22);
  flex-shrink: 0;
}

.modal-shop-cash-label {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.modal-shop-cash-value {
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(57, 255, 20, 0.95);
}

/* Cartes plus compactes dans la modale : 2 lignes par page sans scroll */
.modal-box--shop .shop-card:not(.shop-card--feature) {
  padding: 0.45rem 0.6rem;
  gap: 0.5rem;
}

.modal-box--shop .shop-card:not(.shop-card--feature) .shop-card-name {
  font-size: 0.86rem;
}

.modal-box--shop .shop-card:not(.shop-card--feature) .shop-card-desc {
  font-size: 0.72rem;
  margin-top: 0.06rem;
  line-height: 1.25;
}

.modal-box--shop .shop-card:not(.shop-card--feature) .shop-card-price {
  margin-top: 0.18rem;
  font-size: 0.8rem;
}

.modal-box--shop .shop-card-thumb:not(.shop-card-thumb--lg) {
  width: 48px;
  height: 48px;
}

.modal-box--shop .shop-card-thumb--lg {
  width: 64px;
  height: 64px;
}

.modal-box--shop .shop-tab-panel .shop-card-list {
  gap: 0.4rem;
}

.shop-tabs {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.shop-tab {
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    color 0.2s;
}

.shop-tab.is-active {
  border-color: rgba(57, 255, 20, 0.45);
  color: var(--neon-green);
  background: rgba(57, 255, 20, 0.08);
}

.shop-tab:not(.is-active):hover {
  color: var(--text);
  border-color: var(--border);
}

.shop-tab-panels {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* [hidden] doit rester masqué : une règle "display:flex" plus bas ne doit pas l’écraser */
.shop-tab-panel[hidden] {
  display: none !important;
}

.shop-tab-panel {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Zone liste : plafond pour que la mesure (pagination auto) soit stable */
.shop-tab-panel__body {
  flex: 0 1 auto;
  min-height: 0;
  max-height: min(72vh, 640px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 0.2rem;
}

/* Pagination active : pas d’ascenseur dans la liste, on change de page à la place */
.shop-tab-panel:has(.shop-pagination:not([hidden])) .shop-tab-panel__body {
  overflow-y: hidden;
}

.shop-tab-panel .shop-intro {
  flex-shrink: 0;
  margin: 0 0 0.55rem;
}

.shop-tab-panel .shop-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.shop-tab-panel .shop-pagination {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  padding: 0.65rem 0.35rem 0.15rem;
  margin-top: 0.45rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.25));
}

.shop-page-prev,
.shop-page-next {
  min-width: 2.5rem;
  height: 2.25rem;
  padding: 0.35rem 0.5rem;
  font-size: 1.15rem;
  line-height: 1;
  border-radius: 999px;
  border-color: rgba(57, 255, 20, 0.35);
  background: rgba(57, 255, 20, 0.06);
}

.shop-page-prev:disabled,
.shop-page-next:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.shop-page-indicator {
  font-size: 0.85rem;
  color: var(--muted);
  min-width: 3.5rem;
  text-align: center;
}

/* Comme pour .shop-tab-panel : [hidden] doit gagner sur display:flex */
.shop-page[hidden] {
  display: none !important;
}

.shop-page {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  min-height: 0;
  overflow: visible;
}

.modal-title {
  font-family: var(--font-display);
  margin: 0 0 0.35rem;
  font-size: 1.2rem;
  color: var(--neon-violet);
}

.modal-intro {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.45;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.modal-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.modal-label input {
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0c0c12;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
}

.modal-label input:focus {
  outline: 2px solid rgba(57, 255, 20, 0.35);
  border-color: var(--neon-green);
}

.modal-submit {
  margin-top: 0.25rem;
  width: 100%;
  padding: 0.65rem 1rem;
}

.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
}

.modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

/* Modale stock */
.modal-box--stock {
  max-width: min(520px, 96vw);
  width: min(520px, 96vw);
  max-height: min(88dvh, 720px);
  overflow-y: auto;
}

.stock-rows {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.stock-row {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.stock-row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.stock-row-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--neon-green);
}

.stock-row-avail {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}

.stock-row-price {
  margin: 0 0 0.55rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.stock-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.stock-sell-input {
  flex: 1 1 6rem;
  min-width: 5rem;
  max-width: 10rem;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: #0c0c12;
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
}

.stock-sell-input:disabled {
  opacity: 0.5;
}

.btn-stock-partial {
  flex: 1 1 auto;
  min-width: 8rem;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.btn-stock-all {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  font-size: 0.85rem;
}

.stock-footer-note {
  margin: 1rem 0 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.btn-stock-sell-all {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.88rem;
}

/* Lien admin + modale parties */
/* Admin intégré (remplace la zone Production) */
.admin-embed {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-top: 0.25rem;
  padding: 0.75rem 1rem 1rem;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.admin-embed[hidden] {
  display: none !important;
}

.admin-embed-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.admin-embed-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--neon-violet);
}

.admin-embed-intro {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
}

.admin-embed-status {
  min-height: 1.25rem;
  font-size: 0.85rem;
  margin: 0 0 0.65rem;
}

.admin-tabs {
  margin-bottom: 0.5rem;
}

.admin-tab-panels {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-tab-panels .shop-tab-panel {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.admin-panel-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding-right: 0.25rem;
}

.admin-subtitle {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0.5rem 0 0.45rem;
  color: var(--text);
}

.admin-create-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.admin-inline-label {
  flex: 1 1 10rem;
  margin-bottom: 0 !important;
}

.admin-inline-label input,
.admin-inline-label select {
  margin-top: 0.25rem;
  width: 100%;
  max-width: 14rem;
}

/* Formulaire « Créer un compte » : mêmes champs que le reste du thème (pas le select blanc du navigateur) */
.admin-create-row .admin-inline-label input[type='text'],
.admin-create-row .admin-inline-label input[type='password'],
.admin-create-row .admin-inline-label select {
  display: block;
  box-sizing: border-box;
  padding: 0.45rem 0.55rem;
  font-size: 0.88rem;
  background: #0c0c12;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.admin-create-row .admin-inline-label select {
  appearance: none;
  padding-right: 2rem;
  background-color: #0c0c12;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238b8b9e' d='M3 4.5L6 7.5 9 4.5' stroke='%238b8b9e' stroke-width='1.2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.45rem center;
  cursor: pointer;
  color-scheme: dark;
}

.admin-create-row .admin-inline-label input:focus,
.admin-create-row .admin-inline-label select:focus {
  outline: 2px solid rgba(57, 255, 20, 0.35);
  border-color: var(--neon-green);
}

/* Bouton Créer / Enregistrer : pas toute la largeur (évite .modal-submit { width:100% }) */
.admin-create-row .modal-submit {
  width: auto;
  flex: 0 0 auto;
  align-self: flex-end;
  margin-top: 0;
  padding: 0.45rem 1.15rem;
  font-size: 0.88rem;
}

.admin-table-wrap {
  overflow-x: auto;
}

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

.admin-data-table th,
.admin-data-table td {
  border: 1px solid var(--border);
  padding: 0.4rem 0.45rem;
  vertical-align: middle;
}

.admin-data-table th {
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-data-table input[type='text'],
.admin-data-table input[type='password'],
.admin-data-table input[type='number'] {
  width: 100%;
  min-width: 3.5rem;
  max-width: 7rem;
  padding: 0.3rem 0.4rem;
  font-size: 0.8rem;
  background: #0c0c12;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.admin-data-table select {
  padding: 0.3rem 0.35rem;
  font-size: 0.8rem;
  background: #0c0c12;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
}

.admin-tab-hint {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

.modal-box--saves {
  max-width: min(480px, 96vw);
  width: min(480px, 96vw);
  max-height: min(88dvh, 640px);
  overflow-y: auto;
}

.saves-list-wrap {
  margin: 0.5rem 0 1rem;
  min-height: 2rem;
}

.saves-list-ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saves-li {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.75rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
  align-items: center;
}

.saves-label {
  grid-column: 1;
  font-size: 0.9rem;
  font-weight: 600;
}

.saves-meta {
  grid-column: 1;
  font-size: 0.78rem;
  color: var(--muted);
}

.saves-btn-load {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.saves-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--neon-green);
  border-radius: 4px;
}

.saves-new-row {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.saves-new-label {
  margin-bottom: 0.65rem;
}

.saves-loading,
.saves-error {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Toast */
#toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  max-width: min(90vw, 22rem);
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  background: #16161e;
  border: 1px solid var(--neon-green);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-panel);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 300;
}

#toast.toast-visible {
  opacity: 1;
}

#toast.toast-error {
  border-color: #ff4466;
  color: #ffc4d0;
}

/* Scrollbar unique : corps d’onglet boutique */
.shop-tab-panel__body {
  scrollbar-width: thin;
  scrollbar-color: rgba(57, 255, 20, 0.35) transparent;
}

.shop-tab-panel__body::-webkit-scrollbar {
  width: 8px;
}

.shop-tab-panel__body::-webkit-scrollbar-thumb {
  background: rgba(57, 255, 20, 0.25);
  border-radius: 999px;
}
