/* The phone app's look: cream background, a glass of beer, Aleo for the big words. */
@font-face {
  font-family: 'Aleo';
  src: url('../fonts/aleo.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --cream: #FDF6E3;
  --foam: #F3E7C9;
  --foam-white: #FFFCF2;
  --amber: #F6B400;
  --dark-amber: #D98300;
  --red: #C62828;
  --ink: #595540;
  --ink-soft: #6B6756;
  --ink-deep: #45412B;
  --link: #8F5200; /* amber dark enough for text on foam (contrast 5:1) */
  --radius: 28px;
  --serif: 'Aleo', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--cream); }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

h1, h2 { margin: 0; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }

.soft { color: var(--ink-soft); }
.small { font-size: .875rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

:focus-visible { outline: 3px solid var(--dark-amber); outline-offset: 2px; }

/* ---- Header ---- */
.top { display: flex; align-items: center; gap: 14px; padding-top: 8px; }
.dial { width: 52px; height: 52px; flex: none; }
.dial svg { display: block; width: 100%; height: 100%; }
.titles { flex: 1; min-width: 0; }
.titles h1 { font-family: var(--serif); font-weight: 900; font-size: 1.5rem; line-height: 1.15; }
.titles p { font-size: .95rem; }

.icon-button {
  width: 48px; height: 48px; flex: none;
  border: 0; border-radius: 50%; background: transparent; cursor: pointer;
  color: var(--ink-soft);
  display: grid; place-items: center;
}
.icon-button svg { width: 26px; height: 26px; }
.icon-button:hover { background: var(--foam); }

/* ---- The glass ---- */
.glass {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px -8px rgba(217, 131, 0, .45);
  text-align: center;
}
.glass-top { background: var(--cream); padding: 22px 20px 26px; min-height: 170px; }
.saying {
  font-family: var(--serif); font-weight: 900; font-size: .95rem;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink);
}
.coaster {
  width: 92px; height: 92px; margin: 12px auto 0;
  border-radius: 50%; background: #fff; border: 3px solid var(--foam);
  box-shadow: 0 3px 6px rgba(0, 0, 0, .18);
  display: grid; place-items: center;
}
.coaster img { width: 54px; height: auto; border-radius: 4px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }

.glass-beer {
  position: relative;
  background: linear-gradient(var(--amber), var(--dark-amber));
  padding: 26px 20px 26px;
}
.foam {
  position: absolute; left: 0; right: 0; top: -18px; height: 36px; width: 100%;
  pointer-events: none;
}
.bubbles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.bubbles span {
  position: absolute; bottom: -10px; border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  animation: rise linear infinite;
}
@keyframes rise {
  from { transform: translateY(0); }
  to { transform: translateY(var(--h, -400px)); }
}
@media (prefers-reduced-motion: reduce) {
  .bubbles span { animation: none; bottom: 40%; }
}
.glass-beer > :not(.foam, .bubbles) { position: relative; }

.place {
  font-family: var(--serif); font-weight: 900;
  font-size: clamp(2rem, 9vw, 2.6rem); line-height: 1.1;
  color: var(--ink); overflow-wrap: anywhere;
}
.place a { text-decoration: none; }
.place a:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.country {
  margin-top: 4px; font-size: .9rem; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink-deep);
}

.pills, .chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 14px; }
.pill, .chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 36px; padding: 6px 14px;
  border-radius: 999px; border: 0;
  background: rgba(255, 255, 255, .4); color: var(--ink);
  font-size: .95rem; font-weight: 600; text-decoration: none;
}
button.pill, a.pill, .chip { cursor: pointer; }
button.pill:hover, a.pill:hover, .chip:hover { background: rgba(255, 255, 255, .6); }
.chip img, .flag-inline { width: 1.35em; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0, 0, 0, .1); vertical-align: -0.15em; }
.also { margin-top: 14px; font-size: .85rem; font-weight: 600; color: var(--ink-deep); }
.chips { margin-top: 6px; gap: 6px; }

/* ---- Cards ---- */
.card { background: var(--foam); border-radius: var(--radius); padding: 20px; }
.next { display: block; text-decoration: none; color: inherit; }
.next:hover { background: #EEDFBC; }
.next-row { display: flex; align-items: center; gap: 12px; }
.next-where { flex: 1; min-width: 0; }
.label { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.next-names {
  font-family: var(--serif); font-weight: 700; font-size: 1.35rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.next-names img { width: 1.1em; }
.countdown { font-family: var(--serif); font-weight: 900; font-size: 1.8rem; white-space: nowrap; }
.progress { height: 8px; margin-top: 14px; border-radius: 999px; background: #fff; overflow: hidden; }
.progress > div { height: 100%; background: var(--amber); border-radius: 999px; }

.section-title { font-family: var(--serif); font-weight: 900; font-size: 1.3rem; padding-top: 8px; }

/* ---- Brewery carousel ---- */
.carousel-wrap { position: relative; margin-top: 12px; }
.carousel {
  display: flex; gap: 12px; margin: 0; padding: 0; list-style: none;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
  border-radius: var(--radius);
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > li { flex: 0 0 100%; scroll-snap-align: start; }
.brewery { height: 100%; padding: 16px; }
.brewery-head { display: flex; align-items: center; gap: 16px; }
.tile {
  width: 56px; height: 56px; flex: none; border-radius: 18px;
  background: linear-gradient(var(--amber), var(--dark-amber));
  display: grid; place-items: center; font-size: 28px;
}
.brewery-town { font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); }
.brewery-name { font-family: var(--serif); font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
.brewery-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 12px 0 0 6px; }
.brewery-links a {
  color: var(--link); font-weight: 700; text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
}
.brewery-links a:hover { text-decoration: underline; }
.nearby { display: flex; align-items: center; gap: 16px; text-decoration: none; height: 100%; }
.nearby:hover { background: #EEDFBC; }
.carousel-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 6px; }
.carousel-nav button {
  width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent;
  cursor: pointer; font-size: 1.2rem; color: var(--ink-soft);
}
.carousel-nav button:hover:not(:disabled) { background: var(--foam); }
.carousel-nav button:disabled { opacity: .3; cursor: default; }
.carousel-count { font-size: .85rem; font-weight: 600; color: var(--ink-soft); min-width: 7em; text-align: center; }

/* ---- Coming up ---- */
.upcoming { list-style: none; margin: 8px 0 0; padding: 0; }
.upcoming a {
  display: flex; align-items: center; gap: 14px; min-height: 48px;
  text-decoration: none; border-radius: 999px;
}
.upcoming a:hover { background: var(--foam); }
.time {
  flex: none; min-width: 84px; padding: 6px 10px; text-align: center;
  border-radius: 999px; background: var(--foam);
  font-family: ui-monospace, 'Cascadia Mono', Menlo, Consolas, monospace; font-size: .9rem;
}
.where { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.install {
  width: 100%; min-height: 52px; margin-top: 8px; border: 0; border-radius: 999px;
  background: var(--amber); color: var(--ink-deep); font-weight: 700; cursor: pointer;
}
.install:hover { background: #FFC21A; }
.install-hint { text-align: center; padding: 0 12px; }

footer { text-align: center; color: var(--ink-soft); font-size: .875rem; display: grid; gap: 6px; padding-top: 8px; }

/* ---- Settings ---- */
dialog {
  border: 0; border-radius: var(--radius); background: var(--cream); color: var(--ink);
  padding: 24px; width: min(420px, calc(100% - 32px));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
dialog::backdrop { background: rgba(69, 65, 43, .45); }
dialog h2 { font-family: var(--serif); font-weight: 900; font-size: 1.3rem; }
fieldset { border: 0; margin: 16px 0 0; padding: 0; }
legend { font-weight: 700; margin-bottom: 4px; }
fieldset label { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
input[type=radio] { width: 20px; height: 20px; accent-color: var(--dark-amber); }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 12px; }
.dialog-actions button {
  border: 0; background: transparent; color: var(--link); font-weight: 700;
  min-height: 44px; padding: 0 16px; border-radius: 999px; cursor: pointer;
}
.dialog-actions button:hover { background: var(--foam); }

.noscript { padding: 24px; text-align: center; }
