@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600;700&family=Noto+Sans+TC:wght@400;500;600;700&display=swap');

:root {
  --ink: #eee9df;
  --muted: #9a9488;
  --gold: #c9a35a;
  --gold-light: #f1d895;
  --night: #050606;
  --panel: rgba(17, 18, 17, .94);
  --line: rgba(202, 166, 92, .26);
  --danger: #d97968;
  --success: #81b69a;
  --game-font-scale: 1;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--night); }
body {
  min-height: 100vh; margin: 0; color: var(--ink);
  font-family: "Noto Sans TC", sans-serif;
  background:
    radial-gradient(circle at 68% 40%, rgba(104, 78, 28, .18), transparent 30rem),
    linear-gradient(110deg, rgba(5, 7, 8, .98), rgba(9, 11, 11, .9)),
    #070808;
}
button, input { font: inherit; }
button { color: inherit; }
.grain {
  position: fixed; inset: 0; opacity: .055; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
}

.topbar {
  height: 78px; padding: 0 clamp(20px, 4vw, 64px); display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.06); position: relative; z-index: 10;
}
.brand { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center; transform: rotate(45deg);
  border: 1px solid var(--gold); color: var(--gold-light); font: 700 25px "Cormorant Garamond";
}
.brand > span:last-child, .server-chip > span:last-child { display: grid; }
.brand strong { letter-spacing: .16em; font-size: 14px; }
.brand small, .server-chip small { margin-top: 3px; color: var(--muted); font-size: 9px; letter-spacing: .18em; }
.server-chip {
  display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.09); background: rgba(0,0,0,.18); text-align: left;
}
.server-chip strong { font-size: 11px; }
.music-controls {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
  padding: 7px 9px; border: 1px solid rgba(201,163,90,.22); background: rgba(0,0,0,.52);
}
.music-controls label { color: #a89a79; font-size: 10px; letter-spacing: .1em; }
.music-controls select {
  width: 118px; height: 30px; padding: 0 8px; color: #ddd2b8;
  border: 1px solid rgba(255,255,255,.13); background: #111; outline: none; font-size: 11px;
}
.music-controls button {
  min-width: 72px; height: 30px; padding: 0 10px; cursor: pointer;
  color: #d7c28e; border: 1px solid rgba(201,163,90,.38); background: rgba(40,33,21,.7);
  font-size: 11px;
}
.music-controls button.is-playing { color: #15120b; background: #c9a35a; }
.music-icon { margin-right: 5px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.status-dot.online { background: var(--success); box-shadow: 0 0 12px var(--success); }
.status-dot.offline { background: var(--danger); box-shadow: 0 0 12px var(--danger); }
.status-dot.pending { animation: pulse 1s infinite; }

main { min-height: calc(100vh - 128px); display: grid; align-items: center; }
.hero {
  width: min(1160px, calc(100% - 42px)); margin: 34px auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(48px, 8vw, 110px); align-items: center;
}
.eyebrow { margin: 0 0 16px; color: var(--gold); font-size: 10px; font-weight: 600; letter-spacing: .27em; }
h1 { margin: 0; font: 600 clamp(52px, 6vw, 88px)/.96 "Cormorant Garamond", "Noto Sans TC"; letter-spacing: -.03em; }
h1 em { color: var(--gold-light); font-style: normal; }
.lead { max-width: 430px; margin: 28px 0 38px; color: var(--muted); font-size: 14px; line-height: 1.9; }
.world-meta { display: flex; gap: 45px; }
.world-meta div { display: grid; gap: 6px; }
.world-meta span { color: #6e6a62; font-size: 9px; letter-spacing: .2em; }
.world-meta strong { font-size: 12px; font-weight: 500; }

.portal-card {
  position: relative; min-height: 520px; padding: clamp(28px, 4vw, 48px);
  border: 1px solid var(--line); background: linear-gradient(145deg, rgba(27,29,27,.95), rgba(11,13,13,.98));
  box-shadow: 0 35px 90px rgba(0,0,0,.45), inset 0 0 80px rgba(200,166,90,.025);
}
.portal-card::before, .portal-card::after { content: ""; position: absolute; width: 38px; height: 38px; pointer-events: none; }
.portal-card::before { left: -1px; top: -1px; border-left: 2px solid var(--gold); border-top: 2px solid var(--gold); }
.portal-card::after { right: -1px; bottom: -1px; border-right: 2px solid var(--gold); border-bottom: 2px solid var(--gold); }
.login-heading { display: flex; gap: 20px; align-items: center; margin-bottom: 32px; }
.step-number { color: rgba(200,166,90,.22); font: 600 62px/1 "Cormorant Garamond"; }
.login-heading .eyebrow { margin-bottom: 5px; }
h2 { margin: 0; font: 600 30px "Cormorant Garamond", "Noto Sans TC"; }
.notice { margin: 0 0 18px; padding: 11px 14px; color: #e8b4aa; background: rgba(217,121,104,.08); border-left: 2px solid var(--danger); font-size: 12px; }
.notice.success { color: #b7d7c6; background: rgba(129,182,154,.08); border-color: var(--success); }
.login-form { display: grid; gap: 19px; }
.login-form label { display: grid; gap: 8px; }
.login-form label span { color: #aaa395; font-size: 11px; letter-spacing: .1em; }
input {
  width: 100%; padding: 15px; color: var(--ink); outline: none;
  border: 1px solid rgba(255,255,255,.11); background: rgba(0,0,0,.22);
}
input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200,166,90,.08); }
input::placeholder { color: #5b5c58; }
.primary-button, .secondary-button {
  min-height: 50px; border: 1px solid var(--gold); cursor: pointer; transition: .2s ease;
}
.primary-button {
  display: flex; justify-content: space-between; align-items: center; margin-top: 7px; padding: 0 20px;
  color: #111; background: linear-gradient(110deg, #967332, #d4b263); font-weight: 700;
}
.primary-button:hover:not(:disabled), .rune-button:hover:not(:disabled) { filter: brightness(1.12); }
.primary-button.is-disabled { opacity: .35; cursor: not-allowed; }
.secondary-button { padding: 0 20px; color: var(--gold-light); background: transparent; }
.privacy-note { margin: 0; color: #666760; font-size: 10px; text-align: center; }
.text-button { color: var(--gold); background: none; border: 0; cursor: pointer; font-size: 11px; }

/* Classic 330 account login */
.login-mode { overflow: hidden; background: #000; }
.login-mode .topbar, .login-mode footer, .login-mode .hero-copy, .login-mode .login-heading { display: none; }
.login-mode main { min-height: 100vh; display: block; }
.login-mode .hero {
  width: 100vw; height: 100vh; margin: 0; display: block;
  background: #000;
}
.login-mode .portal-card {
  position: absolute; left: 50%; top: 50%; width: min(100vw, calc(100vh * 1.35021)); height: min(100vh, calc(100vw / 1.35021));
  min-height: 0; padding: 0; transform: translate(-50%, -50%);
  border: 0; box-shadow: none;
  background: url("login-reference.png") center / 100% 100% no-repeat;
}
.login-mode .portal-card::before, .login-mode .portal-card::after { display: none; }
.login-mode .portal-card > .notice {
  position: absolute; z-index: 8; left: 57%; top: 33%; width: 34%; margin: 0;
  color: #e7d6a9; border: 1px solid rgba(189,154,80,.35); border-left: 3px solid #aa8240;
  background: rgba(0,0,0,.88); font-family: "Noto Sans TC", serif;
}
.login-mode .login-form { display: block; position: absolute; inset: 0; }
.login-mode .login-form label { position: absolute; display: block; width: 18%; height: 3.45%; }
.login-mode .login-form label:nth-of-type(1) { left: 70.65%; top: 44.35%; }
.login-mode .login-form label:nth-of-type(2) { left: 70.65%; top: 52.25%; }
.login-mode .login-form label > span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.login-mode .login-form input {
  width: 100%; height: 100%; min-height: 0; padding: 0 9px;
  color: #f2f2ed; caret-color: #fff; font: 500 clamp(12px, 1.25vw, 20px) "Cormorant Garamond", monospace;
  border: 1px solid rgba(103,103,103,.34); border-radius: 0; background: rgba(6,7,7,.91); box-shadow: inset 0 0 7px #000;
}
.login-mode .login-form input:focus {
  border-color: rgba(218,194,131,.6); box-shadow: inset 0 0 7px #000, 0 0 8px rgba(218,194,131,.22);
}
.login-mode .classic-login-button,
.login-mode .classic-exit-button {
  position: absolute; z-index: 6; width: 11.2%; height: 5.5%; min-height: 0; margin: 0; padding: 0;
  color: transparent; border: 0; background: transparent; cursor: pointer; text-indent: -9999px;
}
.login-mode .classic-login-button { left: 72.9%; top: 80.3%; display: block; }
.login-mode .classic-exit-button { left: 72.9%; top: 92.2%; }
.login-mode .classic-login-button:hover,
.login-mode .classic-login-button:focus-visible,
.login-mode .classic-exit-button:hover,
.login-mode .classic-exit-button:focus-visible {
  outline: 1px solid rgba(224,198,126,.45);
  background: radial-gradient(ellipse, rgba(214,185,111,.18), transparent 72%);
}
.login-mode .privacy-note { display: none; }

/* Character selection mode */
.character-mode { overflow-x: hidden; background: #000; }
.character-mode .topbar { height: 58px; background: rgba(0,0,0,.88); }
.character-mode main { min-height: calc(100vh - 58px); align-items: stretch; }
.character-mode .hero { display: block; width: 100%; margin: 0; }
.character-mode .hero-copy, .character-mode .login-heading, .character-mode footer { display: none; }
.character-mode .portal-card {
  width: 100%; min-height: calc(100vh - 58px); padding: 0; border: 0; box-shadow: none; background: #000;
}
.character-mode .portal-card::before, .character-mode .portal-card::after { display: none; }
.character-mode .portal-card > .notice { position: fixed; z-index: 50; left: 50%; top: 68px; transform: translateX(-50%); width: min(560px, calc(100% - 30px)); }
.character-select {
  min-height: calc(100vh - 58px); display: grid; grid-template-rows: 48px minmax(390px, 54vh) minmax(260px, 1fr);
  background:
    linear-gradient(to bottom, rgba(0,0,0,.08) 0 55%, rgba(0,0,0,.93) 73%),
    radial-gradient(ellipse at center 32%, rgba(71,71,65,.22), transparent 38%),
    #000;
}
.select-toolbar {
  display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(24px, 5vw, 72px);
  color: #8e887c; border-bottom: 1px solid rgba(218,187,113,.12); background: rgba(0,0,0,.78);
}
.select-toolbar > div:first-child { display: flex; align-items: baseline; gap: 13px; }
.select-toolbar > div:first-child span { color: #6a6253; font: 600 9px "Noto Sans TC"; letter-spacing: .24em; }
.select-toolbar > div:first-child strong { color: #d8c28e; font: 600 18px "Cormorant Garamond", "Noto Sans TC"; }
.account-tools { display: flex; align-items: center; gap: 20px; font-size: 10px; }
.account-tools strong { color: #d7d0c0; margin-left: 5px; }

.character-stage {
  position: relative; display: flex; justify-content: center; align-items: stretch; gap: clamp(4px, 1vw, 16px);
  overflow: hidden; padding: 0 clamp(18px, 3vw, 48px);
  background: linear-gradient(to bottom, #000 0%, #020303 70%, rgba(15,13,9,.94) 100%);
}
.character-stage::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 115px; pointer-events: none;
  background: linear-gradient(to top, rgba(20,16,10,.96), transparent);
}
.character-slots { display: contents; }
.character-slot {
  position: relative; width: min(21vw, 260px); min-width: 150px; height: 100%;
  padding: 0; overflow: hidden; border: 0; border-left: 1px solid rgba(255,255,255,.025);
  background: #000; cursor: pointer; isolation: isolate;
}
.character-slot::before {
  content: ""; position: absolute; inset: 0; z-index: -2; opacity: .52;
  background: radial-gradient(ellipse at center 43%, rgba(96,96,90,.25), transparent 58%);
  transition: opacity .25s ease;
}
.character-sprite, .empty-character-sprite {
  position: absolute; z-index: 1; left: 50%; top: 48%; width: auto; height: min(92%, 438px);
  transform: translate(-50%, -50%); object-fit: contain; image-rendering: auto;
}
.character-sprite {
  opacity: .58; filter: grayscale(.18) brightness(.76);
  transition: opacity .25s ease, filter .25s ease, transform .25s ease;
}
.empty-character-sprite { opacity: .82; }
.character-slot:hover .character-sprite {
  opacity: .78; filter: grayscale(.08) brightness(.92); transform: translate(-50%, calc(-50% - 3px));
}
.character-slot.is-active .character-sprite { opacity: 1; filter: none; }
.character-slot.is-active::before { opacity: 1; background: radial-gradient(ellipse at center 40%, rgba(185,170,125,.2), transparent 62%); }
.slot-caption {
  position: absolute; z-index: 4; left: 10px; right: 10px; bottom: 10px; display: grid; gap: 2px;
  padding: 8px; text-align: center; background: linear-gradient(to right, transparent, rgba(0,0,0,.84), transparent);
}
.slot-caption strong { color: #f3dfaa; font: 600 17px "Cormorant Garamond", "Noto Sans TC"; text-shadow: 0 1px 5px #000; }
.slot-caption small { color: #8e887d; font-size: 9px; }
.new-character { cursor: default; opacity: .72; }
.empty-stage { width: 65vw; display: grid; place-content: center; gap: 8px; text-align: center; color: #706b62; }
.empty-stage strong { color: #c5b589; font-size: 20px; }

.character-data {
  position: relative; z-index: 5; display: grid; grid-template-columns: 1.18fr .92fr .55fr; gap: clamp(24px, 5vw, 75px);
  padding: 22px clamp(28px, 6vw, 100px) 26px;
  background:
    radial-gradient(ellipse at center top, rgba(50,44,31,.24), transparent 62%),
    linear-gradient(rgba(3,4,4,.94), rgba(0,0,0,.98));
  border-top: 1px solid rgba(224,193,119,.14);
}
.identity-panel dl { margin: 0 0 17px; display: grid; gap: 5px; }
.identity-panel dl div { display: grid; grid-template-columns: 94px 1fr; align-items: center; }
dt { color: #d9c28a; font-family: "Noto Sans TC"; font-size: 13px; letter-spacing: .22em; text-shadow: 0 0 5px #8f6d27; }
dd {
  min-height: 25px; margin: 0; padding: 2px 10px; color: #f0eee9; font-size: 14px;
  border: 1px solid rgba(255,255,255,.055); background: rgba(31,33,32,.72);
}
.resource-row { display: grid; grid-template-columns: 55px 1fr 55px; gap: 10px; align-items: center; margin-top: 7px; }
.resource-row > span { color: #d7c38f; font-size: 12px; letter-spacing: .18em; }
.resource-row b { color: #eee; font: 500 14px "Cormorant Garamond", monospace; }
.meter { height: 13px; padding: 2px; border: 1px solid rgba(255,255,255,.12); background: #070808; }
.meter i { display: block; height: 100%; transition: width .3s ease; }
.meter.hp i { background: linear-gradient(to right, #59231b, #ca6047); }
.meter.mp i { background: linear-gradient(to right, #182d54, #4e78c1); }
.armor-row { grid-template-columns: 55px 1fr; }
.armor-row b { padding: 2px 10px; background: rgba(31,33,32,.72); border: 1px solid rgba(255,255,255,.055); }
.level-line { display: grid; grid-template-columns: 1fr 80px; align-items: center; margin-bottom: 10px; color: #d7c38f; }
.level-line span { letter-spacing: .22em; }
.level-line strong { padding: 4px 10px; color: #fff; background: rgba(31,33,32,.76); font: 500 18px "Cormorant Garamond"; }
.ability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 13px; }
.ability-grid div { display: grid; grid-template-columns: 1fr 48px; align-items: center; }
.ability-grid span { color: #d9c28a; font-size: 12px; letter-spacing: .18em; }
.ability-grid b { padding: 4px 8px; color: #fff; background: rgba(31,33,32,.76); border: 1px solid rgba(255,255,255,.055); font-weight: 500; }
.select-actions { display: grid; align-content: end; gap: 8px; padding-bottom: 4px; }
.rune-button {
  min-height: 38px; cursor: pointer; color: #e6d5a9; border: 1px solid rgba(202,166,92,.45);
  background: linear-gradient(#29261f, #11120f); letter-spacing: .16em;
}
.rune-button:disabled { opacity: .35; cursor: not-allowed; }
.rune-button.muted { color: #8b8579; }
.delete-character { color: #927f65; background: none; border: 0; font-size: 11px; letter-spacing: .12em; }

.selected-view { max-width: 520px; margin: 11vh auto 0; padding: 40px; text-align: center; }
.selected-sigil {
  width: 90px; height: 90px; margin: 0 auto 26px; display: grid; place-items: center;
  color: var(--gold-light); border: 1px solid var(--gold); transform: rotate(45deg); font-size: 34px;
}
.selected-view h2 { font-size: 42px; }
.selected-summary { color: var(--muted); font-size: 12px; }
.selected-view button { width: 100%; margin-top: 10px; }

/* 640x480 classic in-game composition */
.game-mode { overflow: hidden; background: #000; }
.game-mode .topbar, .game-mode footer { display: none; }
.game-mode main { min-height: 100vh; display: grid; place-items: center; }
.game-mode .hero { width: 100%; margin: 0; display: block; }
.game-mode .hero-copy, .game-mode .login-heading { display: none; }
.game-mode .portal-card {
  width: 100%; min-height: 100vh; padding: 0; border: 0; background: #000; box-shadow: none;
}
.game-mode .portal-card::before, .game-mode .portal-card::after { display: none; }
.game-view { min-height: 100vh; display: grid; place-items: center; background: #000; }
.game-client {
  position: relative; width: min(100vw, calc(100vh * 1.333333)); aspect-ratio: 4 / 3;
  overflow: hidden; color: #fff; background: #423d31;
  border: 1px solid #17140e; box-shadow: 0 0 60px #000;
}
.world-viewport {
  position: absolute; inset: 0 0 21.5% 0; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 48%, rgba(180,164,125,.18), transparent 42%),
    repeating-linear-gradient(28deg, transparent 0 13px, rgba(20,18,14,.18) 14px 15px),
    repeating-linear-gradient(118deg, #77705e 0 10px, #696351 11px 21px, #5c5749 22px 23px);
}
.world-viewport::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse, transparent 42%, rgba(5,6,5,.46) 100%);
}
.world-location {
  position: absolute; z-index: 4; left: 10px; top: 9px; display: grid;
  color: #e5d89f; text-shadow: 1px 1px 2px #000; font-size: calc(10px * var(--game-font-scale));
}
.world-location span { color: #ddd; font-size: calc(9px * var(--game-font-scale)); }
.game-font-controls {
  position: absolute; z-index: 9; right: 7%; top: 6px; display: flex; align-items: center;
  height: 24px; border: 1px solid rgba(220,196,132,.45); background: rgba(7,8,7,.78);
}
.game-font-controls button {
  width: 30px; height: 22px; padding: 0; cursor: pointer; color: #f0d88f;
  border: 0; background: rgba(44,39,28,.82); font: 700 11px serif;
}
.game-font-controls select {
  width: 105px; height: 22px; padding: 0 5px; color: #ddd5c0;
  border: 0; border-right: 1px solid rgba(220,196,132,.35); background: #151510;
  font-size: 9px; outline: none;
}
.game-font-controls .game-music-toggle {
  width: 28px; color: #d9c27d; border-right: 1px solid rgba(220,196,132,.35);
}
.game-font-controls .game-music-toggle.is-playing { color: #16130c; background: #c9a35a; }
.game-font-controls .quick-attack-button { width: 86px; color: #f0c978; font: 600 9px "Noto Sans TC"; }
.game-font-controls .quick-attack-button.is-active { color: #fff; background: #8a251e; }
.game-font-controls .hunt-settings-button { width: 60px; color: #d8c991; font: 600 9px "Noto Sans TC"; }
.game-font-controls button:disabled { opacity: .35; cursor: default; }
.game-font-controls output {
  min-width: 42px; padding: 0 4px; color: #ddd5c0; text-align: center;
  font-size: 9px; line-height: 22px;
}
.world-zone {
  position: absolute; z-index: 5; right: 6.5%; bottom: 0; display: flex; align-items: end; gap: 5px;
  padding: 3px 7px; color: #d1c5a3; background: rgba(20,18,14,.68);
  font: 600 clamp(6px, 1vw, 9px) "Noto Sans TC"; text-shadow: 1px 1px #000;
}
.world-zone strong { color: #f3eee0; font-size: clamp(9px, 1.7vw, 15px); letter-spacing: .08em; }
.world-objects { position: absolute; z-index: 3; inset: 0; }
.world-entity {
  position: absolute; width: 1px; height: 1px; transform: translate(-50%, -50%);
  filter: drop-shadow(1px 2px 2px #000);
}
.world-entity i {
  position: absolute; left: -7px; top: -8px; width: 14px; height: 14px;
  transform: rotate(45deg); border: 1px solid #b8b19d; background: #363a32;
}
.world-entity span {
  position: absolute; left: 50%; bottom: 13px; transform: translateX(-50%);
  width: max-content; max-width: 220px; color: #f2f0de; font-size: calc(10px * var(--game-font-scale));
  text-shadow: -1px -1px #000, 1px 1px #000, 0 0 3px #000;
}
.world-entity.is-player { z-index: 5; }
.world-entity.is-player i {
  left: -10px; top: -15px; width: 20px; height: 30px;
  border-color: #ffca43; background: linear-gradient(135deg, #f4eee1, #912d26);
}
.world-entity.is-player span { color: #fff36b; font-weight: 700; }
.world-entity.is-monster, .world-entity.is-player { cursor: crosshair; }
.world-entity.is-monster i { border-color: #bb6659; background: #4b201c; }
.world-entity.is-targeted { z-index: 7; }
.world-entity.is-targeted i { border: 2px solid #ff3d2e; box-shadow: 0 0 10px #ff2d1e; }
.world-entity.is-targeted span { color: #ffdf70; }
.world-entity.is-dead { pointer-events: none; opacity: .38; filter: grayscale(1); }
.classic-side-tools {
  position: absolute; z-index: 8; right: 0; top: 0; width: 6.1%; height: 78.5%;
  display: grid; grid-template-columns: repeat(2, 1fr); grid-auto-rows: 11.5%;
  align-content: start; padding-top: .5%; background: linear-gradient(to left, rgba(5,7,6,.88), rgba(5,7,6,.35));
}
.classic-side-tools button {
  padding: 0; color: #f3f0dd; border: 1px solid rgba(255,255,255,.14);
  background: rgba(32,38,34,.58); font-size: clamp(9px, 1.6vw, 16px); text-shadow: 0 1px 3px #000;
}
.classic-side-tools button:nth-child(4) { font-size: clamp(13px, 2.4vw, 24px); }
.classic-side-tools button:nth-child(n+7) { grid-column: 1 / -1; width: 100%; }
.classic-status-panel {
  position: absolute; z-index: 10; left: 0; right: 0; bottom: 0; height: 21.5%;
  display: grid; grid-template-columns: 18% 59% 23%; border-top: 3px ridge #8b6c42;
  background: linear-gradient(#34313a, #111118);
}
.classic-player-status {
  position: relative; padding: 2px 4px 2px 3px; border-right: 2px ridge #766247;
  font-size: calc(8px * var(--game-font-scale)); background: linear-gradient(110deg, #121218, #25232b);
}
.classic-level-row { display: flex; justify-content: space-between; height: 17%; color: #eee9d8; white-space: nowrap; }
.classic-level-row b { font-weight: 500; }
.classic-exp { color: #cfc7b2; }
.classic-resource-line { height: 20%; display: grid; grid-template-columns: 13% 87%; align-items: center; }
.resource-orb {
  position: relative; z-index: 2; display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%;
  color: #e5d09b; border: 1px solid #8f7144; background: radial-gradient(circle at 35% 30%, #81613c, #18130e 68%);
  font-size: clamp(5px, .75vw, 7px); box-shadow: 0 0 3px #000;
}
.hp-orb { color: #f3c5ac; }
.mp-orb { color: #b8c9ff; }
.food-orb { color: #e9d7a0; }
.classic-bar {
  position: relative; height: 68%; min-height: 5px; margin-left: -2px; overflow: hidden;
  border: 1px solid #0a0a0a; border-radius: 8px; background: #090909;
}
.classic-bar i { display: block; height: 100%; }
.classic-bar.hp i { background: linear-gradient(#d9462e, #63160e); }
.classic-bar.mp i { background: linear-gradient(#4578e0, #172d77); }
.classic-bar span { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(8px * var(--game-font-scale)); text-shadow: 1px 1px #000; }
.classic-food { height: 42%; margin-left: -2px; overflow: hidden; border: 1px solid #0a0a0a; border-radius: 5px; background: #080808; }
.classic-food i { display: block; height: 100%; background: linear-gradient(#e9cd75, #815e20); }
.classic-player-meta { height: 20%; display: flex; align-items: end; justify-content: space-between; color: #cac5b8; white-space: nowrap; }
.classic-player-meta strong { max-width: 47%; overflow: hidden; color: #f5df8a; text-overflow: ellipsis; }
.classic-chat {
  position: relative; overflow: hidden; padding: 18px 7px 17px; border-right: 2px ridge #766247;
  color: #ddd9c9; font-size: calc(8px * var(--game-font-scale));
}
.chat-tabs {
  position: absolute; left: 3px; top: 1px; right: 3px; height: 15px; display: flex; gap: 2px;
}
.chat-tabs button {
  min-width: 44px; padding: 0 6px; color: #d3c9ae; border: 1px solid #514933; background: #1c1b20;
  font-size: calc(7px * var(--game-font-scale));
}
.chat-lines { height: 100%; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #5d5239 transparent; }
.classic-chat p { margin: 0 0 2px; }
.classic-chat p:first-child { color: #e4d363; }
.classic-chat .chat-general { color: #eee9d9; }
.classic-chat .chat-shout { color: #e9d56d; }
.classic-chat .chat-global { color: #d9b0ff; }
.classic-chat .chat-clan { color: #91e6b0; }
.classic-chat .chat-party { color: #9ed7ff; }
.classic-chat .chat-trade { color: #f4bb75; }
.classic-chat .chat-alliance { color: #80e3d8; }
.classic-chat .chat-whisper { color: #ef9fc5; }
.classic-chat .chat-system { color: #e9dc65; }
.classic-chat .chat-server { color: #f0c271; }
.chat-input {
  position: absolute; left: 3px; right: 3px; bottom: 2px; height: 14px; display: grid;
  grid-template-columns: 36px 1fr; border: 1px solid #19191c; background: #08080a;
}
.chat-input span { display: grid; place-items: center; color: #a99d7d; border-right: 1px solid #3b3527; }
.chat-input input {
  min-height: 0; height: 100%; padding: 0 4px; color: #eee9d9; border: 0;
  background: transparent; font-size: calc(8px * var(--game-font-scale));
}
.classic-hotkeys { display: grid; grid-template-rows: 78% 22%; min-width: 0; }
.hotkey-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr); min-height: 0; }
.hotkey-grid button {
  position: relative; padding: 0; border: 1px solid #17171a; background: linear-gradient(135deg, #24252a, #070709);
}
.hotkey-grid span { position: absolute; left: 2px; top: 1px; color: #72716c; font-size: clamp(6px, 1vw, 9px); }
.hotkey-grid i { display: block; width: 42%; aspect-ratio: 1; margin: auto; border: 1px solid #6d5c36; background: #191712; }
.classic-menu-row { display: grid; grid-template-columns: repeat(8, 1fr); border-top: 2px ridge #756344; background: #0d0d0f; }
.classic-menu-row button {
  min-width: 0; padding: 0; cursor: pointer; color: #d8ceb5; border: 1px solid #242226;
  background: radial-gradient(circle, #423a2a, #101012 70%); font-size: clamp(7px, 1.35vw, 13px);
}
.classic-menu-row .system-menu-button { color: #fff4cd; font-size: clamp(12px, 2vw, 20px); }
.classic-menu-row button:hover { color: #fff1ae; filter: brightness(1.25); }
.system-menu {
  position: absolute; z-index: 40; inset: 0; display: grid; place-items: center;
  background: rgba(0,0,0,.48);
}
.system-menu-panel {
  width: 43%; max-width: 275px; padding: 15px; border: 2px ridge #9b8253;
  background: linear-gradient(145deg, #29271f, #0b0c0c); box-shadow: 0 10px 35px #000;
}
.system-menu-panel h3 {
  margin: 0 0 11px; color: #e9d69f; text-align: center;
  font-size: calc(13px * var(--game-font-scale)); letter-spacing: .15em;
}
.system-menu-panel button {
  width: 100%; min-height: 30px; margin-top: 6px; cursor: pointer; color: #e7dfc9;
  border: 1px solid #615538; background: linear-gradient(#343127, #151514);
  font-size: calc(9px * var(--game-font-scale));
}
.system-menu-panel button:hover { color: #fff0b0; border-color: #b99b58; }
.hunt-settings-panel { width: 52%; max-width: 330px; }
.hunt-settings-panel > p { margin: -3px 0 10px; color: #a9a18e; font-size: calc(8px * var(--game-font-scale)); }
.nearby-monster-list {
  max-height: 210px; overflow-y: auto; padding: 5px; border: 1px solid #403a2c;
  background: rgba(0,0,0,.42); scrollbar-width: thin; scrollbar-color: #6d5b37 transparent;
}
.monster-setting {
  min-height: 28px; display: flex; align-items: center; gap: 9px; padding: 4px 6px;
  color: #e6ddc5; border-bottom: 1px solid rgba(255,255,255,.055);
  font-size: calc(9px * var(--game-font-scale)); cursor: pointer;
}
.monster-setting input { width: 15px; height: 15px; min-height: 0; padding: 0; accent-color: #b68c3d; }
.empty-monster-list { margin: 15px; color: #8f897c; text-align: center; font-size: 9px; }
.hunt-settings-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }

footer {
  height: 50px; padding: 0 clamp(20px, 4vw, 64px); display: flex; justify-content: space-between; align-items: center;
  border-top: 1px solid rgba(255,255,255,.05); color: #565852; font-size: 9px; letter-spacing: .17em;
}
@keyframes pulse { 50% { opacity: .3; } }

@media (max-width: 920px) {
  .hero { grid-template-columns: 1fr; width: min(620px, calc(100% - 32px)); }
  .hero-copy { text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .world-meta { justify-content: center; }
  .character-select { grid-template-rows: 46px 47vh auto; }
  .character-stage { justify-content: flex-start; overflow-x: auto; }
  .character-slot { min-width: 210px; }
  .character-data { grid-template-columns: 1fr 1fr; }
  .select-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; }
  .delete-character { display: none; }
}

@media (max-width: 600px) {
  .topbar { height: 64px; padding: 0 15px; }
  .brand small, .server-chip small { display: none; }
  .server-chip { padding: 9px 10px; }
  h1 { font-size: 47px; }
  .portal-card { padding: 25px 20px; }
  .character-mode .topbar { height: 50px; }
  .character-select { min-height: calc(100vh - 50px); grid-template-rows: 44px 43vh auto; }
  .select-toolbar { padding: 0 15px; }
  .select-toolbar > div:first-child span, .account-tools > span { display: none; }
  .character-stage { padding: 0 10px; }
  .character-slot { min-width: 170px; }
  .character-data { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .select-actions { grid-column: auto; }
  footer span:last-child { display: none; }
  .music-controls label { display: none; }
  .music-controls select { width: 86px; }
}

/* Modern login layout with original client artwork */
.login-mode {
  overflow-x: hidden;
  background:
    linear-gradient(100deg, rgba(4,6,7,.78), rgba(5,7,8,.91)),
    url("login-reference.png") center / cover fixed no-repeat,
    #070808;
}
.login-mode .topbar {
  display: flex; height: 78px;
  background: rgba(4,6,7,.76); backdrop-filter: blur(8px);
}
.login-mode footer { display: flex; }
.login-mode main { min-height: calc(100vh - 128px); display: grid; }
.login-mode .hero {
  width: min(1160px, calc(100% - 42px)); height: auto; margin: 34px auto;
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(48px, 8vw, 110px); align-items: center;
  background: none;
}
.login-mode .hero-copy { display: block; }
.login-mode .login-heading { display: flex; }
.login-mode .portal-card {
  position: relative; left: auto; top: auto; width: auto; height: auto; min-height: 520px;
  padding: clamp(28px, 4vw, 48px); transform: none;
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(27,29,27,.94), rgba(7,9,9,.97));
  box-shadow: 0 35px 90px rgba(0,0,0,.6), inset 0 0 80px rgba(200,166,90,.025);
}
.login-mode .portal-card::before, .login-mode .portal-card::after { display: block; }
.login-mode .portal-card > .notice {
  position: static; width: auto; margin: 0 0 18px;
  color: #e8b4aa; border: 0; border-left: 2px solid var(--danger);
  background: rgba(217,121,104,.08); font-family: inherit;
}
.login-mode .portal-card > .notice.success {
  color: #b7d7c6; border-color: var(--success); background: rgba(129,182,154,.08);
}
.login-mode .login-form { position: static; display: grid; gap: 19px; }
.login-mode .login-form label { position: static; display: grid; width: auto; height: auto; gap: 8px; }
.login-mode .login-form label > span {
  position: static; width: auto; height: auto; margin: 0; overflow: visible;
  clip: auto; white-space: normal; color: #aaa395;
}
.login-mode .login-form input {
  width: 100%; height: auto; min-height: 50px; padding: 15px;
  color: var(--ink); font: inherit; border: 1px solid rgba(255,255,255,.11);
  background: rgba(0,0,0,.42); box-shadow: none;
}
.login-mode .classic-login-button {
  position: static; display: flex; width: 100%; height: 50px; min-height: 50px; margin-top: 7px; padding: 0 20px;
  justify-content: center; color: #111; border: 1px solid var(--gold);
  background: linear-gradient(110deg, #967332, #d4b263); text-indent: 0;
}
.login-mode .classic-exit-button {
  position: static; width: 100%; height: 42px; min-height: 42px; margin: 0; padding: 0 20px;
  color: var(--gold-light); border: 1px solid rgba(201,163,90,.48);
  background: rgba(0,0,0,.28); text-indent: 0;
}
.login-mode .classic-login-button:hover,
.login-mode .classic-login-button:focus-visible,
.login-mode .classic-exit-button:hover,
.login-mode .classic-exit-button:focus-visible {
  outline: none; filter: brightness(1.12);
}
.login-mode .privacy-note { display: block; }

.announcement-board {
  padding: 30px; border: 1px solid rgba(215,185,112,.2);
  background: linear-gradient(145deg, rgba(4,5,5,.76), rgba(11,12,11,.9));
  box-shadow: 0 24px 70px rgba(0,0,0,.4);
}
.announcement-board header { padding-bottom: 17px; border-bottom: 1px solid rgba(215,185,112,.18); }
.announcement-board header .eyebrow { margin-bottom: 6px; }
.announcement-board h1 { color: var(--gold-light); font-size: clamp(34px, 4vw, 54px); }
.announcement-window {
  position: relative; height: 244px; overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent, #000 12%, #000 88%, transparent);
}
.announcement-track { animation: announcement-scroll 18s linear infinite; }
.announcement-window:hover .announcement-track { animation-play-state: paused; }
.announcement-group { display: grid; }
.announcement-group article {
  min-height: 81px; display: grid; grid-template-columns: 62px 1fr; gap: 16px; align-items: center;
  border-bottom: 1px solid rgba(255,255,255,.055);
}
.announcement-group time { color: var(--gold); font: 600 10px "Cormorant Garamond"; letter-spacing: .12em; }
.announcement-group strong { color: #e8dfca; font-size: 14px; }
.announcement-group p { margin: 5px 0 0; color: #8c887f; font-size: 11px; line-height: 1.6; }
.announcement-board .world-meta { margin-top: 20px; }
@keyframes announcement-scroll {
  from { transform: translateY(0); }
  to { transform: translateY(-50%); }
}

@media (max-width: 820px) {
  .login-mode .hero { grid-template-columns: 1fr; }
  .login-mode .hero-copy { display: none; }
  .login-mode .portal-card { width: min(520px, 100%); margin: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .announcement-track { animation: none; }
}

/* Final classic 330 login composition */
.login-mode { overflow: hidden; background: #000; }
.login-mode footer, .login-mode .login-heading { display: none; }
.login-mode .topbar {
  position: fixed; z-index: 30; left: 0; right: 0; top: 0; display: flex;
  height: 72px; background: linear-gradient(to bottom, rgba(0,0,0,.9), rgba(0,0,0,.18));
  border-bottom-color: rgba(255,255,255,.035);
}
.login-mode main { min-height: 100vh; display: block; }
.login-mode .hero {
  position: absolute; left: 50%; top: 50%;
  width: min(100vw, calc(100vh * 1.35021)); height: min(100vh, calc(100vw / 1.35021));
  margin: 0; display: block; transform: translate(-50%, -50%);
  background: url("login-reference.png?v=2") center / 100% 100% no-repeat;
}
.login-mode .portal-card {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0;
  padding: 0; border: 0; background: none; box-shadow: none; transform: none;
}
.login-mode .portal-card::before, .login-mode .portal-card::after { display: none; }
.login-mode .hero-copy {
  position: absolute; z-index: 5; display: block;
  left: 5.1%; top: 8.4%; width: 34.2%; height: 68%;
  color: #3a2c1e; text-align: left; pointer-events: auto;
}
.login-mode .announcement-board {
  height: 100%; padding: 6% 7%; overflow: hidden;
  border: 0; background: transparent; box-shadow: none;
}
.login-mode .announcement-board header {
  padding-bottom: 3.5%; border-bottom: 1px solid rgba(79,55,29,.23);
}
.login-mode .announcement-board header .eyebrow {
  margin-bottom: 1%; color: #866435; font-size: clamp(6px, .65vw, 10px);
}
.login-mode .announcement-board h1 {
  color: #46331f; font-size: clamp(20px, 2.4vw, 38px); text-shadow: 0 1px rgba(255,255,255,.5);
}
.login-mode .announcement-window {
  height: 76%; mask-image: linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
}
.login-mode .announcement-group article {
  min-height: clamp(62px, 8.5vh, 92px);
  grid-template-columns: 17% 1fr; gap: 4%;
  border-bottom-color: rgba(79,55,29,.15);
}
.login-mode .announcement-group time {
  color: #8a6030; font-size: clamp(7px, .7vw, 11px);
}
.login-mode .announcement-group strong {
  color: #49331f; font-size: clamp(9px, 1vw, 14px);
}
.login-mode .announcement-group p {
  color: #71573b; font-size: clamp(7px, .78vw, 11px); line-height: 1.45;
}
.login-mode .announcement-board .world-meta { display: none; }
.login-mode .portal-card > .notice {
  position: absolute; z-index: 8; left: 57%; top: 33%; width: 34%; margin: 0;
  color: #e7d6a9; border: 1px solid rgba(189,154,80,.35); border-left: 3px solid #aa8240;
  background: rgba(0,0,0,.88); font-family: "Noto Sans TC", serif;
}
.login-mode .login-form { position: absolute; inset: 0; display: block; }
.login-mode .login-form label { position: absolute; display: block; width: 18%; height: 3.45%; }
.login-mode .login-form label:nth-of-type(1) { left: 70.65%; top: 44.35%; }
.login-mode .login-form label:nth-of-type(2) { left: 70.65%; top: 52.25%; }
.login-mode .login-form label > span {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.login-mode .login-form input {
  width: 100%; height: 100%; min-height: 0; padding: 0 9px;
  color: #f2f2ed; caret-color: #fff;
  font: 500 clamp(12px, 1.25vw, 20px) "Cormorant Garamond", monospace;
  border: 1px solid rgba(103,103,103,.34); border-radius: 0;
  background: rgba(6,7,7,.91); box-shadow: inset 0 0 7px #000;
}
.login-mode .classic-login-button,
.login-mode .classic-exit-button {
  position: absolute; z-index: 6; width: 11.2%; height: 5.5%; min-height: 0;
  margin: 0; padding: 0; color: transparent; border: 0; background: transparent;
  cursor: pointer; text-indent: -9999px;
}
.login-mode .classic-login-button { left: 72.9%; top: 80.3%; display: block; }
.login-mode .classic-exit-button { left: 72.9%; top: 92.2%; }
.login-mode .classic-login-button:hover,
.login-mode .classic-login-button:focus-visible,
.login-mode .classic-exit-button:hover,
.login-mode .classic-exit-button:focus-visible {
  outline: 1px solid rgba(224,198,126,.45); filter: none;
  background: radial-gradient(ellipse, rgba(214,185,111,.18), transparent 72%);
}
.login-mode .privacy-note { display: none; }
