/* =========================================================
   ORION — estilo "Corte Celestial"
   Noite índigo profunda, ouro ornamental, serifas elegantes.
   Tipografia: Cormorant Garamond (display) + Spectral (texto)
   ========================================================= */

:root {
  --night:   #131129;   /* fundo profundo */
  --dusk:    #1b1838;   /* superfícies */
  --veil:    #2a2550;   /* superfícies elevadas */
  --violet:  #9289d8;   /* acento lavanda */
  --silver:  #c9cbe4;   /* texto secundário */
  --starlit: #f1ead9;   /* texto principal, creme quente */
  --gold:    #d9b36a;   /* ouro ornamental */
  --gold-soft: rgba(217, 179, 106, 0.45);
  --gold-faint: rgba(217, 179, 106, 0.16);
  --danger:  #c76a85;   /* banimento */

  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "Spectral", Georgia, serif;

  --radius: 12px;
  --shadow: 0 14px 44px rgba(5, 4, 18, 0.6);
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  background:
    radial-gradient(120% 55% at 50% -6%, #211c49 0%, transparent 58%),
    var(--night);
  color: var(--starlit);
  min-height: 100dvh;
  line-height: 1.65;
  overflow-x: hidden;
}

#sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

#app {
  position: relative;
  z-index: 1;
  max-width: 460px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------- ornamento dourado (linha ✦ linha) ---------- */
.ornament {
  height: 22px;
  margin: 2px auto 18px;
  width: 190px;
  background: center / contain no-repeat
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 190 22' fill='none'><path d='M6 11h58M126 11h58' stroke='%23d9b36a' stroke-width='0.8'/><path d='M95 2l2.6 6.4L104 11l-6.4 2.6L95 20l-2.6-6.4L86 11l6.4-2.6z' fill='%23d9b36a'/><path d='M74 7a5 5 0 1 0 2 9 6 6 0 0 1-2-9z' fill='%23d9b36a' opacity='.8'/><path d='M116 7a5 5 0 1 1-2 9 6 6 0 0 0 2-9z' fill='%23d9b36a' opacity='.8'/></svg>");
  opacity: 0.9;
}

/* ---------- voltar ---------- */
#btn-back {
  position: absolute;
  top: 10px;
  left: 2px;
  background: none;
  border: none;
  color: var(--silver);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-style: italic;
  cursor: pointer;
  padding: 8px 10px;
  opacity: 0.75;
  z-index: 6;
}
#btn-back:active { opacity: 1; }

/* ---------- progresso: constelação ---------- */
.constellation {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 10px 0 22px;
}
.constellation span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--veil);
  transition: background 0.4s, box-shadow 0.4s, transform 0.4s;
}
.constellation span.lit {
  background: var(--violet);
  box-shadow: 0 0 10px rgba(146, 137, 216, 0.9);
}
.constellation span.now {
  background: var(--starlit);
  box-shadow: 0 0 12px rgba(241, 234, 217, 0.9);
  transform: scale(1.35);
}

/* ---------- ecrãs ---------- */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: pageIn 0.6s ease both;
}
.screen.active { display: flex; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

.chapter {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--violet);
  text-align: center;
  margin-bottom: 4px;
}

h1, h2 {
  font-family: var(--font-display);
  font-weight: 600;
  text-align: center;
  line-height: 1.15;
  letter-spacing: 0.015em;
  color: var(--starlit);
}
h1 { font-size: 2.6rem; margin-bottom: 8px; }
h2 { font-size: 2.1rem; margin-bottom: 10px; }

.intro {
  text-align: center;
  color: var(--silver);
  font-size: 1.02rem;
  margin-bottom: 24px;
}

.prose {
  background: rgba(19, 17, 41, 0.6);
  border: 1px solid rgba(217, 179, 106, 0.14);
  border-radius: var(--radius);
  padding: 20px 18px 8px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.prose p {
  margin-bottom: 14px;
  font-size: 1.05rem;
}
.prose p:last-child { font-style: italic; color: var(--silver); }

/* ---------- capa ---------- */
#screen-cover { justify-content: center; text-align: center; position: relative; }

.hero-top {
  margin: -6px auto 8px;
  width: min(320px, 82%);
}
.hero-top img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 0 30px rgba(146, 137, 216, 0.3));
}

.valley-bg {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
}
.valley-bg img {
  width: 100%;
  display: block;
  filter: brightness(0.82);
  -webkit-mask-image: linear-gradient(to top, black 52%, transparent 100%);
  mask-image: linear-gradient(to top, black 52%, transparent 100%);
}

.chapter-hero {
  width: 200px;
  margin: -4px auto 4px;
}
.chapter-hero img {
  width: 100%;
  display: block;
  filter: drop-shadow(0 0 22px rgba(146, 137, 216, 0.3));
}

.corner-flowers {
  position: fixed;
  z-index: -1;
  width: 170px;
  opacity: 0.9;
  pointer-events: none;
}
.corner-flowers.left { left: -56px; bottom: -30px; transform: rotate(8deg); }
.corner-flowers.right { right: -56px; top: -24px; transform: scaleX(-1) rotate(6deg); }

.cover-kicker {
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.cover-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 3.6rem;
  line-height: 1.05;
  margin-bottom: 6px;
  text-shadow: 0 0 36px rgba(146, 137, 216, 0.45);
}
.cover-dedication {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.25rem;
  color: var(--silver);
  white-space: pre-line;
  margin-bottom: 36px;
  text-shadow: 0 2px 16px rgba(10, 9, 26, 0.9), 0 0 6px rgba(10, 9, 26, 0.7);
}
.shooting-star {
  position: fixed;
  top: 12%;
  right: -4%;
  font-size: 1rem;
  opacity: 0.85;
  cursor: pointer;
  z-index: 2;
  animation: drift 9s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(0, 0) rotate(-8deg); }
  to   { transform: translate(-30px, 18px) rotate(4deg); }
}
.secret-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(20px);
  background: var(--dusk);
  border: 1px solid var(--gold-soft);
  color: var(--silver);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-style: italic;
  font-size: 0.95rem;
  max-width: 85vw;
  text-align: center;
  opacity: 0;
  transition: opacity 0.4s, transform 0.4s;
  z-index: 30;
  pointer-events: none;
}
.secret-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- botões ---------- */
.btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
  color: #1b1838;
  background: linear-gradient(180deg, #fbf5e7, #ece1c6);
  border: none;
  border-radius: 999px;
  padding: 16px 38px;
  cursor: pointer;
  align-self: center;
  margin-top: auto;
  transition: transform 0.15s, box-shadow 0.3s, opacity 0.3s;
  box-shadow: 0 0 0 1px rgba(217, 179, 106, 0.5), 0 0 28px rgba(241, 234, 217, 0.18);
}
.btn::after { content: "  →"; }
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.35; cursor: default; box-shadow: none; }
.btn.gold {
  background: linear-gradient(180deg, #ecc984, var(--gold));
  box-shadow: 0 0 0 1px rgba(217, 179, 106, 0.7), 0 0 28px rgba(217, 179, 106, 0.35);
}

.btn-ghost {
  background: none;
  border: none;
  color: var(--silver);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-style: italic;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  align-self: center;
  margin-top: 14px;
  padding: 8px;
}

:is(.btn, .btn-ghost, .duel-card, .rate-btn, .path-card, .day-card):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

/* ---------- moldura dourada partilhada ---------- */
.duel-card,
.triage-card,
.format-card-big,
.path-card,
.day-card,
.exiles-panel,
.note-modal {
  background: linear-gradient(168deg, rgba(34, 29, 70, 0.92), rgba(20, 17, 44, 0.96));
  border: 1px solid var(--gold-soft);
  outline: 1px solid var(--gold-faint);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ---------- duelos ---------- */
.duel-counter {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--violet);
  margin-bottom: 14px;
}
.duel-setup {
  text-align: center;
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 20px;
}
.duel-pair {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.duel-card {
  padding: 20px 18px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
  width: 100%;
  color: var(--starlit);
  font-family: var(--font-body);
}
.duel-card .emoji { font-size: 2rem; display: block; margin-bottom: 8px; }
.duel-card .label { font-size: 1.12rem; font-weight: 400; display: block; }
.duel-card .note {
  font-style: italic;
  color: var(--silver);
  font-size: 0.9rem;
  display: block;
  margin-top: 4px;
}
.duel-card:active { transform: scale(0.97); }
.duel-card.chosen {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(217, 179, 106, 0.35);
}
.duel-vs {
  text-align: center;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--gold);
  font-size: 1.1rem;
}

/* ---------- triagem de ingredientes ---------- */
.triage-stage { display: flex; flex-direction: column; flex: 1; }
.triage-card {
  padding: 34px 20px;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.triage-card.slide-in { animation: cardIn 0.35s ease both; }
@keyframes cardIn {
  from { opacity: 0; transform: translateX(26px); }
  to   { opacity: 1; transform: none; }
}
.triage-card .emoji { font-size: 3.2rem; line-height: 1; }
.triage-card .name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}
.triage-card .desc {
  font-style: italic;
  color: var(--silver);
  font-size: 0.96rem;
}

.rate-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.rate-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: linear-gradient(168deg, rgba(34, 29, 70, 0.92), rgba(20, 17, 44, 0.96));
  border: 1px solid var(--gold-faint);
  border-radius: var(--radius);
  padding: 14px 6px;
  cursor: pointer;
  color: var(--starlit);
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.rate-btn .emoji { font-size: 1.5rem; }
.rate-btn:active { transform: scale(0.95); }
.rate-gosto:active, .rate-gosto:focus-visible { border-color: var(--violet); }
.rate-meh:active,   .rate-meh:focus-visible   { border-color: var(--silver); }
.rate-nao:active,   .rate-nao:focus-visible   { border-color: var(--danger); }

/* ---------- exilados ---------- */
.exiles-panel {
  border-color: rgba(199, 106, 133, 0.55);
  padding: 24px 18px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.exiles-panel h2 { color: var(--danger); font-size: 1.8rem; }
.exiles-list {
  list-style: none;
  text-align: center;
  margin-bottom: 18px;
}
.exiles-list li {
  font-size: 1.05rem;
  padding: 4px 0;
  color: var(--silver);
  text-decoration: line-through;
  text-decoration-color: var(--danger);
}

/* ---------- formatos (cartão grande, julgado um a um) ---------- */
.format-card-big {
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding-bottom: 22px;
}
.format-card-big.slide-in { animation: cardIn 0.35s ease both; }
.format-img {
  display: block;
  aspect-ratio: 5 / 2;
  background: var(--veil);
  margin-bottom: 12px;
  border-bottom: 1px solid var(--gold-faint);
}
.format-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.format-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  font-size: 2.6rem;
}
.format-card-big { padding-bottom: 18px; }
.format-card-big .name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  display: block;
}
.format-card-big .desc {
  font-style: italic;
  color: var(--silver);
  font-size: 0.96rem;
  display: block;
  margin-top: 4px;
  padding: 0 16px;
}

/* ---------- sítio ---------- */
.path-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 8px; }
.path-card {
  padding: 22px 18px;
  text-align: center;
  cursor: pointer;
  width: 100%;
  color: var(--starlit);
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  transition: border-color 0.2s, transform 0.15s;
}
.path-card:active { transform: scale(0.97); }
.path-card small {
  display: block;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-style: italic;
  color: var(--silver);
  margin-top: 6px;
}

.place-input {
  width: 100%;
  background: var(--dusk);
  border: 1px solid var(--gold-faint);
  border-radius: var(--radius);
  color: var(--starlit);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 14px 16px;
  margin-top: 14px;
  resize: vertical;
  min-height: 90px;
}
.place-input::placeholder { color: var(--silver); opacity: 0.6; font-style: italic; }
.place-input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- calendário ---------- */
.day-list { display: flex; flex-direction: column; gap: 12px; }
.day-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
  width: 100%;
  color: var(--starlit);
  font-family: var(--font-body);
  text-align: left;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.day-card:active { transform: scale(0.98); }
.day-card.picked {
  border-color: var(--gold);
  box-shadow: 0 0 16px rgba(217, 179, 106, 0.35);
}
.day-card .date {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
}
.day-card .quip {
  font-size: 0.85rem;
  font-style: italic;
  color: var(--silver);
}
.weather-note {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--silver);
  background: var(--dusk);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 14px;
  margin: 18px 0;
}
.rebel-input {
  width: 100%;
  background: var(--dusk);
  border: 1px solid var(--gold-faint);
  border-radius: var(--radius);
  color: var(--starlit);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  margin-top: 10px;
  display: none;
}
.rebel-input.show { display: block; }

/* ---------- fecho / decreto ---------- */
.closing-main {
  display: flex;
  flex-direction: column;
}
.closing-main .btn {
  margin: 28px auto 8px;
}
.decree {
  background: linear-gradient(170deg, #f2ead8, #e9dfc8);
  color: #2a2438;
  border-radius: 6px;
  padding: 30px 24px;
  font-family: var(--font-display);
  box-shadow: var(--shadow);
  position: relative;
}
.decree h3 {
  font-size: 1.8rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 4px;
}
.decree .decree-sub {
  text-align: center;
  font-style: italic;
  font-size: 1rem;
  color: #6b6380;
  margin-bottom: 18px;
}
.decree-section { margin-bottom: 16px; }
.decree-section h4 {
  font-size: 1.15rem;
  font-weight: 600;
  border-bottom: 1px solid #d8d2c4;
  padding-bottom: 4px;
  margin-bottom: 8px;
}
.decree-section ul { list-style: none; }
.decree-section li { font-size: 1.02rem; padding: 2px 0; }
.decree-section li.banned-li { color: #b05a72; font-style: italic; }
.decree-section .banned-wrap li {
  color: #b05a72;
  text-decoration: line-through;
}
.decree-section li.note-li { font-style: italic; color: #6b6380; }
.decree-seal {
  position: absolute;
  bottom: 16px;
  right: 18px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ecc984, var(--gold) 60%, #9a7430);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  opacity: 0;
  transform: scale(2) rotate(-20deg);
}
.decree-seal.stamped {
  animation: stamp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes stamp {
  to { opacity: 1; transform: scale(1) rotate(-8deg); }
}

.sealed-wrap { text-align: center; justify-content: center; }
.sealed-wrap h1 { color: var(--gold); }
.sealed-wrap .ps {
  font-style: italic;
  color: var(--silver);
  margin-top: 22px;
  font-size: 0.95rem;
}

/* ---------- modal: nota para o chef ---------- */
.note-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(9, 8, 24, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.note-modal {
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow), 0 0 40px rgba(217, 179, 106, 0.18);
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  animation: pageIn 0.3s ease both;
}
.note-title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 6px;
}
.note-hint {
  text-align: center;
  font-style: italic;
  color: var(--silver);
  font-size: 0.95rem;
  margin-bottom: 14px;
}
#note-input {
  width: 100%;
  background: var(--night);
  border: 1px solid var(--gold-faint);
  border-radius: 10px;
  color: var(--starlit);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 14px;
  resize: vertical;
  margin-bottom: 16px;
}
#note-input::placeholder { color: var(--silver); opacity: 0.55; font-style: italic; }
#note-input:focus { outline: 2px solid var(--gold); outline-offset: 2px; }
.note-modal .btn { margin-top: 0; }

/* ---------- acessibilidade / movimento ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (min-width: 700px) {
  #app { max-width: 520px; }
  .duel-pair { flex-direction: row; align-items: stretch; }
  .duel-pair .duel-card { flex: 1; }
  .duel-vs { align-self: center; }
}
