/* styles.css
   HHN AT HOME
*/

:root{
  --bg:#000;
  --fg:#fff;
  --muted:#bdbdbd;
  --fade:#222;
  --mels:#fd53dd;
  --hhnred:#e33737;

  --card:#0e0e0e;
  --border: rgba(255,255,255,0.14);

  /* default accent (Any year) */
  --accent-default:#b30000;

  --fab: rgba(255,255,255,0.12);
  --fab2: rgba(0,0,0,0.55);
}

/* ---------- Base ---------- */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family: "Mulish", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

.app{ min-height:100vh; }

/* Visually-hidden utility (for accessible labels) */
.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip: rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

/* ---------- HERO (image ONLY here) ---------- */
.hero{
  position:relative;
  min-height:90vh;
  display:grid;
  place-items:center;
  padding:24px;

  background-image: url("assets/img/hhn-die-in-background.jpg");
  background-size: cover;
  background-position: center;
  background-repeat:no-repeat;
}

/* dark overlay so text is readable */
.hero::before{
  content:"";
  position:absolute;
  inset:0;
  background: rgba(0,0,0,0.70);
  z-index:0;
}

.hero__content{
  position:relative;
  z-index:1;
  width:min(1190px, 100%);
  display:grid;
  gap:16px;
}

.title{ text-align:center; }

.title img{
  max-width: 680px;
  width: 100%;
  height: auto;
  display:block;
  margin: 0 auto 10px;
}

.title h1{
  margin:0 0 8px 0;
  line-height:1.05;
  font-size: clamp(28px, 6vw, 50px);
  text-shadow: rgba(227,55,55,0.9) 0px 0px 10px;
  font-weight:700;
}

.fade{ color:var(--fade); }
.sub{ margin:0; color:var(--muted); }

/* subtitle with inline dropdown */
.sub-inline{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
  line-height: 1.35;
  font-size:16px;
}

.yearSelectInline{
  width:auto;
  min-width: 240px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(227,55,55,1);
  background: rgba(227,55,55,0.15);
  color:var(--fg);
  font-family: inherit;
  font-size: 16px;
}

.yearSelectInline option {
  background: #000;
  color: #fff;
}

.hero__content .btn.primary {
  margin-top:20px;
  width:50%;
  max-width: 420px;
}

/* checkbox under the button */
.hero-check{
  margin-top: 14px;
  display:flex;
  justify-content:center;
}

.check{
  display:flex;
  align-items:center;
  gap:10px;
  user-select:none;
  color: var(--fg);
}

/* Buttons */
.btn{
  border:1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.35);
  color:var(--fg);
  border-radius:14px;
  padding:14px 16px;
  font-size:16px;
  cursor:pointer;
}

.btn.primary{
  background:var(--hhnred);
  color:#000;
  font-weight:800;
  border-color: transparent;
  transition: background 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.btn.primary:hover{
  background: #111;
  color:var(--hhnred);
  font-weight:800;
  border-color: transparent;
  transform: translateY(-1px);
}

/* little hint arrow */
.hero__hint{
  position:absolute;
  bottom:14px;
  left:50%;
  transform: translateX(-50%);
  z-index:1;
  opacity:0.75;
  font-size:24px;
  display:none; /* hidden until a night is generated */
}

/* ---------- RESULTS AREA (no image) ---------- */
.results-wrap{
  padding: 26px 24px 140px; /* extra bottom room for action bar */
  background: #000;
}

.results{
  width:min(1190px, 100%);
  margin:0 auto;
  padding:18px;
  border-radius:18px;
  /* border:1px solid var(--border);
  background: rgba(255,255,255,0.03); */
}

.results__header{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-bottom: 10px;
}

.results__header .note {
  display: none !important;
}

/* ---------- Featured Year Stamp ---------- */
.results-year-stamp{
  display:flex;
  align-items:center;
  gap:12px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(0,0,0,0.35);
  overflow:hidden;
  flex-wrap:wrap;
}

.results-year-stamp__swatch{
  width:10px;
  height:52px;
  border-radius:10px;
  background: var(--accent-default);
  flex:0 0 auto;
}

.results-year-stamp__logo{
  max-width: 90px;
  width: 90px;
  height:auto;
  display:block;
  flex:0 0 auto;
}

.results-year-stamp__text{
  display:grid;
  gap:2px;
  min-width: 200px;
  flex: 1 1 200px;
}

.results-year-stamp__title{
  font-size: 14px;
}

.results-year-stamp__sub{
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Groups ---------- */
.group{ margin-top:18px; }
.group h2{ margin:0 0 10px 0; }

.rows{
  display:grid;
  gap:12px;
}

/* ---------- Result Row Card (stacked UI) ---------- */
.result-row{
  border:1px solid var(--border);
  background: rgba(0,0,0,0.35);
  border-radius:16px;
  padding:14px;
  display:flex;
  align-items:center;
  gap:16px;
  min-width: 0;
  position:relative;
}

/*
.result-row__left{
  flex: 0 0 auto;
  width: 120px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.result-row__logo{
  width: 100%;
  max-width: 120px;
  height:auto;
  display:block;
}
*/

.result-row__left{
  flex: 0 0 auto;
  width: 120px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.result-row__logo{
  width: 120px;
  height: 120px;
  border-radius: 14px;
  object-fit: contain;
  display:block;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(0,0,0,0.25);
}

.result-row__main{
  flex: 1 1 auto;
  min-width: 0;
}

.result-row__name{
  font-weight: 900;
  font-size: clamp(18px, 3.2vw, 24px);
  line-height:1.1;
  margin: 0 0 8px 0;
}

.result-row__meta{
  color: var(--muted);
  font-size: 15px;
  display:flex;
  align-items:center;
  gap:8px;
  flex-wrap:wrap;
}

.year-text{
  font-weight: 900;
  color: var(--accent-default);
}

/* right-side row actions (reroll + lock) */
.result-row__actions{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  gap:10px;
}

/* lock button */
.lock-btn{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.30);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.lock-btn img{
  width: 26px;
  height: 26px;
  display:block;
}

/* per-row reroll button */
.reroll-btn{
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border:1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.30);
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.reroll-btn[aria-disabled="true"]{
  opacity:0.45;
  cursor:not-allowed;
}

.reroll-btn img{
  width: 24px;
  height: 24px;
  display:block;
}

.item-desc{
  margin: 8px 0 10px;
  color: #bdbdbd;
  font-size: 14px;
  line-height: 1.4;
  max-width: 560px;
}

/* ---------- Details toggle (Ingredients) ---------- */
.details-toggle{
  margin-top:12px;
  border:1px solid rgba(255,255,255,0.12);
  border-radius:12px;
  background: rgba(0,0,0,0.25);
  padding:10px 12px;
  max-width: 420px;
}

.details-toggle > summary{
  cursor:pointer;
  font-weight:900;
  font-size:14px;
  color: var(--fg);
  list-style:none;
}

.details-toggle > summary::-webkit-details-marker{ display:none; }

.details-toggle > summary::after{
  content:"▾";
  float:right;
  opacity:0.85;
}

.details-toggle[open] > summary::after{ content:"▴"; }

.details-list{
  margin:10px 0 0 18px;
  padding:0;
  color: var(--fg);
  font-size:14px;
}

.details-list li{ margin:4px 0; }

/* Item link (Buttons) */
.item-link{
  display:inline-block;
  margin-top:0px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.25);
  color: var(--hhnred);
  text-decoration:none;
  font-weight:900;
  font-size:12px;
}
.item-link:hover{
  background: rgba(227,55,55,0.12);
}

/* ---------- Note ---------- */
.note{ color:var(--muted); margin:0; }

/* ---------- Floating Controls ---------- */
.fab-top{
  position: fixed;
  right: 16px;
  bottom: 0;
  transform: translateY(-50%);
  z-index: 61;

  width: 52px;
  height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(120,120,120,0.35);
  backdrop-filter: blur(6px);
  color: #fff;
  font-weight: 900;
  font-size: 22px;
  cursor: pointer;

  display:none; /* shown once results appear */
}

/* ---------- Bottom Action Bar ---------- */
.regen-bar{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;

  padding: 18px 0 18px;
  display:none; /* shown once results appear */
  justify-content:center;

  background: linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0));
  pointer-events:none; /* allow click only on inner */
}

.regen-bar__inner{
  pointer-events:auto;
  display:flex;
  gap: 12px;
}

.regen-action{
  width: 64px;
  height: 64px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.18);
  background: var(--hhnred);
  backdrop-filter: blur(6px);
  cursor: pointer;

  display:flex;
  align-items:center;
  justify-content:center;
  transition: transform 0.08s ease, background 0.15s ease;
}

.regen-action:hover{
  transform: translateY(-1px);
  background: #000;
}

.regen-action img{
  width: 34px;
  height: 34px;
  display:block;
}

/* ---------- Toast ---------- */
.toast{
  position: fixed;
  left: 50%;
  bottom: 104px;
  transform: translateX(-50%) translateY(10px);
  z-index: 80;

  background: rgba(0,0,0,0.70);
  border: 1px solid rgba(255,255,255,0.14);
  color: var(--fg);
  padding: 10px 14px;
  border-radius: 14px;
  backdrop-filter: blur(6px);

  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-weight: 800;
  font-size: 14px;
}

.toast.show{
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.copyright {
  color:#999;
  font-size:12px;
  text-align:center;
  padding-top:20px;
}

.copyright a {
  color:var(--hhnred);
}

.copyright a:hover {
  color:var(--fg);
}

/* ---------- Responsive ---------- */
@media (max-width: 760px){
  .hero{
    padding: 18px;
    min-height: 100vh;
  }

  .hero__content .btn.primary{
    width: 100%;
    max-width: none;
  }

  .yearSelectInline{
    width: 100%;
    min-width: 0;
  }

  .results-wrap{
    padding: 18px 14px 140px;
  }

  .results{
    padding: 14px;
    border-radius: 16px;
  }

  .results-year-stamp__logo{
    width: 70px;
    max-width: 70px;
  }

  .result-row{
    padding: 12px;
    gap: 12px;
  }

  .result-row__left{
    width: 92px;
  }

  .result-row__logo{
    max-width: 92px;
  }

  .lock-btn{
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }

  .lock-btn img{
    width: 24px;
    height: 24px;
  }

  .reroll-btn{
    width: 42px;
    height: 42px;
    border-radius: 16px;
  }

  .reroll-btn img{
    width: 22px;
    height: 22px;
  }

  .fab-top{
    right: 12px;
  }

  .toast{
    bottom: 108px;
  }
}

@media (max-width: 600px) {
  .result-row__left{
    width: 70px;
  }

  .result-row__logo{
    max-width: 70px;
  }
  .result-row__actions {
    display: block;
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }
  .result-row__actions .reroll-btn {
    margin-bottom:15px;
  }
}

@media (max-width: 420px){
  .title img{ max-width: 260px; }

  .result-row{
    flex-direction: row;
    align-items:flex-start;
  }

  .result-row__meta{
    font-size: 14px;
  }

  .details-toggle{
    max-width: 100%;
  }
}

/* ---------------------------------------------------------
   YEAR COLORS
   Applies to:
   - .results-year-stamp__swatch[data-year="YYYY"]
   - .results-year-stamp__title[data-year="YYYY"]
   - .year-text[data-year="YYYY"]
--------------------------------------------------------- */

/* Any year / default */
.results-year-stamp__swatch[data-year="any"]{ background: var(--accent-default); }
.results-year-stamp__title[data-year="any"],
.year-text[data-year="any"]{ color: var(--accent-default); }

/* 2017 */
.results-year-stamp__swatch[data-year="2017"]{ background:#da8067; }
.results-year-stamp__title[data-year="2017"],
.year-text[data-year="2017"]{ color:#da8067; }

/* 2018 */
.results-year-stamp__swatch[data-year="2018"]{ background:#c90000; }
.results-year-stamp__title[data-year="2018"],
.year-text[data-year="2018"]{ color:#c90000; }

/* 2019 */
.results-year-stamp__swatch[data-year="2019"]{ background:#81d5f9; }
.results-year-stamp__title[data-year="2019"],
.year-text[data-year="2019"]{ color:#81d5f9; }

/* 2021 */
.results-year-stamp__swatch[data-year="2021"]{ background:#d11f1f; }
.results-year-stamp__title[data-year="2021"],
.year-text[data-year="2021"]{ color:#d11f1f; }

/* 2022 */
.results-year-stamp__swatch[data-year="2022"]{ background:#969f00; }
.results-year-stamp__title[data-year="2022"],
.year-text[data-year="2022"]{ color:#969f00; }

/* 2023 */
.results-year-stamp__swatch[data-year="2023"]{ background:#f95c15; }
.results-year-stamp__title[data-year="2023"],
.year-text[data-year="2023"]{ color:#f95c15; }

/* 2024 */
.results-year-stamp__swatch[data-year="2024"]{ background:#d0ce00; }
.results-year-stamp__title[data-year="2024"],
.year-text[data-year="2024"]{ color:#d0ce00; }

/* 2025 */
.results-year-stamp__swatch[data-year="2025"]{ background:#77aa97; }
.results-year-stamp__title[data-year="2025"],
.year-text[data-year="2025"]{ color:#77aa97; }
