/* Filmmaker Fight Night — shared styles for the popup, account icon and the PHP pages. */
:root {
  --salmon: #e3705c;
  --salmon-deep: #b8442f;
  --ink: #111;
  --gold: #f1b800;
  --cream: #f4e6c8;
  --paper: #fbf3e2;
  --muted: #5a4a3a;
}

[hidden] { display: none !important; }

/* ---------- PHP page shell (index.html has its own inline layout) ---------- */
.ffn-page * { box-sizing: border-box; }
.ffn-page { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--salmon); color: var(--ink);
  font-family: "Courier Prime", "Courier New", monospace; font-size: 18px; line-height: 1.5; }
.ffn-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(ellipse at center, rgba(255,255,255,.08) 0%, rgba(0,0,0,.18) 100%); }
.ffn-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 76px 14px 20px; border-bottom: 3px solid var(--ink); }
.ffn-brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none;
  font-family: "Alfa Slab One", Georgia, serif; text-transform: uppercase; font-size: 18px; line-height: 1; }
.ffn-brand img { width: 44px; height: 44px; transform: rotate(-6deg); }
.ffn-nav { display: flex; gap: 18px; }
.ffn-nav a { color: var(--ink); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 15px; text-decoration: none; border-bottom: 3px solid transparent; }
.ffn-nav a:hover, .ffn-nav a:focus-visible { border-bottom-color: var(--ink); }
.ffn-main { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 40px 20px 56px; }
.ffn-foot { text-align: center; padding: 24px 16px; font-size: 14px; border-top: 3px solid var(--ink); }
.ffn-foot a { color: var(--ink); }
.ffn-page h1 { font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; text-transform: uppercase; margin: 0 0 16px; }
.ffn-page h2 { font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; font-size: 24px; line-height: 1.15; margin: 0 0 12px; }
.ffn-page p { margin: 0 0 14px; }
.ffn-page .badge { display: inline-block; background: var(--gold); border: 3px solid var(--ink); padding: 4px 14px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; font-size: 14px; margin-bottom: 18px; transform: rotate(-2deg); }
.ffn-card { background: var(--paper); border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--ink); padding: 28px; margin-bottom: 32px; }
.ffn-center { text-align: center; max-width: 640px; margin-left: auto; margin-right: auto; }
.ffn-lede { max-width: 40em; }
.ffn-muted { color: var(--muted); font-size: 15px; }

/* ---------- Buttons (same look as the home page button) ---------- */
.btn, .ffn-btn { display: inline-block; background: var(--ink); color: var(--cream); font-family: "Alfa Slab One", Georgia, serif; font-size: 20px;
  text-transform: uppercase; text-decoration: none; padding: 14px 28px; border: 0; cursor: pointer; box-shadow: 6px 6px 0 var(--gold);
  transition: transform .12s ease, box-shadow .12s ease; line-height: 1.2; }
.btn:hover, .btn:focus-visible, .ffn-btn:hover, .ffn-btn:focus-visible { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--gold); }
.ffn-btn[disabled], .ffn-btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; box-shadow: 4px 4px 0 var(--gold); }
.ffn-btn-sm { font-size: 16px; padding: 10px 18px; box-shadow: 4px 4px 0 var(--gold); }
.ffn-btn-ghost { background: transparent; color: var(--ink); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.ffn-btn-ghost:hover, .ffn-btn-ghost:focus-visible { box-shadow: 6px 6px 0 var(--ink); }
.ffn-btn-danger { background: var(--salmon-deep); color: #fff; }
.ffn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--ink); text-decoration: underline; cursor: pointer; }

/* ---------- Account icon (top-right on every page) ---------- */
.ffn-acct { position: fixed; top: 12px; right: 14px; z-index: 900; width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--paper); color: var(--ink); border: 3px solid var(--ink); border-radius: 50%; box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer; text-decoration: none; padding: 0; }
.ffn-acct:hover, .ffn-acct:focus-visible { background: var(--gold); }
.ffn-acct svg { width: 24px; height: 24px; }
.ffn-acct[data-state="in"]::after { content: ""; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px;
  background: var(--gold); border: 3px solid var(--ink); border-radius: 50%; }

/* ---------- Popup ---------- */
.ffn-dialog { margin: auto; border: 0; padding: 0; background: transparent; max-width: min(480px, calc(100vw - 32px)); width: 100%; overflow: visible; color: var(--ink); }
.ffn-dialog::backdrop { background: rgba(17,17,17,.6); }
.ffn-modal { position: relative; background: var(--paper); border: 4px solid var(--ink); box-shadow: 10px 10px 0 var(--gold);
  padding: 30px 26px 24px; font-family: "Courier Prime", "Courier New", monospace; font-size: 17px; line-height: 1.45;
  max-height: calc(100vh - 48px); overflow-y: auto; }
.ffn-modal * { box-sizing: border-box; }
.ffn-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; background: none; font-size: 28px; line-height: 1;
  cursor: pointer; color: var(--ink); font-family: inherit; }
.ffn-x:hover, .ffn-x:focus-visible { color: var(--salmon-deep); }
.ffn-modal h2 { font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; font-size: 25px; line-height: 1.12; margin: 0 34px 8px 0; text-transform: none; }
.ffn-sub { font-family: "Alfa Slab One", Georgia, serif; font-style: italic; font-weight: 400; font-size: 20px; line-height: 1.2;
  color: var(--salmon-deep); margin: 0 0 20px; transform: rotate(-1.5deg); transform-origin: left; display: inline-block; }
.ffn-modal p { margin: 0 0 14px; }
.ffn-field { display: block; margin: 0 0 14px; }
.ffn-field > span { display: block; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 13px; margin-bottom: 4px; }
.ffn-input, .ffn-modal input[type="text"], .ffn-modal input[type="email"], .ffn-modal input[type="password"], .ffn-modal select,
.ffn-page input[type="text"], .ffn-page input[type="email"], .ffn-page input[type="password"], .ffn-page textarea, .ffn-page select {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff; border: 3px solid var(--ink); border-radius: 0; padding: 10px 12px; }
.ffn-modal select, .ffn-page select { appearance: none; -webkit-appearance: none; padding-right: 36px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%23111' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 12px center; }
.ffn-modal input:focus, .ffn-modal select:focus, .ffn-page input:focus, .ffn-page textarea:focus, .ffn-page select:focus { outline: 3px solid var(--gold); outline-offset: 0; }
.ffn-pass { position: relative; }
.ffn-pass input { padding-right: 70px; }
.ffn-pass button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; font: inherit;
  font-size: 13px; font-weight: 700; text-transform: uppercase; cursor: pointer; padding: 6px; color: var(--ink); }
.ffn-code { font-size: 30px !important; letter-spacing: .4em; text-align: center; font-weight: 700; }
.ffn-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.ffn-modal .ffn-btn { width: 100%; margin-top: 6px; }
.ffn-alt { margin-top: 18px; font-size: 15px; text-align: center; }
.ffn-alt p { margin: 0 0 6px; }
.ffn-err { background: #fff; border: 3px solid var(--salmon-deep); color: var(--salmon-deep); font-weight: 700; padding: 8px 12px; margin: 0 0 14px; font-size: 15px; }
.ffn-ok { background: #fff; border: 3px solid var(--ink); padding: 8px 12px; margin: 0 0 14px; font-size: 15px; }
.ffn-fine { font-size: 13px; color: var(--muted); margin-top: 12px !important; }
.ffn-busy { opacity: .6; pointer-events: none; }

/* ---------- Toast ---------- */
.ffn-toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 1100; background: var(--ink); color: var(--cream);
  padding: 12px 18px; font-family: "Courier Prime", "Courier New", monospace; font-weight: 700; font-size: 16px; box-shadow: 5px 5px 0 var(--gold);
  max-width: calc(100vw - 32px); }

/* ---------- Films gallery ---------- */
.ffn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 28px; }
.ffn-film { background: var(--paper); border: 4px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); display: flex; flex-direction: column; }
.ffn-film a.ffn-thumb { display: block; aspect-ratio: 16 / 9; background: var(--ink) center / cover no-repeat; border-bottom: 4px solid var(--ink); position: relative; }
.ffn-film a.ffn-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ffn-film a.ffn-thumb::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--cream); font-size: 36px;
  text-shadow: 2px 2px 0 var(--ink); opacity: .85; }
.ffn-film-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.ffn-film h3 { font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; font-size: 20px; line-height: 1.15; margin: 0; }
.ffn-film h3 a { color: var(--ink); text-decoration: none; }
.ffn-by { font-size: 14px; color: var(--muted); margin: 0; }
.ffn-film .ffn-vote { margin-top: auto; align-self: flex-start; }
.ffn-vote-note { font-size: 14px; margin: 0 0 24px; }
.ffn-preview-bar { background: var(--gold); border: 3px solid var(--ink); padding: 8px 14px; font-weight: 700; margin-bottom: 24px; font-size: 15px; }

/* ---------- Single film page ---------- */
.ffn-player { position: relative; aspect-ratio: 16 / 9; background: var(--ink); border: 5px solid var(--ink); box-shadow: 12px 12px 0 var(--ink); margin-bottom: 28px; }
.ffn-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ffn-player .ffn-processing { position: absolute; inset: 0; display: grid; place-items: center; color: var(--cream); text-align: center; padding: 20px; }
.ffn-film-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 18px 28px; margin-bottom: 18px; }
.ffn-film-head h1 { margin-bottom: 6px; }
.ffn-desc { white-space: pre-line; max-width: 42em; }
.ffn-share h2 { margin-bottom: 14px; }
.ffn-copy { display: flex; gap: 0; margin-bottom: 16px; }
.ffn-copy input { flex: 1; min-width: 0; border-right: 0 !important; font-size: 15px !important; background: #fff; }
.ffn-copy button { flex: none; box-shadow: none; padding: 10px 18px; font-size: 16px; }
.ffn-copy button:hover, .ffn-copy button:focus-visible { transform: none; box-shadow: none; background: var(--salmon-deep); }
.ffn-socials { display: flex; flex-wrap: wrap; gap: 10px; }
.ffn-socials a, .ffn-socials button { display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: 15px; font-weight: 700; color: var(--ink);
  background: #fff; border: 3px solid var(--ink); padding: 7px 12px; text-decoration: none; cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.ffn-socials a:hover, .ffn-socials a:focus-visible, .ffn-socials button:hover, .ffn-socials button:focus-visible { background: var(--gold); }
.ffn-socials svg { width: 18px; height: 18px; flex: none; }

/* ---------- Forms on pages (submit, account) ---------- */
.ffn-form { max-width: 560px; }
.ffn-form .ffn-field textarea { min-height: 120px; resize: vertical; }
.ffn-drop { display: block; border: 4px dashed var(--ink); background: #fff; padding: 28px 18px; text-align: center; cursor: pointer; margin-bottom: 16px; }
.ffn-drop:hover, .ffn-drop.is-over { background: var(--cream); }
.ffn-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.ffn-drop:focus-within { outline: 3px solid var(--gold); }
.ffn-progress { height: 22px; border: 3px solid var(--ink); background: #fff; margin: 12px 0 8px; }
.ffn-progress > div { height: 100%; width: 0; background: var(--gold); transition: width .2s ease; }
.ffn-settings { display: grid; gap: 32px; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.ffn-settings .ffn-card { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.ffn-settings .ffn-card > :last-child { margin-bottom: 0; }
.ffn-settings .ffn-wide { grid-column: 1 / -1; }
.ffn-settings form { display: flex; flex-direction: column; flex: 1; }
.ffn-settings form > .ffn-btn, .ffn-settings .ffn-push { margin-top: auto; align-self: flex-start; }
.ffn-settings form > .ffn-field:last-of-type { margin-bottom: 22px; }
.ffn-page a[href^="mailto:"], .ffn-card a:not([class]) { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 3px; overflow-wrap: anywhere; }
.ffn-page a[href^="mailto:"]:hover, .ffn-card a:not([class]):hover { background: var(--gold); }
.ffn-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.ffn-check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex: none; }

/* ---------- Admin ---------- */
.ffn-invite { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 18px; }
.ffn-invite .ffn-field { flex: 1 1 260px; margin: 0; }
.ffn-invite input { width: 100%; }
.ffn-row-actions { display: flex; gap: 14px; }
.ffn-row-actions form { margin: 0; }
.ffn-table-wrap { overflow-x: auto; border: 3px solid var(--ink); background: #fff; margin-bottom: 20px; }
.ffn-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.ffn-table th, .ffn-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #ddd; white-space: nowrap; }
.ffn-table th { background: var(--cream); border-bottom: 3px solid var(--ink); text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.ffn-stats { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 24px; }
.ffn-stat { background: var(--paper); border: 3px solid var(--ink); padding: 10px 16px; min-width: 140px; }
.ffn-stat b { display: block; font-family: "Alfa Slab One", Georgia, serif; font-weight: 400; font-size: 28px; line-height: 1.1; }

@media (max-width: 760px) {
  .ffn-top { padding: 12px 70px 12px 14px; flex-wrap: wrap; }
  .ffn-brand span { font-size: 15px; }
  .ffn-nav { gap: 14px; }
  .ffn-main { padding: 28px 16px 44px; }
  .ffn-settings { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .ffn-card { padding: 22px 18px; box-shadow: 7px 7px 0 var(--ink); }
  .ffn-modal { padding: 26px 18px 20px; }
  .ffn-modal h2 { font-size: 22px; }
  .ffn-acct { top: 10px; right: 10px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .ffn-btn, .ffn-progress > div { transition: none; }
}
