/* Kardallah website: a fantasy-portal look (parchment-dark panels, gold frames, saturated jewel tones). */
:root {
  --night: #0a0718;
  --night-2: #140c2c;
  --velvet: #2a0a2e;
  --crimson: #c8102e;
  --crimson-deep: #7a0820;
  --gold: #ffcc33;
  --gold-deep: #c98a12;
  --gold-pale: #fff0b3;
  --sapphire: #2f6bff;
  --violet: #8b3dff;
  --emerald: #1fe08a;
  --emerald-deep: #0b8f55;
  --ember: #ff6a1a;
  --ink: #f7ecd2;
  --ink-dim: #c9b896;
  --frame: 3px solid var(--gold);
  --glow-gold: 0 0 12px rgba(255, 204, 51, .55);
  --radius: 6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(139, 61, 255, .35), transparent 60%),
    radial-gradient(900px 500px at 100% 30%, rgba(200, 16, 46, .25), transparent 60%),
    var(--night);
  color: var(--ink);
  font-family: "Alegreya Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
}
img.pixel, .pixel { image-rendering: pixelated; }
a { color: var(--gold); }
h1, h2, h3, .brand, .btn, .nav a { font-family: "Cinzel", serif; letter-spacing: .04em; }

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, #3a0d1e, #1c0614);
  border-bottom: var(--frame);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .6);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: 8px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gold); font-size: 22px; font-weight: 700; text-shadow: 0 2px 0 #000, var(--glow-gold); }
.brand img { width: 40px; height: 40px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.nav a {
  color: var(--gold-pale); text-decoration: none; padding: 6px 12px; border-radius: var(--radius);
  font-size: 15px; font-weight: 700; text-transform: uppercase;
}
.nav a:hover, .nav a.active { background: rgba(255, 204, 51, .15); color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255, 204, 51, .5); }
.account { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.account .who { color: var(--gold-pale); }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 2px solid var(--gold); border-radius: var(--radius); cursor: pointer;
  padding: 8px 16px; font-size: 15px; font-weight: 700; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, var(--crimson), var(--crimson-deep));
  box-shadow: 0 3px 0 #3a0410, var(--glow-gold);
  text-shadow: 0 1px 0 #000;
}
.btn:hover { filter: brightness(1.15); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a0410; }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: default; }
.btn.blue { background: linear-gradient(180deg, var(--sapphire), #16348f); box-shadow: 0 3px 0 #0a1a4a, var(--glow-gold); }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.play {
  font-size: 26px; padding: 14px 44px; border-width: 3px;
  background: linear-gradient(180deg, #4dffad, var(--emerald) 45%, var(--emerald-deep));
  color: #062b18; text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
  box-shadow: 0 5px 0 #054a2b, 0 0 28px rgba(31, 224, 138, .7);
}
.btn.play.art {
  background: url("../img/play_button.png") center / 100% 100% no-repeat;
  border: 0; box-shadow: none; color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px #000;
  min-width: 300px; min-height: 120px; padding: 0 60px;
}

/* ---------------------------------------------------------------- hero banner */
.hero {
  position: relative; overflow: hidden;
  border-bottom: var(--frame);
  background: #1b0b2a url("../img/hero_bg.png") center / cover no-repeat;
  image-rendering: pixelated;
  min-height: 460px;
}
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(10, 7, 24, .7)); pointer-events: none; }
.hero-inner { position: relative; z-index: 2; max-width: 1200px; margin: 0 auto; padding: 48px 16px 40px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; }
.hero .crest { width: 132px; height: 132px; filter: drop-shadow(0 0 16px rgba(255, 60, 140, .7)); }
.hero h1 {
  margin: 0; font-family: "Cinzel Decorative", "Cinzel", serif; font-size: clamp(40px, 8vw, 84px); line-height: 1;
  color: var(--gold); text-shadow: 0 4px 0 #5a1a00, 0 0 30px rgba(255, 140, 0, .8);
}
.hero p.tag { margin: 0; font-size: 21px; font-weight: 700; color: #fff; text-shadow: 0 2px 0 #000, 0 0 10px #000, 0 0 18px #2a0a2e; max-width: 640px; }
.hero .fighters { position: absolute; inset: auto 0 0 0; z-index: 1; display: flex; justify-content: space-between; padding: 0 3%; pointer-events: none; }
.hero .fighters img { height: 240px; image-rendering: pixelated; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); }
.hero .fighters img.flip { transform: scaleX(-1); }

/* ---------------------------------------------------------------- page layout */
.page { max-width: 1200px; margin: 0 auto; padding: 28px 16px 60px; }
.cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
@media (max-width: 860px) { .cols { grid-template-columns: 1fr; } .hero .fighters img { height: 140px; } }

.panel {
  position: relative; border: var(--frame); border-radius: var(--radius); padding: 18px 20px;
  background: linear-gradient(180deg, rgba(122, 8, 32, .55), rgba(42, 10, 46, .85)), var(--night-2);
  box-shadow: 0 0 0 3px #3a1200, 0 8px 24px rgba(0, 0, 0, .55), inset 0 0 24px rgba(255, 204, 51, .12);
}
/* The PixelLab gold-and-sapphire frame (img/panel.png), 9-sliced at its own pixel size so it stays crisp. */
.panel {
  border-style: solid; border-width: 36px; border-radius: 0; padding: 0 6px 4px;
  border-image: url("../img/panel.png") 36 fill / 36px / 0 stretch;
  image-rendering: pixelated;
  background: none;
  box-shadow: none;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .6));
}
.panel > * { image-rendering: auto; }
.panel h2 { margin: 0 0 12px; color: var(--gold); font-size: 22px; text-shadow: 0 2px 0 #000; border-bottom: 1px solid rgba(255, 204, 51, .4); padding-bottom: 8px; }
.panel + .panel { margin-top: 24px; }

.news-item { padding: 12px 0; border-bottom: 1px dashed rgba(255, 204, 51, .3); }
.news-item:last-child { border-bottom: 0; }
.news-item h3 { margin: 0 0 4px; font-size: 18px; color: var(--gold-pale); }
.news-item .date { font-size: 13px; color: var(--emerald); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.news-item p { margin: 6px 0 0; color: var(--ink-dim); }

.feature { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.feature .gem { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; font-weight: 800; color: #fff; background: radial-gradient(circle at 35% 30%, #ff7aa0, var(--crimson) 60%, var(--crimson-deep)); box-shadow: var(--glow-gold); }
.feature .gem.blue { background: radial-gradient(circle at 35% 30%, #9cc0ff, var(--sapphire) 60%, #16348f); }
.feature .gem.green { background: radial-gradient(circle at 35% 30%, #b6ffd9, var(--emerald) 60%, var(--emerald-deep)); }
.feature p { margin: 0; color: var(--ink-dim); }
.feature b { color: var(--gold-pale); }

footer { border-top: var(--frame); background: #12061a; color: var(--ink-dim); font-size: 14px; text-align: center; padding: 18px 16px; }

/* ---------------------------------------------------------------- modal */
.modal-back { position: fixed; inset: 0; background: rgba(5, 2, 12, .75); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-back.open { display: flex; }
.modal { width: min(420px, 100%); }
.modal label { display: block; margin: 10px 0 4px; font-weight: 700; color: var(--gold-pale); }
.modal input, select {
  width: 100%; padding: 10px 12px; border-radius: var(--radius); border: 2px solid var(--gold-deep);
  background: #12081f; color: var(--ink); font-size: 16px; font-family: inherit;
}
.modal .row { display: flex; gap: 10px; margin-top: 16px; }
.modal .err { color: #ff7a8a; min-height: 1.4em; margin-top: 8px; font-weight: 700; }

/* ---------------------------------------------------------------- card gallery */
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filters button { font-family: "Cinzel", serif; font-weight: 700; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--gold-deep); background: #1c0d2e; color: var(--gold-pale); cursor: pointer; }
.filters button.on { background: linear-gradient(180deg, var(--violet), #4a1aa0); color: #fff; border-color: var(--gold); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.card {
  border: 2px solid var(--gold-deep); border-radius: 8px; overflow: hidden;
  background: linear-gradient(180deg, #2c1240, #160a24); box-shadow: 0 4px 12px rgba(0, 0, 0, .5);
  display: flex; flex-direction: column;
}
.card .art { aspect-ratio: 1; background: radial-gradient(circle, #3d1a5c, #12081f); display: grid; place-items: center; overflow: hidden; }
.card .art img { width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.card .art .ph { font-family: "Cinzel Decorative", serif; font-size: 42px; color: rgba(255, 204, 51, .5); }
.card .body { padding: 8px 10px 10px; }
.card .name { font-family: "Cinzel", serif; font-weight: 700; color: var(--gold); font-size: 15px; line-height: 1.2; }
.card .meta { font-size: 12px; color: var(--ink-dim); text-transform: uppercase; letter-spacing: .06em; }
.stats { display: flex; gap: 6px; margin-top: 6px; font-size: 13px; font-weight: 800; }
.stats span { padding: 1px 6px; border-radius: 4px; }
.stats .hp { background: #0d5c34; color: #b6ffd9; }
.stats .atk { background: #7a0820; color: #ffd0d8; }
.stats .rng { background: #16348f; color: #cddcff; }
.stats .cd { background: #5a3a00; color: #ffe39a; }
.rank-COMMON { border-color: #9aa3ad; } .rank-RARE { border-color: #3d8bff; } .rank-EPIC { border-color: #b04dff; }
.rank-LEGENDARY { border-color: #ffb300; box-shadow: 0 0 14px rgba(255, 179, 0, .5); } .rank-GODLIKE { border-color: #ff2e63; box-shadow: 0 0 16px rgba(255, 46, 99, .6); }

.notice { padding: 12px 16px; border-radius: var(--radius); border: 2px solid var(--sapphire); background: rgba(47, 107, 255, .15); margin-bottom: 16px; }

/* Phones: logo and account on one line, the nav as a single scrolling row under them. */
@media (max-width: 640px) {
  .topbar-inner { gap: 6px 10px; justify-content: space-between; }
  .nav { order: 3; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; }
  .nav a { flex: none; padding: 6px 10px; }
  .account .btn { padding: 6px 10px; font-size: 13px; }
  .brand { font-size: 19px; }
}
