/* ThreeDoom - classic Doom status-bar HUD (no site chrome while playing) */

:root {
  --td-bar: #4a3a2a;
  --td-bar-dark: #2a1e14;
  --td-bar-edge: #1a1008;
  --td-num: #ff1a1a;
  --td-num-dim: #8a2020;
  --td-label: #c8a060;
  --td-face-bg: #3a2818;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#stage {
  display: block;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

body.td-play .overlay,
body.td-play .doom-hint {
  display: none !important;
}

/* Hide site-style panels; only the status bar remains */
.doom-hud {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 2;
  pointer-events: none;
  padding: 0;
  margin: 0;
  display: block;
  line-height: 0; /* kill inline gaps under the bar */
}

.doom-stbar {
  display: grid;
  grid-template-columns: 1fr 1.1fr auto 1.1fr 1fr;
  align-items: stretch;
  gap: 0;
  margin: 0;
  height: clamp(56px, 10vh, 72px);
  background:
    linear-gradient(180deg, #5a4634 0%, var(--td-bar) 18%, var(--td-bar-dark) 100%);
  border-top: 3px solid #7a6248;
  box-shadow: inset 0 2px 0 rgba(255, 220, 160, 0.12), 0 -4px 18px rgba(0, 0, 0, 0.55);
  font-family: "Lucida Console", "Courier New", monospace;
  color: var(--td-num);
  text-transform: uppercase;
  user-select: none;
  line-height: normal;
}

.doom-stbar__cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0.15rem 0.4rem 0.25rem;
  border-left: 2px solid var(--td-bar-edge);
  border-right: 1px solid rgba(255, 200, 120, 0.08);
  min-width: 0;
}

.doom-stbar__cell:first-child {
  border-left: none;
}

.doom-stbar__label {
  font-size: 0.55rem;
  letter-spacing: 0.12em;
  color: var(--td-label);
  line-height: 1;
  margin-bottom: 0.15rem;
}

.doom-stbar__value {
  font-size: clamp(1.35rem, 4.2vh, 2rem);
  font-weight: 700;
  line-height: 1;
  color: var(--td-num);
  text-shadow: 0 2px 0 #400808, 0 0 8px rgba(255, 40, 40, 0.35);
  letter-spacing: 0.02em;
}

.doom-stbar__value--arms {
  font-size: clamp(0.85rem, 2.4vh, 1.15rem);
  letter-spacing: 0.2em;
  color: #e8d080;
  text-shadow: 0 1px 0 #302010;
}

.doom-stbar__value--arms .on {
  color: #fff6a8;
}

.doom-stbar__value--arms .off {
  color: #5a4030;
}

.doom-stbar__face {
  width: clamp(48px, 8vh, 64px);
  height: 100%;
  margin: 0 auto;
  background:
    radial-gradient(circle at 50% 40%, #6a4830 0%, var(--td-face-bg) 70%);
  border-left: 2px solid var(--td-bar-edge);
  border-right: 2px solid var(--td-bar-edge);
  position: relative;
  image-rendering: pixelated;
}

.doom-stbar__face::before,
.doom-stbar__face::after {
  content: "";
  position: absolute;
  background: #f0d040;
  box-shadow: 0 0 0 1px #201008;
}

/* eyes */
.doom-stbar__face::before {
  width: 18%;
  height: 14%;
  top: 32%;
  left: 22%;
  box-shadow:
    0 0 0 1px #201008,
    48px 0 0 0 #f0d040,
    48px 0 0 1px #201008;
}

/* mouth */
.doom-stbar__face::after {
  width: 42%;
  height: 6%;
  top: 62%;
  left: 29%;
  border-radius: 0;
}

.doom-stbar__face[data-mood="hurt"]::after {
  top: 58%;
  height: 10%;
  border-radius: 0 0 40% 40%;
}

.doom-stbar__face[data-mood="dead"] {
  filter: grayscale(0.4) brightness(0.7);
}

.doom-stbar__face[data-mood="dead"]::after {
  top: 55%;
  height: 4%;
  width: 50%;
  left: 25%;
  transform: rotate(-12deg);
}

/* Crosshair removed - Doom-style free aim */

.doom-flash {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  transition: opacity 40ms linear;
  mix-blend-mode: screen;
}

.doom-hint {
  display: none;
}

.td-levelclear .overlay__card h1 {
  color: #ffe14a;
}

/* Keep debug usable but out of the way */
.td-debug {
  bottom: calc(clamp(56px, 10vh, 72px) + 0.5rem) !important;
}

/* Main menu actions */
.overlay__actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: stretch;
}

.overlay__actions button,
.overlay__card--wide > button {
  width: 100%;
}

.overlay__btn-secondary {
  background: #3a4650 !important;
  color: #e8f0f4 !important;
}

.overlay__btn-secondary:hover {
  background: #4a5a66 !important;
}

.overlay__card--wide {
  width: min(44rem, 96vw);
}

.td-pad-name {
  margin: -0.4rem 0 0.75rem !important;
  font-size: 0.78rem;
  color: #8ab4c8 !important;
  word-break: break-word;
  min-height: 1.1em;
}

.td-pad-stage {
  display: block;
  width: 100%;
  height: clamp(240px, 42vh, 400px);
  margin: 0 0 1rem;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(40, 80, 100, 0.45), transparent 65%),
    #061018;
  border: 1px solid rgba(255, 225, 74, 0.2);
}

.td-pad-stage[hidden] {
  display: none;
}

.td-pad-connect {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: clamp(240px, 42vh, 400px);
  margin: 0 0 1rem;
  padding: 1.5rem 1rem;
  border-radius: 0.75rem;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(80, 40, 20, 0.35), transparent 60%),
    #0a1016;
  border: 1px dashed rgba(255, 180, 80, 0.35);
}

.td-pad-connect[hidden] {
  display: none;
}

.td-pad-connect__icon {
  font-size: 2.6rem;
  line-height: 1;
  color: #ffe14a;
  text-shadow: 0 0 18px rgba(255, 200, 60, 0.55);
  margin-bottom: 0.35rem;
}

.td-pad-connect h2 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: 1.35rem;
  color: #ffe14a;
}

.td-pad-connect p {
  margin: 0;
  max-width: 22rem;
  color: #9aa8b0;
  font-size: 0.92rem;
}

body.td-play .td-pad-setup {
  display: none !important;
}
