:root {
  --page-bg: #07080b;
  --panel: #111318;
  --panel-raised: #181b22;
  --text: #ffffff;
  --muted: #a6a8af;
  --line: rgba(255, 255, 255, .11);
  --accent: #ffd700;
  --font: 'Noto Sans Thai', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; margin: 0; overflow-x: clip; }
body { min-height: 100vh; background: var(--page-bg); color: var(--text); font-family: var(--font); }
button, select { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.name-page { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 105px 0 80px; }

.name-hero {
  position: relative;
  min-height: 410px;
  display: flex;
  align-items: center;
  padding: 72px 46% 64px 0;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.name-hero::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('/img/bg-13.jpg');
  background-position: center;
  background-size: cover;
  opacity: .17;
  content: '';
}

.name-hero::after { position: absolute; inset: 0; z-index: -1; background: rgba(7, 8, 11, .68); content: ''; }
.hero-copy { position: relative; z-index: 2; }

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hero-kicker::before { width: 28px; height: 3px; background: var(--accent); content: ''; }
.name-hero h1 { margin: 0; font-size: clamp(2.7rem, 7vw, 5.1rem); font-weight: 800; line-height: 1.02; }
.name-hero h1 span { display: block; color: var(--accent); }

.hero-description { max-width: 590px; margin: 19px 0 0; color: #c4c6cb; font-size: 1rem; font-weight: 500; line-height: 1.75; }

.server-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17, 19, 24, .82);
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
}

.server-pill .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ab577; }

.hero-character {
  position: absolute;
  right: 0;
  bottom: -72px;
  z-index: 1;
  width: min(42%, 430px);
  max-height: 500px;
  object-fit: contain;
  object-position: bottom;
  pointer-events: none;
}

.generator-section { padding: 46px 0 0; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 22px; margin-bottom: 22px; }
.section-heading h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.35rem); line-height: 1.25; }
.section-heading p { margin: 7px 0 0; color: var(--muted); font-size: .92rem; }
.step-label { flex: none; color: var(--accent); font-size: .78rem; font-weight: 800; }

.generator-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; }
.control-panel, .result-panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.control-panel { padding: 24px; }
.control-title { display: flex; align-items: center; gap: 11px; margin-bottom: 22px; }

.control-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: none;
  place-items: center;
  border: 1px solid #665d19;
  border-radius: 9px;
  background: #25230e;
  color: var(--accent);
}

.control-icon .material-symbols-outlined { font-size: 20px; }
.control-title strong { display: block; font-size: 1rem; }
.control-title small { display: block; color: var(--muted); font-size: .75rem; }
.field { margin-top: 17px; }
.field label, .count-label { display: block; margin-bottom: 8px; color: #d7d8dc; font-size: .8rem; font-weight: 700; }
.select-wrap { position: relative; }

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 15px;
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  content: '';
  pointer-events: none;
  transform: translateY(-75%) rotate(45deg);
}

select { width: 100%; height: 48px; padding: 0 42px 0 14px; border: 1px solid var(--line); border-radius: 9px; outline: none; background: #0c0e12; color: var(--text); appearance: none; }
select:focus { border-color: var(--accent); }
.count-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.count-options input { position: absolute; opacity: 0; pointer-events: none; }

.count-options label {
  display: grid;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0e12;
  color: var(--muted);
  cursor: pointer;
  font-size: .82rem;
  font-weight: 700;
}

.count-options input:checked + label { border-color: var(--accent); background: var(--accent); color: #0a0a0a; }
.count-options input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

.generate-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 50px;
  margin-top: 23px;
  border: 0;
  border-radius: 9px;
  background: var(--accent);
  color: #0a0a0a;
  cursor: pointer;
  font-weight: 800;
}

.generate-button:hover { background: #ffe033; }
.generate-button:active { transform: translateY(1px); }
.generate-button .material-symbols-outlined { font-size: 20px; }
.result-panel { min-height: 410px; overflow: hidden; }

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  background: #0d0f13;
}

.result-header strong { display: block; font-size: 1rem; }
.result-header small { color: var(--muted); font-size: .75rem; }
.result-status { display: inline-flex; align-items: center; gap: 7px; color: #c8cad0; font-size: .75rem; font-weight: 700; }
.result-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: #5ab577; }
.name-list { display: grid; gap: 10px; margin: 0; padding: 16px; list-style: none; }

.name-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 15px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel-raised);
}

.name-card:hover { border-color: rgba(255, 215, 0, .58); background: #1c1f27; }
.name-index { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 9px; background: #29260f; color: var(--accent); font-size: .8rem; font-weight: 800; }
.name-main { min-width: 0; }
.name-main strong { display: block; overflow-wrap: anywhere; font-size: clamp(1.05rem, 2.3vw, 1.25rem); line-height: 1.35; }
.name-main small { color: var(--muted); font-size: .77rem; }

.copy-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0c0e12;
  color: #d9dade;
  cursor: pointer;
  font-size: .77rem;
  font-weight: 700;
}

.copy-button:hover { border-color: var(--accent); color: var(--accent); }
.copy-button .material-symbols-outlined { font-size: 17px; }
.empty-result { display: grid; min-height: 338px; padding: 40px; place-items: center; color: var(--muted); text-align: center; }
.empty-result .material-symbols-outlined { display: block; margin-bottom: 12px; color: #5f626a; font-size: 48px; }
.empty-result p { max-width: 350px; margin: 0; line-height: 1.7; }
.empty-result[hidden], .name-list[hidden] { display: none; }
.name-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }

.tip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.45;
}

.tip-card .material-symbols-outlined { flex: none; color: var(--accent); font-size: 21px; }

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10000;
  padding: 11px 16px;
  border: 1px solid #5d5519;
  border-radius: 9px;
  background: #1b1c18;
  color: var(--text);
  font-size: .8rem;
  font-weight: 700;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}

.toast.is-visible { transform: translateY(0); opacity: 1; }
.name-footer { margin-top: 60px; padding: 25px 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; text-align: center; }

@media (max-width: 820px) {
  .name-page { padding-top: 95px; }
  .name-hero { min-height: 390px; padding: 60px 38% 50px 0; }
  .hero-character { right: -70px; width: 49%; }
  .generator-layout { grid-template-columns: 280px minmax(0, 1fr); }
}

@media (max-width: 690px) {
  .name-hero { min-height: 430px; align-items: flex-end; padding: 50px 0 42px; }
  .name-hero::after { background: rgba(7, 8, 11, .76); }
  .hero-copy { width: 100%; }
  .hero-description { max-width: 82%; }
  .hero-character { right: -105px; bottom: -55px; width: 64%; max-height: 420px; opacity: .42; }
  .generator-layout { grid-template-columns: 1fr; }
  .control-panel { padding: 20px; }
  .name-tips { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .name-page { width: min(100% - 24px, 1100px); }
  .name-hero { min-height: 400px; }
  .name-hero h1 { font-size: 2.7rem; }
  .hero-description { max-width: 100%; font-size: .9rem; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .result-header { align-items: flex-start; }
  .name-card { grid-template-columns: 38px minmax(0, 1fr); gap: 10px; }
  .copy-button { grid-column: 2; width: max-content; }
  .toast { right: 12px; bottom: 12px; left: 12px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
