/* Elder Angels home screen.
   Plain, high-contrast colors; large type; big tap targets; nothing depends on hover. */

:root {
  --bg: #fafaf7;
  --ink: #111111;
  --muted: #444444;
  --line: #111111;
  --call: #0f5132;   /* deep green */
  --write: #0b3c8c;  /* deep blue */
  --watch: #7a1f1f;  /* deep maroon */
  --tile-ink: #ffffff;
  --ok: #1b7f2a;
  --warn: #b26a00;
  --bad: #b00020;
}

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

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

/* Only one screen shows at a time. */
.screen { display: none; height: 100vh; height: 100dvh; flex-direction: column; }
.screen.active { display: flex; }

/* ---------- Home ---------- */

#home { padding: 2.5vh 3vw; gap: 3vh; position: relative; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.greeting { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 600; }
.when { text-align: right; }
.clock { font-size: clamp(2.2rem, 6vw, 4rem); font-weight: 700; line-height: 1; }
.date { font-size: clamp(1.1rem, 2.4vw, 1.6rem); color: var(--muted); margin-top: .3rem; }

.tiles {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5vw;
  min-height: 0;
}

.tile {
  border: 0;
  border-radius: 22px;
  color: var(--tile-ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5vh;
  padding: 1rem;
  min-height: 160px;
  box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.tile:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.tile:focus-visible { outline: 6px solid #f0b400; outline-offset: 4px; }

.tile-call  { background: var(--call); }
.tile-write { background: var(--write); }
.tile-watch { background: var(--watch); }

.tile-icon  { font-size: clamp(3rem, 9vw, 6rem); line-height: 1; }
.tile-label { font-size: clamp(1.6rem, 4vw, 3rem); font-weight: 700; text-align: center; }

/* Tiny system dot for whoever is testing; means nothing to the person using it. */
.status {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cccccc;
}
.status.ok   { background: var(--ok); }
.status.warn { background: var(--warn); }
.status.bad  { background: var(--bad); }

/* ---------- Inner screens ---------- */

.bar {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  padding: 12px 16px;
  border-bottom: 3px solid var(--line);
  background: #ffffff;
  flex-wrap: wrap;
}
.bar h1 { margin: 0; font-size: clamp(1.5rem, 3.5vw, 2.4rem); flex: 1; }

.home-btn, .bar-btn {
  min-height: 64px;
  padding: 0 1.4rem;
  border: 3px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1.5rem;
  font-weight: 700;
}
.home-btn:active, .bar-btn:active { background: #e8e8e8; }

.saved { font-size: 1.2rem; color: var(--muted); min-width: 8ch; text-align: right; }
.saved.bad { color: var(--bad); font-weight: 700; }

.placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
}
.placeholder p { margin: .4em 0; }
.placeholder .small { font-size: .6em; color: var(--muted); }

/* Writing */
#page {
  flex: 1;
  width: 100%;
  border: 0;
  padding: 24px clamp(16px, 5vw, 80px);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  line-height: 1.55;
  color: var(--ink);
  background: #fffef9;
  resize: none;
  outline: none;
}

/* Watch & Listen */
.choices {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  align-content: start;
}

.choice {
  min-height: 120px;
  border: 3px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.4vw, 1.8rem);
  font-weight: 700;
  padding: 1rem;
  text-align: center;
}
.choice:active { background: #e8e8e8; }

.empty {
  grid-column: 1 / -1;
  font-size: 1.4rem;
  color: var(--muted);
  text-align: center;
  padding: 3rem 1rem;
}

.player { flex: 1; background: #000000; display: flex; }
.player[hidden] { display: none; }
.player iframe { flex: 1; width: 100%; height: 100%; border: 0; }

/* Phones and narrow windows: stack the tiles. */
@media (max-width: 700px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { flex-direction: row; justify-content: flex-start; padding: 1rem 1.5rem; min-height: 0; }
  .tile-icon { font-size: 3rem; }
  .when { text-align: left; }
}
