:root {
  --bg-image: url("/img/background.jpg");
  --bg0: #07090c;
  --bg1: #0b0f14;
  --panel: #0f141b;
  --panel2: #0c1117;
  --text: #e6e7ea;
  --muted: #a0a6b0;
  --border: #2a2f38;

  /* Changement pour le thème Terraria (Vert Forêt) */
  --primary: #2d5a27;
  --primary-bright: #4a9e3f;
  
  /* Danger/Off reste rouge mais plus subtil */
  --danger: #8b0000;
  --green: #16c172;

  --shadow: 0 22px 70px rgba(0,0,0,.55);
  --radius: 18px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: #07090c;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: var(--bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(5px) saturate(.9) contrast(.95);
  transform: scale(1.06);
  z-index: -3;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(1000px 600px at 60% 30%, rgba(0,0,0,.25), rgba(0,0,0,.78)),
    linear-gradient(180deg, rgba(0,0,0,.35), rgba(0,0,0,.75));
  z-index: -2;
}

.card {
  width: min(780px, 100%);
  position: relative;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
  padding: 22px;
  overflow: hidden;
  backdrop-filter: blur(2px);
  background: linear-gradient(180deg, rgba(15,20,27,.92), rgba(15,20,27,.88));
}

/* top stripe - Vert pour Terraria */
.card::before {
  content: "";
  position: absolute;
  left: -30px;
  top: -30px;
  width: 220px;
  height: 90px;
  background: repeating-linear-gradient(
    135deg,
    rgba(45, 90, 39, .4) 0px,
    rgba(45, 90, 39, .4) 10px,
    transparent 10px,
    transparent 20px
  );
  opacity: .22;
  transform: rotate(-6deg);
  filter: blur(.2px);
}

.header {
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  margin-bottom: 14px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.25rem;
}

.status {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(0,0,0,.22), rgba(0,0,0,.12));
}

.statusText {
  margin: 0;
  color: var(--text);
  line-height: 1.35rem;
  font-family: var(--mono);
  font-size: .95rem;
}

.badge {
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: .3px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,0.05);
  text-transform: uppercase;
}

.badge--on {
  background: rgba(22, 193, 114, .16);
  border-color: rgba(22, 193, 114, .35);
  color: var(--green);
}
.badge--off {
  background: rgba(139, 0, 0, .20);
  border-color: rgba(139, 0, 0, .42);
  color: #ffb4b0;
}
.badge--unknown {
  background: rgba(148,163,184,.14);
  border-color: rgba(148,163,184,.28);
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.05);
  color: var(--text);
  border-radius: 14px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 800;
  letter-spacing: .3px;
  text-transform: uppercase;
  transition: all .16s ease;
}

.btn:hover:not(:disabled) {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.16);
}

.btn:active { transform: translateY(1px); }

.btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  filter: saturate(.8);
}

.btn--primary {
  background: linear-gradient(180deg, rgba(45, 90, 39, .5), rgba(45, 90, 39, .2));
  border-color: rgba(74, 158, 63, .42);
}
.btn--primary:hover:not(:disabled) {
  border-color: var(--primary-bright);
  box-shadow: 0 0 15px rgba(45, 90, 39, 0.3);
}

.btn--danger {
  background: linear-gradient(180deg, rgba(139, 0, 0, .3), rgba(139, 0, 0, .1));
  border-color: rgba(255, 59, 48, .3);
}

.btn--ghost { background: transparent; }

/* INPUTS */
.input {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  color: var(--text);
  outline: none;
  font-family: var(--mono);
}

.input:focus {
  border-color: var(--primary-bright);
  box-shadow: 0 0 0 3px rgba(45, 90, 39, .2);
}

/* LOG */
.log {
  margin: 0;
  padding: 14px;
  min-height: 120px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(180deg, rgba(0,0,0,.32), rgba(0,0,0,.20));
  color: #d2d6dd;
  overflow: auto;
  font-family: var(--mono);
  font-size: .92rem;
}

/* TITRE LES BRANKES */
.main-header {
  position: absolute;
  top: 40px;
  width: 100%;
  text-align: center;
}

.main-header h1 {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #e5e5e5;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(45, 90, 39, 0.45), 0 0 40px rgba(0,0,0,0.9);
}

.main-header h1::after {
  content: "";
  display: block;
  margin: 10px auto 0;
  width: 220px;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-bright), transparent);
}