/* ========== TOASTED PALS — Styles ========== */

:root {
  /* warm toast palette */
  --salmon:     #FF8C69;       /* hero bg / brand coral */
  --salmon-deep:#E5633A;
  --butter:     #FFE566;       /* butter accent */
  --butter-soft:#FFF3C4;       /* checker page bg */
  --cream:      #FFF8EE;       /* apply page bg */
  --cream-card: #FFF0D6;       /* apply form card */
  --toast:      #D4820A;       /* golden toast */
  --toast-light:#F4A83A;
  --crust:      #A85C28;       /* medium brown */
  --ink:        #2C1A0E;       /* very dark brown — main "black" */
  --ink-soft:   #4A2C14;
  --warm-white: #FFFBF2;
  --shadow:     4px 4px 0 var(--ink);
  --shadow-sm:  3px 3px 0 var(--ink);
  --shadow-lg:  6px 6px 0 var(--ink);
}

*{box-sizing:border-box;margin:0;padding:0;}
html,body{min-height:100%;}

body{
  font-family:'Fredoka', system-ui, -apple-system, sans-serif;
  color:var(--ink);
  min-height:100vh;
  position:relative;
}

/* ============ PAGE-SPECIFIC BACKGROUNDS ============ */

/* Page 1: Landing — salmon coral hero + hero image */
body.page-landing {
  background:
    url('assets/toast-hero.jpeg') center center / cover no-repeat fixed,
    linear-gradient(160deg, #FF8C69 0%, #FFAE82 40%, #FFD18C 100%);
  overflow: hidden;
}

/* Page 2: Menu — crowd of toasts as backdrop */
body.page-menu {
  background:
    url('assets/toast-crowd.jpeg') center center / cover no-repeat fixed,
    linear-gradient(160deg, #FF8C69 0%, #FFB87A 100%);
}
body.page-menu::after {
  content: "";
  position: fixed; inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,140,105,.28) 100%);
  pointer-events: none;
  z-index: 1;
}

/* Page 3: Apply — flat warm cream */
body.page-apply {
  background: var(--cream);
}

/* Page 4: Checker — flat butter yellow */
body.page-checker {
  background: var(--butter-soft);
}

/* floating crumbs layer */
.crumbs {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
.crumbs span {
  position: absolute;
  color: rgba(255,255,255,.7);
  text-shadow: 0 0 6px rgba(212,130,10,.6);
  animation: crumble 4s ease-in-out infinite;
}
@keyframes crumble {
  0%,100% { transform: scale(.5) rotate(-10deg); opacity:.35; }
  50%      { transform: scale(1.1) rotate(8deg);  opacity:.9; }
}

/* layout */
.wrap {
  position: relative; z-index: 3;
  max-width: 760px; margin: 0 auto;
  padding: 20px;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ============ BACK BUTTON ============ */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  font-family: 'Bubblegum Sans', cursive;
  letter-spacing: 1px;
  align-self: flex-start;
  transition: transform .12s ease, box-shadow .12s ease;
}
.back-btn:hover { transform: translate(-2px,-2px); box-shadow: var(--shadow-sm); }

/* ============ PAGE 1 — LANDING ============ */
.landing-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  gap: 16px;
  text-align: center;
}
.landing-logo {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 64px;
  color: #fff;
  text-shadow: 5px 5px 0 var(--ink), 0 0 40px rgba(212,130,10,.4);
  letter-spacing: 4px;
  line-height: 1.05;
}
.landing-sub {
  font-family: 'Fredoka', sans-serif;
  font-size: 19px;
  color: var(--warm-white);
  font-weight: 600;
  letter-spacing: 1.5px;
  text-shadow: 2px 2px 0 var(--ink);
}
.explore-btn {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--ink);
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 16px 44px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  display: inline-block;
  margin-top: 10px;
}
.explore-btn:hover {
  transform: translate(-3px,-3px);
  box-shadow: 7px 7px 0 var(--ink);
  background: var(--toast-light);
  color: #fff;
}
.explore-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }

/* ============ PAGE 2 — MENU ============ */
.menu-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: 0;
  min-height: 100vh;
}
.menu-collection-tag {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 13px;
  letter-spacing: 2px;
  color: #fff;
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 6px 18px;
  margin-bottom: 14px;
  display: inline-block;
}
.menu-title {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 58px;
  color: #fff;
  text-shadow: 5px 5px 0 var(--ink);
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: 32px;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 260px;
}
.menu-btn {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--ink);
  background: var(--butter);
  border: 3px solid var(--ink);
  border-radius: 999px;
  padding: 14px 28px;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
  cursor: pointer;
  text-align: center;
}
.menu-btn:hover {
  transform: translate(-3px,-3px);
  box-shadow: 7px 7px 0 var(--ink);
  background: var(--warm-white);
}
.menu-btn:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }

/* ============ PAGE 3 — APPLY ============ */
.apply-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
}
.page-title {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 38px;
  letter-spacing: 3px;
  color: var(--ink);
  text-align: center;
  margin-bottom: 6px;
}
.page-subtitle {
  font-family: 'Fredoka', sans-serif;
  font-size: 15px;
  color: var(--crust);
  font-weight: 600;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 22px;
}

.apply-card {
  background: var(--cream-card);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  width: 100%;
  max-width: 520px;
}

/* TASK ROW */
.task-row {
  display: flex; align-items: center;
  background: var(--ink);
  color: #fff;
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 6px;
  margin-bottom: 12px;
  gap: 6px;
}
.task-row .label {
  flex: 1;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
  font-family: 'Bubblegum Sans', cursive;
  letter-spacing: 1.5px;
  line-height: 1.25;
  text-transform: uppercase;
}
.task-row .input-wrap {
  flex: 0 0 45%;
  display: flex;
}
.task-row input[type="text"] {
  flex: 1; width: 100%;
  padding: 11px 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 13px;
  border: none;
  border-radius: 10px;
  background: var(--warm-white);
  color: var(--ink);
  outline: none;
}
.task-row input[type="text"]::placeholder { color: #bbb; font-style: italic; }
.task-row input[type="text"]:focus { box-shadow: inset 0 0 0 2px var(--toast); }
.task-row input.error { box-shadow: inset 0 0 0 2px #e94e4e; background: #fff0f0; }
.task-row .follow-btn {
  flex: 1;
  padding: 11px 14px;
  background: var(--butter);
  color: var(--ink);
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  font-family: 'Fredoka', sans-serif;
  letter-spacing: .5px;
  transition: background .15s;
}
.task-row .follow-btn:hover { background: var(--toast-light); color: #fff; }
.task-row .follow-btn.done { background: #8BE0A0; color: #1a4a2a; }

/* SUBMIT */
.submit-wrap { display: flex; justify-content: center; margin-top: 18px; }
.submit-btn {
  font-family: 'Bubblegum Sans', cursive;
  font-size: 18px;
  letter-spacing: 2px;
  color: #fff;
  background: var(--toast);
  border: 3px solid var(--ink);
  border-radius: 14px;
  padding: 14px 46px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.submit-btn:hover { transform: translate(-2px,-2px); box-shadow: 5px 5px 0 var(--ink); background: var(--salmon-deep); }
.submit-btn:active { transform: translate(1px,1px); box-shadow: 1px 1px 0 var(--ink); }
.submit-btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }

/* messages */
.msg {
  margin-top: 14px; padding: 12px 14px;
  border: 3px solid var(--ink);
  border-radius: 14px;
  font-weight: 600;
  display: none;
  text-align: center;
  font-size: 14px;
}
.msg.show { display: block; }
.msg.ok   { background: #c7f0dc; color: #1a5a3a; }
.msg.warn { background: #ffd9d9; color: #7a1e1e; }
.msg.info { background: var(--butter-soft); color: #7a5a0e; }

/* ============ PAGE 4 — CHECKER ============ */
.checker-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 30px;
}
.checker-input-wrap {
  width: 100%;
  max-width: 520px;
  margin-bottom: 20px;
}
.checker-input {
  width: 100%;
  padding: 18px 22px;
  font-family: 'Bubblegum Sans', cursive;
  font-size: 18px;
  letter-spacing: 1px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #E8E0D0;
  color: var(--ink);
  outline: none;
  text-align: center;
  box-shadow: var(--shadow);
}
.checker-input::placeholder { color: #9a8a72; }
.checker-input:focus { background: var(--warm-white); border-color: var(--toast); }
.checker-input.error { background: #ffe5e5; border-color: #e94e4e; }

/* leaderboard table */
.leaderboard { width: 100%; max-width: 680px; }
table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  border: 3px solid var(--ink);
  border-radius: 18px;
  overflow: hidden;
  background: #E8DCC8;
  box-shadow: var(--shadow);
}
th, td {
  padding: 12px 14px; text-align: center; font-size: 14px;
  border-bottom: 2px solid var(--ink);
}
th {
  background: #D4C4A0;
  font-family: 'Bubblegum Sans', cursive;
  letter-spacing: 2px;
  font-size: 18px;
  color: var(--ink);
  border-bottom: 3px solid var(--ink);
}
th:first-child { border-right: 2px solid var(--ink); }
td:first-child { border-right: 2px solid var(--ink); width: 80px; font-weight: 700; font-family: 'Bubblegum Sans', cursive; font-size: 16px; }
tr:last-child td { border-bottom: none; }
td.wallet { font-family: 'Courier New', monospace; color: var(--ink); font-size: 13px; word-break: break-all; text-align: center; }
tr:nth-child(even) td { background: #DDD0B8; }

/* loader */
.spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 3px solid rgba(0,0,0,.2);
  border-top-color: var(--toast);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ RESPONSIVE ============ */
@media (max-width: 600px) {
  .wrap { padding: 16px; }
  .landing-logo { font-size: 36px; }
  .explore-btn { font-size: 18px; padding: 14px 30px; }
  .menu-title { font-size: 40px; }
  .menu-buttons { width: 90%; max-width: 280px; }
  .page-title { font-size: 28px; letter-spacing: 2px; }
  .apply-card { padding: 16px; }
  .task-row { flex-direction: column; align-items: stretch; padding: 8px; gap: 6px; }
  .task-row .label { padding: 6px 4px 4px; font-size: 12px; text-align: center; }
  .task-row .input-wrap { flex: 1; width: 100%; }
  .checker-input { font-size: 14px; padding: 14px; }
  th, td { padding: 8px 6px; font-size: 12px; }
  th { font-size: 14px; }
  td.wallet { font-size: 11px; }
}
