:root {
  --bg: #f3ecd8;
  --bg-soft: #ece1c4;
  --ink: #22262b;
  --ink-soft: #55534a;
  --gold: #8a6a24;
  --gold-bright: #a3801f;
  --gold-line: #c7a955;
  --border: #cdb989;
  --card-bg: #fbf6e8;
  --card-shadow: rgba(60, 45, 10, 0.12);
  --yes: #4d7a3f;
  --no: #a3402f;
  --moon-lit: #dcb95a;
  --moon-sea: #c29c3e;
  --moon-dark: #3a3528;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #080807;
    --bg-soft: #101010;
    --ink: #f4e9cc;
    --ink-soft: #b0a689;
    --gold: #e3c26f;
    --gold-bright: #f2d888;
    --gold-line: #c9a24b;
    --border: #372d1c;
    --card-bg: #121110;
    --card-shadow: rgba(0, 0, 0, 0.6);
    --yes: #8fce78;
    --no: #e58a76;
    --moon-lit: #f2d888;
    --moon-sea: #d4b566;
    --moon-dark: #262117;
  }
}

:root[data-theme="dark"] {
  --bg: #080807;
  --bg-soft: #101010;
  --ink: #f4e9cc;
  --ink-soft: #b0a689;
  --gold: #e3c26f;
  --gold-bright: #f2d888;
  --gold-line: #c9a24b;
  --border: #372d1c;
  --card-bg: #121110;
  --card-shadow: rgba(0, 0, 0, 0.6);
  --yes: #8fce78;
  --no: #e58a76;
  --moon-lit: #f2d888;
  --moon-sea: #d4b566;
  --moon-dark: #262117;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-family: "EB Garamond", "Iowan Old Style", Georgia, serif;
  font-size: 18px;
  line-height: 1.5;
  transition: background 0.3s ease, color 0.3s ease;
}

a {
  color: var(--gold-bright);
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 20px 48px;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  flex-shrink: 0;
}

.icon-btn:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.header-tag {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: right;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions .icon-btn {
  background: none;
  cursor: pointer;
  font: inherit;
}

.settings-wrap {
  position: relative;
}

.settings-panel {
  position: absolute;
  top: 46px;
  right: 0;
  z-index: 20;
  width: 220px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 26px var(--card-shadow);
  padding: 16px;
  text-align: left;
}

.settings-panel[hidden] {
  display: none;
}

.settings-title {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-style: italic;
}

.settings-days {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}

.settings-days label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.92rem;
  color: var(--ink);
  cursor: pointer;
}

.settings-days input[type="checkbox"] {
  accent-color: var(--gold);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.crest {
  display: flex;
  justify-content: center;
  margin: 18px 0 4px;
}

.crest-image {
  width: 148px;
  height: 148px;
  object-fit: cover;
  border-radius: 18px;
  border: 2px solid var(--gold-line);
  box-shadow: 0 6px 18px var(--card-shadow);
}

.pub-name {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  font-size: 3.1rem;
  line-height: 1.05;
  color: var(--gold);
  margin: 4px 0 10px;
}

.pub-sub {
  text-align: center;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 1.05rem;
  margin: 0 0 30px;
  letter-spacing: 0.02em;
}

.pub-sub::before,
.pub-sub::after {
  content: "";
  display: inline-block;
  width: 26px;
  height: 1px;
  background: var(--gold-line);
  vertical-align: middle;
  margin: 0 12px 3px;
}

.throstles-card,
.weather-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 8px 24px var(--card-shadow);
  padding: 26px 24px;
  margin-bottom: 22px;
  text-align: center;
}

.throstles-label {
  margin: 0 0 6px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.throstles-answer {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  font-size: 3.4rem;
  line-height: 1.1;
}

.throstles-answer.is-yes {
  color: var(--yes);
}

.throstles-answer.is-no {
  color: var(--no);
}

.throstles-detail {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 1rem;
}

.weather-card {
  text-align: left;
}

.weather-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.weather-head h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.5rem;
  color: var(--gold);
  font-weight: 700;
}

.weather-place {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-style: italic;
}

.weather-status {
  color: var(--ink-soft);
  margin: 0;
}

.weather-now {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.weather-icon {
  font-size: 3rem;
  line-height: 1;
}

.weather-temp {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--ink);
}

.weather-desc {
  color: var(--ink-soft);
  font-size: 0.95rem;
  margin-top: 2px;
}

.moon {
  flex: 0 0 auto;
  width: 112px;
  margin-left: auto;
  text-align: center;
}

.moon-art {
  display: block;
  width: 62px;
  height: 62px;
  margin: 0 auto 6px;
}

.moon-dark {
  fill: var(--moon-dark);
}

.moon-lit {
  fill: var(--moon-lit);
}

.moon-sea {
  fill: var(--moon-sea);
}

.moon-name {
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.2;
}

.moon-percent {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.weather-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 4px;
}

.weather-meta span {
  white-space: nowrap;
}

.weather-hours {
  display: flex;
  gap: 4px;
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
  overflow-x: auto;
}

.weather-hour {
  flex: 1 0 58px;
  text-align: center;
  font-size: 0.85rem;
  padding: 2px 2px 4px;
}

.weather-hour .hour-label {
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-size: 0.68rem;
}

.weather-hour .hour-icon {
  font-size: 1.4rem;
  margin: 4px 0;
}

.weather-hour .hour-temp {
  color: var(--ink);
  font-weight: 600;
}

.weather-hour .hour-pop {
  color: var(--gold);
  font-size: 0.68rem;
  margin-top: 2px;
}

.weather-footnote {
  margin: 14px 0 0;
  font-size: 0.72rem;
  color: var(--ink-soft);
  text-align: right;
}

.page-footer {
  text-align: center;
  color: var(--ink-soft);
  font-style: italic;
  font-size: 0.9rem;
}

.share-dialog {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 14px;
  background: var(--card-bg);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.share-dialog[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.share-dialog::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

.share-dialog img {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 110px);
  border-radius: 8px;
}

.share-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.share-action {
  flex: 1 1 0;
  max-width: 130px;
  min-height: 42px;
  padding: 0 12px;
  background: none;
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font: inherit;
  cursor: pointer;
}

.share-action:hover {
  border-color: var(--gold);
  color: var(--gold-bright);
}

.share-action.is-main {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--card-bg);
  font-weight: 600;
}

@media (max-width: 480px) {
  .pub-name {
    font-size: 2.4rem;
  }
  .throstles-answer {
    font-size: 2.6rem;
  }
  .weather-hour {
    flex: 0 0 52px;
  }
  .weather-now {
    gap: 12px;
  }
  .weather-icon {
    font-size: 2.4rem;
  }
  .moon {
    width: 84px;
  }
  .moon-art {
    width: 54px;
    height: 54px;
  }
}
