:root {
  --paper: #f3ead8;
  --paper-dark: #e8dbc0;
  --ink: #2a1215;
  --wine: #6b1f2a;
  --tomato: #c8442f;
  --mustard: #e2a73b;
  --navy: #1c2340;
  --shadow: rgba(42, 18, 21, 0.25);

  --serif: "Playfair Display", Georgia, serif;
  --hand: "Caveat", cursive;
  --type: "Special Elite", "Courier New", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--type);
  color: var(--ink);
  background-color: var(--paper);

  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3  0 0 0 0 0.2  0 0 0 0 0.1  0 0 0 0.09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 0;
  gap: 8px;
}

.logo {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 1.1rem;
  color: var(--wine);
}
.logo span { color: var(--tomato); }

.login {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1.5px solid var(--ink);
  padding: 6px 12px;
  border-radius: 2px;
}

.nav {
  order: 3;
  width: 100%;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 10px 0 12px;
  border-bottom: 1.5px dashed var(--ink);
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.nav a:hover { color: var(--tomato); }

.hero {
  text-align: center;
  padding: 44px 20px 56px;
  max-width: 760px;
  margin: 0 auto;
}

.note {
  font-family: var(--hand);
  font-size: 1.6rem;
  color: var(--tomato);
}
.rotate-left { display: inline-block; transform: rotate(-4deg); }

.hero-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(3.8rem, 20vw, 8rem);
  line-height: 0.9;
  letter-spacing: 0.04em;
  color: var(--wine);
  margin: 6px 0 18px;
  text-shadow: 3px 3px 0 var(--mustard);
}

.tagline {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.subline { font-size: 0.95rem; opacity: 0.8; }

.tonight-q {
  font-family: var(--serif);
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 44px 0 14px;
}

.pick-btn {
  background: var(--wine);
  color: var(--paper);
  border: 2px solid var(--ink);
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  padding: 20px 34px;
  min-height: 60px;
  border-radius: 3px;
  box-shadow: 6px 6px 0 var(--mustard);
  transition: transform 0.12s, box-shadow 0.12s;
}
.pick-btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--mustard); }
.pick-btn:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--mustard); }

.tiny { font-family: var(--hand); font-size: 1.3rem; margin-top: 16px; opacity: 0.75; }

.section { padding: 10px 18px 60px; max-width: 1100px; margin: 0 auto; }

.section-title {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 30px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.night-card {
  position: relative;
  text-align: left;
  background: #fffaf0;
  border: 1.5px solid var(--ink);
  padding: 26px 22px 22px;
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.15s;
  color: var(--ink);
}
.night-card:nth-child(odd)  { transform: rotate(-1.2deg); }
.night-card:nth-child(even) { transform: rotate(1deg); }
.night-card:hover { transform: rotate(0deg) translateY(-4px); }

.night-card::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 90px;
  height: 24px;
  background: rgba(226, 167, 59, 0.7);
  transform: translateX(-50%) rotate(-3deg);
  box-shadow: 0 1px 2px var(--shadow);
}

.night-card .num { font-size: 0.75rem; letter-spacing: 0.2em; color: var(--tomato); }
.night-card h3 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  line-height: 1.1;
  margin: 6px 0 10px;
  color: var(--wine);
}
.night-card .mood { font-family: var(--hand); font-size: 1.4rem; line-height: 1.2; }
.night-card .emoji-row { margin-top: 14px; font-size: 1.4rem; letter-spacing: 6px; }

.site-footer {
  background: var(--navy);
  color: var(--paper);
  text-align: center;
  padding: 44px 20px;
}
.footer-logo {
  font-family: var(--serif);
  font-weight: 900;
  letter-spacing: 0.25em;
  font-size: 1.4rem;
  margin-bottom: 6px;
}
.site-footer .note { color: var(--mustard); }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 35, 64, 0.82);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 14px;
  z-index: 50;
}
.overlay[hidden] { display: none; }

.result-card {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fffaf0;
  border: 2px solid var(--ink);
  padding: 34px 24px 26px;
  box-shadow: 8px 8px 0 var(--mustard);
  margin: auto;

  background-image: repeating-linear-gradient(transparent 0 31px, rgba(200, 68, 47, 0.12) 31px 32px);
}

.close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--ink);
  line-height: 1;
}

.kicker { font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tomato); }

.result-card h2 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 2rem;
  text-transform: uppercase;
  color: var(--wine);
  line-height: 1.05;
  margin: 4px 0 8px;
}
.result-mood { font-family: var(--hand); font-size: 1.5rem; margin-bottom: 18px; }

.rows div { padding: 9px 0; border-bottom: 1px dashed var(--ink); }
.rows dt { font-size: 0.7rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--tomato); }
.rows dd { font-size: 1rem; }

.rule-box {
  margin: 20px 0;
  padding: 12px 14px;
  background: var(--mustard);
  border: 1.5px solid var(--ink);
  transform: rotate(-1deg);
}
.rule-box .kicker { color: var(--ink); }
.rule-box p { font-family: var(--hand); font-size: 1.6rem; line-height: 1.15; }

.actions { display: flex; flex-direction: column; gap: 12px; }
.btn {
  min-height: 52px;
  padding: 14px 18px;
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  border: 2px solid var(--ink);
  border-radius: 3px;
}
.btn-main { background: var(--wine); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn:active { transform: translateY(2px); }

.confirm { font-family: var(--hand); font-size: 1.8rem; text-align: center; color: var(--wine); margin-top: 6px; }
.confirm[hidden] { display: none; }

@media (min-width: 720px) {
  .site-header { flex-wrap: nowrap; padding: 20px 40px; border-bottom: 1.5px dashed var(--ink); }
  .nav { order: 0; width: auto; border: none; padding: 0; gap: 28px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .actions { flex-direction: row; }
  .actions .btn { flex: 1; }
}

@media (min-width: 1000px) {
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.content-card {
  display: block;
  background: #fffaf0;
  border: 1.5px solid var(--ink);
  box-shadow: 5px 5px 0 var(--shadow);
  transition: transform 0.15s;
  position: relative;
  overflow: hidden;
}
.content-card:nth-child(odd)  { transform: rotate(-0.8deg); }
.content-card:nth-child(even) { transform: rotate(0.8deg); }
.content-card:hover { transform: rotate(0deg) translateY(-4px); }

.content-card .thumb {
  font-size: 3.4rem;
  text-align: center;
  padding: 26px 0 18px;
  border-bottom: 1.5px dashed var(--ink);
}
.type-drink .thumb { background: var(--mustard); }
.type-eat   .thumb { background: #f1c9b8; }
.type-watch .thumb { background: #c9cfe4; }
.type-read  .thumb { background: #cfe0c9; }
.type-listen .thumb { background: #e4c9d8; }

.card-body { padding: 16px 18px 20px; }
.card-body h3 {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.15;
  color: var(--wine);
  margin: 4px 0 8px;
}
.card-body p { font-size: 0.9rem; opacity: 0.85; }

.mood-tag {
  display: inline-block;
  margin-top: 12px;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: 20px;
  padding: 0 12px;
}

.more-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 34px;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.more-links a { border-bottom: 1.5px solid var(--tomato); }
.more-links a:hover { color: var(--tomato); }

.page-top { text-align: center; padding-top: 36px; }
.page-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(2.6rem, 12vw, 4.5rem);
  text-transform: uppercase;
  color: var(--wine);
  text-shadow: 3px 3px 0 var(--mustard);
  margin-bottom: 34px;
}
.empty { font-family: var(--hand); font-size: 1.8rem; }
.empty[hidden] { display: none; }
.cards[hidden] { display: none; }

.detail { padding: 24px 14px 60px; max-width: 640px; margin: 0 auto; }

.detail-card {
  background: #fffaf0;
  border: 2px solid var(--ink);
  box-shadow: 8px 8px 0 var(--mustard);
  padding: 28px 22px 26px;
  background-image: repeating-linear-gradient(transparent 0 31px, rgba(200, 68, 47, 0.1) 31px 32px);
}

.back-link-small {
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-bottom: 1.5px solid var(--tomato);
}

.detail-emoji { font-size: 3.6rem; margin: 18px 0 6px; }

.detail-title {
  font-family: var(--serif);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1.05;
  text-transform: uppercase;
  color: var(--wine);
  margin: 6px 0 12px;
}
.detail-desc { font-size: 1.05rem; margin-bottom: 8px; }

.d-section { margin-top: 24px; }
.d-section h2 {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--tomato);
  border-bottom: 1px dashed var(--ink);
  padding-bottom: 4px;
  margin-bottom: 10px;
}
.d-section ul, .d-section ol { padding-left: 22px; }
.d-section li { margin-bottom: 6px; }

.note-box { margin: 28px 0 22px; }
.back-link { display: inline-block; margin-top: 10px; background: var(--wine); color: var(--paper); text-align: center; }

@media (min-width: 720px) {
  .detail-card { padding: 40px 44px 36px; }
  .detail-title { font-size: 2.6rem; }
}
.loading {
  font-family: var(--hand);
  font-size: 1.6rem;
  text-align: center;
  grid-column: 1 / -1;
  opacity: 0.8;
}
.inline-link { border-bottom: 1.5px solid var(--tomato); }
.inline-link:hover { color: var(--tomato); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.lock { display: inline-block; width: 0.85em; height: 0.85em; vertical-align: -0.08em; margin-left: 0.15em; opacity: 0.85; }
.nav a, .t-title { position: relative; }
.notify-box .nt-line { margin: 0 0 12px; line-height: 1.5; }
.notify-box .nt-opt { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 10px; line-height: 1.4; cursor: pointer; }
.notify-box .nt-opt input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: #6f202c; }
.notify-box .nt-err { margin: 0 0 12px; color: #9b1c1c; }
.notify-box .nt-err[hidden] { display: none; }
.notify-box .nt-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }