*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-dark: #1f7a8a;
  --green-mid: #2997AB;
  --green-light: #3bb3c7;
  --terracotta: #c47b5a;
  --terracotta-dark: #a8623f;
  --bg: #f5f2eb;
  --white: #ffffff;
  --text: #2c2c2c;
  --text-light: #666;
  --text-muted: #999;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --nav-height: 64px;
  --header-height: 72px;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ---- Install Banner ---- */

.install-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--terracotta);
  color: var(--white);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  animation: slideBanner 0.3s ease-out;
}

@keyframes slideBanner {
  from { transform: translateY(-100%); }
  to { transform: translateY(0); }
}

.install-banner-text {
  flex: 1;
}

.install-banner-text strong {
  display: block;
  font-size: 0.95rem;
}

.install-banner-text span {
  font-size: 0.78rem;
  opacity: 0.92;
  line-height: 1.4;
}

.install-dismiss {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  opacity: 0.8;
  -webkit-tap-highlight-color: transparent;
}

.has-install-banner .app-header {
  top: 52px;
}

.has-install-banner main {
  padding-top: calc(var(--header-height) + 52px);
}

/* ---- Header ---- */

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--green-dark);
  color: var(--white);
  height: var(--header-height);
  box-shadow: var(--shadow-lg);
}

.header-logo {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.header-text h1 {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.header-text p {
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: 1px;
}

.header-refresh {
  margin-left: auto;
  flex-shrink: 0;
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.header-refresh:hover,
.header-refresh:focus-visible {
  background: rgba(255, 255, 255, 0.24);
  outline: none;
}

.header-refresh:active {
  background: rgba(255, 255, 255, 0.32);
}

.header-refresh svg {
  width: 20px;
  height: 20px;
}

.header-refresh.is-loading .refresh-icon {
  animation: refresh-spin 0.7s linear infinite;
}

.header-refresh .refresh-tick {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.header-refresh.is-done .refresh-icon {
  opacity: 0;
}

.header-refresh.is-done .refresh-tick {
  opacity: 1;
  transform: scale(1);
}

@keyframes refresh-spin {
  to { transform: rotate(360deg); }
}

/* ---- Main / Pages ---- */

main {
  padding-top: var(--header-height);
  padding-bottom: var(--nav-height);
  min-height: 100vh;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-content {
  padding: 20px 16px 32px;
}

.page-content h2 {
  font-size: 1.4rem;
  color: var(--green-dark);
  margin-bottom: 16px;
  font-weight: 700;
}

/* ---- Day Tabs (Schedule) ---- */

.day-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.day-tab {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: var(--white);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.day-tab.active {
  color: var(--white);
  background: var(--green-mid);
}

.day-tab:not(.active):active {
  background: #eee;
}

/* ---- Schedule Cards ---- */

.day-content {
  display: none;
}

.day-content.active {
  display: block;
  animation: fadeIn 0.2s ease-out;
}

.schedule-note {
  background: var(--white);
  border-left: 4px solid var(--terracotta);
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-bottom: 20px;
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.5;
}

.schedule-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  margin: 24px 0 12px;
  font-weight: 700;
}

.schedule-divider {
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  margin: 24px 0 4px;
}

.schedule-card {
  display: flex;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}

.schedule-time {
  flex-shrink: 0;
  width: 70px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--green-mid);
  padding-top: 2px;
}

.schedule-detail strong {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.schedule-detail p {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.45;
}

/* Lambourne End activity cards */

.le-card {
  border-left: 3px solid var(--terracotta);
  background: #fdf8f5;
  position: relative;
}

.le-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: var(--terracotta);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 4px;
  line-height: 1.3;
}

.le-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.le-list li {
  padding: 6px 0;
  font-size: 0.92rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.le-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.age-badge, .prebook-badge, .tbc-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 4px;
}

.age-badge {
  background: #e8d5c4;
  color: var(--terracotta-dark);
}

.prebook-badge {
  background: var(--green-mid);
  color: var(--white);
}

.tbc-badge {
  background: #e0e0e0;
  color: var(--text-light);
}

/* ---- Site Map ---- */

.map-hint {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.map-link {
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--white);
}

.map-image {
  width: 100%;
  height: auto;
  display: block;
}

/* ---- Announcements ---- */

.announcements-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 40px !important;
}

.announcements-content h2 {
  text-align: center;
}

.announcements-intro {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 340px;
  margin-bottom: 32px;
  line-height: 1.6;
}

.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #25D366;
  color: var(--white);
  text-decoration: none;
  padding: 18px 36px;
  border-radius: 60px;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.whatsapp-btn:active {
  transform: scale(0.97);
  box-shadow: 0 3px 10px rgba(37, 211, 102, 0.3);
}

.whatsapp-icon {
  width: 28px;
  height: 28px;
}

.announcements-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 40px;
  padding: 14px 18px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 360px;
  text-align: left;
}

.info-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: var(--text-muted);
  margin-top: 1px;
}

.announcements-note p {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.5;
}

/* ---- Links ---- */

.links-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.links-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.link-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.link-card:active {
  transform: scale(0.98);
  box-shadow: var(--shadow-lg);
}

.link-card.link-coming-soon {
  opacity: 0.6;
}

.link-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--green-dark);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.link-icon-wrap svg {
  width: 22px;
  height: 22px;
}

.link-text {
  flex: 1;
  min-width: 0;
}

.link-text strong {
  display: block;
  font-size: 1rem;
}

.link-text span {
  font-size: 0.82rem;
  color: var(--text-light);
}

.link-arrow {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ---- Bottom Navigation ---- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  background: var(--white);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
  height: var(--nav-height);
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.06);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 4px;
  transition: color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.2s ease;
}

.nav-btn span {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.nav-btn.active {
  color: var(--green-mid);
}

.nav-btn.active svg {
  transform: scale(1.1);
}

.nav-btn:not(.active):active {
  color: var(--text-light);
}

/* ---- Safe area for notched phones ---- */

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    height: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }

  main {
    padding-bottom: calc(var(--nav-height) + env(safe-area-inset-bottom));
  }
}
