@font-face {
  font-family: 'Pixelify Sans';
  src: url('/fonts/pixelify-sans-variable.ttf') format('truetype');
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
}
:root {
  --felt: #1d2f5c; --felt2: #0f1b3a; --panel: #0a1530; --line: #050a1a;
  --ink: #f6f0de; --muted: #a9b6d6; --gold: #f5c542; --gold2: #ffe08a;
  --red: #e5484d; --red2: #a82a30; --key: #3d5aa8; --key2: #243670; --bad: #ff8a8a;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --felt: #19284f; --felt2: #0b1530; --panel: #08112a; }
}
:root[data-theme="dark"] { --felt: #19284f; --felt2: #0b1530; --panel: #08112a; }
html { min-height: 100%; scroll-padding-top: env(safe-area-inset-top, 0px); }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100%; background: var(--felt2); color: var(--ink);
  font-family: 'Pixelify Sans', ui-monospace, Menlo, Consolas, monospace;
  overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: -50%; z-index: 0; pointer-events: none;
  background: conic-gradient(from 0deg, var(--felt), var(--felt2), var(--felt), var(--felt2), var(--felt));
  animation: swirl 40s linear infinite; opacity: .9;
}
body::after {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px);
}
@keyframes swirl { to { transform: rotate(360deg); } }
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; border: 0; }
a { color: var(--gold2); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
main { position: relative; z-index: 1; overflow-wrap: anywhere; }
.wrap {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; justify-content: center; gap: 18px;
  padding: 24px max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px));
}
.brand { text-align: center; }
.brand h1 { margin: 4px 0 0; font-size: 30px; text-shadow: 0 3px 0 var(--line); }
.panel {
  background: var(--panel); border: 3px solid var(--line); border-radius: 14px;
  padding: 20px 18px; box-shadow: 0 5px 0 var(--line), inset 0 0 0 2px rgba(255,255,255,.06);
  display: flex; flex-direction: column; gap: 14px;
}
.panel form { display: flex; flex-direction: column; gap: 14px; }
.panel h2, .app h1 { margin: 0; font-size: 24px; color: var(--gold); }
.panel p, .app p { margin: 0; font-size: 15px; color: var(--muted); line-height: 1.4; }
.f { display: flex; flex-direction: column; gap: 6px; }
.f label { font-size: 14px; color: var(--muted); letter-spacing: .04em; }
.in { display: flex; gap: 8px; }
.wrap input[type=text], .wrap input[type=email], .wrap input[type=password] {
  flex: 1; min-width: 0; min-height: 52px; border-radius: 10px;
  border: 3px solid var(--line); background: #050d22; color: var(--ink);
  font-size: 18px; padding: 0 12px; outline: none;
}
.wrap input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245,197,66,.35); }
.wrap input[aria-invalid="true"] { border-color: var(--bad); }
.eye {
  width: 52px; flex: none; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; border: 3px solid var(--line); background: var(--key); box-shadow: 0 3px 0 var(--key2);
}
.eye:active { transform: translateY(3px); box-shadow: none; }
.eye svg { display: block; }
.eye .off { display: none; }
.eye[aria-pressed="true"] .on { display: none; }
.eye[aria-pressed="true"] .off { display: block; }
.err, .panel p.err { min-height: 18px; font-size: 14px; color: var(--bad); }
.meter { display: flex; gap: 4px; }
.meter i { flex: 1; height: 8px; border-radius: 3px; background: #1b2850; border: 2px solid var(--line); }
.meter i.on { background: var(--gold); }
.meter i.on.w { background: var(--red); }
.meter i.on.g { background: #3ddc84; }
.hint, .panel p.hint { font-size: 13px; color: var(--muted); }
.chk { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--muted); min-height: 44px; }
.chk input { width: 22px; height: 22px; accent-color: var(--gold); }
.btn {
  min-height: 58px; border-radius: 12px; background: var(--red); border: 3px solid var(--line);
  box-shadow: 0 6px 0 var(--red2), 0 6px 0 3px var(--line);
  font-size: 22px; font-weight: 700; letter-spacing: .08em; text-shadow: 0 2px 0 var(--red2);
}
.btn:active:not(:disabled) { transform: translateY(4px); box-shadow: none; }
.btn:disabled { background: #4a5470; box-shadow: 0 6px 0 #2e3650, 0 6px 0 3px var(--line); color: #a9b3c9; text-shadow: none; cursor: not-allowed; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.centered { justify-content: center; }
.lnk { display: inline-flex; align-items: center; background: transparent; color: var(--gold2); text-decoration: underline; font-size: 15px; min-height: 44px; padding: 0 4px; }
.lnk:disabled { color: var(--muted); cursor: not-allowed; }
.ok { display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; padding: 8px 0; }
.note { font-size: 12px; color: var(--muted); text-align: center; line-height: 1.4; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.app {
  max-width: 430px; margin: 0 auto; min-height: 100vh;
  display: flex; flex-direction: column; gap: 14px;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) 20px max(16px, env(safe-area-inset-left, 0px));
}
.screen { background: var(--panel); border: 3px solid var(--line); border-radius: 12px; padding: 12px 16px; box-shadow: 0 4px 0 var(--line), inset 0 0 0 2px rgba(255,255,255,.06); display: flex; flex-direction: column; gap: 14px; }
.screen h2 { margin: 0; font-size: 24px; color: var(--gold); }
.cards { list-style: none; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 10px 0 0; }
.card {
  position: relative; min-height: 74px; border-radius: 10px; background: #f6f0de; color: #1b1b1b;
  border: 3px solid var(--line); box-shadow: 0 4px 0 var(--line); font-size: 17px; font-weight: 600;
  display: flex; align-items: flex-end; justify-content: center; padding: 0 4px 8px;
}
.card::before { position: absolute; top: 4px; left: 7px; font-size: 18px; }
.card:nth-child(1)::before { content: '♥'; color: #c8323a; }
.card:nth-child(2)::before { content: '♠'; }
.card:nth-child(3)::before { content: '♦'; color: #c8323a; }
.card:nth-child(4)::before { content: '♣'; }
.card:nth-child(5)::before { content: '★'; color: #c8323a; }
.card:nth-child(6)::before { content: '✦'; }
.card:nth-child(odd) { transform: rotate(-1.5deg); }
.card:nth-child(even) { transform: rotate(1.5deg); }
.app .btn { width: 100%; }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { body::before { animation: none; } }
#svelte-announcer {
  position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px;
}
/* Auth-only effects: no Catat selectors or stylesheet changes. */
[data-auth-panel] { position: relative; }
[data-auth-client-status]:empty { display: none; }
[data-auth-feedback] {
  position: absolute; inset: 0; z-index: 7; pointer-events: none;
  border-radius: inherit;
}
[data-auth-panel].auth-shake { animation: auth-shake 350ms ease-out; }
@keyframes auth-shake {
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
[data-auth-feedback] .auth-particle {
  position: absolute; left: 50%; top: 50%; width: 6px; height: 6px;
  background: currentColor; box-shadow: 0 0 5px currentColor;
  animation: auth-burst 1200ms ease-out both;
}
[data-auth-feedback] .auth-particle:nth-child(odd) {
  clip-path: polygon(50% 0, 65% 35%, 100% 50%, 65% 65%, 50% 100%, 35% 65%, 0 50%, 35% 35%);
}
.auth-gold-0 { color: #f5c542; }
.auth-gold-1 { color: #ffe08a; }
.auth-gold-2 { color: #ffd23f; }
.auth-gold-3 { color: #fff3c4; }
.auth-gold-4 { color: #e0a526; }
@keyframes auth-burst {
  from { opacity: 1; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 0; transform: translate(var(--auth-x), var(--auth-y)) rotate(var(--auth-turn)); }
}
@media (prefers-reduced-motion: reduce) {
  [data-auth-panel].auth-shake { animation: none; }
  [data-auth-feedback] .auth-particle {
    animation: auth-fade 1200ms ease-out both;
    left: calc(50% + var(--auth-x)); top: 30%;
  }
}
@keyframes auth-fade { from { opacity: 1; } to { opacity: 0; } }

