/* Toby & Fred game chrome — the shared "frame" every game wears.
   Each game sets --tf-accent so the chrome tints to its own palette.
   Loaded from /css/games/chrome.css before the game's own styles. */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@700;800&family=Be+Vietnam+Pro:wght@400;500;700&display=swap');

:root {
  --tf-accent: #0055c4;
  --tf-ink: #0b0a14;
  --tf-paper: #f7f5ff;
  --tf-head: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  --tf-body: 'Be Vietnam Pro', 'Segoe UI', system-ui, sans-serif;
}

/* ---- back-to-games pill ---- */
.tf-back {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 10px;
  border-radius: 999px;
  font: 700 13px/1 var(--tf-head);
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  cursor: pointer !important;
  pointer-events: auto;
  background: color-mix(in srgb, var(--tf-accent) 22%, rgba(8, 6, 16, .62));
  border: 1px solid color-mix(in srgb, var(--tf-accent) 55%, rgba(255, 255, 255, .25));
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform .15s ease, background .15s ease;
  user-select: none;
}
.tf-back:hover { transform: translateY(-1px) scale(1.03); background: color-mix(in srgb, var(--tf-accent) 40%, rgba(8, 6, 16, .7)); }
.tf-back:active { transform: scale(.97); }
.tf-back svg { width: 14px; height: 14px; display: block; }
.tf-back .tf-back-title { opacity: .7; font-weight: 500; font-family: var(--tf-body); }
@media (max-width: 520px) { .tf-back .tf-back-title { display: none; } }

/* ---- HUD pill (games can reuse for score/timer) ---- */
.tf-hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font: 700 13px/1 var(--tf-head);
  color: #fff;
  background: rgba(8, 6, 16, .55);
  border: 1px solid color-mix(in srgb, var(--tf-accent) 45%, transparent);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* ---- centred panel (title / game over / pause) ---- */
.tf-scrim {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, .45), rgba(0, 0, 0, .78));
  animation: tf-fade .25s ease both;
  cursor: default !important;
}
.tf-panel {
  position: relative;
  width: min(440px, 100%);
  padding: 26px 26px 22px;
  border-radius: 22px;
  text-align: center;
  color: #fff;
  font-family: var(--tf-body);
  background:
    linear-gradient(160deg, color-mix(in srgb, var(--tf-accent) 28%, #14111f), #0f0d18 60%);
  border: 2px solid color-mix(in srgb, var(--tf-accent) 70%, #fff 10%);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, .35),
    0 0 46px color-mix(in srgb, var(--tf-accent) 45%, transparent),
    0 24px 60px rgba(0, 0, 0, .55),
    inset 0 1px 0 rgba(255, 255, 255, .14);
  animation: tf-pop .32s cubic-bezier(.2, 1.4, .4, 1) both;
}
.tf-panel::before {
  content: '';
  position: absolute;
  left: 50%;
  top: -3px;
  width: 44%;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--tf-accent), transparent);
  filter: blur(.4px);
}
.tf-kicker {
  font: 700 11px/1 var(--tf-head);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--tf-accent) 70%, #fff);
  margin-bottom: 8px;
}
.tf-title {
  font: 800 clamp(30px, 7vw, 44px)/1.05 var(--tf-head);
  letter-spacing: -.01em;
  margin: 0 0 6px;
  background: linear-gradient(#fff, color-mix(in srgb, var(--tf-accent) 35%, #fff) 60%, color-mix(in srgb, var(--tf-accent) 80%, #fff));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 3px 0 rgba(0, 0, 0, .55));
}
.tf-sub { margin: 0 0 14px; font-size: 15px; color: rgba(255, 255, 255, .78); }
.tf-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
}
.tf-stat {
  min-width: 92px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .1);
}
.tf-stat b { display: block; font: 800 20px/1.1 var(--tf-head); color: #fff; }
.tf-stat span { display: block; margin-top: 3px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .6); }
.tf-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

/* ---- buttons (Mythos .bbtn pattern: --c + color-mix) ---- */
.tf-btn {
  --c: var(--tf-accent);
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 0;
  font: 800 15px/1 var(--tf-head);
  letter-spacing: .02em;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(color-mix(in srgb, var(--c) 78%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 80%, #000));
  box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 45%, #000), 0 8px 18px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .35);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
  user-select: none;
}
.tf-btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.tf-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--c) 45%, #000), 0 3px 8px rgba(0, 0, 0, .35); }
.tf-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.tf-btn.ghost {
  background: rgba(255, 255, 255, .08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22);
  text-shadow: none;
}
.tf-btn.ghost:hover { background: rgba(255, 255, 255, .14); }

/* ---- toast ---- */
.tf-toast-wrap {
  position: fixed;
  left: 50%;
  top: 14%;
  z-index: 58;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}
.tf-toast {
  padding: 9px 16px;
  border-radius: 999px;
  font: 700 14px/1 var(--tf-head);
  color: #fff;
  background: color-mix(in srgb, var(--tf-accent) 35%, rgba(8, 6, 16, .8));
  border: 1px solid color-mix(in srgb, var(--tf-accent) 70%, #fff 10%);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
  animation: tf-toast .28s cubic-bezier(.2, 1.4, .4, 1) both;
}
.tf-toast.out { animation: tf-toast-out .3s ease both; }

/* ---- keyboard hints ---- */
.tf-keys { margin-top: 12px; font-size: 12px; color: rgba(255, 255, 255, .5); }
.tf-keys kbd {
  display: inline-block;
  padding: 2px 7px;
  margin: 0 2px;
  border-radius: 6px;
  font: 700 11px/1.4 var(--tf-head);
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: 0 2px 0 rgba(0, 0, 0, .4);
}
@media (pointer: coarse) { .tf-keys { display: none; } }

@keyframes tf-pop { from { opacity: 0; transform: translateY(18px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes tf-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tf-toast { from { opacity: 0; transform: translateY(-14px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes tf-toast-out { to { opacity: 0; transform: translateY(-8px); } }

@media (prefers-reduced-motion: reduce) {
  .tf-panel, .tf-scrim, .tf-toast, .tf-back, .tf-btn { animation: none !important; transition: none !important; }
}
