:root {
  color-scheme: light;
  --desk: #c7a77d;
  --desk-shadow: #a17e56;
  --ink: #26211b;
  --paper: #f4eddc;
  --paper-edge: #d6c6a8;
  --accent: #9a3126;
  --muted: #6f6251;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 247, 224, 0.45), rgba(255, 247, 224, 0) 36%),
    linear-gradient(180deg, #d6b488, var(--desk) 35%, #b58f64);
  font-family: Georgia, "Palatino Linotype", "Book Antiqua", serif;
  color: var(--ink);
}

body {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  left: max(14px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  width: min(30rem, calc(100vw - 28px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  padding: 0.7rem 0.9rem 0.75rem;
  border-radius: 0.9rem;
  background: rgba(244, 237, 220, 0.84);
  box-shadow: 0 0.5rem 1.2rem rgba(55, 34, 18, 0.14);
  backdrop-filter: blur(1px);
  z-index: 2;
}

.desk-tab {
  position: absolute;
  display: block;
  border: 1px solid #c7b086;
  border-radius: 0.85rem;
  background: #ead8b5;
  color: #4c3c2d;
  font: 600 1rem/1 Georgia, "Palatino Linotype", "Book Antiqua", serif;
  letter-spacing: 0.01em;
  padding: 0;
  box-shadow: 0 0.3rem 0.9rem rgba(55, 34, 18, 0.12);
  z-index: 2;
}

.desk-tab:active {
  transform: translateY(1px);
}

.desk-tab[hidden] {
  display: none;
}

.blot-tab {
  background: #ddc39a;
}

.hud-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.title {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.stage-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.status-line {
  margin: 0.45rem 0 0;
  font-size: 0.93rem;
  line-height: 1.3;
  color: #45392c;
}

@media (max-width: 720px) {
  .hud {
    width: calc(100vw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
    padding: 0.7rem 0.8rem;
  }

  .hud-line {
    gap: 0.5rem;
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html,
  body,
  .hud {
    scroll-behavior: auto;
  }
}
