@font-face {
  font-family: "Frisky Puppy";
  src: url("/static/fonts/Frisky%20Puppy.woff?v=35") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --site-font: "Frisky Puppy", "Comic Sans MS", "Comic Sans", cursive;
  --bg: #07101f;
  --card: #101b32;
  --card-2: #0b1427;
  --panel: #162033;
  --line: #263a66;
  --line-2: #31466f;
  --text: #dceeff;
  --muted: #7f91b8;
  --cyan: #79ddff;
  --cyan-2: #8eeeff;
  --pink: #ff8df0;
  --pink-2: #ff3ed8;
  --blue: #148dff;
  --blue-2: #0c6fd1;
  --good: #78ffbd;
  --bad: #ff6f9b;
  --mono-font: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
  font-family: var(--site-font) !important;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  font-family: var(--site-font);
  background:
    radial-gradient(circle at top left, rgba(121, 221, 255, 0.18), transparent 30rem),
    radial-gradient(circle at bottom right, rgba(255, 62, 216, 0.18), transparent 30rem),
    var(--bg);
  text-rendering: geometricPrecision;
}

button,
input,
textarea,
select {
  font-family: var(--site-font) !important;
}

::placeholder {
  font-family: var(--site-font) !important;
}

body.download-body,
body.home-body {
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
}

.page-shell {
  width: min(940px, 100%);
  min-height: calc(100dvh - 72px);
  margin: 0 auto;
  padding: 34px 18px 22px;
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.download-card,
.home-card {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(16, 27, 50, 0.96), rgba(8, 15, 29, 0.96));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
  overflow: visible;
}

.download-card {
  max-width: 760px;
  padding: 30px;
}

.top-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  margin: 0;
  color: var(--cyan);
  font-size: clamp(50px, 8vw, 74px);
  line-height: 0.9;
  font-weight: 400;
  letter-spacing: 0.01em;
  word-spacing: 0.2em;
}

.status-dot {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: var(--good);
  box-shadow: 0 0 0 8px rgba(120, 255, 189, 0.12), 0 0 32px rgba(120, 255, 189, 0.9);
}

.status-dot.off {
  background: var(--bad);
  box-shadow: 0 0 0 8px rgba(255, 111, 155, 0.12), 0 0 32px rgba(255, 111, 155, 0.75);
}

.file-panel {
  padding: clamp(28px, 4.6vw, 42px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(20, 141, 255, 0.13), transparent 40%),
    linear-gradient(315deg, rgba(255, 62, 216, 0.12), transparent 42%),
    var(--card-2);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gone-panel {
  background:
    linear-gradient(135deg, rgba(255, 111, 155, 0.14), transparent 40%),
    var(--card-2);
}

.micro-label {
  margin: 0 0 18px;
  color: var(--cyan-2);
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
}

h1 {
  margin: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: clamp(46px, 6.8vw, 68px);
  line-height: 0.95;
  letter-spacing: 0.01em;
  word-spacing: 0.14em;
  font-weight: 400;
  text-align: center;
}

.meta-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 30px;
  width: 100%;
  text-align: center;
}

.meta-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 18px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.86);
  color: #c8d7f4;
  font-size: 21px;
  line-height: 1;
  white-space: nowrap;
  text-align: center;
}

.error {
  margin: 16px 0 0;
  padding: 14px 16px 12px;
  border: 1px solid rgba(255, 111, 155, 0.35);
  border-radius: 16px;
  background: rgba(255, 111, 155, 0.1);
  color: #ffd3df;
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
  overflow: hidden;
  animation: error-fade-out 4.75s ease forwards;
}

@keyframes error-fade-out {
  0%, 84% {
    opacity: 1;
    transform: translateY(0);
    max-height: 140px;
    margin-top: 16px;
    padding-top: 14px;
    padding-bottom: 12px;
    border-width: 1px;
  }
  100% {
    opacity: 0;
    transform: translateY(-3px);
    max-height: 0;
    margin-top: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
  }
}

.muted {
  color: var(--muted);
  font-size: 24px;
  line-height: 1.15;
  text-align: center;
}

.action-area {
  margin-top: 34px;
}

.password-form {
  display: grid;
  gap: 14px;
}

.password-form label {
  color: var(--cyan-2);
  font-weight: 400;
  font-size: 24px;
  line-height: 1;
  text-align: center;
}

.password-form input {
  width: 100%;
  min-height: 58px;
  padding: 6px 18px 0;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  outline: none;
  background: var(--panel);
  color: var(--text);
  font-size: 26px;
  line-height: 1;
  text-align: center;
}

.password-form input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(121, 221, 255, 0.14);
}

.button-wrap {
  --button-height: 86px;
  --sticker-size: 174px;
  --sticker-overlap: 0px;
  --sticker-right: 76px;
  position: relative;
  display: block;
  width: min(100%, 560px);
  margin: 0 auto;
  /* Button starts exactly after the sticker box, so the sticker bottom sits on the button top edge. */
  padding-top: var(--sticker-size);
  transition: transform 120ms ease;
}

.button-wrap:hover,
.button-wrap:focus-within {
  transform: translateY(-3px);
}

.button-wrap:active {
  transform: translateY(1px) scale(0.99);
}

.download-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-height: var(--button-height);
  padding: 20px 48px 16px;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--pink-2), var(--blue));
  color: white;
  font-size: clamp(38px, 5.4vw, 54px);
  line-height: 0.95;
  font-weight: 400;
  letter-spacing: 0.015em;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 18px 45px rgba(255, 62, 216, 0.22), 0 10px 28px rgba(20, 141, 255, 0.2);
  transition: filter 120ms ease;
}

.button-wrap:hover .download-button,
.button-wrap:focus-within .download-button {
  filter: brightness(1.08);
}

.whoa-sticker {
  position: absolute;
  right: var(--sticker-right);
  top: 0;
  width: var(--sticker-size);
  height: var(--sticker-size);
  object-fit: contain;
  transform: translateY(var(--sticker-overlap)) rotate(0deg);
  transform-origin: 50% 100%;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35));
  pointer-events: none;
  z-index: 2;
}

.home-body {
  align-items: center;
  justify-content: center;
}

.home-card {
  width: min(620px, calc(100% - 32px));
  padding: clamp(42px, 9vw, 78px) 26px;
  text-align: center;
}

.home-card h1 {
  color: var(--pink);
  text-align: center;
}

.site-footer {
  width: 100%;
  padding: 18px 14px 24px;
  color: #8fa2c9;
  font-size: 18px;
  line-height: 1.05;
  text-align: center;
  flex: 0 0 auto;
}

.site-footer a {
  color: var(--cyan-2);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 560px) {
  .page-shell {
    min-height: calc(100dvh - 78px);
    padding: 18px 12px 10px;
    align-items: center;
  }

  .download-card {
    padding: 18px;
    border-radius: 24px;
  }

  .brand {
    font-size: clamp(42px, 14vw, 58px);
  }

  h1 {
    font-size: clamp(36px, 13vw, 52px);
  }

  .micro-label {
    font-size: 16px;
  }

  .meta-grid {
    display: flex;
    justify-content: center;
  }

  .meta-grid span {
    min-height: 46px;
    font-size: 20px;
  }

  .button-wrap {
    --button-height: 76px;
    --sticker-size: 148px;
    --sticker-overlap: 0px;
    --sticker-right: 38px;
    width: min(100%, 420px);
  }

  .download-button {
    width: 100%;
    min-height: var(--button-height);
    font-size: clamp(34px, 12vw, 46px);
  }

  .whoa-sticker {
    right: var(--sticker-right);
  }

  .site-footer {
    font-size: 15px;
    line-height: 1.3;
  }
}

/* ---------- Admin: login ---------- */

.admin-login-title {
  margin-top: 4px;
}

.admin-login-sub {
  margin: 14px 0 0;
  font-size: 18px;
}

.login-button {
  appearance: none;
  border: 0;
  cursor: pointer;
  width: 100%;
  min-height: 58px;
  padding: 14px 18px 10px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--pink-2), var(--blue));
  color: white;
  font-size: 26px;
  line-height: 1;
  font-weight: 400;
  text-align: center;
  box-shadow: 0 14px 32px rgba(255, 62, 216, 0.2), 0 8px 20px rgba(20, 141, 255, 0.18);
  transition: filter 120ms ease;
}

.login-button:hover {
  filter: brightness(1.08);
}

/* ---------- Admin: dashboard ---------- */

.admin-shell {
  width: min(1180px, 100%);
}

.admin-card {
  max-width: none;
}

.admin-brand {
  font-size: clamp(36px, 5.4vw, 52px);
}

.logout-button {
  appearance: none;
  cursor: pointer;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.86);
  color: #c8d7f4;
  font-size: 18px;
  line-height: 1;
  padding: 11px 20px 9px;
  white-space: nowrap;
}

.logout-button:hover {
  border-color: var(--cyan);
  color: var(--cyan-2);
}

.admin-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 22px;
}

.stat-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 11px 18px 9px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: rgba(22, 32, 51, 0.86);
  color: #c8d7f4;
  font-size: 18px;
  line-height: 1;
}

.stat-pill strong {
  color: var(--cyan-2);
  font-weight: 400;
  font-size: 22px;
}

.stat-pill-warn {
  border-color: rgba(255, 111, 155, 0.4);
  color: #ffd3df;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-2);
}

.admin-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 17px;
}

.admin-table th,
.admin-table td {
  font-family: var(--mono-font) !important;
  text-align: left;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.admin-table th {
  color: var(--cyan-2);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(20, 141, 255, 0.07);
}

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

.admin-table tbody tr:hover {
  background: rgba(121, 221, 255, 0.05);
}

.cell-name {
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cell-mono {
  color: var(--muted);
  font-size: 15px;
}

.file-link {
  color: var(--cyan);
  text-decoration: none;
}

.file-link:hover {
  text-decoration: underline;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px 3px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge-locked {
  color: #ffd3df;
  background: rgba(255, 111, 155, 0.14);
  border: 1px solid rgba(255, 111, 155, 0.3);
}

.badge-open {
  color: #b9ffe0;
  background: rgba(120, 255, 189, 0.12);
  border: 1px solid rgba(120, 255, 189, 0.28);
}

.cell-actions {
  text-align: right;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px 7px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--line-2);
}

.btn-danger {
  color: #ffd3df;
  background: rgba(255, 111, 155, 0.1);
  border-color: rgba(255, 111, 155, 0.32);
}

.btn-danger:hover {
  background: rgba(255, 111, 155, 0.18);
}

.btn-ghost {
  color: #c8d7f4;
  background: rgba(22, 32, 51, 0.86);
}

.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan-2);
}

.admin-empty {
  margin-top: 4px;
}

.admin-empty-title {
  font-size: clamp(34px, 5vw, 46px);
}

.confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.btn-danger-lg {
  appearance: none;
  font-size: 20px;
  padding: 14px 26px 11px;
  border-radius: 16px;
}

@media (max-width: 560px) {
  .top-strip {
    flex-wrap: wrap;
    row-gap: 10px;
  }

  .admin-stats {
    gap: 8px;
  }

  .stat-pill {
    font-size: 15px;
    padding: 9px 14px 7px;
  }
}
