:root {
  --bg: #000000;
  --panel: rgba(28, 30, 33, 0.82);
  --panel-strong: rgba(28, 30, 33, 0.94);
  --text: #ffffff;
  --secondary: #e4e6eb;
  --muted: #b0b3b8;
  --line: rgba(255, 255, 255, 0.72);
  --peak: #ffffff;
  --tower: #7dd3fc;
  --church: #fde68a;
  --partial: #b0b3b8;
  --focus: rgba(0, 212, 255, 0.46);
  --danger: #ff8a8a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 600px;
  height: 600px;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

button {
  font: inherit;
}

#app,
.screen {
  width: 600px;
  height: 600px;
}

.screen {
  position: relative;
  padding: 8px;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

.topbar {
  height: 72px;
  padding: 14px 16px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(28, 30, 33, 0.9), rgba(28, 30, 33, 0.35));
  border-radius: 8px;
}

h1 {
  font-size: 28px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0;
}

.topbar p {
  max-width: 410px;
  margin-top: 7px;
  color: var(--secondary);
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heading-pill {
  min-width: 74px;
  min-height: 42px;
  padding: 8px 12px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
  text-align: center;
}

.heading-pill.ready {
  border-color: rgba(125, 211, 252, 0.78);
  box-shadow: 0 0 14px rgba(125, 211, 252, 0.22);
}

.heading-pill.settling {
  border-color: rgba(253, 230, 138, 0.7);
}

.sky {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.horizon {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.heading-scale {
  position: absolute;
  left: 24px;
  right: 24px;
  top: 18px;
  display: flex;
  justify-content: space-between;
  color: rgba(255, 255, 255, 0.42);
  font-size: 12px;
  line-height: 1;
}

.reticle {
  position: absolute;
  left: 50%;
  top: 88px;
  bottom: 30px;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.54), transparent);
}

.reticle::before {
  content: "";
  position: absolute;
  top: 146px;
  left: -9px;
  width: 20px;
  height: 2px;
  background: rgba(255, 255, 255, 0.68);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.debug-panel {
  position: absolute;
  left: 12px;
  bottom: 14px;
  width: 228px;
  min-height: 152px;
  padding: 10px 12px;
  border: 2px solid rgba(125, 211, 252, 0.48);
  border-radius: 8px;
  background: rgba(28, 30, 33, 0.92);
  color: var(--secondary);
  z-index: 4;
}

.debug-title {
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  margin-bottom: 8px;
}

.debug-output {
  white-space: pre-line;
  font-size: 12px;
  line-height: 1.22;
  color: var(--secondary);
}

.sky-object {
  position: absolute;
  width: 124px;
  height: 500px;
  transform: translateX(-62px);
  opacity: 0.96;
  transition: left 180ms ease, top 180ms ease, opacity 180ms ease;
}

.sky-object.outside {
  opacity: 0;
}

.guide {
  position: absolute;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
  background: linear-gradient(to bottom, var(--line), rgba(255, 255, 255, 0.18));
  border-radius: 2px;
}

.anchor-dot {
  position: absolute;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translate(-50%, -50%);
  border: 2px solid var(--text);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.32);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.38);
}

.label {
  position: absolute;
  left: 0;
  right: 0;
  height: 68px;
  padding: 7px 8px;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-radius: 8px;
  background: var(--panel-strong);
  color: var(--text);
  text-align: center;
  overflow: hidden;
}

.sky-object.peak .label {
  border-color: rgba(255, 255, 255, 0.72);
}

.sky-object.church .label,
.sky-object.chapel .label,
.sky-object.bell-tower .label {
  border-color: rgba(253, 230, 138, 0.72);
}

.sky-object.observation-tower .label,
.sky-object.tower .label {
  border-color: rgba(125, 211, 252, 0.72);
}

.sky-object.partial {
  opacity: 0.76;
}

.sky-object.partial .guide {
  background: linear-gradient(to bottom, rgba(176, 179, 184, 0.76), rgba(176, 179, 184, 0.12));
}

.sky-object.partial .label {
  border-style: dashed;
}

.sky-object.partial .anchor-dot {
  border-color: var(--partial);
  background: rgba(176, 179, 184, 0.28);
}

.name {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.08;
  font-weight: 800;
  overflow-wrap: anywhere;
  max-height: 32px;
  overflow: hidden;
}

.meta {
  display: block;
  margin-top: 5px;
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.state-panel {
  position: absolute;
  left: 28px;
  right: 28px;
  top: 104px;
  min-height: 288px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  background: var(--panel-strong);
  border: 2px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  z-index: 5;
}

.state-icon {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  font-size: 40px;
  line-height: 1;
}

.state-panel h2 {
  font-size: 24px;
  line-height: 1.12;
  font-weight: 800;
}

.state-panel p {
  color: var(--secondary);
  font-size: 16px;
  line-height: 1.3;
}

.error {
  border-color: rgba(255, 138, 138, 0.72);
}

.nav-bar {
  height: 96px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.nav-item {
  height: 88px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.focusable {
  opacity: 0.82;
  transition: transform 475ms cubic-bezier(0.6, 0, 0.4, 1), opacity 300ms cubic-bezier(0.4, 0.04, 0.5, 1), box-shadow 180ms ease;
}

.focusable:focus {
  outline: none;
  opacity: 1;
  transform: scale(0.91);
  box-shadow: 0 0 20px var(--focus);
}
