/* QF Space — "How are you feeling?" iPad page.
   Layout is a fixed 1194x834 stage (iPad landscape) scaled with --k to fit the screen, like the Heart to Heart app.
   On a portrait screen the stage becomes 834x1194 and the feelings go to two columns. */

@font-face { font-family: "QF"; font-weight: 400; font-display: block; src: url("../assets/fonts/QF-Regular.otf") format("opentype"); }
@font-face { font-family: "QF"; font-weight: 500; font-display: block; src: url("../assets/fonts/QF-Medium.otf") format("opentype"); }
@font-face { font-family: "QF"; font-weight: 600; font-display: block; src: url("../assets/fonts/QF-Semibold.otf") format("opentype"); }
@font-face { font-family: "QF"; font-weight: 700; font-display: block; src: url("../assets/fonts/QF-Bold.otf") format("opentype"); }
@font-face { font-family: "Amiri Quran"; font-display: block; src: url("../assets/fonts/amiri-quran-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: "Amiri"; font-style: normal; font-display: block; src: url("../assets/fonts/amiri-latin.woff2") format("woff2"); }
@font-face { font-family: "Amiri"; font-style: italic; font-display: block; src: url("../assets/fonts/amiri-latin-italic.woff2") format("woff2"); }

:root {
  --k: 1;
  --green: #004538;          /* QF logo background */
  --green-deep: #00362c;
  --gold: #c9a961;
  --gold-soft: rgba(201, 169, 97, .55);
  --cream: #f3ecdc;
  --cream-soft: rgba(243, 236, 220, .78);
  --ui: "QF", system-ui, sans-serif;
  --quran: "Amiri Quran", "Amiri", serif;
  --scripture: "Amiri", Georgia, serif;
}

/* Background: plain logo green. */
html, body { margin: 0; height: 100vh; background-color: var(--green); }
body {
  overflow: hidden; position: fixed; inset: 0;
  background: var(--green);
  color: var(--cream);
  font-family: var(--ui);
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

#stage {
  --w: 1194px; --h: 834px;
  position: absolute; left: 50%; top: 50%; width: var(--w); height: var(--h);
  transform: translate(-50%, -50%) scale(var(--k));
  transform-origin: center;
}
.portrait #stage { --w: 834px; --h: 1194px; }

/* Separator: a plain gold line (same footprint as the old star divider, so nothing moves). */
.divider { width: 262px; height: 18px; margin: 0 auto; background: linear-gradient(var(--gold), var(--gold)) center / 100% 1px no-repeat; }

/* ---------- Views ---------- */
.view {
  position: absolute; inset: 64px 84px 92px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease, visibility 0s linear .45s;
}
.view.is-active { opacity: 1; visibility: visible; transform: none; transition: opacity .45s ease, transform .45s ease, visibility 0s; }

.logo { display: block; height: 84px; width: auto; pointer-events: auto; }
.logo.small { height: 50px; }

/* ---------- Welcome ---------- */
.heading { margin: 22px 0 0; font-weight: 600; font-size: 42px; line-height: 1.2; color: var(--gold); }
html[lang="en"] .heading { text-transform: uppercase; letter-spacing: .14em; font-size: 34px; }

.intro { margin-top: 20px; max-width: 900px; }
.intro .text { margin: 0; }
html[lang="ar"] .intro .text { font-family: var(--quran); font-size: 35px; line-height: 1.9; }
html[lang="en"] .intro .text { font-family: var(--scripture); font-style: italic; font-size: 26px; line-height: 1.45; }
.intro .ref { margin-top: 6px; }

#home .divider { margin-top: 24px; }
.instruction { margin: 20px 0 0; max-width: 780px; font-size: 21px; line-height: 1.55; color: var(--cream-soft); }

.feelings {
  margin-top: 36px;
  display: grid; grid-template-columns: repeat(4, 232px); gap: 24px 28px;
}
.portrait .feelings { grid-template-columns: repeat(2, 280px); gap: 22px 28px; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0 28px; height: 84px; cursor: pointer;
  font: 500 25px/1 var(--ui); color: var(--cream);
  background: transparent;
  border: 1px solid var(--gold); border-radius: 3px;
  box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 5px var(--gold-soft);
  -webkit-appearance: none; appearance: none;
  transition: background-color .2s ease, transform .15s ease;
}
html[lang="ar"] .btn { font-size: 29px; padding-bottom: 4px; }
.btn:active, .btn.is-pressed { background: rgba(201, 169, 97, .22); transform: scale(.97); }
.btn:focus { outline: none; }
.btn:focus-visible { outline: 2px solid var(--cream); outline-offset: 4px; }

/* ---------- Verse view ---------- */
.v-title { margin: 14px 0 12px; font-weight: 600; font-size: 38px; line-height: 1.2; color: var(--gold); }
html[lang="en"] .v-title { text-transform: uppercase; letter-spacing: .14em; font-size: 32px; }

/* The text box has a fixed share of the stage; app.js shrinks --fs until the text fits it. */
.v-box { flex: 1 1 auto; min-height: 0; width: 900px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.portrait .v-box { width: 640px; }
.v-body { --fs: 40; width: 100%; }
.v-body .text { margin: 0; color: var(--cream); }
html[lang="ar"] .v-body .text { font-family: var(--quran); font-size: calc(var(--fs) * 1px); line-height: 1.95; }
html[lang="en"] .v-body .text { font-family: var(--scripture); font-size: calc(var(--fs) * .78px); line-height: 1.5; }
.v-body .divider { margin: calc(var(--fs) * .45px) auto; }

.ref { margin-top: 10px; font: 500 16px/1.4 var(--ui); color: var(--gold); letter-spacing: .04em; }
html[lang="en"] .ref { text-transform: uppercase; letter-spacing: .12em; font-size: 14px; }
.ref::before, .ref::after { content: "—"; opacity: .6; margin: 0 .6em; }

.v-actions { position: relative; flex: 0 0 auto; margin-top: 18px; }
.back { min-width: 300px; font-size: 20px; }
/* Audio button sits beside the back button (absolutely, so the back button stays centred either way). */
.audio-btn {
  position: absolute; top: 50%; inset-inline-start: calc(100% + 20px); transform: translateY(-50%);
  width: 64px; height: 64px; padding: 0; margin: 0; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--gold); border-radius: 50%;
  box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 5px var(--gold-soft);
  -webkit-appearance: none; appearance: none;
}
.audio-btn[hidden] { display: none; }
.audio-btn:active { background: rgba(201, 169, 97, .22); }
.audio-btn:focus { outline: none; }
.audio-btn svg { width: 26px; height: 26px; fill: var(--gold); }
.audio-btn .ico-pause, .audio-btn.is-playing .ico-play { display: none; }
.audio-btn.is-playing .ico-pause { display: block; }
html[lang="ar"] .back { font-size: 23px; }

/* ---------- Language switch ---------- */
.lang { position: absolute; left: 0; right: 0; bottom: 38px; display: flex; justify-content: center; align-items: center; gap: 14px; direction: ltr; }
.lang a { color: var(--cream-soft); text-decoration: none; padding: 12px 16px; margin: -12px -16px; }
.lang a[lang="en"] { font: 500 17px/1 var(--ui); letter-spacing: .1em; }
.lang a[lang="ar"] { font: 500 22px/1 var(--ui); }
.lang .sep { color: var(--gold-soft); font-size: 18px; }
html[lang="en"] .lang a[lang="en"], html[lang="ar"] .lang a[lang="ar"] { color: var(--gold); }

@media (prefers-reduced-motion: reduce) { .view, .view.is-active { transition: none; transform: none; } }
