:root {
  --teal-dark: #075b5f;
  --teal: #0b8585;
  --aqua: #7efcff;
  --cream: #fff8d8;
  --peach: #ffd195;
  --purple: #6b4ab6;
  --ink: #10262b;
  --panel: #f8f1c9;
  --shadow: rgba(0, 0, 0, 0.34);
  --danger: #b8203f;
  --good: #127943;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100%;
  margin: 0;
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(126, 252, 255, 0.35), transparent 28rem),
    linear-gradient(135deg, #073b46 0%, #0b6f6f 42%, #2d1d58 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 24px 24px;
  mix-blend-mode: screen;
}

button, select, input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.65;
}

.page-shell {
  min-height: 100vh;
  padding: 18px 18px 92px;
  position: relative;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  max-width: 1180px;
  margin: 0 auto 18px;
  padding: 12px 14px;
  border: 3px solid #06272b;
  border-radius: 18px;
  background: linear-gradient(#fef7cf, #f3c66f);
  box-shadow: 0 10px 0 #06272b, 0 16px 30px var(--shadow);
}

.brand-lockup {
  display: flex;
  gap: 12px;
  align-items: center;
}

.orb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid #06272b;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 12%, transparent 13%),
    radial-gradient(circle at center, var(--aqua), var(--teal) 62%, var(--purple));
  box-shadow: inset -8px -8px 0 rgba(0, 0, 0, 0.18);
}

h1 {
  margin: 0;
  line-height: 1;
  font-size: clamp(1.8rem, 5vw, 3rem);
  letter-spacing: -2px;
  text-shadow: 2px 2px 0 #fff, 4px 4px 0 rgba(0, 0, 0, 0.18);
}

.tagline {
  margin: 4px 0 0;
  font-size: 0.85rem;
}

.status-panel {
  display: grid;
  gap: 4px;
  text-align: right;
  font-size: 0.78rem;
}

#versionBadge {
  justify-self: end;
  padding: 4px 8px;
  border: 2px solid #06272b;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 2px 2px 0 #06272b;
  font-weight: 700;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 18px;
  max-width: 1180px;
  margin: 0 auto;
}

.retro-window {
  border: 3px solid #06272b;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 8px 8px 0 #06272b, 0 16px 32px var(--shadow);
  background: var(--panel);
}

.window-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  min-height: 38px;
  padding: 8px 10px;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(90deg, #1b2f85, #0e8c95);
  border-bottom: 3px solid #06272b;
}

.window-buttons {
  display: flex;
  gap: 6px;
}

.window-buttons i {
  display: block;
  width: 14px;
  height: 14px;
  border: 2px solid #06272b;
  border-radius: 50%;
  background: #ffd95b;
}

.window-buttons i:nth-child(2) {
  background: #71e07e;
}

.window-buttons i:nth-child(3) {
  background: #ff7676;
}

.window-body {
  padding: 16px;
}

.field-group {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label, legend {
  font-weight: 700;
  font-size: 0.9rem;
}

select {
  width: 100%;
  border: 2px solid #06272b;
  border-radius: 10px;
  padding: 10px;
  background: #fffdf0;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, 0.12);
}

fieldset {
  border: 2px dashed #0b6f6f;
  border-radius: 12px;
  padding: 12px;
}

.check-row {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 400;
  padding: 5px 0;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

.mini-note {
  padding: 10px;
  border-radius: 12px;
  background: #fffdf0;
  border: 2px solid rgba(6, 39, 43, 0.25);
  font-size: 0.8rem;
  line-height: 1.4;
  margin-bottom: 12px;
}

.discovery-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 320px);
  gap: 16px;
}

.discovery-card {
  min-height: 420px;
  padding: clamp(18px, 5vw, 34px);
  border: 3px solid #06272b;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 248, 216, 0.92)),
    repeating-linear-gradient(45deg, rgba(11, 133, 133, 0.08) 0 8px, transparent 8px 16px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.category-pill {
  width: fit-content;
  padding: 6px 10px;
  border: 2px solid #06272b;
  border-radius: 999px;
  background: var(--peach);
  box-shadow: 3px 3px 0 #06272b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

h2 {
  margin: 18px 0 10px;
  font-size: clamp(1.8rem, 6vw, 3.8rem);
  line-height: 0.96;
  letter-spacing: -2px;
}

#siteDescription {
  max-width: 65ch;
  font-size: 1rem;
  line-height: 1.55;
}

.link-box {
  margin: 12px 0 18px;
  padding: 12px;
  border: 2px inset #d6c987;
  border-radius: 10px;
  background: #fffdf0;
  overflow-wrap: anywhere;
  font-size: 0.86rem;
}

.action-row, .taste-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-link,
.small-button,
.rate-button {
  border: 2px solid #06272b;
  border-radius: 12px;
  padding: 10px 13px;
  background: linear-gradient(#ffffff, #e7e1bd);
  box-shadow: 3px 3px 0 #06272b;
  color: var(--ink);
  font-weight: 700;
}

.primary-link {
  background: linear-gradient(#dffcff, #7efcff);
}

.rate-button.like {
  background: linear-gradient(#e8fff0, #85e09d);
}

.rate-button.dislike {
  background: linear-gradient(#fff0f4, #ff9bad);
}

.rate-button.block {
  background: linear-gradient(#fff7dc, #ffd96e);
}

.saved-panel {
  border: 3px solid #06272b;
  border-radius: 16px;
  background: #fffdf0;
  padding: 14px;
  max-height: 420px;
  overflow: auto;
}

.saved-panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

#savedList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

#savedList li {
  border: 2px solid rgba(6, 39, 43, 0.25);
  border-radius: 10px;
  padding: 8px;
  background: #f8f1c9;
  font-size: 0.82rem;
}

#savedList a {
  color: #1b2f85;
  font-weight: 700;
}

.drift-button {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(44px, env(safe-area-inset-bottom));
  z-index: 10;
  width: clamp(104px, 24vw, 152px);
  height: clamp(104px, 24vw, 152px);
  border: 5px solid #06272b;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, #ffffff 0 10%, transparent 11%),
    radial-gradient(circle at center, #ffdd5c, #ff8c42 62%, #b8203f);
  box-shadow: 0 9px 0 #06272b, 0 16px 30px var(--shadow);
  color: #06272b;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  transform: rotate(-4deg);
}

.drift-button:hover {
  transform: rotate(-4deg) translateY(-2px);
}

.drift-button:active {
  transform: rotate(-4deg) translateY(6px);
  box-shadow: 0 3px 0 #06272b, 0 9px 20px var(--shadow);
}

.footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  min-height: 32px;
  display: flex;
  gap: 9px;
  justify-content: center;
  align-items: center;
  padding: 7px 14px;
  background: rgba(6, 39, 43, 0.9);
  color: #fff8d8;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
}

.footer a {
  color: var(--aqua);
  font-weight: 700;
}

@media (max-width: 860px) {
  .page-shell {
    padding: 10px 10px 112px;
  }

  .topbar {
    align-items: flex-start;
    border-radius: 14px;
  }

  .status-panel {
    text-align: left;
  }

  .app-grid,
  .discovery-body {
    grid-template-columns: 1fr;
  }

  .left-panel {
    order: 2;
  }

  .main-panel {
    order: 1;
  }

  .discovery-card {
    min-height: 360px;
  }

  .saved-panel {
    max-height: 240px;
  }

  .drift-button {
    right: 14px;
    bottom: 50px;
  }
}

@media (max-width: 560px) {
  .topbar {
    display: grid;
  }

  .brand-lockup {
    align-items: flex-start;
  }

  .orb {
    width: 42px;
    height: 42px;
  }

  .action-row button,
  .taste-row button {
    flex: 1 1 100%;
  }

  .drift-button {
    width: 94px;
    height: 94px;
    font-size: 1rem;
  }
}
