/* Pelican Swap — Stardew-Valley-flavoured UI.
   Pixel headings (Pixelify Sans) + a layered wooden menu-box frame to echo
   the in-game dialogue boxes, on a parchment interior. */
:root {
  --bg: #2c4a1e;
  --bg2: #3a5f28;
  --card: #fff7e6;
  --ink: #45341f;
  --muted: #7a6a55;
  --accent: #6b8e23;
  --accent-dark: #557018;
  --line: #e3d6b8;
  --danger: #a33;
  --radius: 10px;

  /* Wooden frame tones, light -> dark. */
  --wood-hi: #d8b67a;
  --wood: #9c6b35;
  --wood-lo: #5a3d22;

  --pixel: "Pixelify Sans", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  /* Layered farm scene: warm sun glow up top, soil-shadow vignette at the
     bottom, a faint diagonal pixel texture, over a vertical grass gradient. */
  background-color: var(--bg2);
  background-image:
    radial-gradient(140% 115% at 50% -12%, rgba(255, 246, 198, .22), transparent 55%),
    radial-gradient(110% 85% at 50% 118%, rgba(0, 0, 0, .38), transparent 60%),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 6px, transparent 6px 12px),
    linear-gradient(180deg, #4d7a30 0%, var(--bg2) 46%, var(--bg) 100%);
  background-attachment: fixed;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 6vh 16px;
}

.card {
  width: 100%;
  max-width: 560px;
  background:
    linear-gradient(180deg, #fffaf0, var(--card));
  border: 4px solid var(--wood);
  border-radius: var(--radius);
  /* Stacked rings fake a chunky carved wooden frame without an image asset. */
  box-shadow:
    inset 0 0 0 3px var(--wood-hi),
    0 0 0 4px var(--wood-lo),
    0 16px 44px rgba(0, 0, 0, .45);
  padding: 28px;
}

header h1 {
  margin: 0 0 6px;
  font-family: var(--pixel);
  font-weight: 700;
  font-size: 2.3rem;
  letter-spacing: .5px;
  color: #4d6a17;
  text-shadow: 2px 2px 0 #d8e9b6;
}
.tagline { margin: 0; color: var(--muted); }

h2 {
  font-family: var(--pixel);
  font-weight: 600;
  font-size: 1.35rem;
  margin: 0 0 8px;
  color: #4d6a17;
}

.picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.picker-head h2 { margin: 0; }
.remove {
  flex: none;
  font-size: .82rem;
  color: var(--muted);
  background: #f6eed8;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color .12s, border-color .12s, background .12s;
}
.remove:hover {
  color: var(--danger);
  border-color: #e0a8a8;
  background: #fdecec;
}

.privacy {
  margin: 18px 0;
  padding: 10px 14px;
  background: #eef6e0;
  border: 1px solid #cfe0a8;
  border-radius: 10px;
  font-size: .92rem;
}

.drop { margin-top: 16px; }

.dropzone {
  padding: 30px 18px;
  text-align: center;
  border: 3px dashed #c2a877;
  border-radius: 12px;
  background: #fffdf6;
  transition: background .15s, border-color .15s, transform .15s;
}
.drop.over .dropzone {
  background: #f1f7e4;
  border-color: var(--accent);
  transform: scale(1.01);
}
.dropzone-icon {
  font-size: 2.2rem;
  line-height: 1;
  margin-bottom: 6px;
  filter: saturate(.85);
}
.dropzone p { margin: 6px 0; }
.hint { color: var(--muted); font-size: .85rem; }

.locations {
  margin: 0 0 14px;
  text-align: left;
  font-size: .85rem;
  background: #faf3df;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 14px;
}
.locations > summary {
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 600;
  list-style-position: inside;
}
.locations ul {
  list-style: none;
  margin: 12px 0 4px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.locations li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
}
.locations .os {
  flex: none;
  min-width: 64px;
  font-family: var(--pixel);
  font-weight: 600;
  color: #4d6a17;
}
.locations code { word-break: break-all; }
code {
  background: #efe6cd;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: .85em;
}

.error {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fdecec;
  border: 1px solid #f0b8b8;
  border-radius: 10px;
  color: var(--danger);
  font-size: .9rem;
}

.row { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.badge {
  font-family: var(--pixel);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 3px 9px;
  border-radius: 999px;
  background: #e7d9b3;
  color: #6a5836;
}
.badge.host { background: #d8e9b6; color: #4d6a17; }
.who { font-weight: 600; }

.farmhands { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 18px; }
.farmhand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: #fffdf6;
  cursor: pointer;
  transition: border-color .12s, background .12s, box-shadow .12s;
}
.farmhand:hover { border-color: var(--accent); }
/* Highlight the chosen farmhand — previously only the radio dot changed. */
.farmhand:has(input:checked) {
  border-color: var(--accent);
  background: #f1f7e4;
  box-shadow: inset 0 0 0 1px var(--accent);
}
.farmhand input { width: 18px; height: 18px; accent-color: var(--accent); }
.farmhand .who { display: block; }
.farmhand .meta { display: block; font-size: .8rem; color: var(--muted); }

button.primary {
  width: 100%;
  padding: 14px;
  font-family: var(--pixel);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .3px;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  /* Chunky pressable button, Stardew-style raised edge. */
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .22), 0 3px 0 var(--accent-dark);
  cursor: pointer;
  transition: transform .08s, box-shadow .08s, background .12s;
}
button.primary:hover:not(:disabled) { background: var(--accent-dark); }
button.primary:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22), 0 0 0 var(--accent-dark);
}
button.primary:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; }

button.link {
  background: none;
  border: none;
  color: var(--accent-dark);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
}

.done .steps { padding-left: 20px; line-height: 1.6; }
.done .steps li { margin-bottom: 4px; }

/* Ad slot stays invisible until a snippet fills it, so it never leaves a gap. */
.ad-slot {
  display: block;
  margin-top: 20px;
}
.ad-slot:empty { display: none; }

footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .8rem;
  color: var(--muted);
}
footer p { margin: 4px 0; }
footer a { color: var(--accent-dark); }
.updated { color: var(--muted); opacity: .85; }
.updated time { font-weight: 600; }
