@font-face { font-family: "Dela Gothic One"; src: url("/fonts/dela-gothic-one-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "M PLUS 1p"; src: url("/fonts/m-plus-1p-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "M PLUS 1p"; src: url("/fonts/m-plus-1p-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "M PLUS 1p"; src: url("/fonts/m-plus-1p-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  --black: #000;
  --yellow: #ffe11a;
  --yellow-deep: #f2c500;
  --static: #8a8a8a;
  --static-dim: #3a3a3a;
  --velvet: #1e2e8c;
  --velvet-deep: #101a5c;
  --paper: #fff7d1;
  --alarm: #e5352b;
  --ok: #47c26b;
  --text: #f5f1df;
  --muted: #b9b3a0;
  --display: "Dela Gothic One", "Arial Black", sans-serif;
  --body: "M PLUS 1p", "Hiragino Sans", "Segoe UI", sans-serif;
  --skew: -8deg;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: 2.2rem;
  --step-4: 3rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--black);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--text);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: #fff; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
img, svg { max-width: 100%; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- header: the yellow channel bar ---------- */
.bar {
  background: var(--yellow);
  color: var(--black);
  border-bottom: 4px solid var(--black);
  box-shadow: 0 4px 0 var(--yellow-deep);
}
.bar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 10px; flex-wrap: wrap; }
.brand {
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
  color: var(--black);
  text-decoration: none;
  display: inline-block;
  transform: skewX(var(--skew));
  letter-spacing: .01em;
  line-height: 1;
}
.brand small { display: block; font-family: var(--body); font-weight: 800; font-size: .7rem; letter-spacing: .04em; }
.brand:hover { color: var(--black); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--black);
  font-weight: 800;
  text-decoration: none;
  padding: 6px 12px;
  transform: skewX(var(--skew));
  display: inline-block;
}
.nav a:hover, .nav a[aria-current="page"] { background: var(--black); color: var(--yellow); }

/* ---------- page headings ---------- */
.page-head { padding: 40px 0 8px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: clamp(var(--step-3), 5vw, var(--step-4)); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
.lede { color: var(--muted); max-width: 62ch; margin: 0 0 24px; }
.tag-slant {
  display: inline-block;
  background: var(--yellow);
  color: var(--black);
  padding: 2px 14px;
  transform: skewX(var(--skew));
  font-family: var(--display);
}

/* ---------- the TV ---------- */
.tv {
  margin: 24px 0 48px;
  background: linear-gradient(160deg, #2b2b2b, #111 60%);
  border-radius: 28px;
  padding: 18px;
  box-shadow: inset 0 0 0 2px #444, 0 0 0 4px var(--black), 0 0 0 7px var(--yellow);
}
.tv-screen {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #1a1a1a, #000 75%);
  padding: clamp(16px, 3vw, 32px);
  min-height: 420px;
}
.tv-screen::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 2px, transparent 2px 4px);
  border-radius: inherit;
  box-shadow: inset 0 0 80px rgba(0,0,0,.85);
}
.tv-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 8px 0; color: var(--static); font-size: var(--step--1); gap: 12px; flex-wrap: wrap; }
.tv-led { width: 10px; height: 10px; border-radius: 50%; background: var(--alarm); box-shadow: 0 0 8px var(--alarm); display: inline-block; margin-right: 8px; vertical-align: middle; }

.modes { display: flex; gap: 6px; margin-bottom: 20px; flex-wrap: wrap; position: relative; z-index: 2; }
.modes button {
  font: 800 var(--step--1)/1 var(--body);
  background: transparent;
  color: var(--text);
  border: 2px solid var(--static-dim);
  padding: 10px 16px;
  cursor: pointer;
  transform: skewX(var(--skew));
}
.modes button[aria-selected="true"] { background: var(--yellow); color: var(--black); border-color: var(--yellow); }
.modes button:hover:not([aria-selected="true"]) { border-color: var(--yellow); }

.panel { position: relative; z-index: 2; }
.panel[hidden] { display: none; }

.slots { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.slots.three { grid-template-columns: 1fr auto 1fr auto 1fr; }
.op { font-family: var(--display); font-size: var(--step-3); color: var(--yellow); text-align: center; }

/* combobox slot */
.slot { position: relative; }
.slot label { display: block; font-weight: 800; font-size: var(--step--1); color: var(--muted); margin-bottom: 6px; }
.slot input {
  width: 100%;
  font: 700 var(--step-1)/1.2 var(--body);
  color: var(--black);
  background: var(--yellow);
  border: 0;
  padding: 14px 16px;
  clip-path: polygon(3% 0, 100% 0, 97% 100%, 0 100%);
}
.slot input::placeholder { color: rgba(0,0,0,.5); }
.slot input:focus { outline: none; background: #fff; }
.slot input:focus-visible { box-shadow: inset 0 0 0 3px var(--velvet); }
.slot .meta { min-height: 1.6em; font-size: var(--step--1); color: var(--muted); margin-top: 6px; }
.listbox {
  position: absolute; z-index: 20; left: 0; right: 0; top: 100%;
  max-height: 280px; overflow: auto;
  margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--paper); color: var(--black);
  border: 3px solid var(--black);
  box-shadow: 6px 6px 0 var(--yellow);
}
.listbox li { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.listbox li small { color: #5a5440; font-weight: 700; }
.listbox li[aria-selected="true"], .listbox li:hover { background: var(--black); color: var(--yellow); }
.listbox li[aria-selected="true"] small, .listbox li:hover small { color: var(--yellow); }

/* result */
.result { margin-top: 28px; }
.result-card {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  background: linear-gradient(135deg, var(--velvet), var(--velvet-deep));
  border: 3px solid var(--yellow);
  padding: 20px;
}
.result-card .name { font-family: var(--display); font-size: clamp(var(--step-2), 4vw, var(--step-3)); line-height: 1.1; }
.result-card .sub { color: #d7dcff; }
.result-card .actions { margin-top: 10px; display: flex; gap: 14px; flex-wrap: wrap; font-weight: 800; }
.result-empty { color: var(--static); border: 2px dashed var(--static-dim); padding: 22px; text-align: center; }
.badge { display: inline-block; font-size: .75rem; font-weight: 800; padding: 1px 8px; background: var(--yellow); color: var(--black); margin-left: 6px; vertical-align: middle; }
.badge.alt { background: var(--paper); }

.tuning { animation: tune .55s steps(6) both; }
@keyframes tune {
  0% { filter: contrast(3) brightness(2) blur(2px); opacity: .2; transform: scaleY(.04); }
  40% { opacity: 1; transform: scaleY(1.02); filter: contrast(2) brightness(1.5); }
  100% { filter: none; transform: none; }
}
.static-flash { position: absolute; inset: 0; z-index: 5; pointer-events: none; opacity: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.2' numOctaves='1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px; mix-blend-mode: screen; }
.static-flash.on { animation: flash .45s steps(5) both; }
@keyframes flash { 0%,60% { opacity: .9; background-position: 0 0; } 30% { background-position: 37px 91px; } 100% { opacity: 0; background-position: 80px 20px; } }
@media (prefers-reduced-motion: reduce) {
  .tuning, .static-flash.on { animation: none; }
}

/* tarot arcana card (original design) */
.arcana-card {
  width: 78px; aspect-ratio: 2 / 3;
  background: var(--paper);
  color: var(--black);
  border: 3px solid var(--black);
  outline: 2px solid var(--yellow);
  display: grid; place-items: center; text-align: center;
  font-family: var(--display);
  line-height: 1;
  padding: 4px;
  position: relative;
}
.arcana-card .num { font-size: 1.5rem; }
.arcana-card .nm { font-family: var(--body); font-weight: 800; font-size: .6rem; letter-spacing: .02em; }
.arcana-card.sm { width: 40px; outline-width: 1px; border-width: 2px; }
.arcana-card.sm .num { font-size: .9rem; }
.arcana-card.sm .nm { display: none; }

/* reverse results */
.recipes { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 6px; max-height: 460px; overflow: auto; }
.recipes li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 10px 12px; background: rgba(255,255,255,.04); border-left: 4px solid var(--yellow); }
.recipes .plus { color: var(--yellow); font-weight: 800; }
.recipes .lv { color: var(--muted); font-size: var(--step--1); }
.hint { color: var(--muted); font-size: var(--step--1); margin-top: 10px; }

/* ---------- content sections ---------- */
section.block { padding: 32px 0; border-top: 2px solid var(--static-dim); }
.prose { max-width: 70ch; }
.prose p, .prose li { color: var(--text); }
.prose h2 { margin-top: 1.6em; }
.prose code { background: #222; padding: 1px 6px; }

.grid-arcana { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.arcana-group { background: rgba(255,255,255,.03); border: 2px solid var(--static-dim); padding: 14px; }
.arcana-group h3 { display: flex; align-items: center; gap: 12px; font-size: var(--step-1); }
.arcana-group ul { list-style: none; padding: 0; margin: 0; }
.arcana-group li { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px dotted var(--static-dim); }
.arcana-group li span { color: var(--muted); font-size: var(--step--1); }

.filter { width: min(420px, 100%); font: 700 var(--step-0) var(--body); padding: 12px 14px; background: var(--paper); border: 3px solid var(--black); outline: 2px solid var(--yellow); margin-bottom: 20px; }

/* tables */
.table-wrap { overflow-x: auto; margin: 12px 0 24px; }
table { border-collapse: collapse; width: 100%; font-size: var(--step--1); }
th { background: var(--yellow); color: var(--black); text-align: left; padding: 8px 10px; font-weight: 800; white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--static-dim); vertical-align: top; }
tr:hover td { background: rgba(255,225,26,.05); }
.res td, .res th { text-align: center; }
.Wk { color: #fff; background: var(--alarm); font-weight: 800; }
.Str { color: var(--black); background: #9fd6ff; font-weight: 800; }
.Nul { color: var(--black); background: var(--static); font-weight: 800; }
.Rpl { color: var(--black); background: var(--yellow); font-weight: 800; }
.Drn { color: #fff; background: var(--ok); font-weight: 800; }

/* persona page */
.persona-hero { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; padding: 36px 0 12px; }
.persona-hero .arcana-card { width: 110px; }
.persona-hero .arcana-card .num { font-size: 2.4rem; }
.persona-hero .arcana-card .nm { font-size: .8rem; }
.facts { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 0; padding: 0; list-style: none; }
.facts li { background: rgba(255,255,255,.06); padding: 4px 12px; transform: skewX(var(--skew)); }
.facts strong { color: var(--yellow); }
.stats { display: grid; gap: 8px; max-width: 520px; }
.stat { display: grid; grid-template-columns: 40px 1fr 36px; gap: 10px; align-items: center; }
.stat .track { height: 12px; background: #222; }
.stat .fill { height: 100%; background: var(--yellow); }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 32px; }
.callout { background: linear-gradient(135deg, var(--velvet), var(--velvet-deep)); border-left: 6px solid var(--yellow); padding: 16px 20px; margin: 20px 0; }
.btn {
  display: inline-block; background: var(--yellow); color: var(--black); font-weight: 800;
  text-decoration: none; padding: 10px 18px; transform: skewX(var(--skew)); border: 0; cursor: pointer; font-size: var(--step-0);
}
.btn:hover { background: #fff; color: var(--black); }

.ad-slot { min-height: 0; margin: 24px 0; }

/* footer */
footer { margin-top: 64px; border-top: 4px solid var(--yellow); padding: 28px 0 40px; color: var(--muted); font-size: var(--step--1); }
footer nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
footer a { color: var(--text); }

@media (max-width: 760px) {
  .slots, .slots.three { grid-template-columns: 1fr; }
  .op { font-size: var(--step-2); line-height: 1; }
  .result-card { grid-template-columns: 1fr; }
  .tv { padding: 10px; border-radius: 18px; }
  .tv-screen { min-height: 0; }
  .persona-hero { grid-template-columns: 1fr; }
}

/* ---------- game switcher + section nav ---------- */
.games { display: flex; gap: 6px; }
.games a {
  color: var(--black); font-family: var(--display); text-decoration: none;
  padding: 4px 12px; border: 3px solid var(--black); transform: skewX(var(--skew)); display: inline-block;
}
.games a:hover, .games a[aria-current="true"] { background: var(--black); color: var(--yellow); }
.subbar { background: var(--black); border-top: 3px solid var(--black); }
.subbar .wrap { padding-block: 6px; }
.subbar .nav a { color: var(--text); }
.subbar .nav a:hover, .subbar .nav a[aria-current="page"] { background: var(--yellow); color: var(--black); }

/* ---------- home: game picker ---------- */
.game-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 28px; margin: 24px 0 48px; }
.pick { display: grid; gap: 6px; padding: 28px; text-decoration: none; min-height: 230px; align-content: end; position: relative; }
.pick-title { font-family: var(--display); font-size: clamp(1.7rem, 4vw, 2.4rem); line-height: 1.05; }
.pick-sub { font-weight: 800; }
.pick-body { font-size: var(--step--1); }
.pick-go { margin-top: 10px; font-weight: 800; justify-self: start; padding: 6px 14px; transform: skewX(var(--skew)); }
.pick-p4 {
  color: var(--text); background: radial-gradient(ellipse at 50% 30%, #222, #000 75%);
  border-radius: 24px; box-shadow: inset 0 0 0 2px #444, 0 0 0 4px var(--black), 0 0 0 7px var(--yellow);
}
.pick-p4 .pick-title { color: var(--yellow); }
.pick-p4 .pick-go { background: var(--yellow); color: var(--black); }
.pick-p5 {
  color: #000; background: #fff;
  clip-path: polygon(0 4%, 96% 0, 100% 92%, 3% 100%);
  box-shadow: none;
  background-image: linear-gradient(115deg, transparent 62%, #e60012 62% 70%, transparent 70%);
}
.pick-p5 .pick-title { color: #000; }
.pick-p5 .pick-go { background: #000; color: #fff; }
.pick:hover .pick-go { outline: 3px solid currentColor; }
.pick-p5:hover .pick-go { background: #e60012; }

/* ---------- Persona 5 theme: red, black, white, slashes ---------- */
.theme-p5 {
  --yellow: #ff3347;          /* accent for text and links on black (contrast-safe) */
  --yellow-deep: #b8000f;
  --red: #e60012;             /* accent for solid backgrounds, with white text */
  --paper: #ffffff;
  --velvet: #000;
  --velvet-deep: #000;
  --skew: -12deg;
  background-color: #000;
  background-image:
    repeating-linear-gradient(135deg, rgba(230,0,18,.07) 0 2px, transparent 2px 16px);
}
.theme-p5 .bar { background: var(--red); color: #fff; box-shadow: 0 4px 0 #000, 0 8px 0 #fff; border-bottom: 0; }
.theme-p5 .brand, .theme-p5 .brand:hover { color: #fff; }
.theme-p5 .games a { color: #fff; border-color: #fff; }
.theme-p5 .games a:hover, .theme-p5 .games a[aria-current="true"] { background: #fff; color: #000; }
.theme-p5 .subbar { background: #000; margin-top: 8px; }
.theme-p5 .subbar .nav a:hover, .theme-p5 .subbar .nav a[aria-current="page"] { background: #fff; color: #000; }
.theme-p5 h1 {
  display: inline-block; background: #fff; color: #000; padding: 4px 16px 6px;
  transform: rotate(-1.5deg); box-shadow: 8px 8px 0 var(--red);
}
.theme-p5 .persona-hero h1 { margin-bottom: 18px; }
.theme-p5 .tv {
  border-radius: 0; background: #000;
  box-shadow: 0 0 0 4px #fff, 12px 12px 0 4px var(--red);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 28px), calc(100% - 28px) 100%, 0 100%);
}
.theme-p5 .tv-screen { border-radius: 0; background:
  radial-gradient(circle at 1px 1px, rgba(230,0,18,.35) 1px, transparent 1.6px) 0 0 / 10px 10px, #0a0a0a; }
.theme-p5 .tv-screen::after { display: none; }
.theme-p5 .tv-led { background: #fff; box-shadow: 0 0 8px #fff; }
.theme-p5 .modes button { border-color: #555; }
.theme-p5 .modes button[aria-selected="true"] { background: var(--red); color: #fff; border-color: var(--red); }
.theme-p5 .modes button:hover:not([aria-selected="true"]) { border-color: #fff; }
.theme-p5 .slot input { background: #fff; color: #000; box-shadow: 6px 6px 0 var(--red); clip-path: none; transform: skewX(-6deg); }
.theme-p5 .slot input:focus { box-shadow: 6px 6px 0 #fff, inset 0 0 0 3px var(--red); }
.theme-p5 .op { color: #fff; }
.theme-p5 .listbox { box-shadow: 6px 6px 0 var(--red); }
.theme-p5 .listbox li[aria-selected="true"], .theme-p5 .listbox li:hover { background: var(--red); color: #fff; }
.theme-p5 .listbox li[aria-selected="true"] small, .theme-p5 .listbox li:hover small { color: #fff; }
/* the result arrives as a white "calling card" */
.theme-p5 .result-card {
  background: #fff; color: #000; border: 0;
  box-shadow: 10px 10px 0 var(--red); transform: rotate(-1deg);
}
.theme-p5 .result-card .sub { color: #333; }
.theme-p5 .result-card a { color: #b8000f; }
.theme-p5 .result-card a:hover { color: #000; }
.theme-p5 .result-card .arcana-card { background: #000; color: #fff; outline-color: var(--red); }
.theme-p5 .static-flash {
  background-image: linear-gradient(115deg, transparent 42%, var(--red) 42% 58%, transparent 58%);
  background-size: 300% 100%; mix-blend-mode: normal;
}
.theme-p5 .static-flash.on { animation: slash .45s ease-out both; }
@keyframes slash { 0% { opacity: 1; background-position: 100% 0; } 70% { opacity: 1; } 100% { opacity: 0; background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .theme-p5 .static-flash.on { animation: none; } }
.theme-p5 .tuning { animation: none; }
.theme-p5 .recipes li { border-left-color: var(--red); }
.theme-p5 .recipes .plus { color: #fff; }
.theme-p5 .arcana-card { outline-color: var(--red); }
.theme-p5 th { background: #fff; color: #000; }
.theme-p5 tr:hover td { background: rgba(230,0,18,.08); }
.theme-p5 .Rpl { background: #fff; color: #000; }
.theme-p5 .stat .fill { background: var(--red); }
.theme-p5 .facts li { background: #fff; color: #000; }
.theme-p5 .facts strong { color: #b8000f; }
.theme-p5 .btn, .theme-p5 .badge, .theme-p5 .tag-slant { background: var(--red); color: #fff; }
.theme-p5 .btn:hover { background: #fff; color: #000; }
.theme-p5 .badge.alt { background: #fff; color: #000; }
.theme-p5 .callout { background: #111; border-left-color: var(--red); }
.theme-p5 .filter { outline-color: var(--red); }
.theme-p5 .arcana-group { border-color: #333; }
.theme-p5 footer { border-top-color: var(--red); }

@media (max-width: 760px) {
  .bar .wrap { gap: 8px; }
  .games a { padding: 3px 9px; }
  .theme-p5 .tv { clip-path: none; box-shadow: 0 0 0 3px #fff, 6px 6px 0 3px var(--red); }
}

/* keep the ingredient boxes level even when one description wraps */
.slots { align-items: start; }
.slots .op { padding-top: 34px; }
@media (max-width: 760px) { .slots .op { padding-top: 0; } }
/* Persona 5 card on the homepage: slash sits at the edge, clear of the text */
.pick-p5 { padding-right: 24%; background-image: linear-gradient(115deg, transparent 80%, #e60012 80% 88%, transparent 88%); }
@media (max-width: 760px) { .pick-p5 { padding-right: 20%; } }
