:root {
  --bg: #0b0a0f;
  --ink: #e9e4d8;
  --ink-dim: #9a9488;
  --accent: #b3263a;       /* backgrounds (error messages) */
  --accent-text: #e05264;  /* red text on the dark background (contrast ~4.7:1) */
  --bar-bg: #24212b;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
}

#game {
  position: fixed;
  inset: 0;
}

#unity-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--bg);
  outline: none;
}

/* ---- Loading screen ---- */
#loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  text-align: center;
  background: radial-gradient(ellipse at center, #1a1720 0%, var(--bg) 70%);
  transition: opacity 0.6s ease;
}

#loader.done {
  opacity: 0;
  pointer-events: none;
}

.title {
  margin: 0;
  font-size: clamp(2rem, 6vw, 4rem);
  font-weight: normal;
  letter-spacing: 0.04em;
}

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

.subtitle {
  margin: 0 0 18px;
  color: var(--ink-dim);
  font-style: italic;
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
}

.bar {
  width: min(360px, 80vw);
  height: 4px;
  border-radius: 2px;
  background: var(--bar-bg);
  overflow: hidden;
}

.bar-fill {
  width: 0;
  height: 100%;
  background: var(--ink);
  transition: width 0.2s ease;
}

.status {
  margin: 0;
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.hint {
  margin: 8px 0 0;
  max-width: 420px;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

/* ---- Messages ---- */
#banner {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(560px, calc(100% - 32px));
  pointer-events: none;
}

.banner-msg {
  padding: 10px 14px;
  border-radius: 6px;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  background: #2a2733;
  color: var(--ink);
}

.banner-msg.warning { background: #5a4a12; }
.banner-msg.error { background: var(--accent); pointer-events: auto; }

/* ---- Fullscreen button ---- */
#fullscreen {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 6px;
  background: rgba(11, 10, 15, 0.55);
  color: var(--ink);
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

#fullscreen:hover,
#fullscreen:focus-visible { opacity: 1; }

#fullscreen[hidden] { display: none; }
