/* ---------------------------------------------------------------
   Orbis Status — thème "univers cubique"
   Palette de pierre/parchemin en base, deux familles d'accents
   (Minecraft : herbe/terre — Hytale : aurore violet/cyan)
   activées selon l'écran affiché.
--------------------------------------------------------------- */

:root {
  --bg-deep: #14120d;
  --bg: #201c15;
  --panel: #372f22;
  --panel-light: #4a4030;
  --border-light: #6d604239;
  --border-hi: #857352;
  --border-lo: #0e0c08;
  --text: #f1e9d6;
  --text-dim: #b7ab8c;

  --mc-a: #6fa72e;
  --mc-a-dim: #4d7a1f;
  --mc-b: #8a5a2f;

  --hy-a: #8a5fce;
  --hy-a-dim: #6a45a8;
  --hy-b: #33c6bd;

  --accent: var(--mc-a);
  --accent-dim: var(--mc-a-dim);
  --accent-2: var(--mc-b);

  --font-display: "Press Start 2P", monospace;
  --font-body: "Rubik", sans-serif;

  --radius: 3px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-deep);
  color: var(--text);
  font-family: var(--font-body);
}

body {
  overflow-x: hidden;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.world {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
}

/* Textured "block" floor pattern, subtle */
.world::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image:
    linear-gradient(var(--text) 1px, transparent 1px),
    linear-gradient(90deg, var(--text) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
}

.parallax-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; }

/* ---------- header ---------- */

.site-header {
  position: relative;
  z-index: 1;
  padding: 28px 24px 8px;
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-cube {
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dim) 100%);
  border-top: 2px solid #ffffff55;
  border-left: 2px solid #ffffff33;
  border-right: 2px solid #00000055;
  border-bottom: 2px solid #00000066;
  transition: background 0.4s ease;
}

.brand-text {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--text);
}

.brand-tagline {
  margin: 10px 0 0;
  font-size: 13.5px;
  color: var(--text-dim);
}

/* ---------- stage / screens ---------- */

#stage {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px 60px;
}

.screen {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: screen-in 0.35s ease both;
}

.screen.is-hidden { display: none; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.screen-title {
  font-family: var(--font-display);
  font-size: clamp(15px, 2.6vw, 20px);
  line-height: 1.6;
  text-align: center;
  margin: 6px 0 34px;
  color: var(--text);
  text-shadow: 2px 2px 0 var(--border-lo);
}

.back-btn {
  align-self: flex-start;
  background: var(--panel);
  color: var(--text-dim);
  border: none;
  border-top: 2px solid var(--border-hi);
  border-left: 2px solid var(--border-hi);
  border-right: 2px solid var(--border-lo);
  border-bottom: 2px solid var(--border-lo);
  padding: 8px 14px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13px;
  border-radius: var(--radius);
  margin-bottom: 18px;
}

.back-btn:hover { color: var(--text); background: var(--panel-light); }
.back-btn:active {
  border-top-color: var(--border-lo);
  border-left-color: var(--border-lo);
  border-right-color: var(--border-hi);
  border-bottom-color: var(--border-hi);
}

/* ---------- game cards (inventory-slot style cubes) ---------- */

.card-row {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  justify-content: center;
}

.game-card {
  --theme-a: var(--mc-a);
  --theme-b: var(--mc-b);
  width: 216px;
  padding: 26px 18px 22px;
  background: var(--panel);
  border-top: 3px solid var(--border-hi);
  border-left: 3px solid var(--border-hi);
  border-right: 3px solid var(--border-lo);
  border-bottom: 3px solid var(--border-lo);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: transform 0.12s ease, background 0.2s ease;
}

.game-card.hy-theme { --theme-a: var(--hy-a); --theme-b: var(--hy-b); }

.game-card:hover {
  background: var(--panel-light);
  transform: translateY(-3px);
}

.game-card:active {
  transform: translateY(0);
  border-top-color: var(--border-lo);
  border-left-color: var(--border-lo);
  border-right-color: var(--border-hi);
  border-bottom-color: var(--border-hi);
}

.card-cube {
  position: relative;
  width: 64px;
  height: 64px;
  margin: 6px 0 4px;
}

.cube-face {
  position: absolute;
  width: 44px;
  height: 44px;
}

.cube-top {
  top: 0; left: 10px;
  background: var(--theme-a);
  transform: skewX(-30deg) scaleY(0.58) rotate(30deg);
  border-radius: 2px;
}

.cube-left {
  bottom: 0; left: 0;
  height: 36px;
  background: color-mix(in srgb, var(--theme-a) 55%, black);
  transform: skewY(15deg);
  border-radius: 2px;
}

.cube-right {
  bottom: 0; right: 0;
  height: 36px;
  background: var(--theme-b);
  transform: skewY(-15deg);
  border-radius: 2px;
}

.card-label {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--text);
  text-align: center;
}

.card-sub {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
}

/* ---------- status panel ---------- */

.status-panel {
  width: 100%;
  max-width: 480px;
  background: var(--panel);
  border-top: 3px solid var(--border-hi);
  border-left: 3px solid var(--border-hi);
  border-right: 3px solid var(--border-lo);
  border-bottom: 3px solid var(--border-lo);
  border-radius: var(--radius);
  padding: 26px 26px 30px;
}

.status-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.status-header .screen-title { margin: 0; }

.status-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

.status-pill[data-state="online"] { background: #315c1e; color: #cdeeb0; }
.status-pill[data-state="offline"] { background: #5c2020; color: #f0c0c0; }
.status-pill[data-state="loading"] { background: #4a4030; color: var(--text-dim); }

.status-body { margin-top: 22px; }

.server-address {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 13.5px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

#server-host-port {
  font-family: "Rubik", monospace;
  color: var(--text);
  word-break: break-all;
}

.copy-btn {
  flex-shrink: 0;
  background: var(--panel-light);
  color: var(--text);
  border: none;
  border-radius: var(--radius);
  padding: 6px 10px;
  font-size: 12px;
}

.copy-btn:hover { background: var(--accent-dim); }

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 18px;
}

.stat-slot {
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: lowercase;
}

.stat-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.status-motd {
  font-size: 13px;
  color: var(--text-dim);
  font-style: italic;
  min-height: 1em;
  margin: 0 0 20px;
}

.refresh-btn {
  width: 100%;
  background: var(--accent);
  color: #14120d;
  font-weight: 700;
  font-size: 13.5px;
  border: none;
  border-top: 2px solid #ffffff55;
  border-left: 2px solid #ffffff33;
  border-right: 2px solid #00000044;
  border-bottom: 2px solid #00000055;
  border-radius: var(--radius);
  padding: 12px;
  transition: background 0.2s ease;
}

.refresh-btn:hover { background: var(--accent-dim); color: var(--text); }

/* ---------- admin panel ---------- */

.admin-form-panel {
  max-width: 460px;
}

.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.admin-panel-header .back-btn {
  margin: 0;
  text-decoration: none;
  display: inline-block;
}

.admin-fieldset {
  border: none;
  background: var(--bg-deep);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  margin: 0 0 16px;
}

.admin-fieldset legend {
  font-size: 12px;
  color: var(--text-dim);
  padding: 0 4px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-dim);
}

.form-field:last-child { margin-bottom: 0; }

.form-field input {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--text);
  background: var(--panel);
  border: none;
  border-top: 2px solid var(--border-lo);
  border-left: 2px solid var(--border-lo);
  border-right: 2px solid var(--border-hi);
  border-bottom: 2px solid var(--border-hi);
  border-radius: var(--radius);
  padding: 9px 10px;
}

.form-field input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.admin-form .refresh-btn { margin-top: 4px; }

.form-error {
  background: #5c2020;
  color: #f0c0c0;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 18px;
}

.form-success {
  background: #315c1e;
  color: #cdeeb0;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  margin: 0 0 18px;
}

.admin-back-link {
  text-align: center;
  margin: 18px 0 0;
  font-size: 12.5px;
}

.admin-back-link a,
.admin-form-panel a {
  color: var(--text-dim);
}

.admin-back-link a:hover { color: var(--text); }

/* ---------- footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 18px;
  font-size: 11px;
  color: var(--text-dim);
  opacity: 0.6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.admin-footer-link {
  color: inherit;
  text-decoration: none;
}

.admin-footer-link:hover { text-decoration: underline; }

/* ---------- responsive ---------- */

@media (max-width: 520px) {
  .card-row { gap: 16px; }
  .game-card { width: 45%; min-width: 140px; padding: 20px 12px 16px; }
  .stat-grid { grid-template-columns: 1fr; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  .screen, .game-card { animation: none !important; transition: none !important; }
}
