/* Arrow Escape website. Same palette as the game's Midnight theme. */
@font-face {
  font-family: "Fredoka";
  src: url("../fonts/fredoka-bold.ttf") format("truetype");
  font-weight: 600 700;
  font-display: swap;
}

:root {
  --bg: #0b0d21;
  --bg2: #1a1f45;
  --panel: rgba(35, 42, 92, 0.72);
  --panel-solid: #232a5c;
  --line: rgba(156, 163, 216, 0.18);
  --text: #f4f5ff;
  --dim: #9ca3d8;
  --accent: #7c6cff;
  --accent-deep: #5847e0;
  --pink: #ff86c0;
  --mint: #5fe3c4;
  --gold: #ffcf6a;
  --blue: #8fa8ff;
  --danger: #ff5470;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(3, 4, 15, 0.45);
  --maxw: 1140px;
  --head: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(1200px 700px at 80% -10%, #2a2470 0%, transparent 60%),
              radial-gradient(900px 600px at -10% 30%, #13305a 0%, transparent 55%),
              linear-gradient(180deg, var(--bg2) 0%, var(--bg) 60%);
  background-color: var(--bg);
  color: var(--text);
  font: 400 17px/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; line-height: 1.12; letter-spacing: 0.2px; margin: 0 0 0.5em; }
h1 { font-size: clamp(2.3rem, 5.6vw, 4.1rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); text-align: center; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.muted { color: var(--dim); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 8px; }

.bg { position: fixed; inset: 0; pointer-events: none; z-index: -1; }
.bg-arrows { width: 100%; height: 100%; opacity: 0.55; }

/* ------------------------------------------------------------------ top bar */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: var(--maxw); margin: 0 auto; padding: 14px 20px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  background: linear-gradient(180deg, rgba(11, 13, 33, 0.85), rgba(11, 13, 33, 0.35));
  border-radius: 0 0 20px 20px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font: 600 1.25rem var(--head); }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; }
.brand b { color: var(--accent); filter: brightness(1.25); }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--dim); font-weight: 600; }
.nav a:hover { color: var(--text); text-decoration: none; }
.nav a.btn { color: #fff; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--accent); color: #fff; font: 700 1.05rem var(--head); letter-spacing: 0.3px;
  box-shadow: 0 5px 0 var(--accent-deep), 0 14px 30px rgba(124, 108, 255, 0.35);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.2s;
}
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--accent-deep), 0 6px 16px rgba(124, 108, 255, 0.3); }
.btn-small { padding: 9px 18px; font-size: 0.95rem; box-shadow: 0 4px 0 var(--accent-deep); }
.btn-ghost { background: rgba(255, 255, 255, 0.07); color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-ghost:active { transform: translateY(2px); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn-play {
  background: #0d0f1f; color: #fff; padding: 11px 26px 11px 20px; border-radius: 16px; text-align: left;
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.28), 0 14px 32px rgba(0, 0, 0, 0.4);
}
.btn-play svg { color: var(--mint); }
.btn-play span { display: flex; flex-direction: column; line-height: 1.1; font-size: 1.25rem; }
.btn-play small { font: 500 0.72rem var(--body); color: var(--dim); letter-spacing: 0.4px; text-transform: uppercase; }
.btn-play:active { transform: translateY(2px); box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.28); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ------------------------------------------------------------------ hero */
.hero {
  max-width: var(--maxw); margin: 0 auto; padding: 46px 20px 30px;
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
}
.eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--mint); font-weight: 700; font-size: 0.92rem;
  background: rgba(95, 227, 196, 0.1); border: 1px solid rgba(95, 227, 196, 0.3); padding: 6px 14px; border-radius: 99px; }
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); animation: pulse 1.6s infinite; }
.hero h1 { margin-top: 18px; }
.grad { background: linear-gradient(90deg, var(--accent) 0%, var(--pink) 50%, var(--gold) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: brightness(1.2); }
.lede { font-size: 1.15rem; color: #d3d7ff; max-width: 34em; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; margin: 28px 0 22px; }
.pills { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.pills li { padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); color: var(--dim); font-weight: 600; font-size: 0.9rem; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; text-align: center; padding-top: 26px; }
  .lede { margin-left: auto; margin-right: auto; }
  .cta-row, .pills { justify-content: center; }
}

/* ------------------------------------------------------------------ phone + demo */
.hero-phone { display: flex; flex-direction: column; align-items: center; scroll-margin-top: 90px; }
.phone {
  position: relative; width: min(330px, 86vw); aspect-ratio: 9 / 18.5; border-radius: 46px; padding: 12px;
  background: linear-gradient(145deg, #3b3f72, #15183a 40%, #2b2f63);
  box-shadow: var(--shadow), 0 0 0 1.5px rgba(255, 255, 255, 0.08), 0 0 80px rgba(124, 108, 255, 0.25);
}
.phone-notch { position: absolute; top: 20px; left: 50%; width: 92px; height: 24px; transform: translateX(-50%); background: #05060f; border-radius: 99px; z-index: 2; }
.demo {
  position: relative; width: 100%; height: 100%; border-radius: 36px; overflow: hidden;
  background: linear-gradient(180deg, #1a1f45, #0b0d21);
  display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: manipulation;
}
.demo-top { display: flex; justify-content: space-between; align-items: center; padding: 54px 22px 6px; font: 700 1.1rem var(--head); }
.demo-hearts { color: #ff4d6d; letter-spacing: 3px; font-size: 1.15rem; }
.demo-hearts .lost { color: rgba(255, 255, 255, 0.15); }
.demo-canvas { flex: 1; width: 100%; cursor: pointer; }
.demo-hint { text-align: center; color: var(--dim); font-size: 0.85rem; padding: 6px 12px 22px; transition: opacity 0.4s; }
.demo-overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: rgba(11, 13, 33, 0.82); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); text-align: center; padding: 30px;
  animation: fadein 0.3s ease;
}
.demo-overlay[hidden] { display: none; }
.demo-msg { font: 700 1.6rem var(--head); margin: 0; }
.demo-store { color: var(--mint); font-weight: 700; font-size: 0.95rem; }
.phone-caption { color: var(--dim); font-size: 0.9rem; margin-top: 14px; }

/* ------------------------------------------------------------------ stats */
.stats { max-width: 920px; margin: 10px auto 0; padding: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stats[hidden] { display: none; }
.stat { text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px 6px; }
.stat b { display: block; font: 700 1.7rem var(--head); color: var(--gold); }
.stat span { color: var(--dim); font-size: 0.85rem; }
@media (max-width: 640px) { .stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------------ sections */
.section { max-width: var(--maxw); margin: 0 auto; padding: 70px 20px 10px; scroll-margin-top: 70px; }
.sub { text-align: center; color: var(--dim); margin-top: -6px; }

.steps { list-style: none; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; text-align: center; }
.step-art { width: 150px; height: 100px; margin: 0 auto 12px; display: block; }
.step p { color: var(--dim); margin: 0; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }

.ln { fill: none; stroke-width: 9; stroke-linecap: round; stroke-linejoin: round; }
.hd { stroke-width: 3; stroke-linejoin: round; }
.c1 { stroke: var(--mint); fill: var(--mint); }
.ln.c1, .ln.c2, .ln.c3 { fill: none; }
.c2 { stroke: var(--pink); fill: var(--pink); }
.c3 { stroke: var(--blue); fill: var(--blue); }
.dt { fill: #353d78; }
.ht { fill: #ff4d6d; transform-origin: 60px 45px; animation: beat 1.4s ease-in-out infinite; }
.a-slide { animation: slide 2.4s cubic-bezier(0.55, 0, 0.8, 0.2) infinite; }
.a-bump { animation: bump 2.4s ease-in-out infinite; }

.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 36px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; transition: transform 0.2s, border-color 0.2s; }
.card:hover { transform: translateY(-4px); border-color: rgba(124, 108, 255, 0.5); }
.card p { color: var(--dim); margin: 0; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }
.ic { display: inline-block; width: 52px; height: 52px; border-radius: 16px; margin-bottom: 14px; position: relative; }
.ic::after { content: ""; position: absolute; inset: 12px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.ic-grid { color: var(--accent); background: rgba(124, 108, 255, 0.16); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 3h5v5H3zM9.5 3h5v5h-5zM16 3h5v5h-5zM3 9.5h5v5H3zM9.5 9.5h5v5h-5zM16 9.5h5v5h-5zM3 16h5v5H3zM9.5 16h5v5h-5zM16 16h5v5h-5z'/%3E%3C/svg%3E"); }
.ic-cal { color: var(--gold); background: rgba(255, 207, 106, 0.14); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h2v3H7zM15 2h2v3h-2zM3 5h18v16H3zm2 5v9h14v-9zm2 2h3v3H7z'/%3E%3C/svg%3E"); }
.ic-pal { color: var(--pink); background: rgba(255, 134, 192, 0.14); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 0 0 0 20c1.4 0 2-1 2-2 0-1.3-1-1.6-1-3 0-1.2 1-2 2.3-2H17a5 5 0 0 0 5-5c0-4.4-4.5-8-10-8zM6.5 12a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3-4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm5 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3 4a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z'/%3E%3C/svg%3E"); }
.ic-bulb { color: var(--gold); background: rgba(255, 207, 106, 0.14); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2zM9 19h6v1.5a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 20.5z'/%3E%3C/svg%3E"); }
.ic-off { color: var(--mint); background: rgba(95, 227, 196, 0.14); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2zm0 3v13h10V5zm5 14.2a1 1 0 1 0 0 1.6 1 1 0 0 0 0-1.6z'/%3E%3C/svg%3E"); }
.ic-snd { color: var(--blue); background: rgba(143, 168, 255, 0.16); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3 9h4l5-4v14l-5-4H3zM15.5 8.5a5 5 0 0 1 0 7l-1.4-1.4a3 3 0 0 0 0-4.2zM18.4 5.6a9 9 0 0 1 0 12.8L17 17a7 7 0 0 0 0-10z'/%3E%3C/svg%3E"); }

.gallery { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 30px 6px 26px; margin-top: 10px; scrollbar-width: thin; }
.gallery figure { margin: 0; flex: 0 0 auto; width: clamp(200px, 26vw, 250px); scroll-snap-align: center; border-radius: 28px; overflow: hidden;
  box-shadow: var(--shadow), 0 0 0 6px #1d2150, 0 0 0 7.5px rgba(255, 255, 255, 0.08); }

.board { max-width: 640px; margin: 28px auto 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 18px; }
.board-table { width: 100%; border-collapse: collapse; }
.board-table th { text-align: left; color: var(--dim); font-weight: 600; font-size: 0.85rem; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.board-table td { padding: 10px 8px; border-bottom: 1px solid rgba(156, 163, 216, 0.08); }
.board-table tr:last-child td { border-bottom: 0; }
.board-table td:first-child { font: 700 1rem var(--head); color: var(--dim); width: 48px; }
.board-table tr.r1 td:first-child { color: var(--gold); }
.board-table tr.r2 td:first-child { color: #c9d3e3; }
.board-table tr.r3 td:first-child { color: #e3a26f; }

.faq { max-width: 820px; }
.faq details { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 4px 20px; margin: 12px 0; }
.faq summary { cursor: pointer; font: 600 1.08rem var(--head); padding: 14px 0; list-style: none; position: relative; padding-right: 30px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 10px; font-size: 1.5rem; color: var(--accent); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--dim); }

.final { text-align: center; padding-bottom: 90px; }
.final .btn-play { margin-top: 10px; }

/* ------------------------------------------------------------------ legal */
.legal { max-width: 780px; margin: 0 auto; padding: 40px 22px 70px; }
.legal h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.legal h2 { text-align: left; font-size: 1.35rem; margin-top: 1.8em; }
.legal p, .legal li { color: #d3d7ff; }
.legal ul, .legal ol { padding-left: 1.3em; }
.legal li { margin: 0.35em 0; }
.howto li { margin: 0.6em 0; }

.notfound { text-align: center; padding: 70px 20px 120px; }
.nf-art svg { width: 240px; margin: 0 auto 10px; display: block; animation: slide 2.4s cubic-bezier(0.55, 0, 0.8, 0.2) infinite; }

/* ------------------------------------------------------------------ footer */
.footer { border-top: 1px solid var(--line); margin-top: 40px; background: rgba(5, 6, 15, 0.4); }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 34px 20px 40px; display: grid; grid-template-columns: 1fr auto; gap: 18px 30px; align-items: center; }
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { border-radius: 12px; }
.footer-brand p { color: var(--dim); margin: 0; font-size: 0.92rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: var(--dim); }
.footer-copy { grid-column: 1 / -1; color: #6c72a8; font-size: 0.82rem; margin: 0; }
@media (max-width: 700px) { .footer-inner { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------ admin */
.admin { max-width: 1100px; margin: 0 auto; padding: 30px 20px 80px; }
.admin h2 { text-align: left; font-size: 1.4rem; margin-top: 1.6em; }
.admin-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.admin-head h1 { font-size: 1.8rem; margin: 0; }
.admin-login, .admin-filter { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin input, .admin select { background: rgba(255, 255, 255, 0.08); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
.admin-filter label { color: var(--dim); font-size: 0.9rem; display: flex; gap: 6px; align-items: center; }
.admin-filter input { width: 90px; }
.admin-error { color: var(--danger); width: 100%; margin: 0; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-top: 24px; }
.admin-cards div { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.admin-cards b { display: block; font: 700 1.6rem var(--head); color: var(--gold); }
.admin-cards span { color: var(--dim); font-size: 0.85rem; }
.admin-table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }
.admin-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.admin-table th, .admin-table td { padding: 8px 12px; text-align: right; border-bottom: 1px solid rgba(156, 163, 216, 0.1); white-space: nowrap; }
.admin-table th:first-child, .admin-table td:first-child { text-align: left; }
.admin-table .bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--mint); vertical-align: middle; margin-right: 8px; }
.admin-table tr.hard td { background: rgba(255, 84, 112, 0.09); }
.admin-table tr.easy td { background: rgba(95, 227, 196, 0.06); }
.admin-config { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; margin: 14px 0 18px; }
.admin-config label { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--dim); font-size: 0.92rem; }
.admin-config input { width: 110px; text-align: right; }

/* ------------------------------------------------------------------ motion */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }
@keyframes pulse { 50% { opacity: 0.4; } }
@keyframes fadein { from { opacity: 0; } }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.12); } 30% { transform: scale(0.98); } 45% { transform: scale(1.06); } }
@keyframes slide { 0%, 25% { transform: translateX(0); opacity: 1; } 70% { transform: translateX(70px); opacity: 0; } 71% { transform: translateX(-20px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }
@keyframes bump { 0%, 30% { transform: translateX(0); } 45% { transform: translateX(12px); } 52% { transform: translateX(6px); } 60%, 100% { transform: translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}
