:root {
  --bg: #0f1216;
  --panel: #1a1f26;
  --text: #eef2f5;
  --muted: #9aa3ad;
  --accent: #3dd68c;
  --accent-dim: #2a6b4a;
  --line: rgba(255, 255, 255, 0.12);
  --danger: #f07178;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  color: var(--text);
  background: #111418;
}

body {
  background-color: #111418;
  background-image:
    linear-gradient(180deg, rgba(15, 18, 22, 0.88), rgba(15, 18, 22, 0.94)),
    url("/EverythingPippin/uploads/web%20page%20possible%20background.png");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
}

a { color: var(--accent); }
a:hover { color: #6aefb0; }

.hero {
  position: relative;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.25rem 1.25rem 1.25rem;
  overflow: hidden;
  border-bottom: 0;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 12, 16, 0.35), rgba(10, 12, 16, 0.72)),
    url("/EverythingPippin/uploads/web%20page%20possible%20background.png");
  background-size: cover;
  background-position: center;
  filter: saturate(0.85) contrast(1.05);
  z-index: 0;
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(1100px, 100%);
  text-align: center;
}

.hero-logo-link {
  display: inline-block;
  text-decoration: none;
}

.hero-logo {
  display: block;
  width: min(640px, 92%);
  height: auto;
  margin: 0 auto;
  filter:
    drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.55))
    drop-shadow(0 18px 40px rgba(0, 0, 0, 0.65));
}

.hero-tag {
  margin: 1rem 0 0;
  color: #d7dee6;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
}

.nav-sticky {
  position: sticky;
  top: 0;
  z-index: 300;
  border-bottom: 1px solid var(--line);
  background-color: rgba(17, 20, 24, 0.94);
  background-image:
    linear-gradient(180deg, rgba(15, 18, 22, 0.92), rgba(15, 18, 22, 0.96)),
    url("/EverythingPippin/uploads/web%20page%20possible%20background.png");
  background-size: cover;
  background-position: center top;
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.nav-sticky-inner,
.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.65rem;
}

.nav-sticky-inner {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 0.75rem 0;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.6rem;
  padding: 0.55rem 1.05rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(28, 33, 40, 0.92);
  color: #f2f5f7;
  text-decoration: none;
  font-weight: 650;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.28);
  transition: background 0.15s ease, border-color 0.15s ease, filter 0.15s ease;
}

.nav-btn:hover {
  background: rgba(42, 48, 58, 0.96);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff;
}

.nav-btn-download {
  background: linear-gradient(180deg, #49e098, #2faf6d);
  border-color: rgba(61, 214, 140, 0.55);
  color: #0b1711;
}

.nav-btn-download:hover {
  filter: brightness(1.06);
  color: #0b1711;
  background: linear-gradient(180deg, #49e098, #2faf6d);
}

.nav-btn-admin {
  border-color: rgba(120, 170, 255, 0.45);
  background: rgba(40, 55, 80, 0.9);
}

.nav-btn-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.nav-btn.is-active {
  border-color: rgba(61, 214, 140, 0.55);
  box-shadow: 0 0 0 1px rgba(61, 214, 140, 0.25);
}

.wrap-doc {
  width: min(1100px, calc(100% - 2rem));
  padding-top: 1.1rem;
}

.doc-frame {
  display: block;
  width: 100%;
  min-height: 70vh;
  height: 70vh;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

/* Grown to full document height so the page (not the iframe) scrolls,
   which lets the sticky button bar stay on screen. */
.doc-frame.is-grown {
  height: auto;
  min-height: 0;
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.5rem 0 3.5rem;
}

.wrap-form {
  width: min(640px, calc(100% - 2rem));
}

.wrap-about {
  width: min(820px, calc(100% - 2rem));
}

.wrap-admin {
  width: min(1100px, calc(100% - 2rem));
}

.app-shot {
  position: relative;
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  cursor: zoom-in;
}

.app-shot img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: middle;
}

.app-shot-hint {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #e8eef4;
  font-size: 0.8rem;
  font-weight: 650;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.app-shot:hover .app-shot-hint,
.app-shot:focus-visible .app-shot-hint,
.app-shot-hint.is-forced {
  opacity: 1;
  transform: translateY(0);
}

.app-shot.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: 0;
  border-radius: 0;
  border: 0;
  background: rgba(8, 10, 14, 0.96);
  box-shadow: none;
  cursor: zoom-out;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: auto;
}

.app-shot.is-expanded img {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.app-shot.is-expanded .app-shot-hint {
  right: 1rem;
  bottom: 1rem;
}

body.shot-expanded {
  overflow: hidden;
}

.nav-btn-auth {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.08);
}

.nav-btn-auth:hover {
  background: rgba(255, 255, 255, 0.14);
}

.auth-corner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.auth-who {
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-who strong {
  color: var(--text);
}

.auth-corner-form {
  margin: 0;
}

.btn-signin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 1.25rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.06);
  color: #f4f7fa;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.btn-signin:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.btn-signout {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}

.btn-signout:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.form-alt {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.about-panel h1 {
  margin: 0 0 1rem;
  font-size: 1.45rem;
}

.about-body h2 {
  margin: 1.4rem 0 0.55rem;
  font-size: 1.1rem;
}

.about-body p {
  margin: 0 0 0.75rem;
  color: #d5dbe2;
  line-height: 1.55;
}

.about-body ul {
  margin: 0 0 0.9rem;
  padding-left: 1.2rem;
  color: #d5dbe2;
  line-height: 1.5;
}

.about-body li {
  margin-bottom: 0.35rem;
}

.about-body .about-step {
  font-weight: 650;
  color: var(--text);
}

.panel {
  background: rgba(26, 31, 38, 0.92);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.35rem 1.35rem 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.panel + .panel { margin-top: 1rem; }

h2 {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.lead {
  margin: 0 0 1rem;
  color: var(--muted);
  line-height: 1.45;
}

.doc-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.doc-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(61, 214, 140, 0.45);
  background: rgba(61, 214, 140, 0.1);
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
}

.doc-links a:hover {
  background: rgba(61, 214, 140, 0.2);
  color: #fff;
}

.grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 640px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}

label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #d5dbe2;
}

input {
  width: 100%;
  min-height: 2.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #12161c;
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(61, 214, 140, 0.45);
  border-color: var(--accent-dim);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

button, .btn, a.btn-primary, a.btn-secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  min-height: 2.75rem;
  padding: 0.7rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary {
  background: linear-gradient(180deg, #49e098, #2faf6d);
  color: #0b1711;
}

.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: none;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.05); }

.msg {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  font-size: 0.92rem;
}

.msg.error {
  background: rgba(240, 113, 120, 0.12);
  border: 1px solid rgba(240, 113, 120, 0.35);
  color: #ffc4c8;
}

.msg.ok {
  background: rgba(61, 214, 140, 0.12);
  border: 1px solid rgba(61, 214, 140, 0.35);
  color: #c7f7dc;
}

.signed-in {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(61, 214, 140, 0.08);
  border: 1px solid rgba(61, 214, 140, 0.25);
}

.signed-in strong { color: #fff; }

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tabs button {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 2.4rem;
  padding: 0.45rem 0.95rem;
}

.tabs button.active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.04);
}

.hidden { display: none !important; }

.foot {
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.admin-subhead {
  margin: 1.35rem 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.admin-note {
  margin-top: 0 !important;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.admin-note code {
  color: var(--accent);
  font-size: 0.85em;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.stats-grid-shared {
  opacity: 0.95;
}

@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #stats-visitors { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .stats-grid-shared { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  padding: 0.95rem 0.75rem 0.85rem;
  text-align: center;
  min-height: 5.25rem;
}

.stat-num {
  display: block;
  width: 100%;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.stat-label {
  display: block;
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.3;
  color: var(--muted);
}

.optional {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9em;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 0.65rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}

.admin-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.admin-table tbody tr:last-child td {
  border-bottom: none;
}

.admin-table .empty-row td {
  color: var(--muted);
  font-style: italic;
}

.admin-table .row-shared td,
.admin-table .row-muted td {
  color: var(--muted);
}

.badge-shared {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
