html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #6f6a4a;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
}

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

#game-container canvas {
  display: block;
}

.back-link {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 20;
  color: #eef0c0;
  opacity: 0.45;
  font-size: 0.8rem;
  text-decoration: none;
}

.back-link:hover {
  opacity: 1;
}

.coords {
  position: fixed;
  top: 0.75rem;
  right: 1rem;
  z-index: 20;
  color: #eef0c0;
  opacity: 0.45;
  font-size: 0.8rem;
  pointer-events: none;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 6, 0.78);
  text-align: center;
  transition: opacity 0.4s ease;
}

.splash.hidden {
  opacity: 0;
  pointer-events: none;
}

.win98-window {
  width: min(560px, 92vw);
  background: #c0c0c0;
  border: 2px solid #fff;
  border-right-color: #000;
  border-bottom-color: #000;
  box-shadow:
    inset -1px -1px #808080,
    inset 1px 1px #dfdfdf,
    2px 2px 0 1px rgba(0, 0, 0, 0.4);
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}

.win98-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  padding: 3px 4px 3px 6px;
}

.win98-title {
  font-size: 0.85rem;
  font-weight: bold;
  letter-spacing: 0.04em;
}

.win98-buttons {
  display: flex;
  gap: 3px;
}

.win98-btn {
  width: 18px;
  height: 16px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #c0c0c0;
  border: none;
  box-shadow:
    inset -1px -1px #404040,
    inset 1px 1px #fff,
    inset -2px -2px #808080,
    inset 2px 2px #dfdfdf;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 0.65rem;
  font-weight: bold;
  line-height: 1;
  color: #000;
  cursor: default;
}

.win98-btn:active {
  box-shadow:
    inset 1px 1px #404040,
    inset -1px -1px #fff,
    inset 2px 2px #808080,
    inset -2px -2px #dfdfdf;
}

.win98-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.win98-screen {
  width: 100%;
  box-sizing: border-box;
  padding: 2rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
  background: #14150c;
  color: #eef0c0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  box-shadow:
    inset -1px -1px #fff,
    inset 1px 1px #808080,
    inset -2px -2px #dfdfdf,
    inset 2px 2px #404040;
}

.win98-screen h1 {
  margin: 0;
  font-size: 2.2rem;
  letter-spacing: 0.3em;
  text-shadow: 0 0 14px rgba(238, 240, 192, 0.6);
}

.tagline {
  margin: 0;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.55;
}

.controls-hint {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hint-row {
  display: flex;
  gap: 2.5rem;
  align-items: flex-end;
  justify-content: center;
}

.key-group,
.mouse-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.key-row {
  display: flex;
  gap: 0.35rem;
}

.key {
  width: 2.4rem;
  height: 2.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #eef0c0;
  border-radius: 0.25rem;
  font-size: 1rem;
}

.key-wide {
  width: auto;
  min-width: 3.6rem;
  padding: 0 0.5rem;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.mouse-group svg {
  margin: 0.2rem 0;
}

.hint-label {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  opacity: 0.65;
}

.mode-select {
  display: flex;
  gap: 2rem;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  cursor: default;
  user-select: none;
}

.mode-option input[type="radio"] {
  accent-color: #eef0c0;
  width: 1rem;
  height: 1rem;
  cursor: default;
}

#enter-btn {
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: bold;
  letter-spacing: 0.2em;
  background: #c0c0c0;
  color: #000;
  border: none;
  padding: 0.6rem 3rem;
  box-shadow:
    inset -1px -1px #404040,
    inset 1px 1px #fff,
    inset -2px -2px #808080,
    inset 2px 2px #dfdfdf;
  cursor: default;
}

#enter-btn:active {
  box-shadow:
    inset 1px 1px #404040,
    inset -1px -1px #fff,
    inset 2px 2px #808080,
    inset -2px -2px #dfdfdf;
}

.game-over-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 2s ease;
}

.game-over-overlay.visible {
  background: rgba(0, 0, 0, 0.96);
  pointer-events: all;
}

.game-over-box {
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  color: #c0b49a;
  opacity: 0;
  transition: opacity 1s ease 1.5s;
}

.game-over-overlay.visible .game-over-box {
  opacity: 1;
}

.game-over-title {
  font-size: 3rem;
  letter-spacing: 0.2em;
  margin: 0 0 0.5rem;
  color: #fff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.25);
}

.game-over-sub {
  font-size: 1rem;
  letter-spacing: 0.1em;
  margin: 0 0 2.5rem;
  opacity: 0.75;
}

.game-over-btn {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  font-size: 0.9rem;
  letter-spacing: 0.2em;
  background: transparent;
  color: #c0b49a;
  border: 1px solid #c0b49a;
  padding: 0.7rem 2.5rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.game-over-btn:hover {
  background: #c0b49a;
  color: #14150c;
}

/* crosshair */
#crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 25;
  display: none;
}
#crosshair::before,
#crosshair::after {
  content: '';
  position: absolute;
  background: rgba(238, 240, 192, 0.75);
}
#crosshair::before {
  width: 2px; height: 12px;
  left: 5px; top: 0;
}
#crosshair::after {
  width: 12px; height: 2px;
  top: 5px; left: 0;
}
#crosshair.active { display: block; }

/* goblin health bar */
.goblin-hud {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.goblin-hud.hidden { opacity: 0; }
.goblin-hud-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Courier New", monospace;
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: #c0b49a;
  opacity: 0.8;
}
.goblin-hp-track {
  width: 160px;
  height: 6px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(192,180,154,0.4);
}
.goblin-hp-fill {
  height: 100%;
  background: #c0b49a;
  width: 100%;
  transition: width 0.15s ease, background 0.3s ease;
}
