:root {
  color-scheme: light;
  --ink: #14234f;
  --navy: #203879;
  --blue: #4068bd;
  --edge: #9fc3f5;
  --green: #86d84b;
  --leaf: #2f7d3b;
  --rose: #f0527c;
  --hud: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  scroll-padding: 1rem 0 calc(var(--hud) + 1rem);
}

body {
  margin: 0;
  padding-bottom: calc(var(--hud) + 1.5rem);
  color: var(--ink);
  background: linear-gradient(#8fd0f5 0, #d9f3ee 32rem, #a9d987 60rem) #a9d987;
  font: 1.0625rem/1.5 "Trebuchet MS", "Segoe UI", sans-serif;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
a { color: #1c4aa5; }

:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ink);
}

.demo-banner {
  margin: 0;
  padding: .5rem 1rem;
  background: #ffe27a;
  text-align: center;
  font-weight: bold;
}

/* Cover. The image always keeps its proportions and is never cropped. */
.hero {
  padding: 1.5rem 1.5rem 2rem;
  text-align: center;
}
h1 { margin-bottom: 1.25rem; }
.cover {
  display: block;
  /* Leaves room for the button and bottom bar on most screens. Never wider
     than the file (1280px), and not too small on phones held sideways. */
  width: min(100%, 1280px, max(32rem, (100vh - var(--hud) - 9.5rem) * 1280 / 714));
  height: auto;
  margin: auto;
  border-radius: 1rem;
  box-shadow: 0 6px 0 rgb(20 35 79 / 25%);
}

/* Game-style windows */
main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 64rem;
  margin: auto;
  padding: 0 1.5rem;
}
.wide { grid-column: 1 / -1; }
.panel {
  padding: 0 .75rem .75rem;
  border: 3px solid #07134c;
  border-radius: 1.6rem;
  background: linear-gradient(#7890dc, #4563c1 1.3rem, #3755b5 5rem, #4562bd);
  box-shadow: inset 0 2px #b4c4f5, inset 0 0 0 1px #6b84d4, 0 5px 5px rgb(20 35 79 / 40%);
}
.panel h2 {
  display: flex;
  align-items: center;
  gap: .9rem;
  min-height: 5rem;
  margin: 0;
  padding: .5rem;
  color: #fff;
  font-size: clamp(1.4rem, 6vw, 1.9rem);
  text-shadow: 0 2px 2px #172b78;
}
.title-icon { flex: none; width: 3.75rem; height: 3.75rem; }
.title-icon.gem { width: 2.5rem; filter: drop-shadow(0 0 6px #7dff4f); }
.panel-body {
  padding: 1.75rem;
  border-radius: 1.2rem;
  background: #ced5fd;
  box-shadow: inset 0 2px 5px rgb(20 35 79 / 45%), inset 0 0 8px #eef1ff;
}
.panel:not(.wide) { display: flex; flex-direction: column; }
.panel:not(.wide) .panel-body { flex: 1; }

.facts { display: grid; gap: 1rem; margin: 0; }
.facts dt { color: #39568f; font-size: .9375rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
#details .facts { gap: 1.4rem; }
#details .facts, .needs { color: #0b1020; font-size: 1.1875rem; line-height: 1.35; }
#details dt { display: flex; align-items: center; gap: .6rem; margin-bottom: .25rem; color: inherit; font-size: inherit; }
.fact-icon { flex: none; width: 2.2rem; height: 2.2rem; }
#details .button { margin-top: .6rem; }
#dress-code-note { font-size: .9375rem; }
.accounts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.accounts h3 { margin-bottom: .5rem; }
.accounts .facts { gap: .35rem; line-height: 1.25; }

.mood { display: flex; gap: 2.25rem; }
.mood-meter {
  flex: none;
  display: flex;
  width: 2.5rem;
  padding: 4px;
  border: 3px solid #245b35;
  border-radius: 2rem;
  background: #c6cfea;
  box-shadow: inset 0 0 0 2px #8b9bc5;
}
.mood-meter span {
  flex: 1;
  border: 3px solid #14235f;
  border-radius: 2rem;
  background:
    linear-gradient(90deg, rgb(0 70 20 / 25%), rgb(255 255 255 / 55%) 40%, rgb(0 70 20 / 25%)),
    linear-gradient(#46c832 50%, #a9d2cc 50%);
}
.needs {
  display: grid;
  flex: 1;
  align-content: space-between;
  gap: 1rem;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.needs li { position: relative; }
.needs svg { fill: #58cf3d; stroke: #17692a; stroke-width: 2; stroke-linejoin: round; }
.trend { position: absolute; top: .1rem; right: .6rem; height: 1.4rem; }
.bar {
  position: relative;
  display: block;
  height: 2.5rem;
  margin-top: .35rem;
  padding: 3px;
  border: 2px solid #0a1550;
  border-radius: 2rem;
  background: #142356;
  box-shadow: 0 0 0 2px #a5b3e5, 0 3px 2px #fff;
}
/* Mark at the middle of each bar */
.bar::after {
  content: "";
  position: absolute;
  top: 15%;
  bottom: 15%;
  left: calc(50% - 1px);
  width: 3px;
  background: rgb(65 85 105 / 75%);
}
.bar > span {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  padding-right: .3rem;
  border-radius: 2rem;
  background: linear-gradient(#5bc944, #a4ee86 22%, #55cc3b 48%, #35ae25);
}
.bar > span svg { height: 1.4rem; }
.needs .trend-down {
  position: absolute;
  top: calc(50% - .7rem);
  right: calc(100% + .35rem);
  height: 1.4rem;
  fill: #ed4545;
  stroke: #941e30;
}
.needs li:nth-child(1) .bar > span { width: 100%; }
.needs li:nth-child(2) .bar > span { width: 90%; }
.needs li:nth-child(3) .bar > span { width: 80%; }
.needs li:nth-child(4) .bar > span { width: 66%; }
.needs li:nth-child(5) .bar > span { width: 20%; background: linear-gradient(#f05b3c, #ffac83 25%, #ff6845 50%, #e6432d); }

/* Form */
label { display: block; font-weight: bold; }
input:not([type="radio"]), select {
  display: block;
  width: 100%;
  min-height: 3.1rem;
  margin-top: .3rem;
  padding: .6rem .75rem;
  border: 2px solid #5472ad;
  border-radius: .6rem;
  background: #fff;
  color: var(--ink);
  font: inherit;
}
fieldset {
  min-width: 0;
  margin: 0 0 1.25rem;
  padding: 1rem;
  border: 2px solid #91afdf;
  border-radius: .9rem;
}
legend { padding: 0 .4rem; font-weight: bold; }

.button, .remove { font: inherit; font-weight: bold; cursor: pointer; }
.button {
  display: inline-block;
  min-height: 2.9rem;
  padding: .6rem 1.3rem;
  border: 2px solid #265f2c;
  border-radius: 2rem;
  background: linear-gradient(#c9f78b, var(--green));
  box-shadow: inset 0 2px rgb(255 255 255 / 65%), 0 3px 0 #265f2c;
  color: #12351a;
  text-align: center;
  text-decoration: none;
}
.button:hover { filter: brightness(1.06); }
.button:active { transform: translateY(2px); box-shadow: 0 1px 0 #265f2c; }
.button:disabled { opacity: .6; cursor: wait; }
.button.secondary {
  border-color: #0e1c5d;
  background: linear-gradient(#dfe8ff, #bdcefa 50%, #9fb6ee);
  box-shadow: inset 0 2px #f4f7ff, 0 3px 3px rgb(20 35 79 / 55%);
  color: var(--ink);
}
.remove {
  justify-self: start;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  color: #a3203f;
  text-decoration: underline;
}

.hint { margin: .6rem 0 1rem; color: #39568f; font-size: .9375rem; }
.note { padding: .75rem 1rem; border-radius: .6rem; background: #fff0b3; }
.choices { display: flex; flex-wrap: wrap; gap: .5rem 2rem; }
.choices label { display: flex; align-items: center; gap: .5rem; min-height: 2.75rem; }
.choices input { flex: none; width: 1.3rem; height: 1.3rem; accent-color: var(--leaf); }
.bus { flex-direction: column; margin-top: 1.25rem; }
.bus .hint { margin: 0; }
.guest { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 1rem; }
.fields { margin-top: 1.25rem; }
.status { margin: 1rem 0 0; font-weight: bold; }
.status:empty { display: none; }
.status.error { color: #a3203f; }

/* Bottom control bar */
.hud {
  position: fixed;
  z-index: 10;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: var(--hud);
  padding: .6rem 1rem calc(.6rem + env(safe-area-inset-bottom, 0px));
  border-top: 2px solid var(--ink);
  background: linear-gradient(var(--blue), var(--navy));
  box-shadow: inset 0 2px var(--edge);
}
.hud a {
  display: grid;
  place-items: center;
  min-height: 2.75rem;
  padding: 0 1.1rem;
  border: 2px solid var(--ink);
  border-radius: 2rem;
  background: linear-gradient(#fff, #bad6fb);
  color: var(--ink);
  font-weight: bold;
  text-decoration: none;
}
.countdown {
  margin: 0 1rem 0 0;
  padding: .4rem 1rem;
  border-radius: .6rem;
  background: var(--ink);
  color: #c9f78b;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 700px) {
  main { grid-template-columns: 1fr; gap: 1rem; padding: 0 1rem; }
  .guest, .accounts { grid-template-columns: 1fr; }
  .panel { padding: 0 .5rem .5rem; }
  .panel h2 { gap: .6rem; }
  .panel-body { padding: 1.25rem 1rem; }
  .mood { gap: 1.75rem; }
  .mood-meter { width: 2rem; }
  .hud { gap: .35rem; padding-inline: .5rem; }
  .hud a { padding: 0 .6rem; font-size: .875rem; }
  .countdown { margin: 0; padding: .4rem .5rem; font-size: .875rem; }
}

/* Same width as the mobile cover in index.html: the image fills the screen width. */
@media (max-width: 600px) {
  .hero { padding: 0 0 1.5rem; }
  .cover { width: 100%; border-radius: 0; box-shadow: none; }
}

@media (max-width: 360px) {
  .hud { gap: .25rem; padding-inline: .25rem; }
  .hud a { padding: 0 .4rem; font-size: .8125rem; }
  .countdown { padding: .4rem; font-size: .8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
