:root {
  color-scheme: light;
  --sky: #81c8ed;
  --sky-deep: #4e9fd4;
  --cream: #fffaf0;
  --paper: #fffdf8;
  --paper-blue: #f0f8ff;
  --ink: #3c3540;
  --muted: #756d77;
  --blue: #397fb7;
  --blue-deep: #235d91;
  --blue-line: #92b9d6;
  --gold: #d89a2c;
  --gold-light: #ffe3a1;
  --pink: #ee7e9d;
  --green: #528c56;
  --line: #c8d9e6;
  --shadow: 0 12px 34px rgba(42, 77, 105, .18);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 9%, rgba(255, 255, 255, .92) 0 5rem, transparent 5.2rem),
    radial-gradient(ellipse at 78% 5%, rgba(255, 255, 255, .88) 0 7rem, transparent 7.2rem),
    linear-gradient(180deg, #8bd1f2 0, #d9f2ff 28rem, #f7f2e6 45rem, #efe6d5 100%);
  font-family: "Noto Sans Thai", Tahoma, Arial, sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }

.pet-feature-grid,
.pet-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 24px 0;
}
.pet-feature-grid article,
.pet-steps article {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-blue);
}
.pet-feature-grid strong,
.pet-feature-grid span,
.pet-feature-grid small { display: block; }
.pet-feature-grid strong { color: var(--pink); font: 900 1.7rem Georgia, serif; }
.pet-feature-grid span { margin-top: 4px; color: var(--blue-deep); font-weight: 900; }
.pet-feature-grid small { margin-top: 7px; color: var(--muted); line-height: 1.55; }
.pet-evolution-guide { margin: 28px 0; }
.pet-evolution-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.pet-evolution-heading h3 { margin: 2px 0 0; color: var(--blue-deep); font-size: 1.65rem; }
.pet-evolution-heading > p { max-width: 360px; margin: 0; color: var(--muted); text-align: right; }
.pet-tier-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 18px 0; }
.pet-tier-summary span { padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-blue); color: var(--muted); font-size: .86rem; text-align: center; }
.pet-tier-summary b { display: block; margin-bottom: 2px; color: var(--blue-deep); }
.pet-evolution-lines { display: grid; gap: 18px; }
.pet-evo-line { padding: 16px; border: 1px solid var(--blue-line); border-radius: 18px; background: linear-gradient(145deg, #fffdf8, #f3f9fd); box-shadow: 0 8px 24px rgba(42, 77, 105, .1); }
.pet-evo-line > h4 { margin: 0 0 12px; color: var(--blue-deep); font-size: 1rem; }
.pet-evo-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pet-stage-card { position: relative; min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.pet-stage-card.stage-4 { border-color: #e2b04d; background: linear-gradient(160deg, #fffdf7, #fff3cd); }
.pet-stage-label { display: flex; align-items: center; justify-content: space-between; color: var(--pink); font-size: .75rem; font-weight: 900; }
.pet-stage-label small { color: var(--muted); font-size: .72rem; }
.pet-sprite-frame { display: grid; height: 116px; place-items: center; margin: 6px 0; border-radius: 11px; background: radial-gradient(circle, #fff 0 28%, #edf7fd 72%, transparent 73%); }
.pet-sprite-frame img { max-width: 130px; max-height: 110px; image-rendering: pixelated; object-fit: contain; }
.pet-stage-card h5 { margin: 5px 0 0; overflow-wrap: anywhere; color: var(--blue-deep); font-size: 1rem; text-align: center; }
.pet-stage-card .pet-code { display: block; margin-top: 2px; color: var(--muted); font-size: .68rem; text-align: center; overflow-wrap: anywhere; }
.pet-capture-rate { margin: 8px 0 0; color: #9a6816; font-size: .75rem; font-weight: 800; text-align: center; }
.pet-loot-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0 0; }
.pet-loot-stats span { padding: 6px 3px; border-radius: 8px; background: var(--paper-blue); color: var(--muted); font-size: .68rem; text-align: center; }
.pet-loot-stats b { display: block; color: var(--blue-deep); font-size: .82rem; }
.pet-evo-requirement { margin-top: 10px; padding: 9px; border-top: 2px solid #f0c7d3; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.pet-evo-requirement strong { display: block; color: var(--ink); font-size: .74rem; }
.pet-materials { margin: 5px 0 0; padding-left: 17px; }
.pet-materials li { margin: 2px 0; overflow-wrap: anywhere; }
.pet-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pet-steps article { position: relative; padding-left: 64px; }
.pet-steps article > span { position: absolute; left: 20px; color: var(--pink); font: 900 1.15rem Georgia, serif; }
.pet-steps h3 { margin: 0 0 7px; color: var(--blue-deep); }
.pet-steps p { margin: 0; color: var(--muted); line-height: 1.65; }

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 72px;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(22px, calc((100vw - 1320px) / 2));
  border-bottom: 1px solid rgba(76, 121, 157, .34);
  background: rgba(255, 253, 247, .9);
  box-shadow: 0 3px 14px rgba(34, 81, 117, .13);
  backdrop-filter: blur(14px);
}

.brand { display: inline-flex; align-items: center; gap: 11px; }
.brand-number {
  display: grid;
  width: 47px;
  height: 47px;
  place-items: center;
  border: 2px solid #fff4c8;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #ef7095, #c9476c);
  box-shadow: 0 0 0 2px #c48a2c, inset 0 2px 0 rgba(255, 255, 255, .5);
  font-family: Georgia, serif;
  font-size: 1.05rem;
  font-weight: 900;
}
.brand strong, .brand small { display: block; }
.brand strong { color: #315f83; letter-spacing: .025em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: .72rem; }
.topbar nav { display: flex; align-items: stretch; gap: 6px; align-self: stretch; }
.topbar nav a { display: grid; min-width: 80px; place-items: center; border-bottom: 3px solid transparent; color: #5f7180; font-weight: 900; }
.topbar nav a:hover, .topbar nav a.active { border-color: var(--pink); color: var(--blue-deep); }

main { max-width: 1320px; margin: 0 auto; padding: 26px 22px 66px; }
.hero {
  position: relative;
  display: grid;
  min-height: 400px;
  grid-template-columns: minmax(0, 1.2fr) minmax(250px, .62fr) minmax(210px, .56fr);
  align-items: center;
  gap: 28px;
  overflow: hidden;
  padding: 70px 54px 52px;
  border: 4px solid rgba(255, 255, 255, .92);
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 87% 15%, rgba(255, 255, 255, .9) 0 4.5rem, transparent 4.7rem),
    radial-gradient(ellipse at 72% 27%, rgba(255, 255, 255, .73) 0 7.5rem, transparent 7.7rem),
    linear-gradient(125deg, rgba(46, 130, 187, .96), rgba(99, 180, 224, .91) 56%, rgba(176, 224, 244, .94));
  box-shadow: 0 20px 50px rgba(31, 93, 134, .28), inset 0 0 0 1px rgba(40, 104, 149, .3);
}
.hero::before,
.hero::after {
  position: absolute;
  border-radius: 48% 52% 45% 55%;
  content: "";
}
.hero::before {
  right: 4%;
  bottom: -88px;
  width: 260px;
  height: 180px;
  border: 3px solid rgba(255, 255, 255, .55);
  background: rgba(238, 126, 157, .68);
  box-shadow: inset 0 15px 0 rgba(255, 255, 255, .14);
  transform: rotate(-8deg);
}
.hero::after {
  right: 16%;
  bottom: -64px;
  width: 125px;
  height: 100px;
  background: rgba(255, 226, 121, .73);
  transform: rotate(12deg);
}
.hero-copy, .hero-stats { position: relative; z-index: 1; min-width: 0; }
.hero-character {
  position: relative;
  z-index: 1;
  align-self: end;
  width: min(100%, 330px);
  max-height: 335px;
  margin: 0 auto -55px;
  object-fit: contain;
  filter: drop-shadow(0 14px 16px rgba(23, 69, 99, .28));
}
.eyebrow { margin: 0 0 9px; color: #ffeab2; font-size: .76rem; font-weight: 900; letter-spacing: .12em; text-shadow: 0 1px 2px rgba(26, 77, 112, .55); text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 18px; color: #fff; font-size: clamp(2.4rem, 5.5vw, 4.8rem); line-height: 1; letter-spacing: -.045em; text-shadow: 0 3px 0 rgba(31, 84, 121, .2), 0 8px 24px rgba(31, 84, 121, .24); }
h1 span { color: #fff0ae; font-family: Georgia, serif; font-style: italic; font-weight: 500; }
.hero-copy > p:last-child { max-width: 690px; margin-bottom: 0; color: #f8fcff; font-size: clamp(1rem, 1.5vw, 1.16rem); line-height: 1.8; text-shadow: 0 1px 2px rgba(29, 81, 117, .5); }
.hero-stats { display: grid; gap: 10px; }
.hero-stats article {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 20px;
  padding: 16px 20px;
  border: 1px solid rgba(49, 109, 151, .28);
  border-radius: 13px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 20px rgba(33, 98, 141, .14), inset 0 1px 0 #fff;
}
.hero-stats strong { min-width: 70px; color: var(--pink); font: 700 2rem Georgia, serif; text-align: right; }
.hero-stats span { min-width: 0; color: #5d6870; }

.character-parade {
  position: relative;
  display: grid;
  min-height: 178px;
  grid-template-columns: minmax(250px, .54fr) minmax(0, 1.46fr);
  align-items: center;
  gap: 24px;
  overflow: hidden;
  margin-top: 18px;
  padding: 20px 26px;
  border: 1px solid rgba(96, 139, 169, .52);
  border-radius: 16px;
  background: linear-gradient(105deg, rgba(255, 250, 236, .98), rgba(240, 249, 255, .96));
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}
.character-parade::before {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 18%, rgba(255, 219, 126, .23), transparent 24%), repeating-linear-gradient(135deg, transparent 0 30px, rgba(93, 161, 204, .045) 30px 31px);
  content: "";
}
.parade-copy { position: relative; z-index: 2; }
.parade-copy span { display: block; margin-bottom: 6px; color: var(--pink); font: 800 .7rem Georgia, serif; letter-spacing: .14em; }
.parade-copy strong { display: block; color: var(--blue-deep); font-size: clamp(1.05rem, 2vw, 1.42rem); line-height: 1.45; }
.parade-characters {
  position: relative;
  z-index: 1;
  display: flex;
  height: 142px;
  align-items: end;
  justify-content: flex-end;
  gap: clamp(3px, .8vw, 13px);
}
.character {
  width: clamp(70px, 8vw, 112px);
  max-height: 140px;
  object-fit: contain;
  filter: drop-shadow(0 8px 7px rgba(44, 65, 79, .18));
  transform-origin: bottom center;
  transition: transform .2s ease;
}
.character:hover { transform: translateY(-5px); }
.character.adventurers { width: clamp(92px, 10vw, 140px); }
.character.acolytes { width: clamp(78px, 8.8vw, 122px); }
.character.munak { width: clamp(74px, 8.3vw, 116px); }
.character.tree, .character.turtle { width: clamp(66px, 7.4vw, 100px); }

.guide-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; margin-top: 25px; }
.guide-nav {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 17px 12px;
  border: 1px solid var(--blue-line);
  border-radius: 12px;
  background: rgba(255, 253, 248, .94);
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}
.guide-nav p { margin: 0 10px 10px; color: var(--muted); font-size: .75rem; font-weight: 900; text-transform: uppercase; }
.guide-nav a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 8px; color: var(--muted); font-weight: 900; }
.guide-nav a span { color: var(--pink); font: 700 .8rem Georgia, serif; }
.guide-nav a.active { color: #fff; background: linear-gradient(100deg, var(--blue-deep), var(--blue)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22); }
.guide-nav a.active span { color: var(--gold-light); }
.guide-content { display: grid; min-width: 0; gap: 22px; }
.panel {
  min-width: 0;
  scroll-margin-top: 92px;
  padding: clamp(22px, 4vw, 40px);
  border: 1px solid var(--blue-line);
  border-radius: 13px;
  background: rgba(255, 253, 248, .97);
  box-shadow: var(--shadow), inset 0 2px 0 #fff;
}
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-heading > div { min-width: 0; }
.panel .eyebrow { color: var(--pink); text-shadow: none; }
.section-heading h2 { margin-bottom: 0; color: #315f83; font-size: clamp(1.55rem, 2.7vw, 2.15rem); letter-spacing: -.03em; }
.config-badge, .result-count { padding: 7px 11px; border: 1px solid #e7bd69; border-radius: 999px; color: #9b6918; background: #fff7db; font-size: .76rem; white-space: nowrap; }
.lead { color: var(--muted); line-height: 1.75; }
code { padding: 2px 7px; border-radius: 5px; color: #a54567; background: #fff0f4; font-family: Consolas, monospace; }

.equipment-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.equipment-tabs button {
  min-height: 43px;
  padding: 8px 14px;
  border: 1px solid #b8cede;
  border-radius: 9px;
  color: #617381;
  background: linear-gradient(#fff, #eef6fb);
  font-weight: 900;
  box-shadow: inset 0 1px 0 #fff;
}
.equipment-tabs button:hover, .equipment-tabs button[aria-selected="true"] { border-color: #2d78ae; color: #fff; background: linear-gradient(#529bd0, #2f75aa); }
.equipment-summary { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 17px; margin-top: 16px; padding: 19px; border: 1px solid #bad0df; border-radius: 10px; background: linear-gradient(110deg, #eef8ff, #fffdf8); }
.equipment-icon { display: grid; width: 52px; height: 52px; place-items: center; border: 2px solid #fff; border-radius: 50%; color: #fff; background: linear-gradient(145deg, #ef89a5, #d9597e); box-shadow: 0 0 0 2px #e1aa4b; font-size: 1.4rem; }
.equipment-summary strong, .equipment-summary small { display: block; }
.equipment-summary strong { color: var(--blue-deep); }
.equipment-summary small { margin-top: 5px; color: var(--muted); line-height: 1.5; }
.pool-pill { color: var(--green); font-size: .78rem; font-weight: 900; white-space: nowrap; }
.line-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; padding: 13px 15px; border: 1px solid #e6c883; border-radius: 9px; background: #fffae9; }
.line-strip span { padding: 5px 10px; border: 1px solid #e5b550; border-radius: 999px; color: #95671b; background: #fff; font-size: .75rem; font-weight: 900; }
.line-strip p { flex: 1 1 380px; margin: 0 0 0 6px; color: var(--muted); font-size: .83rem; line-height: 1.6; }

.option-heading { align-items: center; }
.toolbar { display: grid; grid-template-columns: minmax(220px, 1fr) 230px; gap: 11px; }
.toolbar label { display: grid; gap: 7px; color: #687985; font-size: .75rem; font-weight: 900; }
.toolbar input, .toolbar select { width: 100%; min-height: 44px; padding: 9px 12px; border: 1px solid #adc7da; border-radius: 8px; outline: 0; color: var(--ink); background: #fff; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(71, 143, 193, .16); }
.pool-explanation { margin: 14px 0 0; padding: 12px 15px; border-left: 4px solid var(--pink); border-radius: 0 8px 8px 0; color: var(--muted); background: #fff3f6; line-height: 1.6; }
.option-groups { display: grid; gap: 16px; margin-top: 20px; }
.option-group { overflow: hidden; border: 1px solid #b8ccdc; border-radius: 10px; background: #fff; }
.option-group header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 15px; border-bottom: 1px solid #a9c7dd; color: #fff; background: linear-gradient(100deg, #337caf, #5aa3d2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25); }
.option-group h3 { margin: 0; font-size: .96rem; }
.option-group header span { color: #e9f7ff; font-size: .72rem; }
.option-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-item { display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 11px 15px; border-bottom: 1px solid #e6eef4; }
.option-item:nth-child(odd) { border-right: 1px solid #e6eef4; }
.option-item:nth-child(4n+1), .option-item:nth-child(4n+2) { background: #f8fbfd; }
.option-item strong { overflow: hidden; color: #4b4a50; font-size: .83rem; text-overflow: ellipsis; }
.option-item span { color: #b66a1f; font: 700 .8rem Consolas, monospace; white-space: nowrap; }
.empty-state { padding: 30px; border: 1px dashed var(--blue-line); border-radius: 9px; color: var(--muted); text-align: center; }

.rule-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.rule-grid article { padding: 19px; border: 1px solid #c3d5e2; border-radius: 10px; background: linear-gradient(135deg, #f4faff, #fff); }
.rule-grid article > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--pink); font: 700 .72rem Georgia, serif; }
.rule-grid h3 { margin: 10px 0 7px; color: var(--blue-deep); font-size: 1rem; }
.rule-grid p { margin-bottom: 0; color: var(--muted); font-size: .85rem; line-height: 1.65; }
footer { display: flex; max-width: 1276px; justify-content: space-between; gap: 20px; margin: 0 auto; padding: 25px 22px 40px; border-top: 1px solid rgba(61, 113, 151, .28); color: #687985; font-size: .78rem; }
footer a { color: var(--blue-deep); font-weight: 900; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr auto; gap: 27px; padding: 56px 30px 38px; }
  .hero-copy { grid-column: 1 / -1; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero-character { width: 190px; max-height: 210px; margin-bottom: -41px; }
  .character-parade { grid-template-columns: 1fr; gap: 12px; }
  .parade-characters { justify-content: center; }
  .hero-stats article { display: grid; gap: 3px; text-align: center; }
  .hero-stats strong { min-width: 0; text-align: center; }
  .guide-layout { grid-template-columns: 1fr; }
  .guide-nav { position: static; display: none; }
}

@media (max-width: 680px) {
  .topbar { min-height: 62px; padding: 0 14px; }
  .brand-number { width: 39px; height: 39px; font-size: .9rem; }
  .brand strong { font-size: .84rem; }
  .brand small { display: none; }
  .topbar nav a { min-width: 56px; font-size: .78rem; }
  main { padding: 13px 11px 38px; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding: 42px 20px 27px; border-width: 3px; border-radius: 15px; }
  .hero h1 span { display: block; margin-top: 8px; }
  .hero-copy > p:last-child { overflow-wrap: anywhere; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats article { display: flex; justify-content: space-between; text-align: left; }
  .hero-stats strong { text-align: left; }
  .hero-character { width: 180px; max-height: 170px; margin: -12px auto -30px; }
  .character-parade { min-height: 0; margin-top: 11px; padding: 17px 14px 10px; text-align: center; }
  .parade-characters { height: 104px; justify-content: center; gap: 0; }
  .character { width: 54px; max-height: 102px; margin: 0 -2px; }
  .character.adventurers { width: 73px; }
  .character.acolytes, .character.munak { width: 62px; }
  .character.tree, .character.turtle { width: 49px; }
  .character.maid { width: 49px; }
  .guide-layout { margin-top: 13px; }
  .panel { padding: 20px 16px; border-radius: 11px; }
  .section-heading { align-items: start; flex-direction: column; }
  .config-badge { white-space: normal; }
  .equipment-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .equipment-tabs button { min-width: 0; padding: 8px; overflow-wrap: anywhere; }
  .equipment-summary { grid-template-columns: auto minmax(0, 1fr); }
  .equipment-summary small { overflow-wrap: anywhere; }
  .pool-pill { grid-column: 1 / -1; }
  .line-strip p { flex-basis: 100%; margin-left: 0; }
  .toolbar { grid-template-columns: 1fr; }
  .pet-feature-grid, .pet-steps { grid-template-columns: 1fr; }
  .pet-evo-flow, .pet-tier-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pet-steps article { padding-left: 58px; }
  .option-list, .rule-grid { grid-template-columns: 1fr; }
  .option-item:nth-child(odd) { border-right: 0; }
  .option-item:nth-child(4n+1), .option-item:nth-child(4n+2) { background: transparent; }
  .option-item:nth-child(odd) { background: #f8fbfd; }
  footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .pet-evolution-heading { align-items: start; flex-direction: column; }
  .pet-evolution-heading > p { text-align: left; }
  .pet-evo-flow, .pet-tier-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
