/* ============================================================
   GOOD GRIEF — the Mixtape
   Visual language: taken directly from the cover artwork and
   the Jiminy Cricket character art.

   Dark, warm near-black base. Gold / coral-red / glowing cyan /
   slate-teal pop against it. Cream reserved for readable text
   and "paper" surfaces (letter, lyrics). One consistent grain
   texture (images/texture-grain.jpg) applied everywhere in the
   chrome at low opacity — never on the real photographs, which
   stay exactly as provided.

   Type: a rounded, bubbly, retro display font (bubble-letter,
   loop-and-curl feeling, matching the cover's GOOD/GRIEF and the
   Jiminy 'J' mark) is used for every title/header/kicker/subtext,
   consistently, site-wide. Body copy stays in a calm rounded sans
   so long text is actually readable.
============================================================ */

:root{
  /* base */
  --black: #14100c;       /* warm near-black, from the cover's shadow/vignette */
  --black-2: #1c1611;     /* slightly lifted panel black */
  --black-3: #241c15;     /* raised surface / card black */

  /* text + paper */
  --cream: #f0e4c8;       /* Jiminy's belly / aged paper — primary light text */
  --cream-dim: #cbbfa0;   /* secondary/soft light text */
  --paper: #e9dcb9;       /* "paper" surfaces: letter, lyrics blocks */
  --paper-ink: #1c1611;   /* text color when sitting on paper surfaces */

  /* the four pop colors, straight off the cover + Jiminy art */
  --gold: #d8a53a;        /* Jiminy Cricket Presents / GOOD / emblem ring */
  --gold-deep: #b3822a;
  --red: #c94a3a;         /* GRIEF, coral-leaning */
  --red-bright: #d1382c;  /* scarf red — small accents, buttons */
  --red-deep: #8f2c22;
  --cyan: #5fd0d6;        /* "the Mixtape" glowing cyan — bright accent */
  --cyan-deep: #3aa3a8;
  --teal: #3d6b6e;        /* jacket / night-sky slate-teal — quiet secondary */
  --teal-deep: #294c4e;

  --line: rgba(240,228,200,0.14);
  --line-soft: rgba(240,228,200,0.08);
  --max: 640px;
}

*{ box-sizing: border-box; }
html,body{ margin:0; padding:0; }

body{
  background: var(--black);
  color: var(--cream);
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  position: relative;
}

/* Consistent grain texture, everywhere in the chrome — never on photos. */
body::before{
  content: '';
  position: fixed;
  inset: 0;
  background-image: url('../images/texture-grain.jpg');
  background-size: 420px 420px;
  background-repeat: repeat;
  opacity: 0.5;
  mix-blend-mode: soft-light;
  pointer-events: none;
  z-index: 1;
}

h1,h2,h3,
.display-type{
  font-family: 'Bagel Fat One', 'Quicksand', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0 0 0.4em 0;
  color: var(--gold);
  line-height: 1.15;
}

a{ color: var(--cyan); text-decoration: none; }

img{ max-width: 100%; display:block; }

button, .btn{
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 3px;
}

/* ---------- Layout shell ---------- */
#app-shell{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#view-root{
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 40px;
  padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  position: relative;
  z-index: 2;
}

.view-header{
  margin-bottom: 22px;
}
.view-header .kicker{
  display: block;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.view-header h1{
  font-size: 2.3rem;
  line-height: 1.1;
}
.view-header p{
  color: var(--cream-dim);
  margin-top: 6px;
  font-family: 'Quicksand', sans-serif;
}

/* ---------- Bottom navigation ---------- */
.bottom-nav{
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  background: var(--black-3);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav .nav-item{
  flex: 1 1 0;
  text-align: center;
  color: var(--cream-dim);
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 13px 2px 11px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 3px solid transparent;
}
.bottom-nav .nav-item.active{
  color: var(--gold);
  border-top-color: var(--gold);
}

/* ---------- Persistent player bar ---------- */
.player-bar{
  position: fixed;
  left: 0; right: 0;
  bottom: 58px;
  z-index: 39;
  background: var(--black-2);
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
}
.player-bar.hidden{ display:none; }
.player-bar .pb-track{
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-bar .pb-sub{
  display:block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--cream-dim);
}
.player-bar button{
  background: transparent;
  border: 1px solid var(--line);
  color: var(--cream);
  padding: 7px 11px;
  font-size: 0.78rem;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.player-bar button.pb-play{
  background: var(--gold);
  border-color: var(--gold);
  color: var(--black);
}

body.has-player #view-root{
  padding-bottom: calc(150px + env(safe-area-inset-bottom, 0px));
}

/* ---------- Buttons ---------- */
.btn{
  display: inline-block;
  background: var(--red-bright);
  color: var(--cream);
  border: none;
  padding: 14px 22px;
  letter-spacing: 0.02em;
  font-size: 0.92rem;
}
.btn:active{ transform: translateY(1px); }
.btn.secondary{
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--line);
}
.btn.gold{ background: var(--gold-deep); color: var(--black); }
.btn.teal{ background: var(--teal-deep); color: var(--cream); }
.btn[disabled], .btn.disabled{
  opacity: 0.4;
  cursor: default;
}
.btn.block{ width:100%; text-align:center; }

.hint-note{
  font-size: 0.82rem;
  color: var(--cream-dim);
  margin-top: 6px;
  font-family: 'Quicksand', sans-serif;
}

/* ---------- Home: hero ---------- */
.home-hero{
  text-align: center;
  padding: 10px 0 8px;
  margin-bottom: 6px;
}
.home-hero .hero-logo{
  max-width: 100%;
  margin: 0 auto 16px;
  animation: gg-breathe 5s ease-in-out infinite;
}
@keyframes gg-breathe{
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(-0.6deg); }
}
.home-hero .hero-sub{
  font-family: 'Quicksand', sans-serif;
  color: var(--cream);
  font-size: 1.02rem;
  line-height: 1.5;
  margin: 4px auto 0;
  max-width: 480px;
}

/* ---------- Home: feature sections (Jams / Cabinet) ---------- */
.home-feature{
  margin: 40px 0 8px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.home-feature .feature-kicker{
  display: block;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 6px;
}
.home-feature h2{
  font-size: 1.6rem;
  margin-bottom: 12px;
}
.home-feature p{
  color: var(--cream);
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  margin: 0 0 16px 0;
}
.home-feature .feature-link{
  display: inline-block;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  color: var(--gold);
  font-size: 0.98rem;
  border-bottom: 1px solid var(--gold-deep);
  padding-bottom: 2px;
}

.cover-frame{
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--cream-dim);
  font-size: 0.9rem;
  padding: 20px;
  margin: 18px 0 16px;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}
.cover-frame img{ width:100%; height:auto; display:block; }

.emblem-frame{
  width: 100%;
  max-width: 260px;
  margin: 18px auto 16px;
  text-align: center;
}
.emblem-frame img{
  width: 100%;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
}

/* ---------- Home: logo-as-button links ---------- */
.logo-link-btn{
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 20px auto 8px;
  text-align: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.logo-link-btn img{
  width: 100%;
  height: auto;
  margin: 0 auto;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,0.5));
  transition: transform 0.15s ease;
}
.logo-link-btn:active img{ transform: scale(0.97); }
.logo-link-btn .tap-hint{
  display: block;
  margin-top: 10px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.82rem;
  color: var(--cream-dim);
  font-style: italic;
}
.jiminy-frame{
  width: 150px;
  height: 150px;
  border: 2px dashed var(--line);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.75rem;
  font-family: 'Quicksand', sans-serif;
  color: var(--cream-dim);
  margin: 0 auto 26px;
  padding: 10px;
  background: var(--black-2);
  overflow: hidden;
}
.jiminy-frame img{ width:100%; height:100%; object-fit: cover; border-radius: 50%; }

.intro-message{
  background: var(--black-2);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
  padding: 18px 20px;
  font-size: 1.02rem;
  color: var(--cream);
  font-family: 'Quicksand', sans-serif;
}
.intro-message p{ margin: 0 0 1em 0; }
.intro-message .signoff{
  display:block;
  margin-top: 12px;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  color: var(--cyan);
  font-size: 1.1rem;
}
.jiminy-sig{
  display:block;
  height: 60px;
  width: auto;
  margin-top: 14px;
  border-radius: 3px;
}
.placeholder-tag{
  display:inline-block;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gold);
  color: var(--black);
  padding: 3px 9px;
  border-radius: 2px;
  margin-bottom: 10px;
}

/* ---------- Jams ---------- */
.jams-cover{
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: 0 14px 34px rgba(0,0,0,0.55);
}
.jams-cover img{ width: 100%; height: auto; display: block; }

.playlist-box{
  background: var(--black-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 20px 18px;
  margin-bottom: 30px;
  text-align: center;
}
.playlist-box h2{
  font-size: 1.15rem;
  margin-bottom: 4px;
}
.playlist-box .hint-note{ margin-bottom: 14px; }

.track{
  border-top: 1px solid var(--line);
  padding: 24px 0;
}
.track:first-of-type{ border-top: none; }
.track-head{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.track-num{
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 1.2rem;
  color: var(--gold);
  width: 28px;
  flex-shrink: 0;
}
.track-title{
  flex: 1 1 auto;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 1.15rem;
  color: var(--cream);
}
.track-duration{
  font-size: 0.82rem;
  color: var(--cream-dim);
  flex-shrink: 0;
}
.track-play{
  flex-shrink: 0;
  background: var(--red-bright);
  color: var(--cream);
  border: none;
  padding: 10px 18px;
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border-radius: 2px;
}
.track-play.playing{ background: var(--cyan-deep); }
.track-play.not-ready{ background: var(--black-3); color: var(--cream-dim); }
.lyrics{
  white-space: pre-wrap;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.98rem;
  color: var(--cream-dim);
  line-height: 1.75;
  margin-top: 14px;
}
.download-block{
  background: var(--black-2);
  border: 1px solid var(--line);
  padding: 18px;
  margin-bottom: 26px;
  text-align: center;
}

/* ---------- Cabinet ---------- */
.cabinet-header{
  text-align: center;
  margin-bottom: 28px;
}
.cabinet-logo{
  max-width: 100%;
  margin: 0 auto 22px;
}
.cabinet-emblem{
  max-width: 260px;
  margin: 0 auto 20px;
  filter: drop-shadow(0 10px 24px rgba(0,0,0,0.55));
}
.cabinet-instructions{
  font-family: 'Quicksand', sans-serif;
  color: var(--cream);
  font-size: 1.02rem;
  line-height: 1.55;
  max-width: 460px;
  margin: 0 auto;
}
.rules-box{
  background: var(--black-2);
  border: 1px solid var(--line);
  padding: 16px 18px;
  margin-bottom: 22px;
  white-space: pre-wrap;
  color: var(--cream-dim);
  font-family: 'Quicksand', sans-serif;
  font-size: 0.95rem;
  border-radius: 4px;
}
.item-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.item-row:first-of-type{ border-top: none; }
.item-name{ font-family: 'Quicksand', sans-serif; font-weight: 600; color: var(--cream); flex: 1 1 auto; }
.item-row select{
  font-family: 'Quicksand', sans-serif;
  font-size: 1rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--black-2);
  color: var(--cream);
  border-radius: 3px;
  min-width: 118px;
}
.shelf-hint{
  background: var(--black-2);
  border: 1px solid var(--line);
  padding: 14px 18px;
  margin: 22px 0;
  border-radius: 4px;
}
.shelf-hint h3{ font-size: 1rem; margin-bottom: 8px; color: var(--gold); }
.shelf-hint ul{ margin:0; padding-left: 18px; font-family: 'Quicksand', sans-serif; color: var(--cream-dim); }
.form-field{ margin-bottom: 16px; }
.form-field label{
  display:block;
  font-family: 'Quicksand', sans-serif;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 6px;
  font-size: 0.9rem;
}
.form-field input[type=text], .form-field input[type=password], .form-field textarea{
  width: 100%;
  padding: 12px 12px;
  font-size: 1rem;
  font-family: 'Quicksand', sans-serif;
  border: 1px solid var(--line);
  background: var(--black-2);
  color: var(--cream);
  border-radius: 3px;
}
.form-field textarea{ min-height: 110px; resize: vertical; }

.result-box{
  background: var(--black-2);
  border: 2px solid var(--gold);
  padding: 18px;
  text-align: center;
  margin-bottom: 22px;
  border-radius: 4px;
}
.result-box .score{
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 2rem;
  color: var(--gold);
}
.result-box p{ font-family: 'Quicksand', sans-serif; color: var(--cream-dim); }

table.leaderboard{
  width: 100%;
  border-collapse: collapse;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.92rem;
  color: var(--cream);
}
table.leaderboard th, table.leaderboard td{
  text-align: left;
  padding: 9px 6px;
  border-bottom: 1px solid var(--line);
}
table.leaderboard th{
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--cyan);
}
table.leaderboard tr.me{ background: var(--black-3); }

/* ---------- Archives ---------- */
.archive-photo{
  margin-bottom: 34px;
  border: 1px solid var(--line);
  background: var(--black-2);
  border-radius: 4px;
  overflow: hidden;
  cursor: zoom-in;
  box-shadow: 0 10px 24px rgba(0,0,0,0.4);
}
.archive-photo img{ width: 100%; display: block; }
.archive-caption{
  padding: 12px 14px;
  font-family: 'Quicksand', sans-serif;
  font-size: 0.85rem;
  color: var(--cream-dim);
  font-style: italic;
}
.empty-state{
  text-align: center;
  color: var(--cream-dim);
  font-family: 'Quicksand', sans-serif;
  padding: 60px 20px;
  font-size: 0.95rem;
}
.archive-submitted-by{
  font-style: normal;
  color: var(--cyan);
  font-size: 0.78rem;
  padding-top: 0;
}
.upload-box{
  margin-top: 12px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.upload-box h2{ font-size: 1.25rem; }
.upload-box input[type=file]{
  width: 100%;
  padding: 10px 0;
  font-family: 'Quicksand', sans-serif;
  color: var(--cream-dim);
  font-size: 0.9rem;
}
.lightbox{
  position: fixed;
  inset: 0;
  background: rgba(15,12,9,0.94);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox img{ max-width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox .lb-close{
  margin-top: 16px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--cream);
  font-family: 'Bagel Fat One', 'Quicksand', sans-serif;
  padding: 10px 20px;
  letter-spacing: 0.02em;
}

/* ---------- The Gift ---------- */
.letter{
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 22px 20px;
  font-size: 1.02rem;
  line-height: 1.75;
}
.letter p{ margin: 0 0 1em 0; }
.comment-wall{ margin-top: 34px; }
.comment-wall h2{ font-size: 1.3rem; }
.comment{
  border-top: 1px solid var(--line);
  padding: 14px 0;
}
.comment .c-name{ font-weight: 700; font-size: 0.9rem; }
.comment .c-time{ font-size: 0.75rem; color: var(--ink-soft); margin-left: 6px; }
.comment .c-msg{ margin-top: 4px; white-space: pre-wrap; }

/* ---------- Admin ---------- */
.admin-section{
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 16px 18px;
  margin-bottom: 22px;
}
.admin-section h2{ font-size: 1.1rem; margin-bottom: 12px; }
.admin-section h3{ font-size: 0.95rem; margin: 16px 0 8px; }
.admin-item-row{
  display:flex; gap:8px; align-items:center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.admin-item-row:first-of-type{ border-top:none; }
.admin-item-row input[type=text]{
  flex: 1 1 140px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-family: inherit;
  font-size: 0.9rem;
}
.admin-item-row input[type=number]{
  width: 66px;
  padding: 8px 6px;
  border: 1px solid var(--line);
  background: var(--cream);
  font-family: inherit;
  font-size: 0.9rem;
}
.admin-item-row button{
  padding: 7px 10px;
  font-size: 0.75rem;
  background: var(--ink);
  color: var(--cream);
  border: none;
}
.admin-item-row button.danger{ background: var(--red-deep); color: var(--paper); }
.small-note{ font-size: 0.78rem; color: var(--ink-soft); margin-top: 4px; }
.stat-line{ display:flex; justify-content: space-between; padding: 6px 0; border-top: 1px solid var(--line); font-size: 0.92rem; }
.stat-line:first-of-type{ border-top: none; }
.msg-ok{ color: var(--teal-deep); font-weight: 600; font-size: 0.85rem; }
.msg-err{ color: var(--red-deep); font-weight: 600; font-size: 0.85rem; }

/* ---------- Secret ---------- */
.secret-view{
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-soft);
}

@media (min-width: 720px){
  #view-root{ padding-top: 44px; }
}
