/* 魔寵王 - site stylesheet
   The game's sky and title art in a clean framed page: banner, menu tabs, news ticker,
   left sidebar boxes, rounded panels. No web fonts, nothing from other sites. */

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  color: #333;
  font: 14px/1.7 "微軟正黑體", "Microsoft JhengHei", "PingFang TC", "Heiti TC", "新細明體", PMingLiU, sans-serif;
  background: #dff2fd linear-gradient(#57bdf0, #bfe6fb 340px, #eef9ff 800px) no-repeat;
  background-attachment: fixed;
}

a { color: #1b55a3; }
a:visited { color: #54408f; }
a:hover { color: #e04400; }
img { border: 0; }
p { margin: 0 0 7px; }
h1, h2, h3, h4 { margin: 0; font-size: 13px; }
code { font-family: "Courier New", monospace; font-size: 12px; background: #f3f7fb; border: 1px solid #c8d9ea; padding: 0 3px; }
.muted { color: #777; }
.small { font-size: 11px; }
.num { text-align: right; }
.plus { color: #18802b; }
.minus { color: #d01c1c; }
.pts, .price { color: #d84c00; font-weight: bold; }
.wait { color: #d01c1c; font-weight: bold; }

/* ---------- frame ---------- */
#page { width: 1000px; margin: 14px auto; background: #fff; border-radius: 12px; box-shadow: 0 6px 22px rgba(20, 70, 120, .28); }
#top { overflow: hidden; padding: 0 14px; border-radius: 12px 12px 0 0; font-size: 12px; line-height: 21px; color: #dcedff; background: #174e8c; }
#top .l { float: left; }
#top .r { float: right; }
#top a, #top a:visited { color: #ffe680; }
#top form.inline { display: inline; }

#banner {
  position: relative;
  height: 220px;
  overflow: hidden;
  background: #ffcf4a url(/static/banner.svg) center bottom / cover no-repeat;
}
#banner.art { background: #d8f3ff url(/static/client/banner-art.png) right center / cover no-repeat; }
#banner a { position: absolute; left: 34px; top: 26px; z-index: 2; text-decoration: none; }
#banner img { display: block; }
#banner a img { width: 440px; height: auto; filter: drop-shadow(0 3px 4px rgba(10, 60, 110, .35)); }
#banner a img.domain { width: 65%; height: auto; margin: 3px auto 0; filter: none; }
#banner .s { display: block; margin: 4px 0 0 150px; font-size: 15px; font-weight: bold; color: #174e8c; }

/* menu tabs */
#nav { display: flex; position: relative; z-index: 5; background: linear-gradient(#5fafee, #1f73c8); border-top: 1px solid #fff; border-bottom: 1px solid #174e8c; }
#nav > a, #nav summary {
  flex: 1;
  display: block;
  padding: 0 6px;
  line-height: 33px;
  text-align: center;
  white-space: nowrap;
  color: #fff;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  list-style: none;
  border-right: 1px solid #174e8c;
  border-left: 1px solid #8cc6f4;
}
#nav > a { flex: 1; }
#nav summary::-webkit-details-marker { display: none; }
#nav summary::after { content: " ▾"; font-size: 11px; }
#nav > a:hover, #nav summary:hover { color: #fff36b; }
#nav > a.on, .drop.on summary { background: linear-gradient(#ffcf4d, #ff8a00); color: #fff; border-left-color: #ffd98a; text-shadow: 1px 1px 0 #a85800; }
.drop { flex: 1; position: relative; }
.drop-menu { position: absolute; left: 0; top: 100%; width: 150px; background: #1f73c8; border: 1px solid #174e8c; }
.drop-menu a, .drop-menu a:visited { display: block; padding: 0 12px; line-height: 26px; color: #fff; text-decoration: none; border-bottom: 1px solid #4b94da; }
.drop-menu a:hover { background: #ff9a14; color: #fff; }

/* ticker */
#marq { overflow: hidden; white-space: nowrap; line-height: 25px; font-weight: bold; color: #c04000; background: #fffbea; border-bottom: 1px solid #f0d890; }
#marq span { display: inline-block; padding-left: 100%; animation: marq 26s linear -5s infinite; }
@keyframes marq { to { transform: translateX(-100%); } }
@media (prefers-reduced-motion: reduce) { #marq span { animation: none; padding-left: 8px; } }

#cols { overflow: hidden; }
#main { float: right; width: 776px; padding: 12px 14px 14px 10px; box-sizing: border-box; min-height: 420px; border-left: 1px solid #cfe1f3; }
#side { float: left; width: 224px; padding: 12px 8px 14px 12px; box-sizing: border-box; background: #eef7ff; }
#cols { background: linear-gradient(#eef7ff, #eef7ff) left top / 224px 100% no-repeat; }
body.admin #main { float: none; width: auto; padding: 8px 10px 12px; border-left: 0; }
body.admin #cols { background: none; }

#foot { clear: both; border-radius: 0 0 12px 12px; padding: 9px 8px; font-size: 11px; line-height: 18px; text-align: center; color: #e6f2ff; background: linear-gradient(#1f73c8, #0f4a8a); }

.crumb { font-size: 12px; color: #666; padding: 0 2px 4px; margin-bottom: 7px; border-bottom: 1px dotted #a9c7e4; }

/* ---------- title bars ---------- */
.sbox-h, .panel > h1:first-child, .panel > h2:first-child {
  padding: 6px 11px;
  font-size: 15px;
  font-weight: bold;
  color: #fff;
  background: linear-gradient(#3fa9ee, #1f78cf);
}
.sbox-h::before, .panel > h1:first-child::before, .panel > h2:first-child::before { content: "◆ "; color: #ffd83a; }

/* ---------- sidebar boxes ---------- */
.sbox { border: 1px solid #a9d2f0; border-radius: 8px; overflow: hidden; margin-bottom: 10px; background: #fff; }
.sbox-b { padding: 8px 9px 6px; font-size: 13px; }
.sbox-b p { margin-bottom: 3px; }
.sbox-b .grp { margin: 5px 0 1px; font-weight: bold; color: #c26000; }
.sbox-b .grp:first-child { margin-top: 0; }
ul.menu { list-style: none; margin: 0 0 3px; padding: 0; }
ul.menu li { padding: 1px 0 1px 10px; border-bottom: 1px dotted #c2d8ec; position: relative; }
ul.menu li::before { content: "‧"; position: absolute; left: 1px; color: #e04400; font-weight: bold; }
ul.menu li:last-child { border-bottom: 0; }
ul.menu a.on { color: #d01c1c; font-weight: bold; text-decoration: none; }
.sideform label { display: block; margin-bottom: 4px; }
.sideform input[name] { width: 128px; }
.sideform input[type="hidden"] { display: none; }
ul.pet-grid { list-style: none; margin: 0 0 3px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
ul.pet-grid li { display: flex; align-items: center; justify-content: center; height: 54px; background: #fff8d8; border: 1px solid #f0d890; }
ul.pet-grid img { display: block; max-width: 48px; max-height: 48px; width: auto; height: auto; }

/* ---------- content boxes ---------- */
.panel { border: 1px solid #a9d2f0; border-radius: 8px; overflow: hidden; margin: 0 0 12px; padding: 9px 12px 7px; background: #fff; }
.panel > h1:first-child, .panel > h2:first-child { margin: -9px -12px 9px; }
.page-head { margin: 0 0 6px; }
.page-head h1 { font-size: 14px; color: #1d4f8c; padding: 2px 0 3px 7px; border-left: 5px solid #ff8a00; border-bottom: 1px solid #7fb2df; margin-bottom: 7px; }
.narrow { max-width: 470px; }
.more { text-align: right; margin: 3px 0 2px; font-size: 12px; }
ol.steps { margin: 0 0 7px; padding-left: 24px; }
.alert { margin: 0 0 8px; padding: 7px 10px 3px; background: #fffbea; border: 2px dashed #e60000; }
.alert-t { font-size: 14px; font-weight: bold; color: #e60000; }
.home-art { margin: 0 0 7px; text-align: center; }
.home-art img { max-width: 100%; height: auto; border: 1px solid #7fb2df; }
ul.class-row { list-style: none; margin: 0; padding: 0; display: flex; justify-content: space-around; align-items: flex-end; }
ul.class-row a { display: block; text-align: center; font-weight: bold; text-decoration: none; }
ul.class-row img { display: block; margin: 0 auto 2px; height: 104px; width: auto; }

.news-item { border-bottom: 1px dotted #a9c7e4; }
.news-item summary { padding: 4px 2px; cursor: pointer; color: #1d4f8c; font-weight: bold; }
.news-item summary:hover { color: #e04400; }
.news-item .d { color: #c26000; font: 12px Verdana, Arial, sans-serif; }
.news-body { padding: 2px 6px 4px; }

table.rows { width: 100%; border-collapse: collapse; }
table.rows td { padding: 2px 4px; border-bottom: 1px dotted #b6cfe6; vertical-align: top; }
table.rows td.k { width: 84px; white-space: nowrap; font-weight: bold; }
table.rows tr:last-child td { border-bottom: 0; }
.panel > h3 { margin: 9px 0 2px; padding-left: 6px; color: #c26000; border-left: 3px solid #ff8a00; }

.newsitem { padding: 5px 0 2px; border-bottom: 1px dashed #a9c7e4; }
.newsitem:last-child { border-bottom: 0; }
.newsitem .d { color: #c26000; font: 12px Verdana, Arial, sans-serif; }
.newsitem p { margin: 3px 0 6px; }

/* ---------- notices / status ---------- */
.notice { margin: 0 0 8px; padding: 5px 9px; border: 1px solid #e0c060; background: #fffbea; }
.notice-ok { border-color: #7fb26a; background: #eef8e6; color: #1f5c14; }
.notice-error { border-color: #d08a8a; background: #fdeeee; color: #a01515; font-weight: bold; }
.notice-info { border: 1px dashed #c9a23a; background: #fffbea; color: #5a4300; }
.status { font-weight: bold; white-space: nowrap; }
.status-pending { color: #d07000; }
.status-delivered { color: #18802b; }
.status-failed { color: #d01c1c; }
.status-refunded { color: #777; }
.tag-test { font-size: 11px; font-weight: bold; color: #fff; background: #d01c1c; padding: 0 5px; }
.sandbox { border: 2px dashed #d01c1c; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 9px; }
table { font-size: 13px; }
.table-wrap table, table.data, table.facts { border-collapse: collapse; }
.table-wrap table { width: 100%; }
.table-wrap th, .table-wrap td, table.data th, table.data td, table.facts th, table.facts td {
  border: 1px solid #a7cdee;
  padding: 3px 6px;
  text-align: left;
  vertical-align: top;
  line-height: 1.55;
}
.table-wrap th, table.data th, table.facts th { background: #dcecfb; color: #1d4f8c; white-space: nowrap; }
.table-wrap td.num, .table-wrap th.num, table.data td.num, table.data th.num { text-align: right; white-space: nowrap; }
table.data tbody tr:nth-child(even) td { background: #f5faff; }
table.data td:first-child { white-space: nowrap; }
table.shop td:first-child { white-space: normal; }
table.shop td.num { width: 1%; }
table.facts { margin: 0 0 9px; }
table.facts th { width: 80px; font-weight: normal; }
table.stats { width: 320px; max-width: 100%; margin-bottom: 7px; }
td.actions form.inline, td.actions .inline-details { margin-left: 3px; }

/* game info text */
.prose h2 { margin: 14px 0 7px; padding: 4px 10px; border-radius: 4px; font-size: 14px; color: #fff; background: linear-gradient(#5fafee, #1f73c8); }
.prose h3 { margin: 12px 0 5px; padding-left: 8px; font-size: 14px; color: #c26000; border-left: 4px solid #ff8a00; border-bottom: 1px dotted #e6c98a; }
.prose h4 { margin: 8px 0 3px; color: #1d4f8c; }
.prose h4::before { content: "◎ "; color: #ff8a00; }
.prose td:first-child { white-space: nowrap; background: #f5faff; }
.prose th[colspan] { text-align: left; }
.prose .figcap { color: #777; font-size: 12px; padding-left: 8px; border-left: 2px solid #c2d8ec; }
.source-note { margin-top: 12px; padding-top: 5px; font-size: 11px; color: #777; border-top: 1px dotted #a9c7e4; }

/* guide pictures */
.fig { margin: 7px 0 10px; padding: 4px; border: 1px solid #c2d8ec; background: #f5faff; display: table; max-width: 100%; box-sizing: border-box; }
.fig img { display: block; max-width: 100%; height: auto; }
.fig p, .gal > p { margin: 3px 2px 1px; font-size: 12px; color: #666; }
.gal { margin: 7px 0 10px; padding: 4px 6px 2px; border: 1px solid #c2d8ec; background: #f5faff; }
.gal > p { margin: 0 0 4px; font-weight: bold; color: #c26000; }
.gal ul { list-style: none; margin: 0; padding: 0; }
.gal li { display: inline-block; vertical-align: bottom; margin: 0 4px 6px 0; padding: 4px 4px 2px; min-width: 62px; max-width: 100%; box-sizing: border-box; text-align: center; background: #fff; border: 1px solid #d8e6f3; }
.gal li img { display: block; margin: 0 auto 2px; max-width: 100%; height: auto; }
.gal li span { font-size: 12px; color: #444; }
.gal-small li { min-width: 54px; }

.fig-wide { display: block; }
.fig-wide img { width: 100%; }

/* ---------- pet encyclopedia ---------- */
.filter { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 8px; padding: 8px; background: #eef7ff; border-radius: 6px; }
.filter select, .filter input { padding: 3px 5px; border: 1px solid #7f9db9; border-radius: 4px; }
.line { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 2px; border-bottom: 1px dotted #b6cfe6; }
.line-forms { display: flex; flex-wrap: wrap; gap: 6px; }
a.form { display: flex; flex-direction: column; align-items: center; width: 92px; padding: 5px 2px 3px; text-align: center; text-decoration: none; color: #174e8c; background: #f5faff; border: 1px solid #d2e5f5; border-radius: 6px; }
a.form:hover { border-color: #ff8a00; background: #fffbea; }
a.form.here { border-color: #ff8a00; background: #fff4d0; }
a.form img { width: 52px; height: 52px; border-radius: 4px; }
a.form b { font-size: 13px; line-height: 1.3; margin-top: 2px; }
a.form small { font-size: 11px; color: #888; }
.line-tags { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.el { display: inline-flex; align-items: center; gap: 3px; font-weight: bold; color: #174e8c; }
.el img { width: 22px; height: 22px; }
.tag { padding: 0 8px; font-size: 12px; line-height: 20px; border-radius: 10px; background: #dcecfb; color: #1d4f8c; }
.tag-special { background: #ffe6a8; color: #8a4b00; }
.pet-top { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-bottom: 6px; }
.pet-art { display: flex; align-items: center; justify-content: center; width: 170px; min-height: 130px; background: radial-gradient(#fffbea, #d8eefc); border-radius: 8px; }
.pet-art img { max-width: 150px; height: auto; }
.pet-top .table-wrap { flex: 1 1 240px; }
.skills { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.skill { display: flex; gap: 6px; padding: 6px; background: #f5faff; border: 1px solid #d2e5f5; border-radius: 6px; font-size: 12px; }
.skill.empty { background: none; border-style: dashed; }
.skill img { flex: none; width: 24px; height: 24px; }
.skill b { color: #174e8c; font-size: 13px; }
.skill small { display: block; color: #c26000; }
.skill p { margin: 2px 0 0; color: #555; }

/* ---------- guide layout ---------- */
.lead { font-size: 15px; color: #174e8c; font-weight: bold; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0 0 10px; }
.c { padding: 8px 11px 5px; background: #f5faff; border: 1px solid #d2e5f5; border-radius: 8px; }
.prose .c h3 { margin: 0 0 3px; padding: 0; border: 0; color: #174e8c; font-size: 15px; }
.c p { margin: 0 0 4px; }
.c ul, .prose > ul { margin: 2px 0 6px; padding-left: 19px; }
.sub { font-size: 12px; color: #c26000; }
.ico { width: 22px; height: 22px; vertical-align: middle; }
.ico.wide { display: block; width: 100%; height: 130px; object-fit: cover; object-position: center; margin-bottom: 6px; border-radius: 5px; }
.ico.tall { width: auto; height: 96px; }
.sprites { float: right; margin-left: 4px; }
.job { min-height: 100px; }
.feats { display: grid; gap: 3px; }
.feat { display: grid; grid-template-columns: 26px 66px minmax(0, 1fr); gap: 6px; align-items: center; font-size: 13px; }
.feat .ico { width: 24px; height: 24px; }
.feat b { color: #174e8c; }
details.more { margin: 10px 0; padding: 5px 10px; background: #f5faff; border: 1px solid #d2e5f5; border-radius: 6px; }
details.more summary { cursor: pointer; color: #1b55a3; font-weight: bold; }
.tile-h { margin: 8px 0 5px; color: #c26000; font-size: 14px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 7px; margin-bottom: 6px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 3px 5px; text-align: center; text-decoration: none; color: #174e8c; background: #f5faff; border: 1px solid #d2e5f5; border-radius: 8px; }
.tile:hover { border-color: #ff8a00; background: #fffbea; text-decoration: none; }
.tile img { width: 52px; height: 52px; object-fit: contain; }

/* ---------- ranking boards ---------- */
.tabs { display: flex; gap: 4px; margin-bottom: -1px; position: relative; }
.tab { flex: 1; padding: 7px 4px; text-align: center; font-weight: bold; text-decoration: none; color: #174e8c; background: #dcecfb; border: 1px solid #a9d2f0; border-bottom: 0; border-radius: 8px 8px 0 0; }
.tab:hover { background: #fffbea; text-decoration: none; }
.tab.on { color: #fff; background: linear-gradient(#ffcf4d, #ff8a00); border-color: #ff8a00; }
table.rank { width: 100%; min-width: 0; }
table.rank td.pos, table.rank th.pos { width: 46px; text-align: center; font-weight: bold; color: #174e8c; }
table.rank tbody tr.top td, table.rank tbody tr.top:nth-child(even) td { background: #fff8d8; }
table.rank tr.top td.pos { color: #d84c00; font-size: 15px; }
.holder { margin: 0 0 8px; padding: 8px 12px; font-size: 15px; text-align: center; background: linear-gradient(#fff4c4, #ffd98a); border: 1px solid #f0c060; border-radius: 6px; }
.holder.none { background: #f5faff; border-color: #d2e5f5; color: #777; }
.rules p { margin: 0 0 3px; }
.rules b { display: inline-block; width: 58px; color: #c26000; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin: 10px 0 6px; }
.pager a, .pager span { min-width: 34px; padding: 4px 8px; text-align: center; box-sizing: border-box; border-radius: 5px; }
.pager a { color: #174e8c; text-decoration: none; background: #f5faff; border: 1px solid #d2e5f5; }
.pager a:hover { border-color: #ff8a00; background: #fffbea; }
.pager .on { color: #fff; font-weight: bold; background: linear-gradient(#ffcf4d, #ff8a00); border: 1px solid #ff8a00; }
.pager .gap { color: #888; }

/* ---------- forms ---------- */
input, select, textarea, button { font: 13px "微軟正黑體", "Microsoft JhengHei", "PingFang TC", sans-serif; }
input[type="text"], input[type="password"], input[type="email"], input[type="number"], input:not([type]), select, textarea {
  border: 1px solid #7f9db9;
  padding: 2px 4px;
  background: #fff;
  color: #222;
  box-sizing: border-box;
}
input:focus, select:focus, textarea:focus { background: #fffff0; outline: 1px solid #ff8a00; }
.form label { display: block; margin: 0 0 7px; font-weight: bold; color: #444; }
.form label input, .form label select, .form label textarea { display: block; width: 260px; max-width: 100%; margin-top: 1px; font-weight: normal; }
.form label textarea { width: 420px; }
.form small { display: block; font-weight: normal; font-size: 11px; color: #777; }
.form .row label { display: inline-block; margin-right: 10px; vertical-align: top; }
.form .row label input { width: 96px; }
.form label.radio { font-weight: normal; margin-bottom: 3px; }
.form label.radio input { display: inline; width: auto; margin: 0 3px 0 0; }
.inline-form label { display: inline-block; vertical-align: bottom; margin-right: 6px; }
form.inline { display: inline; }
.btn, a.btn, a.btn:visited {
  display: inline-block;
  padding: 1px 10px;
  line-height: 22px;
  font-size: 13px;
  border-radius: 4px;
  color: #174e8c;
  text-decoration: none;
  cursor: pointer;
  background: linear-gradient(#fff, #cfe7ff);
  border: 1px solid #5b95cc;
}
.btn:hover { background: #fff; color: #e04400; }
.btn-gold, a.btn-gold, a.btn-gold:visited { background: linear-gradient(#fff4a8, #ffc42e); border-color: #c98400; font-weight: bold; color: #1d4f8c; }
.btn-gold:hover { background: #ffe066; }
.btn-sm { padding: 0 6px; line-height: 17px; font-size: 11px; }
.chips { margin: 0 0 6px; font-size: 12px; }
.chip { margin-right: 10px; }
.chip.active { color: #d01c1c; font-weight: bold; text-decoration: none; }
.picker { margin: 0 0 7px; padding: 2px 0 2px 22px; max-height: 190px; overflow: auto; border: 1px solid #a7cdee; background: #f5faff; font-size: 12px; }
.inline-details { display: inline-block; vertical-align: top; }
.inline-details summary { list-style: none; }
.inline-details summary::-webkit-details-marker { display: none; }
.inline-details[open] { display: block; margin-top: 5px; padding: 5px 7px; border: 1px dotted #a7cdee; background: #f5faff; }

/* ---------- narrow screens: one column, same look ---------- */
@media (max-width: 1020px) {
  body.admin #page { width: auto; margin: 0; }
  body.admin #main { padding: 8px; }
}
@media (max-width: 1020px) {
  body { font-size: 15px; }
  .skills, .cards { grid-template-columns: minmax(0, 1fr); }
  .feat { grid-template-columns: 26px 74px minmax(0, 1fr); }
  a.form { width: 86px; }
  #page { width: auto; margin: 0; border-radius: 0; box-shadow: none; }
  #top, #foot { border-radius: 0; }
  #top .l { display: none; }
  #top .r { float: none; display: block; text-align: right; }
  #banner { height: 122px; }
  #banner.art { height: clamp(108px, 22vw, 220px); }
  #banner a { left: 8px; top: 5%; }
  #banner a img { width: clamp(150px, 57vw, 310px); }
  #banner .s { margin: 2px 0 0 8%; font-size: 12px; }
  #nav { flex-wrap: wrap; }
  #nav > a, .drop { flex: 1 0 25%; }
  #nav > a, #nav summary { line-height: 32px; box-sizing: border-box; border-bottom: 1px solid #174e8c; }
  .drop-menu { width: 200px; }
  #cols { background: none; }
  #main, #side { float: none; width: auto; padding: 8px; min-height: 0; border-left: 0; }
  #side { background: #eef7ff; }
  table { font-size: 13px; }
  input, select, textarea, button, .btn, a.btn { font-size: 14px; }
  .form label input, .form label select, .form label textarea { width: 100%; }
  table.data { min-width: 520px; }
  table.shop, table.stats, table.rank { min-width: 0; }
  table.rank th, table.rank td { padding: 3px 4px; white-space: normal; }
  table.rank td.pos, table.rank th.pos { width: 34px; }
  table.rows td.k { width: 78px; }
  ul.class-row img { height: 74px; }
}
