:root { color-scheme: dark; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  margin: 0;
  background: #000;
  color: #eaeaea;
  overflow: hidden;
}

#matrix {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  display: block;
}

#admin-rabbit {
  position: fixed;
  right: clamp(18px, 3vw, 42px);
  bottom: clamp(16px, 3vw, 36px);
  z-index: 1;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(20px, 2.4vw, 29px);
  line-height: 1;
  text-decoration: none;
  filter: grayscale(1) brightness(1.65) drop-shadow(0 0 7px rgba(143, 255, 175, 0.35));
  opacity: 0;
  animation: rabbit-signal 9s ease-in-out infinite;
}
#admin-rabbit:hover,
#admin-rabbit:focus-visible {
  opacity: 0.75;
  filter: grayscale(1) brightness(2) drop-shadow(0 0 9px rgba(173, 255, 196, 0.8));
  outline: none;
  animation-play-state: paused;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.admin-page {
  min-height: 100%;
  overflow: auto;
  display: grid;
  place-items: center;
  background: #010403;
}

.admin-matrix { opacity: 0.38; }

.admin-vignette {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at center, rgba(1, 8, 4, 0.28) 0 20%, rgba(0, 2, 1, 0.92) 72%),
    linear-gradient(90deg, rgba(0, 0, 0, 0.62), transparent 35% 65%, rgba(0, 0, 0, 0.62));
  pointer-events: none;
}

.admin {
  position: relative;
  z-index: 1;
  width: min(360px, calc(100vw - 40px));
  box-sizing: border-box;
  padding: 42px 38px 36px;
  border: 1px solid rgba(89, 255, 145, 0.3);
  border-radius: 4px;
  background: rgba(1, 7, 4, 0.88);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.8), 0 24px 80px rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  text-align: center;
  animation: admin-enter 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.admin::before,
.admin::after {
  content: '';
  position: absolute;
  top: -1px;
  width: 38px;
  height: 1px;
  background: #78ff9c;
  box-shadow: 0 0 12px rgba(90, 255, 139, 0.7);
}
.admin::before { left: -1px; }
.admin::after { right: -1px; }

.admin-mark {
  position: relative;
  width: 32px;
  height: 38px;
  margin: 0 auto 22px;
  border: 1px solid rgba(116, 255, 158, 0.72);
  border-bottom: 0;
}
.admin-mark::before,
.admin-mark::after {
  content: '';
  position: absolute;
  top: -10px;
  width: 23px;
  height: 1px;
  background: rgba(116, 255, 158, 0.72);
}
.admin-mark::before { left: -4px; transform: rotate(-31deg); transform-origin: right; }
.admin-mark::after { right: -4px; transform: rotate(31deg); transform-origin: left; }
.admin-mark span {
  position: absolute;
  right: 5px;
  bottom: 15px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #aaffc0;
  box-shadow: 0 0 7px #55ff86;
}

.admin-kicker {
  margin: 0 0 10px;
  color: #6eff96;
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
}
.admin h1 {
  margin: 0;
  color: #f1fff5;
  font: 600 31px/1.15 Georgia, 'Times New Roman', serif;
  letter-spacing: 0;
}
.admin-intro {
  margin: 9px 0 28px;
  color: #829087;
  font-size: 13px;
}

.google-button-wrap {
  width: 284px;
  min-height: 48px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 2px;
  border-radius: 999px;
  background: linear-gradient(105deg, rgba(49, 255, 111, 0.28), rgba(4, 74, 27, 0.15), rgba(111, 255, 153, 0.38));
  box-shadow: 0 0 18px rgba(51, 255, 111, 0.12), inset 0 0 0 1px rgba(116, 255, 157, 0.22);
}
.g_id_signin { min-height: 44px; margin: 0; border-radius: 999px; overflow: hidden; }

#signed-in { color: #b6c5bb; }
.signed-in-label { margin: 0 0 5px; color: #77857c; font-size: 12px; }
#admin-email { margin: 0 0 22px; color: #dbffe5; font-size: 14px; overflow-wrap: anywhere; }
.admin button {
  padding: 0.65rem 1.2rem;
  border-radius: 3px;
  border: 1px solid rgba(91, 255, 138, 0.4);
  background: rgba(19, 78, 38, 0.22);
  color: #adffc3;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.admin button:hover { background: rgba(33, 125, 62, 0.32); border-color: #62ff8e; }
#admin-status { min-height: 1.3em; margin: 18px 0 0; color: #9affb5; font-size: 12px; }

/* ── signed-in dashboard ──────────────────────────────────────────────── */
.is-dashboard .admin { width: min(720px, calc(100vw - 40px)); }
.is-dashboard .admin-intro { display: none; }

.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
  text-align: left;
}
#signed-in #admin-email { margin: 0; }
.dash-head button { flex: none; padding: 0.5rem 0.9rem; font-size: 13px; }

.dash-kicker {
  margin: 26px 0 12px;
  color: #6eff96;
  font: 600 11px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-align: left;
  text-transform: uppercase;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 18px 18px 16px !important;
  border: 1px solid rgba(89, 255, 145, 0.28);
  border-radius: 6px;
  background: rgba(4, 20, 10, 0.55) !important;
  color: #dbffe5 !important;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}
.tile:hover {
  transform: translateY(-2px);
  border-color: #62ff8e !important;
  background: rgba(12, 42, 22, 0.62) !important;
}
.tile:focus-visible { outline: 2px solid #62ff8e; outline-offset: 2px; }
.tile-icon { font-size: 26px; line-height: 1; }
.tile-title { font: 600 15px/1.2 Georgia, 'Times New Roman', serif; color: #f1fff5; }
.tile-meta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #93a89b;
}

.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot--unknown { background: #6b7a70; }
.dot--up { background: #46ff86; box-shadow: 0 0 8px rgba(70, 255, 134, 0.75); }
.dot--down { background: #ff5d5d; box-shadow: 0 0 8px rgba(255, 93, 93, 0.6); }

/* ── cat cam modal ────────────────────────────────────────────────────── */
body.modal-open { overflow: hidden; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(0, 3, 1, 0.94);
  backdrop-filter: blur(6px);
}
.modal[hidden] { display: none; }
.modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(89, 255, 145, 0.25);
}
.modal-title {
  color: #6eff96;
  font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.modal-close {
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  border: 1px solid rgba(91, 255, 138, 0.4);
  background: rgba(19, 78, 38, 0.22);
  color: #adffc3;
  font: inherit;
  cursor: pointer;
}
.modal-close:hover { background: rgba(33, 125, 62, 0.32); border-color: #62ff8e; }
.modal-frame { flex: 1; width: 100%; border: 0; background: #000; }

@keyframes admin-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rabbit-signal {
  0%, 18%, 100% { opacity: 0; transform: translateY(5px); }
  33% { opacity: 0.12; }
  48% { opacity: 0.38; transform: translateY(0); }
  62% { opacity: 0.16; }
  76% { opacity: 0; transform: translateY(-4px); }
}

@media (max-width: 440px) {
  .admin { padding: 36px 20px 30px; }
}

@media (prefers-reduced-motion: reduce) {
  .admin { animation: none; }
  #admin-rabbit { animation: none; opacity: 0.24; }
}
