:root {
  color-scheme: dark;
  --bg: #0e0b0c;
  --surface: #171217;
  --surface-raised: #20191c;
  --line: #5a4639;
  --gold: #e0b775;
  --gold-soft: #ad8855;
  --ivory: #f0e8d9;
  --muted: #b8aca2;
  --dragon: #81b5ac;
  --alert: #f4b9a7;
  font-family: "Segoe UI", Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 78px; }
body { margin: 0; min-width: 320px; color: var(--ivory); background: var(--bg); }
button, input { font: inherit; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
img { max-width: 100%; }
h1, h2, h3, p { overflow-wrap: break-word; }
.container { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.hidden { display: none !important; }
.skip { position: absolute; left: 10px; top: -90px; z-index: 20; padding: 12px; background: var(--gold); color: #191013; }
.skip:focus { top: 8px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.header { position: relative; z-index: 4; background: #100c10; border-bottom: 1px solid #60412e; box-shadow: 0 6px 26px #0008; }
.navwrap { min-height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.brand { display: flex; align-items: center; gap: 8px; flex: none; }
.brand img { width: 45px; height: 56px; object-fit: contain; }
.brand span { font: 700 1.2rem Georgia, serif; letter-spacing: .06em; white-space: nowrap; }
.brand b, .footer-inner strong { color: var(--gold); }
.brand small { display: block; color: #baab98; font: 600 .55rem "Segoe UI", sans-serif; letter-spacing: .21em; margin-top: 5px; }
.nav { display: flex; align-items: center; justify-content: flex-end; gap: 21px; }
.nav a { font-size: .81rem; font-weight: 700; white-space: nowrap; color: #d9cbbc; }
.nav a:hover, .footer a:hover { color: var(--gold); }
.nav .nav-login { border: 1px solid #6a5641; padding: 9px 12px; }
.nav .nav-create { background: linear-gradient(#e2bd7d, #b9884e); padding: 10px 14px; color: #22130d; }
.nav-toggle { display: none; border: 1px solid var(--line); color: var(--gold); background: transparent; font-size: 1.4rem; padding: 3px 11px; }
.hero { position: relative; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 76% 45%, #6a312a72, transparent 44%), linear-gradient(110deg, #1e171b 0%, #100c11 60%, #171014 100%); border-bottom: 1px solid #563728; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .32; background: repeating-linear-gradient(90deg, transparent 0 78px, #8c6a5311 79px 80px); }
.hero-grid { min-height: 385px; max-height: 490px; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); align-items: center; gap: 0; }
.hero-copy { z-index: 1; padding: 38px 0 42px; }
.hero-kicker { color: var(--gold); font-size: .74rem; font-weight: 800; letter-spacing: .21em; margin: 0 0 16px; }
.hero h1 { font: 700 clamp(2.7rem, 5vw, 4.9rem)/1.06 Georgia, "Times New Roman", serif; max-width: 640px; letter-spacing: -.035em; margin: 0; text-shadow: 0 3px 22px #090507; }
.hero h1 span { color: var(--gold); }
.hero-desc { max-width: 510px; font-size: .98rem; line-height: 1.65; color: #d0c3b7; margin: 17px 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 25px; }
.btn { min-height: 41px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 19px; border: 1px solid transparent; font-size: .83rem; font-weight: 750; text-align: center; transition: background .16s, border-color .16s; }
.btn-primary { color: #21140e; background: linear-gradient(115deg, #efd099, #bb854a); border-color: #d4a363; }
.btn-primary:hover { background: #efd6a7; }
.btn-line { color: #ecdcc9; background: #181015b8; border-color: #8a7055; }
.btn-line:hover { border-color: var(--gold); background: #2e2227; }
.hero-dragon { height: 385px; display: grid; place-items: center; position: relative; }
.hero-dragon::before { content: ""; position: absolute; width: 72%; aspect-ratio: 1; border: 1px solid #ad7c4855; transform: rotate(45deg) scale(.74); }
.hero-dragon img { max-height: 425px; height: 100%; width: 100%; object-fit: contain; position: relative; filter: drop-shadow(0 5px 25px #28867b30); }
.realm-status { background: #241b1b; border-bottom: 1px solid var(--line); }
.status-bar { min-height: 66px; display: grid; grid-template-columns: 1.25fr 1fr .7fr 1.15fr; gap: 20px; align-items: center; }
.status-bar > div:not(:first-child) { border-left: 1px solid #6b5042; padding-left: 19px; }
.status-bar span { color: #c8b7a9; font-size: .72rem; }
.status-bar strong { display: block; font-size: .84rem; margin-top: 5px; }
.status-name { display: flex; align-items: center; gap: 11px; }
.status-name strong { margin: 0; }
.online-dot { width: 9px; height: 9px; flex: none; background: #75c3a4; box-shadow: 0 0 12px #75c3a466; border-radius: 50%; }
.online-dot.offline { background: #ab7067; box-shadow: none; }
.status-shop { border-left: 1px solid #6b5042; display: flex; align-items: center; padding-left: 19px; gap: 8px; }
.status-shop img { width: 28px; height: 34px; object-fit: contain; }
.status-shop b { color: var(--gold); display: block; margin-top: 3px; }
.realm-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(310px, .85fr); gap: 18px; align-items: start; margin-top: 22px; }
.realm-primary { display: grid; gap: 18px; min-width: 0; }
.panel { background: linear-gradient(145deg, #20191b, #151114); border: 1px solid #614b3b; box-shadow: inset 0 1px #92705722; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; border-bottom: 1px solid #5b4437; min-height: 49px; padding: 11px 20px; background: linear-gradient(90deg, #3e2623, #20181a); }
.panel-title h2 { margin: 0; font: 700 1.1rem Georgia, serif; color: #f0d9ae; }
.panel-title > span { color: #bca18a; font-size: .64rem; letter-spacing: .12em; font-weight: 800; }
.news-row { display: flex; gap: 15px; align-items: center; padding: 15px 21px; border-top: 1px solid #45383188; }
.news-row:first-of-type { border-top: none; }
.news-mark { display: grid; place-items: center; width: 32px; height: 32px; flex: none; color: var(--gold); border: 1px solid #78583d; background: #2a1d1b; }
.news-row strong { font-size: .84rem; font-weight: 700; }
.news-row small { color: var(--muted); font-size: .75rem; display: block; line-height: 1.5; margin-top: 5px; }
.ranking-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 125px; gap: 8px; padding: 11px 21px; font-size: .78rem; border-top: 1px solid #45383188; }
.ranking-row span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking-row span:last-child { text-align: right; }
.ranking-header { background: #271c1c; color: var(--gold); font-weight: 800; font-size: .71rem; border-top: none; }
.ranking-data > p { margin: 0; padding: 19px; color: var(--muted); font-size: .81rem; }
.auth-panel { position: relative; }
.anchor-point { position: absolute; top: -75px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 11px 20px 0; gap: 15px; }
.auth-tabs button { padding: 10px 0; color: #b7a89b; background: none; border: none; border-bottom: 2px solid #604b3f; font-size: .81rem; font-weight: 750; }
.auth-tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }
.auth-form { padding: 14px 25px 0; }
.auth-form label:not(.checkbox-label) { display: flex; justify-content: space-between; gap: 10px; margin: 9px 0 6px; font-size: .75rem; font-weight: 700; }
.auth-form label small { font-size: .66rem; color: #d4b480; }
.auth-form input:not([type=checkbox]) { width: 100%; min-height: 39px; padding: 9px 12px; background: #100d11; border: 1px solid #685748; border-radius: 2px; color: #fff8ed; outline-offset: 0; }
.auth-form input::placeholder { color: #86776f; }
.full { width: 100%; margin-top: 15px; }
.checkbox-label { display: flex; align-items: flex-start; gap: 9px; color: var(--muted); font-size: .72rem; line-height: 1.45; margin-top: 13px; }
.checkbox-label input { accent-color: #cba369; }
.checkbox-label a { text-decoration: underline; color: var(--gold); }
.form-status { min-height: 22px; margin: 9px 0; font-size: .74rem; color: #d1c3b6; line-height: 1.4; }
.form-status.error { color: var(--alert); }
.form-status.success { color: #b2e3bd; }
.auth-form button:disabled { opacity: .55; cursor: not-allowed; }
.honeypot { position: absolute; left: -20000px; }
.account-area { padding: 20px 24px; }
.account-title { display: flex; justify-content: space-between; align-items: center; }
.account-title h3 { font: 700 1.2rem Georgia, serif; margin: 0; }
.btn-small { padding: 7px 11px; border: 1px solid #88694b; background: #1b1416; color: var(--gold); }
.account-greet { font-size: .9rem; }
.account-greet strong { color: var(--gold); }
.profile-email { font-size: .8rem; color: var(--muted); overflow-wrap: anywhere; }
.account-area h4 { margin: 17px 0 10px; font-size: .82rem; color: var(--gold); }
.character-list { display: grid; gap: 6px; }
.character-list > p { color: var(--muted); font-size: .8rem; }
.character-line { display: flex; justify-content: space-between; padding: 9px 10px; border: 1px solid #473b31; font-size: .8rem; }
.character-line small { color: var(--gold); }
.account-note { color: var(--muted); font-size: .72rem; line-height: 1.55; }
.auth-footer { text-align: center; font-size: .7rem; color: #a9a09a; margin: 5px 0 15px; }
.classes-panel { margin-top: 19px; }
.class-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.class-card { padding: 17px 14px; min-width: 0; border-left: 1px solid #5b4535; display: flex; align-items: center; gap: 11px; }
.class-card:first-child { border-left: none; }
.class-card > span { color: var(--gold); font-size: 1.75rem; flex: none; }
.class-card h3 { font: 700 .92rem Georgia, serif; margin: 0 0 5px; }
.class-card small { color: var(--muted); font-size: .67rem; }
.class-note { color: #b7a79c; padding: 8px 20px 13px; margin: 0; border-top: 1px solid #3d3030; font-size: .7rem; }
.join-strip { margin-top: 20px; margin-bottom: 20px; padding: 18px 23px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #604b39; background: linear-gradient(100deg, #2f1e1d, #191319); }
.join-strip h2 { font: 700 1.12rem Georgia, serif; margin: 0 0 5px; }
.join-strip p { color: var(--muted); font-size: .76rem; line-height: 1.5; margin: 0; max-width: 520px; }
.join-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.join-actions .btn { min-height: 37px; }
.footer { border-top: 1px solid #60412e; background: #09080b; padding: 19px 0; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-inner > div span { display: block; color: #ac9a8f; margin-top: 5px; font-size: .72rem; }
.footer a { color: var(--gold); font-size: .75rem; }
.footer details { flex-basis: 100%; font-size: .72rem; color: #baaca3; }
.footer summary { cursor: pointer; width: max-content; }
.footer details p { max-width: 970px; line-height: 1.6; }
.shop-header { margin-top: 23px; padding: 24px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: linear-gradient(120deg, #322120, #151115); border: 1px solid #73543c; }
.shop-header h1 { font: 700 clamp(1.9rem, 3.8vw, 3rem) Georgia, serif; margin: 0 0 9px; }
.shop-header h1 span { color: var(--gold); }
.shop-header p { color: var(--muted); font-size: .86rem; max-width: 580px; line-height: 1.6; margin: 0; }
.shop-coin { min-width: 220px; display: flex; align-items: center; gap: 13px; border: 1px solid #96724a; padding: 15px; background: #241c19; }
.shop-coin img { width: 48px; height: 55px; object-fit: contain; }
.shop-coin strong { display: block; color: var(--gold); font-size: 1rem; }
.shop-coin small { display: block; color: var(--muted); margin-top: 5px; font-size: .71rem; }
.shop-coin a { font-size: .7rem; color: var(--gold); text-decoration: underline; display: inline-block; margin-top: 5px; }
.shop-main { min-height: 480px; }
.shop-toolbar { margin: 20px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.shop-toolbar h2 { font: 700 1.15rem Georgia, serif; color: #f0d9ae; margin: 0; }
.shop-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-filters button { border: 1px solid #6a5646; background: #1c1618; color: #d2c6b8; padding: 8px 13px; font-size: .75rem; }
.shop-filters button.active { border-color: var(--gold); background: #473125; color: #ffe4b3; }
.shop-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.shop-item { min-height: 190px; display: flex; flex-direction: column; padding: 18px; background: linear-gradient(140deg, #241a1a, #141115); border: 1px solid #6a5140; }
.item-crest { display: grid; place-items: center; width: 48px; height: 48px; color: var(--gold); font-size: 1.65rem; border: 1px solid #8a6947; background: #372725; margin-bottom: 14px; }
.shop-item h3 { font: 700 .94rem Georgia, serif; margin: 0 0 8px; }
.shop-item p { color: var(--muted); font-size: .74rem; margin: 0 0 12px; }
.item-price { margin-top: auto; padding-top: 12px; border-top: 1px solid #644e3d; font-size: .79rem; color: var(--gold); }
.shop-disclosure { max-width: 880px; color: #bdafa3; font-size: .74rem; line-height: 1.65; margin: 20px 0 28px; }
.shop-session { margin: 12px 0 0; color: var(--muted); font-size: .75rem; }
.shop-session strong { color: var(--gold); }
@media (max-width: 1000px) {
  .nav { gap: 11px; }
  .nav a { font-size: .73rem; }
  .brand span { font-size: 1.04rem; }
  .realm-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, .87fr); }
  .class-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .class-card:nth-child(3) { border-left: 0; border-top: 1px solid #5b4535; }
  .class-card:nth-child(4) { border-top: 1px solid #5b4535; }
  .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .navwrap { min-height: 68px; }
  .nav-toggle { display: block; }
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; padding: 12px 20px 19px; background: #1a1217; border-bottom: 1px solid #654632; box-shadow: 0 15px 22px #0009; flex-direction: column; align-items: stretch; gap: 0; }
  .nav.open { display: flex; }
  .nav a, .nav .nav-login, .nav .nav-create { padding: 12px 14px; font-size: .87rem; }
  .hero-grid { min-height: 0; max-height: none; grid-template-columns: 1fr .7fr; }
  .hero h1 { font-size: clamp(2.1rem, 6.5vw, 3.6rem); }
  .hero-desc { font-size: .85rem; }
  .hero-dragon { height: 300px; }
  .status-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding-top: 11px; padding-bottom: 11px; }
  .status-bar > div, .status-shop { min-height: 42px; }
  .status-bar > div:not(:first-child), .status-shop { border-left: 0; padding-left: 0; }
  .realm-layout { grid-template-columns: minmax(0, 1fr); }
  .auth-panel { order: -1; }
  .shop-header { flex-direction: column; align-items: stretch; }
  .shop-toolbar { align-items: flex-start; flex-direction: column; }
  .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .join-strip { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 460px) {
  .container { width: calc(100% - 26px); }
  .hero-grid { grid-template-columns: 1fr .48fr; }
  .hero-copy { padding: 30px 0; }
  .hero h1 { font-size: 2.15rem; }
  .hero-kicker { font-size: .59rem; letter-spacing: .12em; }
  .hero-desc { font-size: .75rem; }
  .hero-actions { align-items: flex-start; gap: 8px; }
  .hero-actions .btn { padding: 9px 12px; font-size: .73rem; }
  .hero-dragon { height: 235px; align-self: end; }
  .brand img { width: 38px; }
  .brand span { font-size: .97rem; }
  .realm-status .status-bar { gap: 5px; }
  .status-bar strong { font-size: .72rem; }
  .status-shop img { display: none; }
  .class-grid { grid-template-columns: 1fr; }
  .class-card { border-left: 0; border-top: 1px solid #5b4535; }
  .class-card:first-child { border-top: 0; }
  .ranking-row { grid-template-columns: 39px minmax(0, 1fr) 91px; gap: 5px; padding: 10px; font-size: .74rem; }
  .panel-title { padding: 11px 13px; }
  .panel-title > span { font-size: .57rem; }
  .shop-grid { grid-template-columns: 1fr; }
  .shop-header { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn { transition: none; }
}

/* Classic 0.95d inventory sprites, paired to items by their (group, number) IDs. */
.shop-item { min-height: 268px; padding: 14px; position: relative; }
.shop-item .item-crest {
  height: 116px; width: 100%; margin-bottom: 14px;
  background: radial-gradient(ellipse at center, #45352a 0, #241a1c 43%, #100e12 87%);
  border: 1px solid #64503c; box-shadow: inset 0 0 25px #0009;
}
.shop-item .item-crest img {
  display: block; width: 88px; height: 88px; object-fit: contain;
  image-rendering: pixelated; filter: drop-shadow(0 5px 7px #000c);
}
.shop-item .item-price { font-weight: 800; font-size: 1rem; font-variant-numeric: tabular-nums; }
.shop-price-note { margin: 6px 0 0; color: #bcab94; font-size: .67rem; }
.shop-item-status { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #504238;
  color: #9b978f; font-size: .68rem; }
.shop-item h3 { font-size: 1.03rem; }
