/* Dark-fantasy gacha UI (style_dna.md): charcoal + brushed gold, chamfered double-line frames,
   jewel glow per game, warm-white text, calm motion. */
:root {
  --bg: #1b1b1d;
  --panel: #111113;
  --gold: #d9b574;
  --gold-hi: #f5d58a;
  --gold-lo: #8a6d3b;
  --text: #efe9dc;
  --muted: #9b9588;
  --green: #4fae7a;
  --red: #e5483f;
  --cut: 16px; /* chamfer size of frames */
  --serif: Cormorant, "Be Vietnam Pro", Georgia, serif;
  --sans: "Be Vietnam Pro", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(217, 181, 116, .10), transparent 55%),
    radial-gradient(ellipse at 50% 55%, transparent 40%, rgba(0, 0, 0, .55) 100%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--sans);
}
/* faint sunburst watermark */
body::before {
  content: ""; position: fixed; z-index: 0; left: 50%; top: -30vh; width: 160vmax; height: 160vmax; margin-left: -80vmax;
  background: repeating-conic-gradient(from 0deg, rgba(217, 181, 116, .035) 0 4deg, transparent 4deg 12deg);
  -webkit-mask-image: radial-gradient(circle, #000 0, transparent 55%); mask-image: radial-gradient(circle, #000 0, transparent 55%);
  animation: spin 240s linear infinite; pointer-events: none;
}
header, main, footer { position: relative; z-index: 1; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { box-shadow: inset 0 0 0 3px #0c0b09, inset 0 0 0 4px rgba(217, 181, 116, .45), 0 0 8px -2px var(--accent); } 50% { box-shadow: inset 0 0 0 3px #0c0b09, inset 0 0 0 4px rgba(245, 213, 138, .7), 0 0 20px -2px var(--accent); } }
@keyframes shimmer { to { background-position: 200% center; } }
@keyframes blink { 50% { opacity: .3; } }

.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px clamp(16px, 4vw, 48px);
  background: rgba(15, 15, 17, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-lo);
  box-shadow: 0 1px 0 rgba(245, 213, 138, .12);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 22px; color: var(--gold-hi); text-decoration: none; }
.brand img { display: block; width: auto; }
.logo-icon { height: 36px; }
.logo-text { height: 32px; filter: brightness(0) invert(.93) sepia(.25); } /* dark navy wordmark -> warm white */
.brand b { padding-left: 12px; border-left: 1px solid var(--gold-lo); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 17px; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 18px; }

/* tabs: text + gold underline with a diamond node */
.lang { display: flex; gap: 6px; }
.lang button { position: relative; padding: 8px 10px 10px; border: 0; background: transparent; color: var(--muted); font: 600 13px/1 var(--sans); letter-spacing: .08em; cursor: pointer; transition: color .2s; }
.lang button:hover { color: var(--text); }
.lang button.active { color: var(--gold-hi); }
.lang button.active::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 3px; height: 1px; background: var(--gold); }
.lang button.active::before { content: ""; position: absolute; left: 50%; bottom: 0; width: 5px; height: 5px; margin-left: -2.5px; background: var(--gold-hi); transform: rotate(45deg); z-index: 1; }

.contact { display: inline-flex; align-items: center; gap: 8px; padding: 8px 18px; border: 2px solid var(--gold-hi); border-radius: 999px; background: linear-gradient(180deg, #f5d58a, #c99a45); color: #231a08; font-size: 12.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; text-decoration: none; box-shadow: 0 0 14px rgba(245, 213, 138, .35); animation: ring 3.2s ease-in-out infinite; transition: filter .2s, transform .2s; }
.contact .ico { width: 16px; height: 16px; }
.contact:hover { filter: brightness(1.12); transform: translateY(-1px); }
@keyframes ring { 50% { box-shadow: 0 0 24px rgba(245, 213, 138, .65); } }
.online { padding: 5px 14px; border: 1px solid var(--gold-lo); border-radius: 999px; background: #0f0f11; color: var(--gold); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.online::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; background: var(--green); transform: rotate(45deg); box-shadow: 0 0 8px var(--green); animation: blink 2.4s ease-in-out infinite; vertical-align: 1px; }

main { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }

.hero { padding: clamp(36px, 6vw, 72px) 0 clamp(26px, 4vw, 44px); text-align: center; animation: fade .8s both; }
.hero h1 {
  margin: 0; font-family: var(--serif); font-weight: 700; font-size: clamp(36px, 6.4vw, 74px); line-height: 1.05;
  letter-spacing: .06em; text-transform: uppercase;
  background: linear-gradient(100deg, #b98a3e 0%, var(--gold-hi) 30%, #fff1c4 50%, var(--gold-hi) 70%, #b98a3e 100%);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(245, 213, 138, .25));
  animation: shimmer 8s linear infinite;
}
/* rule fading out at both ends, under the title */
.hero::after { content: ""; display: block; width: min(320px, 60%); height: 1px; margin: 22px auto 0; background: linear-gradient(90deg, transparent, var(--gold), transparent); }

.grid {
  display: grid; gap: clamp(18px, 2.4vw, 30px);
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  padding-bottom: 56px;
}
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(3, 1fr); } }

/* chamfered double-line frame: gold gradient behind, panel inset on top, both clipped to the same notch */
.card {
  --poly: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
  --poly-in: polygon(calc(var(--cut) - 1px) 0, calc(100% - var(--cut) + 1px) 0, 100% calc(var(--cut) - 1px), 100% calc(100% - var(--cut) + 1px), calc(100% - var(--cut) + 1px) 100%, calc(var(--cut) - 1px) 100%, 0 calc(100% - var(--cut) + 1px), 0 calc(var(--cut) - 1px));
  position: relative; display: flex; flex-direction: column;
  padding: 3px;
  background: linear-gradient(160deg, var(--gold-hi), var(--gold-lo) 45%, #5e4a26 70%, var(--gold) );
  clip-path: var(--poly);
  animation: fade .7s both;
  transition: transform .35s ease, filter .35s;
}
.card::before { content: ""; position: absolute; inset: 3px; background: var(--panel); clip-path: var(--poly-in); }
.card > * { position: relative; }
.card:nth-child(1) { animation-delay: .05s; }
.card:nth-child(2) { animation-delay: .15s; }
.card:nth-child(3) { animation-delay: .25s; }
.card:nth-child(4) { animation-delay: .35s; }
.card:nth-child(5) { animation-delay: .45s; }
.card:hover { transform: translateY(-5px); filter: brightness(1.12); }

.clip {
  display: block; width: calc(100% - 20px); margin: 12px 10px 0; aspect-ratio: 4 / 5; max-height: 82vh;
  padding: 0; border: 1px solid var(--gold-lo); border-radius: 2px; overflow: hidden; cursor: zoom-in;
  background: #000; position: relative;
}
.clip video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s; }
.card:hover .clip video { transform: scale(1.04); }
.clip::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 55%, #000), transparent 38%); mix-blend-mode: screen; opacity: .55; }
.expand {
  position: absolute; right: 10px; bottom: 10px; z-index: 2; width: 34px; height: 34px; display: grid; place-items: center;
  border: 1px solid var(--gold); border-radius: 50%; background: rgba(15, 15, 17, .8); color: var(--gold-hi); font-size: 16px;
  transition: box-shadow .2s;
}
.clip:hover .expand { box-shadow: 0 0 14px var(--gold); }

.status { position: absolute; left: 10px; top: 10px; z-index: 2; padding: 4px 12px; border: 1px solid var(--gold-lo); border-radius: 999px; background: rgba(15, 15, 17, .85); color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.status::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: currentColor; transform: rotate(45deg); vertical-align: 1px; }
.status.on { color: var(--gold-hi); }
.status.on::before { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 2.4s ease-in-out infinite; }
.status.off { color: var(--red); border-color: rgba(229, 72, 63, .5); }

/* info area: rarity glow rising from the bottom */
.info { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 22px; flex: 1; background: linear-gradient(to top, color-mix(in srgb, var(--accent) 26%, transparent), transparent 70%); }
.info h2 { margin: 0; font-family: var(--serif); font-weight: 700; font-size: 30px; line-height: 1.1; letter-spacing: .04em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 0 16px color-mix(in srgb, var(--accent) 60%, transparent); }
.info h2::after { content: "◆"; display: block; margin-top: 8px; font-size: 9px; line-height: 1; color: var(--gold); background: linear-gradient(90deg, transparent, var(--gold-lo) 20%, var(--gold-lo) 80%, transparent) center / 100% 1px no-repeat; text-align: center; text-shadow: none; }
.pitch { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; flex: 1; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 4px; padding: 0; list-style: none; }
.tags li { padding: 3px 10px; border: 1px solid rgba(217, 181, 116, .35); border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--gold); }

/* wide pill, double gold border, warm gradient, glow */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 4px; padding: 12px 20px; border: 2px solid var(--gold-lo); border-radius: 999px;
  font-family: var(--sans); font-weight: 700; font-size: 14px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-hi); text-decoration: none;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent, var(--gold)) 38%, #1a140a), #14100a 85%);
  box-shadow: inset 0 0 0 3px #0c0b09, inset 0 0 0 4px rgba(217, 181, 116, .45);
  transition: border-color .2s, color .2s, filter .2s;
}
.card .btn { animation: glow 3.6s ease-in-out infinite; }
.btn:hover { border-color: var(--gold-hi); color: #fff1c4; filter: brightness(1.15); }
.btn:active { filter: brightness(.9); }
.btn[aria-disabled="true"] { pointer-events: none; animation: none; border-color: #3d3a33; color: #6f6a60; background: #17171a; box-shadow: inset 0 0 0 3px #0c0b09, inset 0 0 0 4px #2b2924; }

.foot a { color: var(--gold); text-decoration: none; }
.foot a:hover { color: var(--gold-hi); text-decoration: underline; }
.foot { padding: 28px; text-align: center; color: var(--muted); font-size: 12.5px; letter-spacing: .04em; border-top: 1px solid #2d2a22; background: rgba(15, 15, 17, .6); }

dialog#viewer {
  width: min(96vw, 1100px); max-height: 94vh; padding: 3px;
  border: 0; background: linear-gradient(160deg, var(--gold-hi), var(--gold-lo) 50%, var(--gold)); overflow: hidden;
  clip-path: polygon(var(--cut) 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 var(--cut));
}
dialog#viewer[open] { animation: fade .3s both; }
dialog#viewer::backdrop { background: rgba(8, 8, 10, .85); backdrop-filter: blur(4px); }
#viewerVideo { display: block; width: 100%; max-height: calc(94vh - 80px); background: #000; }
.viewer-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 18px; background: var(--panel); }
.viewer-bar b { font-family: var(--serif); font-weight: 700; font-size: 24px; letter-spacing: .05em; text-transform: uppercase; color: var(--gold-hi); }
.viewer-bar .btn { margin: 0; --accent: var(--gold); animation: none; }
.close { position: absolute; right: 14px; top: 14px; z-index: 2; width: 38px; height: 38px; border: 1px solid var(--gold); border-radius: 50%; background: rgba(15, 15, 17, .85); color: var(--gold-hi); font-size: 16px; cursor: pointer; transition: box-shadow .2s; }
.close:hover { box-shadow: 0 0 14px var(--gold); }

@media (max-width: 720px) {
  :root { --cut: 12px; }
  .grid { grid-template-columns: 1fr; }
  .brand { font-size: 18px; gap: 8px; }
  .brand b { font-size: 15px; }
  .logo-text { display: none; }
  .online { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
