:root {
  --paper: #f7f3e9;
  --ink: #243e32;
  --muted: #53685b;
  --border: #d7dcca;
  --green: #28493b;
  --mint: #e1e9d9;
  --accent: #a8432e;
  --accent-dark: #8c3625;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "WenQuanYi Zen Hei", sans-serif;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
  background-image: radial-gradient(ellipse at 50% 0%, #e7ebde 0%, var(--paper) 68%);
  font: 16px/1.5 var(--sans);
  -webkit-tap-highlight-color: transparent;
}

button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
button:focus, input:focus + span { outline: 2px solid #35725b; outline-offset: 3px; }
h1:focus, h2:focus { outline: none; }
h1, h2, p, ol { margin: 0; }
h1 { font-size: 40px; font-weight: 800; line-height: 1.16; overflow-wrap: break-word; }
h2 { font-size: 20px; font-weight: 700; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* The host's floating buttons can extend to 100px from the viewport top. */
.shell { max-width: 510px; margin: 0 auto; padding: 104px 22px 36px; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  border-bottom: 1px solid #cdd7c8;
}
.brand { display: flex; align-items: center; font-size: 16px; font-weight: 700; white-space: nowrap; }
.brand-icon {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 32px;
  margin-right: 9px;
  border-radius: 50%;
  background: var(--green);
}
.brand-icon::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 14px;
  width: 18px;
  height: 9px;
  border-radius: 2px 2px 12px 12px;
  background: #f5e7b7;
}
.brand-icon::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 7px;
  width: 6px;
  height: 5px;
  border-left: 1px solid #f5e7b7;
  border-right: 1px solid #f5e7b7;
  transform: skew(-14deg);
}
.history-link {
  min-height: 44px;
  padding: 0 11px;
  border: 1px solid #c8d3c5;
  border-radius: 22px;
  background: #f8f8ef;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.masthead-actions { display: flex; align-items: center; }
.masthead-actions > * + * { margin-left: 5px; }
#open-menu { padding: 0 8px; border-color: transparent; background: transparent; }
.clock {
  position: relative;
  display: inline-block;
  vertical-align: -2px;
  width: 13px;
  height: 13px;
  margin-right: 6px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.clock::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  height: 4px;
  width: 3px;
  border-left: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.home-intro { padding: 28px 0 25px; }
.date-line {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .055em;
}
.date-line span { margin-right: 8px; width: 19px; height: 1px; background: var(--accent); }
.home-intro h1 { font-size: 57px; line-height: 1.11; letter-spacing: -.06em; }
#meal-title { margin-left: .06em; color: var(--accent); }
.meal-choice {
  min-width: 0;
  margin: 0 0 20px;
  padding: 4px;
  border: 1px solid var(--border);
  background: #edf0e6;
  border-radius: 14px;
}
/* Chrome 61 needs a regular element as the flex container. */
.meal-options { display: flex; }
.meal-options label { flex: 1 1 25%; min-width: 0; position: relative; cursor: pointer; }
.meal-choice input, .switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}
.meal-choice span {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 45px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}
.meal-choice input:checked + span {
  color: var(--ink);
  background: #fffdf5;
  border-color: var(--border);
  box-shadow: 0 2px 4px rgba(38, 64, 49, .06);
}

.ticket {
  --reel-row-height: 53px;
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  color: #f7f3e7;
  background-color: var(--green);
  background-image: radial-gradient(ellipse at 5% 0%, #405d49, var(--green) 62%);
  box-shadow: 0 12px 25px rgba(36, 62, 50, .14);
}
.ticket-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 19px;
  min-height: 55px;
  border-bottom: 1px solid #658171;
  font-size: 13px;
  font-weight: 600;
}
.ticket-label { letter-spacing: .10em; color: #e7eddc; }
#pool-count { margin-left: 6px; color: #f3dca9; font-variant-numeric: tabular-nums; }
#toggle-filters {
  min-height: 44px;
  margin-right: -7px;
  padding: 0 7px;
  border: 0;
  background: transparent;
  color: #f7f3e7;
  font-size: 13px;
  font-weight: 700;
}
#toggle-filters:focus { outline-color: #f3dca9; outline-offset: -2px; }
.chevron {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin: 0 2px 3px 4px;
  border: solid currentColor;
  border-width: 0 1px 1px 0;
  transform: rotate(45deg);
}
[aria-expanded="true"] > .chevron { margin-bottom: 0; transform: rotate(225deg); }
.filter-panel {
  margin: 0 8px 8px;
  padding: 7px 10px 2px;
  border-radius: 12px;
  background: #f7f3e9;
  color: var(--ink);
}
#filter-fields, #custom-fields, .option-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.option-group legend, #custom-form label[for] { padding: 0; font-size: 14px; font-weight: 700; }
.option-group small, #custom-form small { color: var(--muted); font-size: 11px; font-weight: 400; }
.filter-panel .option-group { position: relative; padding-left: 48px; border-bottom: 1px solid #e3e5d8; }
.filter-panel .option-group legend { position: absolute; left: 0; top: 12px; font-size: 13px; }
.filter-panel .option-group legend small { display: block; margin-top: -3px; }
.chips { display: flex; flex-wrap: wrap; }
.chips label { position: relative; display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; margin-right: 5px; cursor: pointer; }
.chips input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chips label span {
  display: block;
  padding: 4px 7px;
  border: 1px solid #c8d3c5;
  border-radius: 7px;
  background: #fffaf0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
  white-space: nowrap;
}
.chips input:checked + span { border-color: var(--green); background: var(--green); color: #fffaf0; }
.chips input:disabled + span { opacity: .65; }
.filter-panel .category-options { padding: 18px 0 0; }
.filter-panel .category-options legend { top: 3px; }
.filter-panel .category-options label { margin-right: 4px; }
.filter-panel .category-options label span { font-size: 12px; padding-left: 4px; padding-right: 4px; }
#clear-filters { color: var(--accent); padding-left: 0; }

.reel { padding: 15px 19px; }
.reel-window {
  height: calc(3 * var(--reel-row-height) - 1px);
  position: relative;
  overflow: hidden;
  text-align: center;
}
.reel-window::before {
  content: "";
  position: absolute;
  top: calc(var(--reel-row-height) - 1px);
  left: 0;
  right: 0;
  height: calc(var(--reel-row-height) + 1px);
  border: 1px solid #6d8977;
  border-radius: 10px;
  background: #3a5b4b;
}
.reel-window::after {
  content: "";
  position: absolute;
  right: 10px;
  left: 10px;
  top: calc(50% - 4px);
  height: 8px;
  border-left: 3px solid #e9cc91;
  border-right: 3px solid #e9cc91;
  border-radius: 2px;
  pointer-events: none;
}
.reel-row {
  position: relative;
  height: var(--reel-row-height);
  line-height: var(--reel-row-height);
  color: #c3d3bf;
  font-size: 20px;
  letter-spacing: .05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 16px;
}
.reel-center { color: #fff7df; font-weight: 800; font-size: 26px; }
.reel-track { position: relative; }
.ticket-bottom {
  position: relative;
  border-top: 1px dashed #799080;
  padding: 17px 19px 20px;
}
.ticket-bottom::before, .ticket-bottom::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--paper);
}
.ticket-bottom::before { left: -8px; }
.ticket-bottom::after { right: -8px; }
.ticket-bottom > .button { width: 100%; }
.ticket-bottom .message { color: #f7ebce; margin-top: 10px; }
.ticket-bottom .pale { margin-top: 10px; }
.spark { padding-left: 6px; color: #ffe1a7; }

.button {
  min-height: 51px;
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
}
.button span { margin-left: 4px; }
.primary {
  color: #fffaf2;
  background: var(--accent);
  box-shadow: inset 0 1px 0 rgba(255, 245, 228, .18);
}
.primary:active { background: var(--accent-dark); }
.primary:disabled { background: #805144; }
.secondary { border-color: #aebfae; background: #f8f8ef; }
.secondary:active { background: #e4ebdc; }
.secondary:disabled { color: #566758; }
.pale { background: #f8efd8; color: var(--ink); }
.text-button, .back { border: 0; padding-left: 0; background: transparent; }
.back { min-height: 44px; padding-right: 12px; font-size: 14px; font-weight: 700; }
.back span { display: inline-block; vertical-align: -1px; font-size: 20px; line-height: 1; }
.text-button { color: var(--muted); font-size: 14px; box-shadow: none; }
.message { color: var(--muted); font-size: 14px; }
.message:empty { margin: 0; }

.breadcrumb {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 9px 0 10px;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumb > span {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #edf0e6;
  padding: 2px 11px;
}
.result-body {
  padding: 19px;
  background: #fffbf0;
  border: 1px solid var(--border);
  border-radius: 19px;
  box-shadow: 0 10px 24px rgba(36, 62, 50, .075);
}
.dish-header { padding: 2px 0 16px; }
.dish-title { display: flex; align-items: center; justify-content: space-between; }
.dish-title h1 { min-width: 0; }
.favorite {
  flex: 0 0 auto;
  min-height: 44px;
  margin-left: 8px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f7f3e9;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}
.favorite::before { content: "☆"; margin-right: 4px; font-size: 16px; line-height: 1; }
.favorite[aria-pressed="true"] { border-color: #dba993; background: #f8e8dc; color: var(--accent-dark); }
.favorite[aria-pressed="true"]::before { content: "★"; }
.category-label { margin-bottom: 6px; color: var(--accent); font-weight: 700; font-size: 13px; letter-spacing: .09em; }
.dish-copy { margin-top: 8px; color: var(--muted); font-size: 15px; }
.dish-copy:empty { display: none; }
.food-art {
  border-radius: 12px;
  overflow: hidden;
  width: 100%;
  position: relative;
  padding-top: 59.78%;
  background: #e3ead8;
}
.food-art p, .food-art img { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.food-art p {
  display: flex;
  justify-content: center;
  align-items: center;
  color: #43644f;
  letter-spacing: .12em;
  font-size: 19px;
  font-weight: 700;
}
.food-art img { display: block; object-fit: cover; }
.result-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}
#only-one { font-weight: 600; }
.decision-actions, .share-actions { display: flex; margin-top: 15px; }
.decision-actions > *, .share-actions > * { flex: 1 1 0; }
.decision-actions > :first-child, .share-actions > :first-child { margin-right: 9px; }
.decision-actions > :first-child { flex-grow: 1.55; }

.confirmed #decision, .confirmed .food-art, .confirmed .dish-copy, .confirmed .category-label { display: none; }
.confirmed .dish-header { padding: 0 0 12px; }
.confirmed #dish-name { font-size: 22px; }
.confirmed .share { border-top: 0; padding-top: 0; }
.share { border-top: 1px dashed #bdc9b8; padding-top: 12px; }
.share .message { margin: 7px 0; }
.share > img {
  width: 100%;
  max-width: 246px;
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 9px;
}
.share-actions, .share > .text-button { max-width: 350px; margin-left: auto; margin-right: auto; }
.share > .text-button { display: block; width: 100%; margin-top: 4px; }

#history h1 { margin-bottom: 20px; }
#history h2 { margin: 23px 0 10px; }
.history-setting, .empty-history {
  padding: 14px 15px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fffaf0;
}
.history-setting p, .empty-history { color: var(--muted); font-size: 14px; }
.history-setting p { margin: 6px 0 1px; }
.switch {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  font-weight: 700;
  cursor: pointer;
}
.switch-track {
  position: relative;
  display: inline-block;
  width: 43px;
  height: 25px;
  border-radius: 13px;
  background: #757d73;
}
.switch-track::after {
  content: "";
  position: absolute;
  left: 4px;
  top: 4px;
  height: 17px;
  width: 17px;
  border-radius: 50%;
  background: #fffaf0;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track::after { left: 22px; }
.history-list { list-style: none; padding: 0; }
.history-list li {
  padding: 12px 1px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
}
.history-list li > span { color: var(--muted); font-size: 13px; margin-left: 8px; }
.history-list time { margin-left: 8px; }

.menu-title, .menu-panel-title { display: flex; align-items: baseline; justify-content: space-between; }
.menu-title { margin-bottom: 13px; }
.menu-title h1 { font-size: 34px; }
#menu-storage, #custom-count { color: var(--muted); font-size: 12px; }
.menu-panel {
  margin-bottom: 9px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fffaf0;
}
.menu-panel h2 { font-size: 16px; }
.menu-note { color: var(--muted); font-size: 13px; }
.menu-list { margin: 3px 0 0; padding: 0; list-style: none; }
.menu-list li { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #e4e6d9; }
.menu-list li > div { min-width: 0; overflow-wrap: break-word; padding: 5px 0; }
.menu-list strong { font-size: 14px; }
.menu-list li span { display: inline-block; margin-left: 7px; color: var(--muted); font-size: 11px; }
.list-action {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 2px 0 8px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.menu-disclosure summary {
  display: list-item;
  min-height: 44px;
  padding: 11px 0;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.menu-disclosure summary:focus, .form-control:focus { outline: 2px solid #35725b; outline-offset: 1px; }
.menu-disclosure[open] { margin-bottom: 8px; }
.form-control {
  display: block;
  width: 100%;
  min-height: 44px;
  margin: 3px 0 8px;
  padding: 6px 8px;
  border: 1px solid #87998c;
  border-radius: 8px;
  background: #fffdf6;
  color: var(--ink);
  font-size: 16px;
}
.form-control[aria-invalid="true"] { border-color: var(--accent); }
.ingredient-options { max-height: 176px; overflow-y: auto; }
#custom-form .primary { width: 100%; margin-top: 3px; }
#custom-feedback:not(:empty) { margin-top: 4px; color: var(--accent-dark); }

.reel-track.rolling { animation: reel-step 94ms linear infinite; }
@media (prefers-reduced-motion: reduce) {
  .reel-track.rolling { animation: none; }
}
@keyframes reel-step {
  from { transform: translateY(0); }
  to { transform: translateY(calc(-1 * var(--reel-row-height))); }
}

@media (max-width: 364px) {
  .shell { padding-left: 15px; padding-right: 15px; }
  .home-intro h1 { font-size: 48px; }
  .result-body { padding: 14px; }
  #dish-name { font-size: 33px; }
}

@media (max-width: 339px) {
  .masthead-actions .clock { display: none; }
}

@media (max-height: 780px) {
  .home-intro { padding: 14px 0 10px; }
  .date-line { margin-bottom: 6px; }
  .home-intro h1 { font-size: 46px; }
  .meal-choice { margin-bottom: 12px; }
  .ticket { --reel-row-height: 44px; }
  .ticket-top { min-height: 42px; }
  .reel { padding-top: 7px; padding-bottom: 7px; }
  .ticket-bottom { padding-top: 10px; padding-bottom: 12px; }
  .filters-open .home-intro { display: none; }
  .filters-open .meal-choice { margin-top: 4px; margin-bottom: 8px; }
}
