/* ============================================================
   Flashcards — styles shared by the student page (index.html)
   and the deck editor (deck.html): the card itself, the colors,
   and the few pieces both pages use. TeacherBox's tokens and
   components come from theme.css (a copy of TeacherBox's — keep
   the two in step); styles for one page only are in that page's
   <style>.
   ============================================================ */

:root {
  color-scheme: dark; /* the browser's own controls (date picker, checkboxes) match the page */

  /* The colors a teacher can paint words and cards with (COLORS in card-text.js) */
  --c-red:    #ff7b7b;
  --c-orange: #ffa94d;
  --c-yellow: #ffd43b;
  --c-green:  #69db7c;
  --c-blue:   #74c0fc;
  --c-purple: #c4a7ff;

  /* The most a card's picture takes up: 240px, less on a short screen so
     the buttons under the card still fit. Every card is as tall as one with
     a picture and a two-line meaning (owner's request, 2026-10-22), so cards
     don't change size from one to the next. --card-height takes the picture
     height from here: a card that shrinks its own picture (.whole-card) keeps
     the same height. */
  --picture-height: min(240px, 28vh);
  --card-height: calc(var(--picture-height) + 210px);
}

.page { padding-top: 28px; padding-bottom: 40px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 0.95rem; color: var(--text-muted); margin: 0 0 22px; }
.brand img { width: 20px; height: 20px; }
.brand span { color: var(--mint); }

/* A coral strip at the top (as in quiz.css): "Running on this computer" */
.banner {
  background: rgba(255,139,107,0.14);
  border: 1px solid rgba(255,139,107,0.35);
  color: var(--coral);
  border-radius: var(--radius-input);
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 24px;
}

.status-msg { color: var(--danger); font-size: 0.88rem; min-height: 1.2em; margin: 0 0 10px; }
.status-msg:empty { min-height: 0; margin: 0; }

.link-btn { background: none; border: none; padding: 0; color: var(--mint); font: inherit; text-decoration: underline; cursor: pointer; }

input[type=date] {
  background: rgba(243,245,250,0.06);
  border: 1.5px solid var(--hairline-soft);
  border-radius: var(--radius-input);
  color: var(--offwhite);
  font-family: var(--font);
  font-size: 1rem;
  padding: 11px 14px;
}
input[type=date]:focus { outline: none; border-color: var(--mint); }

button, .btn { touch-action: manipulation; } /* no double-tap zoom on phones */

/* A student's initials in a circle (the account chip, the dashboard).
   Google's profile picture in step 2. */
.avatar { flex-shrink: 0; width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--mint); color: var(--navy); font-weight: 800; font-size: 0.75rem; }
.avatar-big { width: 42px; height: 42px; font-size: 1rem; }

/* The box for data-tip tooltips (card-view.js) */
.tip-box {
  position: fixed;
  z-index: 300;
  max-width: 280px;
  padding: 8px 11px;
  border: 1px solid var(--hairline-soft);
  border-radius: 8px;
  background: #0f1430;
  color: var(--offwhite);
  font-family: var(--font);
  font-size: 0.8rem;
  line-height: 1.45;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.1s;
}
.tip-box.on { opacity: 1; }
[data-tip] { cursor: help; }

/* Controls for testing on this computer only (DEV_SIGNIN), set apart with a dashed edge */
.proto-tools {
  border: 1.5px dashed var(--hairline-soft);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 48px;
}
.proto-title { width: 100%; margin: 0 0 4px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--coral); }
.proto-tools .hint { width: 100%; margin: 4px 0 0; font-size: 0.8rem; color: var(--text-faint); }

/* ---------- A card (card-view.js) ---------- */
/* All cards the same height (--card-height), the content in the middle. A
   card with a lot of text can still grow to fit it. */
.flashcard {
  --card-color: transparent;
  position: relative;
  overflow: hidden;
  min-height: var(--card-height);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 28px 34px;
  background: var(--panel);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  text-align: center;
  overflow-wrap: anywhere;
}
/* The card's color: a band across the top and a faint glow under it */
.flashcard::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: var(--card-color);
}
.flashcard[class*="fc-"] { background: linear-gradient(180deg, color-mix(in srgb, var(--card-color) 9%, var(--panel)) 0, var(--panel) 120px); }
.fc-red    { --card-color: var(--c-red); }
.fc-orange { --card-color: var(--c-orange); }
.fc-yellow { --card-color: var(--c-yellow); }
.fc-green  { --card-color: var(--c-green); }
.fc-blue   { --card-color: var(--c-blue); }
.fc-purple { --card-color: var(--c-purple); }

.fc-word-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 14px; }
.fc-word { font-weight: 800; font-size: clamp(2rem, 8vw, 2.9rem); letter-spacing: -0.02em; line-height: 1.15; white-space: pre-wrap; }
.fc-word strong { font-weight: 900; }

.fc-sound {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 50%;
  background: rgba(79,209,197,0.14);
  color: var(--mint);
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}
.fc-sound:hover { background: rgba(79,209,197,0.24); }
.fc-sound svg { width: 22px; height: 22px; }
.fc-listen { width: auto; height: auto; margin: 0 auto; padding: 14px 24px; border-radius: 30px; }

.fc-divider { width: 56px; height: 2px; margin: 24px auto; border-radius: 1px; background: var(--hairline-soft); }
/* The back's text: smaller than the word on the front, but easy to read
   (owner's request, 2026-10-22: it was too small at 1.2rem) */
.fc-meaning { font-size: clamp(1.3rem, 4.6vw, 1.45rem); line-height: 1.45; white-space: pre-wrap; }
.fc-empty { color: var(--text-faint); font-style: italic; }
.fc-meaning strong { font-weight: 700; }
.fc-example { margin-top: 12px; font-size: clamp(1.08rem, 3.8vw, 1.18rem); line-height: 1.45; font-style: italic; color: var(--text-muted); white-space: pre-wrap; }
.fc-example em { font-style: normal; }
.fc-example strong { color: var(--offwhite); }

.fc-image { display: block; max-width: 100%; max-height: var(--picture-height); margin: 0 auto 22px; border-radius: 12px; object-fit: contain; }
/* A typing card once answered also has the word on top: a smaller picture
   keeps it the same height as the others */
.whole-card { --picture-height: max(80px, calc(min(240px, 28vh) - 100px)); }
.fc-meaning + .fc-image,
.fc-example + .fc-image,
.fc-divider + .fc-image { margin: 22px auto 0; }
.fc-divider + .fc-image { margin-top: 0; }

/* Painted words */
.tc-red    { color: var(--c-red); }
.tc-orange { color: var(--c-orange); }
.tc-yellow { color: var(--c-yellow); }
.tc-green  { color: var(--c-green); }
.tc-blue   { color: var(--c-blue); }
.tc-purple { color: var(--c-purple); }

/* Color dots and swatches */
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--hairline-soft); }
.dot-red    { background: var(--c-red); }
.dot-orange { background: var(--c-orange); }
.dot-yellow { background: var(--c-yellow); }
.dot-green  { background: var(--c-green); }
.dot-blue   { background: var(--c-blue); }
.dot-purple { background: var(--c-purple); }

@media (max-width: 560px) {
  :root { --card-height: calc(var(--picture-height) + 175px); }
  .flashcard { padding: 34px 18px 28px; }
  .whole-card { --picture-height: max(70px, calc(min(240px, 28vh) - 130px)); } /* its text wraps onto more lines here */
}
