/* TwineForge - cozy gaming theme ("evening cabin")
   Palette:
     --dusk   #2a1f2d  plum dusk (page)
     --cabin  #3a2c3a  panel
     --edge   #57455a  panel edge
     --cream  #f6e8d6  text
     --lantern#f2a65a  primary accent (warm amber)
     --berry  #c9748f  secondary accent
     --moss   #a8c686  success
   Display face: "Pixelify Sans" - soft rounded pixels, headings & buttons only
   Body face:    "Nunito" - round, warm, easy to read
*/

:root {
  --dusk: #2a1f2d;
  --cabin: #3a2c3a;
  --cabin-deep: #322636;
  --edge: #57455a;
  --cream: #f6e8d6;
  --dim: #bfa9b4;
  --lantern: #f2a65a;
  --lantern-deep: #c77f3b;
  --berry: #c9748f;
  --moss: #a8c686;
  --moss-deep: #7fa15e;
  --danger: #e08080;
}

* { box-sizing: border-box; }
html { height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 90% 55% at 50% -10%, #45324a 0%, var(--dusk) 62%) fixed;
  color: var(--cream);
  font-family: "Nunito", "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}

.wrap { width: min(880px, 92vw); margin: 0 auto; padding-bottom: 4rem; flex: 1; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.4rem 0 1.1rem; margin-bottom: 2.2rem;
  border-bottom: 2px dashed var(--edge);
  flex-wrap: wrap; gap: 0.75rem;
}

.brand {
  font-family: "Pixelify Sans", sans-serif;
  font-size: 1.5rem; font-weight: 700;
  color: var(--lantern); text-decoration: none;
}
.brand b { color: var(--berry); font-weight: 700; }

.nav { display: flex; gap: 1.1rem; align-items: center; }
.nav a { color: var(--dim); text-decoration: none; font-weight: 600; }
.nav a:hover, .nav a:focus { color: var(--lantern); }
.nav .who { color: var(--moss); font-weight: 700; }
/* Button-style links in the nav keep the button's own dark text - otherwise the
   .nav a rules tint them, turning the amber Upgrade button amber-on-amber on hover. */
.nav a.btn-coin,
.nav a.btn-coin:hover,
.nav a.btn-coin:focus { color: #35241a; }

/* --- Type --------------------------------------------------------------- */
h1, h2, h3 {
  font-family: "Pixelify Sans", sans-serif;
  font-weight: 700; line-height: 1.25; margin: 0 0 0.8rem;
}
/* Signature: hearth-glow behind the page title */
h1 {
  font-size: 2.6rem; color: var(--lantern);
  text-shadow: 0 0 34px rgba(242, 166, 90, 0.35);
}
h2 { font-size: 1.5rem; color: var(--cream); }
h3 { font-size: 1.15rem; color: var(--berry); }

.tagline { font-size: 1.15rem; color: var(--dim); margin-top: -0.3rem; }
.lede { font-size: 1.12rem; max-width: 62ch; }
p { max-width: 68ch; }

/* --- Panels ------------------------------------------------------------- */
.panel {
  background: linear-gradient(180deg, var(--cabin) 0%, var(--cabin-deep) 100%);
  border: 2px solid var(--edge);
  border-radius: 18px;
  padding: 1.7rem 1.9rem;
  box-shadow: 0 10px 28px rgba(20, 12, 22, 0.45);
  margin-bottom: 1.6rem;
}
.panel.center { text-align: center; }

/* --- Pillow buttons ------------------------------------------------------ */
.btn {
  font-family: "Pixelify Sans", sans-serif;
  font-size: 1.05rem; font-weight: 700;
  display: inline-block; padding: 0.65rem 1.25rem;
  border: none; border-radius: 14px; cursor: pointer; text-decoration: none;
  background: var(--lantern); color: #35241a;
  box-shadow: 0 4px 0 var(--lantern-deep);
  transition: transform 0.08s, box-shadow 0.08s, filter 0.12s;
}
.btn:hover, .btn:focus-visible { filter: brightness(1.07); outline: none; }
.btn:focus-visible { outline: 3px solid rgba(246, 232, 214, 0.55); outline-offset: 2px; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--lantern-deep); }

.btn-coin { background: var(--lantern); box-shadow: 0 4px 0 var(--lantern-deep); }
.btn-go   { background: var(--moss); color: #253318; box-shadow: 0 4px 0 var(--moss-deep); }
.btn-go:active { box-shadow: 0 1px 0 var(--moss-deep); }
.btn-magenta { background: var(--berry); color: #3a1f2a; box-shadow: 0 4px 0 #9c5570; }
.btn-magenta:active { box-shadow: 0 1px 0 #9c5570; }

/* Upgrade CTA - deliberately NOT amber (so it never clashes with the amber page
   accents) and forced dark text so the .nav cascade can't wash it out anywhere. */
.btn-upgrade,
.btn-upgrade:hover,
.btn-upgrade:focus,
.btn-upgrade:visited {
  background: #f4d9b0;
  color: #4a2d12 !important;
  box-shadow: 0 4px 0 #b98f57;
}
.btn-upgrade:hover, .btn-upgrade:focus-visible { filter: brightness(1.05); }
.btn-upgrade:active { transform: translateY(3px); box-shadow: 0 1px 0 #b98f57; }
.btn-ghost {
  background: transparent; color: var(--dim);
  border: 2px solid var(--edge); box-shadow: none; padding: 0.55rem 1.1rem;
}
.btn-ghost:hover, .btn-ghost:focus-visible { color: var(--cream); border-color: var(--dim); }
.btn-ghost:active { transform: translateY(2px); }

.actions { display: flex; gap: 0.9rem; flex-wrap: wrap; align-items: center; margin-top: 1.3rem; }

/* --- Forms ---------------------------------------------------------------- */
form p, .field { margin: 0 0 1.1rem; }
label { display: block; color: var(--cream); font-weight: 700; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], input[type="password"],
input[type="file"], input[type="number"] {
  width: 100%; padding: 0.65rem 0.85rem;
  background: #241a28; border: 2px solid var(--edge); border-radius: 12px;
  color: var(--cream); font-family: "Nunito", sans-serif; font-size: 1rem;
}
input:focus { outline: none; border-color: var(--lantern); box-shadow: 0 0 0 3px rgba(242,166,90,0.22); }
.helptext, .form-help { color: var(--dim); font-size: 0.92rem; display: block; margin-top: 0.25rem; }
.errorlist { list-style: none; padding: 0; margin: 0.3rem 0; color: var(--danger); font-size: 0.95rem; }

/* File input: style the native "Choose file" button as a pill */
input[type="file"] { padding: 0.5rem 0.6rem; cursor: pointer; }
input[type="file"]::file-selector-button {
  font-family: "Nunito", sans-serif; font-weight: 800; font-size: 0.95rem;
  margin-right: 0.8rem; padding: 0.45rem 0.9rem; cursor: pointer;
  background: var(--lantern); color: #35241a; border: none; border-radius: 10px;
  box-shadow: 0 3px 0 var(--lantern-deep);
}
input[type="file"]::file-selector-button:hover { filter: brightness(1.06); }

/* Segmented radio cards (target platform, window mode) */
.seg { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.seg-opt {
  flex: 1 1 150px; margin: 0; cursor: pointer; display: block;
  border: 2px solid var(--edge); border-radius: 12px; padding: 0.7rem 0.9rem;
  background: #241a28; color: var(--dim); font-weight: 700; transition: all .15s;
}
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.seg-opt:hover { border-color: var(--dim); color: var(--cream); }
.seg-opt:has(input:checked) {
  border-color: var(--lantern); color: var(--cream);
  background: rgba(242,166,90,0.12); box-shadow: 0 0 0 3px rgba(242,166,90,0.18);
}
.seg-opt:has(input:focus-visible) { border-color: var(--lantern); }
.seg-opt small { display: block; font-weight: 400; color: var(--dim); font-size: 0.85rem; margin-top: 0.15rem; }

/* Destination picker: even, logo-topped tiles (3 across, 2 on narrow screens) */
.dest-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; }
@media (max-width: 620px) { .dest-seg { grid-template-columns: repeat(2, 1fr); } }
.dest-opt {
  margin: 0; cursor: pointer; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 0.55rem; text-align: center;
  min-height: 6.4rem; border: 2px solid var(--edge); border-radius: 14px;
  padding: 0.9rem 0.6rem; background: #241a28; color: var(--dim);
  font-weight: 700; font-size: 0.92rem; transition: all .15s;
}
.dest-opt input { position: absolute; opacity: 0; width: 0; height: 0; }
.dest-opt:hover { border-color: var(--dim); color: var(--cream); transform: translateY(-2px); }
.dest-opt:has(input:checked) {
  border-color: var(--lantern); color: var(--cream);
  background: rgba(242,166,90,0.12); box-shadow: 0 0 0 3px rgba(242,166,90,0.18);
}
.dest-opt:has(input:focus-visible) { border-color: var(--lantern); }
.dest-ic { height: 36px; display: flex; align-items: center; justify-content: center; font-size: 30px; line-height: 1; }
.dest-ic img { height: 36px; width: auto; max-width: 100%; display: block; }
.dest-lbl { line-height: 1.25; }

/* Toggle switch (checkbox) */
.toggle { display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer;
  color: var(--cream); font-weight: 700; margin: 0; }
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle .track { width: 46px; height: 26px; flex: 0 0 auto; border-radius: 999px;
  background: #241a28; border: 2px solid var(--edge); position: relative; transition: all .15s; }
.toggle .track::after { content: ""; position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--dim); transition: all .15s; }
.toggle input:checked + .track { background: rgba(168,198,134,0.25); border-color: var(--moss); }
.toggle input:checked + .track::after { left: 22px; background: var(--moss); }
.toggle input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(242,166,90,0.22); }

/* Grouped sub-panel (platform-specific options) + side-by-side fields */
.subpanel { border: 2px dashed var(--edge); border-radius: 14px;
  padding: 1.1rem 1.2rem 0.2rem; margin: 0 0 1.1rem; background: rgba(0,0,0,0.12); }
.subpanel h3 { margin: 0 0 0.9rem; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.field-row .field { flex: 1 1 140px; }
[hidden] { display: none !important; }

/* --- Messages / badges ----------------------------------------------------- */
.msg { border-left: 5px solid var(--lantern); border-radius: 8px; padding: 0.6rem 1rem;
       margin-bottom: 0.8rem; background: rgba(242, 166, 90, 0.08); }
.msg.success { border-color: var(--moss); background: rgba(168, 198, 134, 0.10); }
.msg.error { border-color: var(--danger); background: rgba(224, 128, 128, 0.10); }
.msg.info { border-color: var(--berry); background: rgba(201, 116, 143, 0.10); }

.badge {
  font-family: "Pixelify Sans", sans-serif; font-size: 0.85rem; font-weight: 700;
  padding: 0.2rem 0.6rem; border-radius: 999px; border: 2px solid;
}
.badge.pending    { color: var(--lantern); border-color: var(--lantern); }
.badge.processing { color: var(--berry);   border-color: var(--berry); }
.badge.complete   { color: var(--moss);    border-color: var(--moss); }
.badge.failed     { color: var(--danger);  border-color: var(--danger); }

/* --- Job table -------------------------------------------------------------- */
.jobs { width: 100%; border-collapse: collapse; }
.jobs th, .jobs td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px dashed var(--edge); }
.jobs th { color: var(--dim); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; }
.jobs a { color: var(--lantern); }

pre.log {
  background: #241a28; border: 2px solid var(--edge); border-radius: 12px;
  padding: 1rem; overflow-x: auto; color: var(--dim);
  font-size: 0.85rem; white-space: pre-wrap; word-break: break-word;
}

/* --- Modal (tier gate) -------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(24, 16, 26, 0.78);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.modal {
  width: min(540px, 94vw);
  background: linear-gradient(180deg, var(--cabin) 0%, var(--cabin-deep) 100%);
  border: 2px solid var(--edge); border-radius: 22px;
  box-shadow: 0 18px 48px rgba(15, 9, 18, 0.6);
  padding: 2rem; text-align: center;
}
.modal h2 { color: var(--lantern); }
.price {
  font-family: "Nunito", sans-serif; font-weight: 800;
  color: var(--moss); font-size: 1.6rem; margin: 0.9rem 0;
}
.fineprint { color: var(--dim); font-size: 0.9rem; margin-top: 1.3rem; }

/* --- How-to guide (e.g. Google Play publishing steps) -------------------- */
/* Links inside body copy pick up the amber accent instead of browser blue -
   :not(.btn) so button-styled links keep their own colours. */
.guide a:not(.btn), .msg a:not(.btn) { color: var(--lantern); font-weight: 700; }
.guide a:not(.btn):hover, .msg a:not(.btn):hover { filter: brightness(1.08); }

/* Guide page: section headers, file callouts, and the top jump-links */
.guide-section { scroll-margin-top: 1.5rem; }
.guide-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.4rem; }
.guide-head img { height: 40px; width: auto; display: block; }
.guide-file {
  display: block; margin: 0.4rem 0 0.2rem; padding: 0.6rem 0.9rem; border-radius: 12px;
  background: #241a28; border: 2px solid var(--edge); font-size: 0.95rem; max-width: 66ch;
}
.guide-file strong { color: var(--lantern); }
.store-jump { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.1rem; }
.store-jump a {
  flex: 1 1 8rem; display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
  padding: 0.9rem 0.8rem; border-radius: 14px; text-decoration: none;
  background: #241a28; border: 2px solid var(--edge); color: var(--cream); font-weight: 700;
  transition: transform 0.12s, border-color 0.12s;
}
.store-jump a:hover, .store-jump a:focus-visible { transform: translateY(-3px); border-color: var(--lantern); }
.store-jump img { height: 42px; width: auto; }
.store-jump small { color: var(--lantern); font-weight: 700; font-size: 0.74rem; }

.guide-steps { counter-reset: step; list-style: none; padding: 0; margin: 1.1rem 0; max-width: 68ch; }
.guide-steps > li { position: relative; padding: 0.1rem 0 1rem 2.9rem; margin: 0; line-height: 1.55; }
.guide-steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: "Pixelify Sans", sans-serif; font-weight: 700; font-size: 1rem;
  background: var(--lantern); color: #35241a;
}
/* Connector line between the numbered dots. */
.guide-steps > li:not(:last-child)::after {
  content: ""; position: absolute; left: 0.95rem; top: 2.1rem; bottom: -0.1rem;
  width: 2px; background: var(--edge);
}

/* Signing-key callout (download button + password). */
.keybox {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem;
  border: 2px dashed var(--edge); border-radius: 12px;
  padding: 1rem 1.1rem; margin-top: 0.5rem; background: rgba(0, 0, 0, 0.14);
}
.keybox .kb-pw { color: var(--dim); }
.keybox code {
  background: #241a28; border: 1px solid var(--edge); border-radius: 8px;
  padding: 0.15rem 0.5rem; color: var(--cream);
}

/* --- Official partners ---------------------------------------------------- */
/* Landing "Twine -> stores" publishing-flow visual */
.pubflow { display: flex; align-items: center; justify-content: center; gap: 1.4rem; flex-wrap: wrap; }
.pubflow-tile {
  display: flex; flex-direction: column; align-items: center; gap: 0.55rem;
  padding: 1rem 1.1rem 0.85rem; border-radius: 16px; min-width: 7.4rem;
  background: #241a28; border: 2px solid var(--edge);
  text-decoration: none; color: var(--cream); font-weight: 700; font-size: 0.92rem;
  transition: transform 0.12s, border-color 0.12s;
}
.pubflow-tile:hover, .pubflow-tile:focus-visible { transform: translateY(-3px); border-color: var(--lantern); }
.pubflow-fmt { font-size: 0.74rem; font-weight: 700; color: var(--lantern); letter-spacing: 0.02em; margin-top: -0.15rem; }
.pubflow-src .pubflow-fmt { color: var(--dim); }
.pubflow-tile img { height: 56px; width: auto; display: block; }
.pubflow-src img { height: 64px; }
.pubflow-arrow { color: var(--lantern); flex: 0 0 auto; display: flex; align-items: center; }
.pubflow-arrow svg { width: 56px; height: auto; display: block; }
.pubflow-dests { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; }
@media (max-width: 640px) {
  .pubflow { flex-direction: column; }
  .pubflow-arrow { transform: rotate(90deg); }
}

.partner { display: flex; gap: 1.6rem; align-items: center; flex-wrap: wrap; }
.partner + .partner { margin-top: 1.6rem; padding-top: 1.6rem; border-top: 1px dashed var(--edge); }
.partner-logo {
  flex: 0 0 auto; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  width: min(300px, 66vw); aspect-ratio: 300 / 131;
  padding: 0.9rem 1.1rem; border-radius: 16px;
  background: #241a28; border: 2px solid var(--edge);
}
/* Every badge box is the same size; logos are contained + centered, so whatever
   the logo's own aspect ratio (wide banner or square emblem) it renders at the
   same height inside an identical rectangle. */
.partner-logo img { max-width: 100%; max-height: 100%; width: auto; height: auto; display: block; object-fit: contain; }
.partner-body { flex: 1 1 260px; }
.partner-name { display: flex; align-items: center; gap: 0.6rem; margin: 0 0 0.4rem; }
.partner-tagline { font-style: italic; color: var(--dim); margin: 0 0 1.1rem; max-width: 46ch; }
.badge-18 {
  font-family: "Nunito", sans-serif; font-size: 0.72rem; font-weight: 800;
  letter-spacing: 0.04em; padding: 0.12rem 0.5rem; border-radius: 6px;
  background: var(--berry); color: #3a1f2a;
}

/* --- Pricing tiers (compact, three equal columns) ------------------------ */
.tiers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.4rem;
  align-items: stretch;
}
/* Even at every width: 4 across -> 2x2 -> stacked. Never an orphan card. */
@media (max-width: 1020px) { .tiers { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .tiers { grid-template-columns: 1fr; } }
.tier {
  position: relative;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--cabin) 0%, var(--cabin-deep) 100%);
  border: 2px solid var(--edge);
  border-radius: 16px;
  padding: 1.35rem 1.3rem;
  box-shadow: 0 8px 22px rgba(20, 12, 22, 0.4);
}
/* The recommended (Concierge) tier keeps the same footprint, just berry-accented. */
.tier.featured {
  border-color: var(--berry);
  box-shadow: 0 12px 30px rgba(201, 116, 143, 0.28);
}
.tier-ribbon {
  position: absolute; top: -0.7rem; left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-family: "Pixelify Sans", sans-serif; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.02em; background: var(--berry); color: #3a1f2a;
  padding: 0.22rem 0.7rem; border-radius: 999px; box-shadow: 0 3px 0 #9c5570;
}
.tier-name { margin: 0.1rem 0 0.15rem; color: var(--cream); font-size: 1.12rem; }
.tier.featured .tier-name { color: var(--berry); }
.tier-price {
  font-family: "Nunito", sans-serif; font-weight: 800; line-height: 1.1;
  font-size: 1.5rem; color: var(--moss); margin: 0 0 0.4rem;
}
/* Fixed min-height keeps the price/list rows aligned across all three cards. */
.tier-desc { color: var(--dim); font-size: 0.94rem; margin: 0 0 0.8rem; min-height: 2.6em; }
.tier-list { list-style: none; padding: 0; margin: 0 0 1rem; line-height: 1.4; font-size: 0.92rem; }
.tier-list li { position: relative; padding-left: 1.35rem; margin-bottom: 0.4rem; color: var(--cream); }
.tier-list li::before {
  content: "✓"; position: absolute; left: 0; top: 0;
  color: var(--moss); font-weight: 800;
}
.tier-cta { margin-top: auto; }
.tier-cta .btn { width: 100%; text-align: center; font-size: 0.96rem; padding: 0.58rem 0.9rem; }

/* Checkbox "cards" (concierge target platforms) reuse the segmented look. */
.toggle-card { display: flex; align-items: center; gap: 0.55rem; }
.toggle-card::before {
  content: ""; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 6px;
  border: 2px solid var(--edge); background: #241a28; transition: all .15s;
}
.toggle-card:has(input:checked)::before {
  content: "✓"; display: inline-flex; align-items: center; justify-content: center;
  border-color: var(--lantern); background: var(--lantern); color: #35241a; font-weight: 800;
}

/* File-attach confirmation on the concierge form. */
.attach-status { display: block; margin-top: 0.35rem; font-size: 0.92rem; color: var(--dim); }
.attach-status.ok { color: var(--moss); font-weight: 700; }

footer {
  border-top: 2px dashed var(--edge);
  color: var(--dim); font-size: 0.92rem; padding: 1.3rem 0; text-align: center;
}
footer a { color: var(--lantern); text-decoration: none; }

.dropzone {
  border: 2px dashed var(--edge); border-radius: 14px;
  padding: 1.6rem 1rem; text-align: center; color: var(--dim); margin-bottom: 1.2rem;
}
.dropzone strong { color: var(--lantern); }

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
}
