/* tenderfoot/css/tf.css - the page around the stage: background, loading curtain, rotate curtain,
 * copyright, boot error. The game itself is drawn on the Phaser canvas.
 *
 * Every value here is the main game's own (index.html) unless it says otherwise: the same tokens,
 * the same curtain, the same copyright rule (the long line on desktops and tablets, the short mark on
 * a phone, 30 px in so a rounded corner cannot eat it), the same rotate curtain. Brand recognition is
 * the point (the founder, 2026-09-22).
 */
:root {
  --candy-pink: #FF8FC7;
  --lavender: #C9A8F5;
  --mint-teal: #7FE0D6;
  --gold: #F5C242;
  --parchment: #FBF3E7;
  --obsidian: #14121A;
  --sky-indigo: #241A3D;
  --toxic-green: #6BE04A;
  --muted: #8E7FB0;
  --ink: #0B0814;
  --font: 'Trebuchet MS', 'Lucida Grande', Verdana, sans-serif;
  --title-font: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  font-family: var(--font);
  color: var(--parchment);
  -webkit-tap-highlight-color: transparent;
  touch-action: none;           /* the hunt owns pinch and pan */
  overscroll-behavior: none;
}

/* The painting, edge to edge behind the stage: a wide phone or a desktop window that is not 16:9
   shows the key art in the gutters rather than bare black (the main game's phone treatment). */
body::before {
  content: '';
  position: fixed;
  inset: -40px;
  background: #0B0814 url('../art/splash.jpg') center / cover no-repeat;
  filter: blur(18px) brightness(0.42) saturate(1.1);
  z-index: 0;
  pointer-events: none;
}

#stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* iOS: keep the stage out from under the notch / island and the home bar. */
  padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
#stage canvas { display: block; box-shadow: 0 0 60px rgba(0, 0, 0, 0.55); }

/* ---- the copyright on every screen ---------------------------------------------------------- */
/* ---- the rotate curtain ------------------------------------------------------------------------ */
#rotate-prompt {
  display: none;
  position: fixed; inset: 0; z-index: 60;
  flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 24px; text-align: center; color: var(--parchment);
  background: linear-gradient(160deg, #2C2050 0%, #241A3D 46%, #171029 100%);
}
html[data-rotate="1"] #rotate-prompt { display: flex; }
#rotate-prompt .rp-device {
  width: 46px; height: 84px; border: 3px solid var(--gold); border-radius: 10px;
  box-shadow: inset 0 0 0 2px #14121A, 0 0 24px rgba(245, 194, 66, 0.25);
  animation: tf-rotate-hint 2.2s ease-in-out infinite;
}
html[data-device="tablet"] #rotate-prompt .rp-device { width: 70px; height: 96px; border-radius: 12px; }
#rotate-prompt .rp-title { margin: 0; font-family: var(--title-font); font-weight: bold; font-size: 24px; letter-spacing: 0.08em; color: var(--gold); }
#rotate-prompt .rp-sub { margin: 0; max-width: 320px; font-size: 14px; line-height: 1.5; color: var(--lavender); }
@keyframes tf-rotate-hint { 0%, 20% { transform: rotate(0deg); } 55%, 80% { transform: rotate(-90deg); } 100% { transform: rotate(0deg); } }

/* ---- the boot error ---------------------------------------------------------------------------- */
#boot-error {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--ink); text-align: center; padding: 24px;
}
#boot-error[hidden] { display: none; }
#boot-error .be-title { margin: 0; font-family: var(--title-font); font-size: 26px; color: var(--gold); }
#boot-error .be-sub { margin: 0; font-size: 14px; color: var(--lavender); max-width: 420px; }

/* ======================================================================================
   THE LOADING CURTAIN - the main game's, with Tenderfoot's key art, a few loose Charter
   pages drifting up through the fog, and Tenderfoot trotting along the foot.
   ====================================================================================== */
#load-curtain {
  position: fixed; inset: 0; z-index: 58; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  padding-bottom: 24vh;
  color: var(--parchment);
  background: #0B0814 url('../art/splash.jpg') center / cover no-repeat;
  transition: opacity 0.6s ease;
}
#load-curtain.is-done { opacity: 0; pointer-events: none; }
#load-curtain::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(11, 8, 20, 0.35) 0%, rgba(11, 8, 20, 0.86) 70%, #0B0814 100%),
    linear-gradient(180deg, rgba(44, 32, 80, 0.55), rgba(11, 8, 20, 0.7));
}
.lc-glow {
  position: absolute; width: 60vmax; height: 60vmax; left: 50%; top: 30%; margin: -30vmax 0 0 -30vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 194, 66, 0.22) 0%, rgba(245, 194, 66, 0.07) 35%, rgba(245, 194, 66, 0) 70%);
  animation: lc-breathe 3.6s ease-in-out infinite; will-change: transform, opacity;
}
.lc-fog {
  position: absolute; left: -50%; top: -20%; width: 200%; height: 140%;
  background-image:
    radial-gradient(ellipse 30% 22% at 20% 60%, rgba(120, 90, 170, 0.45), transparent 70%),
    radial-gradient(ellipse 26% 18% at 55% 40%, rgba(90, 60, 140, 0.42), transparent 70%),
    radial-gradient(ellipse 34% 20% at 80% 70%, rgba(140, 100, 190, 0.38), transparent 70%);
  animation: lc-drift 22s linear infinite; will-change: transform;
}
.lc-fog--2 {
  top: 0;
  background-image:
    radial-gradient(ellipse 28% 20% at 30% 30%, rgba(60, 40, 110, 0.5), transparent 70%),
    radial-gradient(ellipse 24% 16% at 65% 65%, rgba(110, 70, 160, 0.4), transparent 70%);
  animation: lc-drift 31s linear infinite reverse;
}
/* Loose Charter pages drifting up and turning, the way the book burst in the prologue. */
.lc-page {
  position: absolute; bottom: -60px; width: 34px; height: 44px; border-radius: 2px;
  background: linear-gradient(160deg, #FBF3E7, #E8D3A8);
  box-shadow: 0 0 14px rgba(245, 194, 66, 0.45), inset 0 0 0 1px rgba(183, 121, 31, 0.5);
  opacity: 0; animation: lc-flutter 9s ease-in infinite;
}
.lc-page::after { content: ''; position: absolute; left: 6px; right: 8px; top: 9px; height: 18px;
  background: repeating-linear-gradient(180deg, rgba(120, 80, 40, 0.35) 0 1px, transparent 1px 5px); }
.lc-page:nth-child(1) { left: 14%; animation-delay: 0s; }
.lc-page:nth-child(2) { left: 30%; animation-delay: 2.4s; transform: scale(0.8); }
.lc-page:nth-child(3) { left: 47%; animation-delay: 4.1s; }
.lc-page:nth-child(4) { left: 62%; animation-delay: 1.2s; }
.lc-page:nth-child(5) { left: 78%; animation-delay: 5.6s; }
.lc-page:nth-child(6) { left: 90%; animation-delay: 3.3s; }
.lc-ember {
  position: absolute; bottom: 12%; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px 2px rgba(245, 194, 66, 0.6);
  opacity: 0; animation: lc-rise 6s ease-out infinite;
}
.lc-ember:nth-child(1) { left: 12%; animation-delay: 0s; }
.lc-ember:nth-child(2) { left: 24%; animation-delay: 1.4s; background: var(--mint-teal); box-shadow: 0 0 8px 2px rgba(127, 224, 214, 0.6); }
.lc-ember:nth-child(3) { left: 38%; animation-delay: 2.8s; }
.lc-ember:nth-child(4) { left: 52%; animation-delay: 0.7s; background: var(--candy-pink); box-shadow: 0 0 8px 2px rgba(255, 143, 199, 0.6); }
.lc-ember:nth-child(5) { left: 63%; animation-delay: 3.6s; }
.lc-ember:nth-child(6) { left: 74%; animation-delay: 2.1s; background: var(--mint-teal); box-shadow: 0 0 8px 2px rgba(127, 224, 214, 0.6); }
.lc-ember:nth-child(7) { left: 86%; animation-delay: 4.4s; }
.lc-ember:nth-child(8) { left: 93%; animation-delay: 1.0s; background: var(--candy-pink); box-shadow: 0 0 8px 2px rgba(255, 143, 199, 0.6); }

.lc-crest { position: relative; width: 78px; height: 78px; filter: drop-shadow(0 0 14px rgba(245, 194, 66, 0.35)); }
.lc-kicker { position: relative; margin: 0; font-size: clamp(11px, 1.5vw, 15px); letter-spacing: 0.34em; color: var(--gold); text-transform: uppercase; opacity: 0.9; }
.lc-title {
  position: relative; margin: 0; font-family: var(--title-font); font-weight: bold;
  font-size: clamp(26px, 5vw, 54px); letter-spacing: 0.1em; color: var(--gold);
  text-shadow: 0 2px 0 #3A2B58, 0 0 24px rgba(245, 194, 66, 0.35);
}
.lc-sub { position: relative; margin: 0; font-size: clamp(12px, 1.6vw, 15px); letter-spacing: 0.22em; color: var(--lavender); text-transform: uppercase; }
.lc-bar {
  position: relative; width: min(420px, 70vw); height: 12px; margin-top: 8px; border-radius: 7px;
  background: rgba(20, 14, 34, 0.9); border: 1px solid rgba(201, 168, 245, 0.35);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 18px rgba(127, 224, 214, 0.12); overflow: hidden;
}
.lc-bar-fill {
  height: 100%; width: 0%; border-radius: 7px;
  background: linear-gradient(90deg, #7FE0D6, #F5C242 60%, #FF8FC7);
  box-shadow: 0 0 12px rgba(245, 194, 66, 0.55); transition: width 0.25s ease-out;
}
.lc-pct { position: relative; font-size: 13px; letter-spacing: 0.1em; color: var(--gold); min-height: 1.2em; }
.lc-note { position: relative; margin: 0; font-size: 14px; color: var(--lavender); min-height: 1.4em; }
.lc-tip { position: relative; margin: 0; font-size: 12px; color: var(--muted); max-width: 420px; text-align: center; }
#load-curtain.is-failed .lc-note { color: var(--candy-pink); font-size: 16px; }
#load-curtain.is-failed .lc-bar, #load-curtain.is-failed .lc-runner { display: none; }

.lc-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 15%;
  background: linear-gradient(180deg, rgba(11, 8, 20, 0) 0%, rgba(11, 8, 20, 0.75) 40%, #0B0814 100%); }
.lc-ground::after { content: ''; position: absolute; left: 0; right: 0; bottom: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 245, 0.35) 30%, rgba(201, 168, 245, 0.35) 70%, transparent); }
.lc-runner { position: absolute; left: -140px; bottom: 3%; width: 112px; height: 112px; animation: lc-run 7s linear infinite; will-change: transform; }
.lc-runner img { width: 100%; height: 100%; display: block; animation: lc-gallop 0.42s ease-in-out infinite; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, 0.55)); transform-origin: 50% 90%; }
.lc-dust { position: absolute; left: 6px; bottom: 6px; width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 245, 0.45), rgba(201, 168, 245, 0) 70%); animation: lc-dust 0.84s ease-out infinite; }
.lc-dust:nth-child(2) { animation-delay: 0.28s; left: 2px; }
.lc-dust:nth-child(3) { animation-delay: 0.56s; left: 10px; }
.lc-copyright { position: absolute; left: 0; right: 0; bottom: 0; text-align: center; font-size: 10px; line-height: 14px; color: rgba(201, 168, 245, 0.75); padding: 3px 12px; background: rgba(11, 8, 20, 0.62); z-index: 2; }
.lc-copyright .cr-short { display: none; }
@media (max-height: 460px) { .lc-copyright { font-size: 8px; line-height: 11px; padding: 2px 8px; } #load-curtain { gap: 6px; } .lc-crest { width: 52px; height: 52px; } }

@keyframes lc-breathe { 0%, 100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes lc-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes lc-rise { 0% { opacity: 0; transform: translateY(0) scale(0.8); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-46vh) translateX(18px) scale(1.2); } }
@keyframes lc-run { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 280px)); } }
@keyframes lc-gallop { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-9px) rotate(5deg); } }
@keyframes lc-dust { 0% { opacity: 0.7; transform: translate(0, 0) scale(0.6); } 100% { opacity: 0; transform: translate(-34px, -10px) scale(1.6); } }
@keyframes lc-flutter {
  0% { opacity: 0; transform: translateY(0) rotate(0deg); }
  12% { opacity: 0.85; }
  50% { transform: translateY(-50vh) translateX(40px) rotate(160deg); }
  85% { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-95vh) translateX(-20px) rotate(320deg); }
}
@media (prefers-reduced-motion: reduce) {
  .lc-glow, .lc-fog, .lc-ember, .lc-page, .lc-runner, .lc-runner img, .lc-dust, #rotate-prompt .rp-device { animation: none !important; }
  .lc-runner { left: 50%; margin-left: -56px; }
}

/* The account dialog sits over the canvas. On a phone, inputs at 16px so iOS does not zoom the page. */
html[data-device="phone"] .ud-overlay input, html[data-device="phone"] .ud-overlay select,
html[data-device="phone"] .ud-overlay textarea { font-size: 16px; }
