/* wow-forever-name-generator - the page's styles, loaded by index.html */

:root {
  --bg: #0b0806;
  --panel: #19120b;
  --panel-2: #231a10;
  --edge: #5e4523;
  --gold: #ffd100;
  --gold-soft: #d9a73a;
  --gold-dim: #8a6a2c;
  --text: #eadfc6;
  --muted: #a39275;
  --red: #8f0f0f;
  --red-dark: #4a0606;
  --faction: #8c1414;
  --faction-ink: #ff8f7a;
  --faction-glow: rgba(190, 25, 25, .30);
  --display: "Cinzel", "Trajan Pro", Georgia, serif;
  --deco: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --body: "Crimson Text", Georgia, "Times New Roman", serif;
}
body[data-faction="alliance"] {
  --faction: #1d4aa3;
  --faction-ink: #8fb8ff;
  --faction-glow: rgba(45, 105, 230, .30);
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font: 18px/1.5 var(--body);
  background:
    radial-gradient(1100px 520px at 50% -140px, var(--faction-glow), transparent 70%),
    radial-gradient(900px 700px at 50% 120%, rgba(0,0,0,.85), transparent 70%),
    repeating-linear-gradient(135deg, rgba(255,235,200,.014) 0 2px, transparent 2px 7px),
    var(--bg);
  background-attachment: fixed;
  padding: 0 16px 3rem;
}
::selection { background: var(--gold-dim); color: #fff; }

/* ---------- header ---------- */
header { text-align: center; padding: clamp(1.5rem, 5vw, 3rem) 0 1.5rem; }
.emblem { width: 76px; height: 76px; display: block; margin: 0 auto .6rem; filter: drop-shadow(0 0 18px var(--faction-glow)); }
.kicker {
  font: 600 .8rem/1 var(--display); letter-spacing: .35em; text-transform: uppercase;
  color: var(--gold-soft); margin: 0 0 .5rem;
}
h1 {
  margin: 0;
  font: 900 clamp(2.1rem, 7vw, 3.8rem)/1.05 var(--deco);
  background: linear-gradient(180deg, #fff6c8 0%, #ffd100 45%, #b77b12 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 0 #2b1a05) drop-shadow(0 0 22px rgba(255,190,40,.18));
}
.tagline { margin: .6rem 0 0; color: var(--muted); font-style: italic; }
.rule {
  display: flex; align-items: center; gap: .8rem; max-width: 26rem; margin: 1rem auto 0;
  color: var(--gold-dim);
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }

/*
 * Grid columns are minmax(0, 1fr) throughout, not 1fr: a plain 1fr never
 * shrinks below its widest unbreakable word, and with the phone's text size
 * turned up (Samsung's default is larger) "SKYBORNE" pushed the whole page
 * past the right edge.
 */
main { max-width: 62rem; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }

/* ---------- framed panels ---------- */
.panel {
  position: relative;
  min-width: 0;
  background:
    linear-gradient(180deg, rgba(255,220,160,.04), transparent 40%),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--edge);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgba(255,209,0,.14),
    inset 0 0 40px rgba(0,0,0,.55),
    0 10px 30px rgba(0,0,0,.55);
  padding: clamp(1.1rem, 3.5vw, 1.8rem);
}
.panel::before, .panel::after {
  content: ""; position: absolute; width: 16px; height: 16px;
  background: radial-gradient(circle at 50% 50%, #ffe27a 0 2px, #b8861d 3px 4px, transparent 5px),
              linear-gradient(45deg, transparent 42%, var(--gold-soft) 42% 58%, transparent 58%),
              linear-gradient(-45deg, transparent 42%, var(--gold-soft) 42% 58%, transparent 58%);
  border: 1px solid var(--gold-dim); background-color: #2a1d0e;
  transform: rotate(45deg);
}
.panel::before { top: -9px; left: -9px; }
.panel::after { bottom: -9px; right: -9px; }

h2 {
  display: flex; align-items: center; gap: .6rem;
  font: 700 .95rem/1.2 var(--display); letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold); margin: 0 0 .8rem;
  text-shadow: 0 1px 0 #000;
}
h2 .num {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem;
  font-size: .75rem; letter-spacing: 0; color: #1a1005;
  background: radial-gradient(circle at 35% 30%, #fff1a8, #d9a73a 60%, #7a5514);
  border-radius: 50%; box-shadow: 0 0 0 1px #3a2708, 0 0 10px rgba(255,200,60,.25);
}
.step + .step { margin-top: 1.4rem; }

/* ---------- faction ---------- */
.factions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.faction-btn {
  display: flex; align-items: center; gap: .9rem;
  padding: .8rem 1rem; text-align: left;
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(0,0,0,.25));
  border: 2px solid #3b2c17; border-radius: 6px;
  color: var(--muted); cursor: pointer;
  font: inherit;
  transition: border-color .2s, box-shadow .2s, color .2s, filter .2s;
  filter: saturate(.35) brightness(.8);
}
.faction-btn svg { width: 54px; height: 64px; flex: none; }
.faction-btn .fname { display: block; font: 900 clamp(1.05rem, 3.5vw, 1.45rem)/1.1 var(--display); letter-spacing: .08em; }
.faction-btn .motto { display: block; font-style: italic; font-size: .92rem; }
.faction-btn > span { min-width: 0; overflow-wrap: anywhere; }
.faction-btn:hover { filter: none; border-color: var(--gold-dim); }
.faction-btn[aria-pressed="true"] { filter: none; color: var(--text); }
.faction-btn.alliance[aria-pressed="true"] { border-color: #4b7bd6; box-shadow: 0 0 0 1px #0d2455, 0 0 24px rgba(60,120,240,.35), inset 0 0 30px rgba(40,90,200,.25); }
.faction-btn.horde[aria-pressed="true"]    { border-color: #c2361f; box-shadow: 0 0 0 1px #3a0404, 0 0 24px rgba(220,40,20,.35), inset 0 0 30px rgba(180,20,10,.25); }
.faction-btn.alliance[aria-pressed="true"] .fname { color: #9cc3ff; }
.faction-btn.horde[aria-pressed="true"] .fname    { color: #ff8b70; }

/* ---------- race / class tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(8.5rem, 100%), 1fr)); gap: .55rem; }
.tile .label { min-width: 0; overflow-wrap: anywhere; }
.tile {
  position: relative;
  display: flex; align-items: center; gap: .55rem;
  min-height: 2.9rem; padding: .45rem .75rem;
  font: 600 .95rem/1.15 var(--display); letter-spacing: .03em;
  color: var(--text);
  background: linear-gradient(180deg, #2a1f13, #16100a);
  border: 1px solid #4a3719; border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,230,170,.08);
  cursor: pointer; text-align: left;
  transition: border-color .15s, box-shadow .15s, transform .05s, opacity .15s;
}
.tile:hover:not(:disabled) { border-color: var(--gold-soft); }
.tile:active:not(:disabled) { transform: translateY(1px); }
.tile[aria-pressed="true"] {
  border-color: var(--gold);
  background: linear-gradient(180deg, #3b2a12, #1d140a);
  box-shadow: 0 0 0 1px #3a2708, 0 0 14px rgba(255,200,40,.28), inset 0 0 12px rgba(255,190,40,.12);
}
.tile:disabled { cursor: not-allowed; opacity: .32; filter: grayscale(1); }
.tile .glyph {
  display: inline-grid; place-items: center; flex: none;
  width: 1.75rem; height: 1.75rem; border-radius: 50%;
  font: 1.05rem/1 "Segoe UI Symbol", "Noto Sans Symbols", "DejaVu Sans", sans-serif;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.12), rgba(0,0,0,.55));
  border: 1px solid currentColor;
}
.race-tile .glyph { color: var(--faction-ink); font: 700 .8rem/1 var(--display); }
.class-tile .label { color: var(--cls); }
.class-tile .glyph { color: var(--cls); }
.class-tile[aria-pressed="true"] { border-color: var(--cls); box-shadow: 0 0 0 1px #000, 0 0 16px color-mix(in srgb, var(--cls) 45%, transparent); }
.badge-new {
  position: absolute; top: -.45rem; right: -.3rem;
  font: 700 .58rem/1 var(--display); letter-spacing: .08em; text-transform: uppercase;
  color: #1a0f02; background: linear-gradient(180deg, #ffe47a, #d39a1c);
  padding: .2rem .35rem; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,.6);
}

.options { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; }
.options > div { min-width: 0; max-width: 100%; }
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid #4a3719; border-radius: 4px; overflow: hidden; }
.seg button {
  font: 600 .92rem/1 var(--display); color: var(--muted);
  background: linear-gradient(180deg, #241a0f, #130d07);
  border: 0; border-right: 1px solid #4a3719;
  padding: .65rem 1rem; cursor: pointer; min-width: 5.2rem;
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--gold); background: linear-gradient(180deg, #3b2a12, #1d140a); box-shadow: inset 0 -2px 0 var(--gold-soft); }
.seg .sym { font-family: "Segoe UI Symbol", "DejaVu Sans", sans-serif; margin-right: .3rem; }

.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; color: var(--text); font: 600 .92rem/1 var(--display); letter-spacing: .04em; user-select: none; }
.check input { appearance: none; margin: 0; width: 1.25rem; height: 1.25rem; border: 1px solid var(--gold-dim); border-radius: 3px; background: #120c06; display: grid; place-items: center; cursor: pointer; }
.check input::after { content: ""; width: .7rem; height: .7rem; background: var(--gold); clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%); transform: scale(0); transition: transform .12s; }
.check input:checked::after { transform: scale(1); }
.surname-opts { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.4rem; }
body.no-surname #surnameStyles { opacity: .45; }

/* ---------- the stage ---------- */
.stage { text-align: center; padding-top: clamp(1.6rem, 5vw, 2.6rem); padding-bottom: clamp(1.6rem, 5vw, 2.4rem); }
.nameplate {
  position: relative; margin: 0 auto 1rem; max-width: 34rem;
  padding: 1.1rem 1rem 1rem;
  background: radial-gradient(ellipse at 50% 50%, rgba(255,200,60,.08), transparent 70%);
}
.nameplate::before, .nameplate::after {
  content: ""; position: absolute; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}
.nameplate::before { top: 0; }
.nameplate::after { bottom: 0; }
.name {
  font: 900 clamp(1.7rem, 8.5vw, 4.2rem)/1.1 var(--display);
  letter-spacing: .03em;
  color: var(--gold);
  text-shadow: 0 2px 0 #3a2300, 0 0 24px rgba(255,200,40,.35);
  min-height: 1.1em;
  overflow-wrap: anywhere;
}
.name.pop { animation: pop .35s ease-out; }
@keyframes pop { from { opacity: .2; transform: scale(.96); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }
.surname { font: 700 clamp(1.15rem, 3.8vw, 1.6rem)/1.3 var(--display); letter-spacing: .04em; color: var(--cls, var(--text)); min-height: 1.3em; margin-top: .15rem; }
body.no-surname .surname, body.no-surname .row .ep { display: none; }
.meta { color: var(--muted); font-size: .98rem; margin-bottom: 1.4rem; }
.meta .dot { color: var(--gold-dim); margin: 0 .4rem; }
.meta .cls { color: var(--cls); }

.controls { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }
.btn {
  font: 700 .92rem/1 var(--display); letter-spacing: .05em;
  color: var(--gold);
  background: linear-gradient(180deg, #b01d14 0%, #7d0c08 48%, #5a0503 52%, #3d0402 100%);
  border: 1px solid #1c0200;
  border-radius: 4px;
  padding: .75rem 1.15rem;
  box-shadow: inset 0 0 0 1px rgba(255,200,80,.45), inset 0 1px 0 rgba(255,230,160,.35), 0 2px 4px rgba(0,0,0,.6);
  text-shadow: 0 1px 0 #000;
  cursor: pointer;
  transition: filter .12s, transform .05s;
}
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: translateY(1px); filter: brightness(.9); }
.btn.primary { font-size: 1.05rem; padding: .85rem 1.6rem; }
.btn.quiet {
  color: var(--text);
  background: linear-gradient(180deg, #3a2c1a, #1d150c);
  box-shadow: inset 0 0 0 1px rgba(217,167,58,.35), 0 2px 4px rgba(0,0,0,.6);
}
kbd { font: 600 .68em/1 var(--body); border: 1px solid currentColor; border-radius: 3px; padding: .15em .35em; margin-left: .5em; opacity: .65; vertical-align: .1em; }
button:focus-visible, input:focus-visible, .row .nm:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- lists ---------- */
.lists { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem; margin-bottom: .8rem; }
.section-head h2 { margin: 0; }
.head-buttons { display: flex; gap: .4rem; }
.small { font-size: .72rem; padding: .45rem .65rem; }
.btn.danger { color: #fff; background: linear-gradient(180deg, #e0321f, #7a0906); }

.list { list-style: none; margin: 0; padding: 0 .2rem 0 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .35rem; max-height: 27rem; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--gold-dim) transparent; }
.list::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 4px; }
.row {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .55rem;
  background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.15));
  border: 1px solid #2f2312; border-left: 3px solid var(--row-faction, var(--gold-dim));
  border-radius: 3px;
}
.row.alliance { --row-faction: #3867c7; }
.row.horde { --row-faction: #b3261a; }
.row:hover { border-color: #4f3a1c; border-left-color: var(--row-faction); }
.row .who { flex: 1; min-width: 0; line-height: 1.2; }
.row .nm { font: 700 1.05rem/1.2 var(--display); color: var(--gold); }
.row .ep { font: 700 1.05rem/1.2 var(--display); color: var(--cls); }
.row .nm, .row .ep { overflow-wrap: anywhere; }
.row .lbl { display: block; font-size: .85rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .lbl .cls { color: var(--cls); }
.row .acts { display: flex; gap: .3rem; flex: none; }
.row .acts .btn { font-size: .68rem; padding: .4rem .5rem; }
.empty { color: var(--muted); font-style: italic; padding: .4rem .2rem; }

footer { max-width: 62rem; margin: 2.5rem auto 0; text-align: center; color: var(--muted); font-size: .9rem; }
footer a { color: var(--gold-soft); }

.toast {
  position: fixed; left: 50%; bottom: 1.5rem; z-index: 10;
  transform: translate(-50%, 1.5rem); opacity: 0; pointer-events: none;
  font: 700 1rem/1.2 var(--display); letter-spacing: .04em;
  color: var(--gold); text-shadow: 0 1px 0 #000, 0 0 12px rgba(255,200,40,.4);
  background: linear-gradient(180deg, rgba(40,28,12,.97), rgba(18,12,6,.97));
  border: 1px solid var(--gold-dim); border-radius: 4px;
  box-shadow: 0 0 0 1px #000, 0 8px 24px rgba(0,0,0,.7);
  padding: .7rem 1.3rem; max-width: calc(100vw - 32px); text-align: center;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .lists { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .factions { grid-template-columns: repeat(auto-fit, minmax(min(8.5rem, 100%), 1fr)); gap: .5rem; }
  .faction-btn { flex-direction: column; text-align: center; gap: .4rem; padding: .7rem .4rem; }
  .faction-btn svg { width: 44px; height: 52px; }
  .faction-btn .motto { font-size: .8rem; }
  .seg button { min-width: 0; padding: .6rem .7rem; flex: 1 1 auto; }
  .tile { gap: .45rem; padding: .45rem .55rem; }
  .controls .btn { flex: 1 1 auto; }
  kbd { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .name.pop { animation: none; }
  * { transition: none !important; }
}
