/* Stay Safe (safety.html): the drawn phone of the chat and feed activities
   (site/js/science/safety.js), and the Boys / Girls tabs on the home screen. */

.tracks .year-tab { min-width: 160px; font-size: 24px; }
.tracks-note { margin: -8px auto 18px; max-width: 640px; color: var(--muted, #5b6478); font: 400 20px/1.3 var(--book); text-align: center; }

/* ---- The phone, with the buttons beside it (under it when the iPad stands up) ---- */

.phone-act { display: grid; grid-template-columns: minmax(0, 430px) auto; justify-content: center; align-items: center; justify-items: center; gap: 56px; min-height: 0; height: 100%; }
.phone {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(430px, 100%);
  height: 100%;
  min-height: 300px;
  max-height: 560px;
  padding: 12px;
  border-radius: 38px;
  background: #1d2433;
  box-shadow: 0 6px 22px rgb(29 36 51 / 0.28);
  overflow: hidden;
}
.phone-buttons { display: grid; gap: 14px; }
.phone-buttons .card { min-width: 210px; padding: 14px 16px 12px; touch-action: manipulation; }
.phone-buttons .card-emoji { font-size: 60px; }
.phone-buttons .card-label { font-size: 24px; }
@media (orientation: portrait) {
  .phone-act { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 16px; }
  .phone-buttons { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: min(100%, 560px); gap: 10px; }
  .phone-buttons .card { min-width: 0; padding: 10px 8px 8px; }
  .phone-buttons .card-emoji { font-size: 48px; }
  .phone-buttons .card-label { font-size: 21px; }
}

/* ---- Chat ---- */

.phone-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px 10px; border-radius: 26px 26px 0 0; background: var(--subject-soft, #eef); }
.chat-avatar { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 50%; background: #fff; font: 34px/1 var(--emoji); }
.chat-who { display: grid; line-height: 1.15; }
.chat-who b { font: 600 22px/1.15 var(--ks-brand-font); color: var(--subject-dark, #333); }
.chat-who small { color: #1f9d55; font: 400 16px/1.2 var(--book); }
.chat-who small::before { content: '● '; }
.chat-log { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 14px 14px 18px; border-radius: 0 0 26px 26px; background: #fff; overflow-y: auto; }
.bubble { position: relative; max-width: 86%; padding: 10px 16px; border: 3px solid transparent; border-radius: 20px 20px 20px 6px; background: #eef1f7; font: 400 22px/1.3 var(--book); color: #1d2433; }
.bubble.flagged { border-color: var(--wrong, #d93b3b); background: #ffe9e7; }
.bubble.fine { border-color: var(--right, #1f9d55); background: var(--right-soft, #e3f6ea); }
.bubble-tag { position: absolute; top: -12px; right: -12px; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgb(29 36 51 / 0.25); font: 20px/1 var(--emoji); }
.bubble.fine .bubble-tag { color: var(--right, #1f9d55); font: 700 22px/1 var(--ks-brand-font); }
.bubble.typing { display: flex; gap: 6px; padding: 14px 16px; }
.bubble.typing i { width: 10px; height: 10px; border-radius: 50%; background: #9aa3b5; animation: typing 1s infinite ease-in-out; }
.bubble.typing i:nth-child(2) { animation-delay: 0.15s; }
.bubble.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes typing { 0%, 100% { transform: translateY(0); opacity: 0.5; } 50% { transform: translateY(-5px); opacity: 1; } }

/* ---- Feed ---- */

.feed-phone { grid-template-rows: minmax(0, 1fr) auto; }
.feed-screen { position: relative; overflow: hidden; border-radius: 28px; background: #000; touch-action: none; container-type: size; }
/* The picture fills the space above the title, so the two never overlap, even on a small phone. */
.feed-video { position: absolute; inset: 0; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; align-items: center; background: linear-gradient(165deg, var(--tint, #ffd6a5), #fff 120%); cursor: grab; }
.feed-emoji { font: min(130px, 42cqh)/1 var(--emoji); filter: drop-shadow(0 6px 10px rgb(29 36 51 / 0.2)); }
.feed-info { justify-self: stretch; display: grid; gap: 2px; padding: 10px 16px 18px; background: linear-gradient(to top, rgb(29 36 51 / 0.78), rgb(29 36 51 / 0.35)); color: #fff; }
.feed-title { font: 600 24px/1.2 var(--ks-brand-font); }
.feed-info small { font: 400 17px/1.2 var(--book); opacity: 0.9; }
.feed-track { position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: rgb(255 255 255 / 0.4); }
.feed-bar { display: block; width: 4%; height: 100%; background: #fff; }
.feed-video.reported { filter: grayscale(1) brightness(0.85); }
.feed-stamp { position: absolute; top: 38%; padding: 8px 18px; border: 4px solid var(--wrong, #d93b3b); border-radius: 14px; background: #fff; color: var(--wrong, #d93b3b); font: 700 30px/1.1 var(--ks-brand-font); transform: rotate(-8deg); }
.feed-end { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: #fff; font: 600 26px/1.2 var(--ks-brand-font); color: var(--subject-dark, #333); }
.feed-end span { font: 64px/1 var(--emoji); }
.feed-dots { display: flex; justify-content: center; gap: 8px; padding: 10px 0 2px; }
.feed-dots i { width: 10px; height: 10px; border-radius: 50%; background: #4a5570; }
.feed-dots i.now { background: #fff; }

/* A phone held sideways: little height, so a shorter phone and smaller buttons. */
@media (max-height: 500px) and (orientation: landscape) {
  .phone-act { gap: 24px; }
  .phone { min-height: 240px; border-radius: 28px; padding: 8px; }
  .phone-buttons { gap: 8px; }
  .phone-buttons .card { min-width: 160px; padding: 6px 10px; }
  .phone-buttons .card-emoji { font-size: 34px; }
  .phone-buttons .card-label { font-size: 18px; }
  .bubble { font-size: 19px; padding: 8px 12px; }
}
