:root {
  --ink: #071015;
  --ink-2: #0b171c;
  --panel: rgba(7, 17, 21, .76);
  --panel-solid: #0c181b;
  --edge: rgba(174, 213, 196, .18);
  --edge-bright: rgba(203, 242, 209, .42);
  --cream: #ecdfbe;
  --muted: #9ca99d;
  --mist: #bfd8c9;
  --teal: #4ac1af;
  --teal-light: #9bf6d5;
  --gold: #dfb969;
  --gold-light: #ffe4a0;
  --blood: #d45d54;
  --mana: #7f89ee;
  --heading: Georgia, 'Times New Roman', serif;
  --body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  overflow: hidden;
  color: var(--cream);
  background: #050b0e;
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--teal-light); outline-offset: 3px; }
button { cursor: pointer; }
.is-hidden { display: none !important; }

.page-grain {
  pointer-events: none;
  position: fixed;
  z-index: 100;
  inset: 0;
  opacity: .12;
  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='.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.58'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.app-shell, .start-screen, .game-screen { width: 100%; height: 100vh; height: 100dvh; }
.start-screen {
  position: relative;
  display: flex;
  isolation: isolate;
  overflow: hidden;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: max(34px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse at 50% 34%, rgba(80, 144, 126, .2), transparent 34%),
    linear-gradient(180deg, #101d23 0%, #091319 46%, #04090c 100%);
}
.start-backdrop, .start-backdrop::before, .start-backdrop::after { position: absolute; inset: 0; pointer-events: none; }
.start-backdrop { z-index: -2; overflow: hidden; }
.start-backdrop::before {
  content: '';
  opacity: .85;
  background:
    radial-gradient(ellipse at 22% 24%, rgba(195, 238, 218, .1) 0 1px, transparent 2px),
    radial-gradient(ellipse at 74% 20%, rgba(195, 238, 218, .12) 0 1px, transparent 2px),
    radial-gradient(ellipse at 58% 8%, rgba(195, 238, 218, .14) 0 1px, transparent 2px),
    radial-gradient(ellipse at 10% 45%, rgba(195, 238, 218, .07) 0 1px, transparent 2px),
    radial-gradient(ellipse at 82% 47%, rgba(195, 238, 218, .08) 0 1px, transparent 2px);
  background-size: 167px 131px, 191px 173px, 239px 199px, 223px 211px, 241px 187px;
}
.start-backdrop::after {
  content: '';
  background: linear-gradient(90deg, rgba(2, 7, 9, .6), transparent 26%, transparent 73%, rgba(2, 7, 9, .62));
}
.moon {
  position: absolute;
  left: 50%; top: 8%; width: min(31vw, 360px); aspect-ratio: 1;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 37% 36%, #e9f1df 0 3%, #c9ddcb 4% 23%, #a9c1b1 57%, #7e978f 74%, #536d69 100%);
  box-shadow: 0 0 35px 8px rgba(177, 229, 207, .14), 0 0 110px 35px rgba(79, 145, 126, .12);
  opacity: .65;
}
.mountain { position: absolute; bottom: 0; width: 0; height: 0; filter: drop-shadow(0 -10px 25px rgba(40, 121, 99, .14)); }
.mountain-back {
  left: -10%; border-style: solid; border-width: 0 42vw 55vh 42vw; border-color: transparent transparent #142827 transparent;
  opacity: .95;
}
.mountain-front {
  right: -18%; border-style: solid; border-width: 0 51vw 48vh 51vw; border-color: transparent transparent #0a1819 transparent;
}
.banner { position: absolute; top: 0; width: 2px; height: 47%; background: linear-gradient(#415d5d, #162728); opacity: .45; }
.banner::after { content: ''; position: absolute; top: 0; width: 56px; height: 118px; background: linear-gradient(90deg, rgba(42, 110, 99, .72), rgba(13, 49, 47, .45)); clip-path: polygon(0 0, 100% 8%, 74% 100%, 0 87%); }
.banner-one { left: 12%; }.banner-one::after { left: 1px; }
.banner-two { right: 12%; }.banner-two::after { right: 1px; transform: scaleX(-1); }

.brand-lockup { width: min(730px, 100%); text-align: center; margin-top: -45px; }
.eyebrow { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 0 0 13px; color: #bad8c7; font-size: 10px; font-weight: 750; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow span { width: 31px; height: 1px; background: linear-gradient(90deg, transparent, #7fb3a0); }.eyebrow span:last-child { transform: scaleX(-1); }
.brand-lockup h1 { margin: 0; color: #f4e7c5; font-family: var(--heading); font-size: clamp(45px, 8.1vw, 102px); line-height: .85; letter-spacing: .025em; text-shadow: 0 1px 0 #fff4d5, 0 12px 32px #000; }
.brand-lockup h1 em { color: #9eb9a9; font-size: .5em; font-style: italic; font-weight: 400; vertical-align: 12%; }
.subtitle { max-width: 550px; margin: 23px auto 0; color: #bec9bd; font-size: clamp(13px, 1.7vw, 16px); line-height: 1.65; text-shadow: 0 2px 15px #000; }

.class-selection { display: grid; grid-template-columns: repeat(3, minmax(150px, 200px)); gap: 10px; width: min(640px, 100%); margin: clamp(28px, 5vh, 45px) auto 19px; }
.class-card {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 76px; overflow: hidden; padding: 12px;
  color: #c2cec2; text-align: left; border: 1px solid rgba(190, 220, 199, .19); border-radius: 4px;
  background: linear-gradient(135deg, rgba(21, 42, 43, .75), rgba(8, 17, 20, .76));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 8px 23px rgba(0,0,0,.16); transition: .2s ease;
}
.class-card::before { content: ''; position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle at 16% 50%, rgba(92, 215, 177, .22), transparent 54%); transition: opacity .2s; }
.class-card:hover, .class-card.selected { border-color: rgba(154, 244, 211, .64); color: #eff3df; transform: translateY(-2px); }
.class-card.selected { box-shadow: inset 0 0 0 1px rgba(170, 255, 218, .2), 0 0 22px rgba(68, 190, 154, .16); }.class-card.selected::before { opacity: 1; }
.class-mark { position: relative; z-index: 1; display: grid; width: 34px; aspect-ratio: 1; place-items: center; color: #f7d38a; font-family: Georgia, serif; font-size: 27px; text-shadow: 0 0 14px rgba(251, 202, 106, .5); }
.arcane-mark { color: #a6b6ff; }.ranger-mark { color: #96e0c1; }
.class-copy { position: relative; z-index: 1; display: grid; gap: 4px; }.class-copy strong { font-family: var(--heading); font-size: 17px; font-weight: 600; }.class-copy small { color: #91a99c; font-size: 10px; }
.start-actions { display: grid; justify-items: center; gap: 12px; }
.primary-button {
  position: relative; display: inline-flex; min-width: 218px; align-items: center; justify-content: center; gap: 22px; padding: 13px 16px 13px 21px;
  color: #13251f; border: 1px solid #c4f5c9; border-radius: 3px; background: linear-gradient(100deg, #84d7b1, #d5edbb); box-shadow: 0 5px 22px rgba(72, 204, 150, .18), inset 0 1px rgba(255,255,255,.65); font-weight: 850; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; transition: transform .18s, filter .18s;
}
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }.primary-button b { font-size: 24px; line-height: 10px; font-weight: 400; }.primary-button:active { transform: translateY(0); }
.text-button { padding: 5px; color: #a5c8b7; border: 0; background: transparent; font-size: 12px; text-decoration: underline; text-decoration-color: rgba(165, 200, 183, .35); text-underline-offset: 4px; }.text-button:hover { color: #e1f7d9; }
.start-note { margin: 21px 0 0; color: #94a99d; font-size: 10px; letter-spacing: .06em; } kbd { padding: 2px 5px; color: #d6e6d7; border: 1px solid rgba(211,238,217,.28); border-radius: 3px; background: rgba(6,15,16,.55); font-family: var(--body); font-size: .9em; }

.game-screen { position: relative; isolation: isolate; overflow: hidden; background: #07110f; }
#worldCanvas { position: absolute; z-index: 0; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.canvas-vignette { position: absolute; z-index: 1; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, transparent 42%, rgba(0, 7, 8, .1) 71%, rgba(0, 6, 7, .73) 125%); }
.top-hud, .player-panel, .quest-card, .minimap-frame, .resource-strip, .action-bar, .desktop-controls, .touch-controls, .hint-bubble, .encounter-banner { position: absolute; z-index: 3; }
.top-hud { top: max(14px, env(safe-area-inset-top)); left: max(16px, env(safe-area-inset-left)); right: max(16px, env(safe-area-inset-right)); display: flex; align-items: flex-start; justify-content: space-between; pointer-events: none; }
.top-hud > * { pointer-events: auto; }
.profile-card { display: flex; align-items: center; min-width: 195px; padding: 5px 10px 5px 5px; color: #e8e3ca; text-align: left; border: 1px solid var(--edge); border-radius: 4px; background: linear-gradient(115deg, rgba(6, 16, 19, .88), rgba(16, 35, 36, .72)); box-shadow: 0 8px 20px rgba(0,0,0,.26); }
.profile-card:hover { border-color: var(--edge-bright); }.profile-seal { display: grid; width: 33px; height: 33px; margin-right: 8px; place-items: center; color: #f5d48a; border: 1px solid rgba(246,209,125,.56); border-radius: 50%; background: radial-gradient(circle at 30% 28%, #647c70, #173332); font-family: var(--heading); font-size: 18px; box-shadow: inset 0 0 10px #091312; }.profile-text { display: grid; flex: 1; gap: 1px; }.profile-text b { max-width: 116px; overflow: hidden; font-size: 11px; letter-spacing: .025em; text-overflow: ellipsis; white-space: nowrap; }.profile-text small { color: #a1b3a7; font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }.profile-text small i { display: inline-block; width: 5px; height: 5px; margin-right: 3px; vertical-align: 1px; border-radius: 50%; background: #acb7ae; }.profile-text small.is-online i { background: #75edbd; box-shadow: 0 0 7px #75edbd; }.profile-chevron { color: #90a89c; font-size: 16px; }
.world-title { display: flex; align-items: center; gap: 10px; padding-top: 6px; color: #dae9d7; text-align: center; text-shadow: 0 2px 4px rgba(0,0,0,.8); }.world-title span:not(.world-rule) { display: grid; gap: 2px; }.world-title b { font-family: var(--heading); font-size: 17px; font-weight: 500; letter-spacing: .08em; }.world-title small { color: #9fb7aa; font-size: 8px; letter-spacing: .15em; text-transform: uppercase; }.world-rule { width: 28px; height: 1px; background: linear-gradient(90deg, transparent, #719c8b); }.world-rule:last-child { transform: scaleX(-1); }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; color: #bed6c8; border: 1px solid var(--edge); border-radius: 4px; background: rgba(7,17,19,.72); font-size: 18px; }.icon-button:hover { color: #e1f4d9; border-color: var(--edge-bright); }

.player-panel { top: 73px; left: max(16px, env(safe-area-inset-left)); width: 198px; padding: 9px 11px 11px; border: 1px solid var(--edge); border-radius: 4px; background: linear-gradient(125deg, rgba(7,18,20,.84), rgba(12,28,27,.68)); box-shadow: 0 8px 25px rgba(0,0,0,.2); }.player-headline { display: flex; justify-content: space-between; margin-bottom: 7px; color: #b5cbbb; font-size: 8px; font-weight: 800; letter-spacing: .1em; }.player-headline b { color: #f3d887; font-size: 9px; }.bar-group { margin-top: 7px; }.bar-label { display: flex; justify-content: space-between; margin-bottom: 3px; color: #b9c6bd; font-size: 9px; }.bar-label b { color: #dfe8d8; font-size: 9px; font-weight: 600; }.bar-track { height: 7px; overflow: hidden; border: 1px solid rgba(0,0,0,.6); border-radius: 2px; background: #07100f; box-shadow: inset 0 1px 3px #000; }.bar-fill { width: 100%; height: 100%; transition: width .18s; }.health .bar-fill { background: linear-gradient(90deg, #994a48, #de7161, #f29a6d); box-shadow: 0 0 7px rgba(241,103,83,.55); }.mana .bar-fill { background: linear-gradient(90deg, #5862ad, #8a91f0, #c3b4ff); box-shadow: 0 0 7px rgba(128,145,245,.45); }.xp-line { position: relative; height: 5px; margin-top: 10px; overflow: visible; border-radius: 3px; background: #050e0d; }.xp-line > span { display: block; width: 0%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #c79748, #f5da78); transition: width .18s; }.xp-line b { position: absolute; right: 0; bottom: 7px; color: #9eae9e; font-size: 8px; font-weight: 600; }

.quest-card { top: 83px; right: max(220px, calc(env(safe-area-inset-right) + 204px)); width: min(296px, 27vw); padding: 11px 13px; border-left: 2px solid #a5d8b6; border-radius: 2px; background: linear-gradient(90deg, rgba(6,17,18,.76), rgba(9,22,23,.48)); text-shadow: 0 1px 2px #000; }.quest-title { display: flex; align-items: center; gap: 6px; color: #9fd2b4; font-size: 9px; letter-spacing: .16em; }.quest-title span { color: #e3c070; font-size: 14px; }.quest-title p { margin: 0; }.quest-card h2 { margin: 5px 0 4px; color: #ebdfc5; font-family: var(--heading); font-size: 17px; font-weight: 500; }.quest-card > p { margin: 0; color: #adc0b3; font-size: 10px; line-height: 1.45; }.quest-progress { display: flex; align-items: center; gap: 9px; margin-top: 9px; color: #d6dfce; font-size: 9px; }.quest-progress span { white-space: nowrap; }.quest-progress b { color: #f2ce7d; }.quest-progress em { font-style: normal; }.quest-progress > i { display: block; flex: 1; height: 4px; overflow: hidden; border-radius: 3px; background: rgba(2,8,8,.75); }.quest-progress > i span { display: block; width: 0%; height: 100%; border-radius: inherit; background: #78cda4; transition: width .2s; }
.minimap-frame { top: 78px; right: max(16px, env(safe-area-inset-right)); width: 190px; height: 148px; overflow: hidden; padding: 3px; border: 1px solid rgba(186,217,194,.44); border-radius: 3px; background: #081312; box-shadow: 0 8px 25px rgba(0,0,0,.31); }.minimap-frame::before { content: ''; position: absolute; inset: 6px; z-index: 1; pointer-events: none; border: 1px solid rgba(215,199,142,.19); }.minimap-frame canvas { display: block; width: 100%; height: 126px; background: #162e28; }.map-label { position: absolute; z-index: 2; bottom: 5px; left: 0; right: 0; color: #c4d7bf; text-align: center; font-size: 8px; font-weight: 800; letter-spacing: .15em; text-shadow: 0 1px #000; }

.resource-strip { right: max(16px, env(safe-area-inset-right)); bottom: 21px; display: flex; align-items: center; gap: 9px; padding: 5px; border: 1px solid rgba(171,203,181,.18); border-radius: 4px; background: rgba(5,14,15,.75); }.resource-strip > span { display: inline-flex; align-items: center; gap: 4px; padding: 0 4px; color: #e7ddbd; font-size: 11px; }.resource-strip i { color: #f0c759; font-size: 16px; font-style: normal; }.resource-strip .potion i { color: #c581ee; }.save-button { display: inline-flex; gap: 5px; align-items: center; padding: 7px 9px; color: #c5e6d4; border: 1px solid rgba(122,205,166,.35); border-radius: 3px; background: rgba(34,82,70,.4); font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }.save-button:hover { color: #f4f5cf; border-color: #8ee8bc; }.save-button:disabled { opacity: .45; cursor: not-allowed; }

.action-bar { left: 50%; bottom: 17px; display: flex; gap: 7px; translate: -50% 0; }.ability-slot { position: relative; display: grid; width: 82px; height: 69px; align-content: center; justify-items: center; overflow: hidden; color: #dfe8d8; border: 1px solid rgba(190,221,199,.32); border-radius: 4px; background: linear-gradient(145deg, rgba(17,40,40,.91), rgba(5,13,15,.94)); box-shadow: 0 5px 15px rgba(0,0,0,.27), inset 0 1px rgba(255,255,255,.05); transition: transform .13s, border-color .13s; }.ability-slot:hover { transform: translateY(-3px); border-color: #b0f3cc; }.ability-slot:active { transform: translateY(0); }.slot-key { position: absolute; top: 4px; left: 5px; color: #9ea9a0; font-size: 7px; font-weight: 750; letter-spacing: .05em; }.ability-glyph { color: #e7c777; font-family: Georgia, serif; font-size: 27px; line-height: 29px; text-shadow: 0 0 10px rgba(237,183,79,.4); }.skill .ability-glyph { color: #a8c7ff; text-shadow: 0 0 10px rgba(129,162,255,.5); }.potion-slot .ability-glyph { color: #d996ed; text-shadow: 0 0 10px rgba(209,105,225,.5); }.ability-slot b { max-width: 72px; overflow: hidden; color: #aebcaf; font-size: 8px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }.cooldown-cover { position: absolute; inset: auto 0 0; display: block; height: 0%; pointer-events: none; background: rgba(4,10,14,.72); transition: height .08s linear; }.ability-slot.is-cooling { border-color: rgba(134,153,151,.22); }
.desktop-controls { bottom: 22px; left: max(16px, env(safe-area-inset-left)); color: rgba(205,221,205,.6); font-size: 9px; letter-spacing: .025em; text-shadow: 0 1px #000; }.desktop-controls b { color: #bcd6c2; font-size: 8px; }.hint-bubble { left: 50%; bottom: 106px; max-width: min(370px, 72vw); padding: 8px 12px; translate: -50% 0; color: #dce6d8; border: 1px solid rgba(179,225,195,.25); border-radius: 3px; background: rgba(4,14,15,.75); box-shadow: 0 4px 16px rgba(0,0,0,.25); font-size: 10px; line-height: 1.4; text-align: center; }.hint-bubble kbd { font-size: 8px; }
.encounter-banner { top: 35%; left: 50%; display: none; padding: 6px 18px; translate: -50% 0; color: #fde0bd; border-top: 1px solid rgba(224,165,91,.6); border-bottom: 1px solid rgba(224,165,91,.6); background: linear-gradient(90deg, transparent, rgba(32,13,11,.82), transparent); font-family: var(--heading); font-size: 15px; letter-spacing: .09em; text-shadow: 0 2px 4px #000; }.encounter-banner.show { display: block; animation: bannerIn .25s ease-out; }
@keyframes bannerIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.damage-layer { position: absolute; z-index: 4; inset: 0; pointer-events: none; }.damage-number { position: absolute; color: #ffe3a7; font-family: var(--heading); font-size: 20px; font-weight: bold; text-shadow: 0 2px 3px #140403, 0 0 9px rgba(242,181,94,.6); animation: floatDamage .75s ease-out forwards; }.damage-number.critical { color: #fff5c5; font-size: 27px; }.damage-number.hurt { color: #f28273; }.damage-number.heal { color: #96f6bd; } @keyframes floatDamage { 0% { opacity: 0; transform: translate(-50%, 5px) scale(.8); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -38px) scale(1.12); } }

.touch-controls { display: none; }.death-screen { position: absolute; z-index: 10; inset: 0; display: grid; place-items: center; background: radial-gradient(circle, rgba(15,9,9,.43), rgba(3,7,8,.87)); }.death-content { max-width: 450px; padding: 30px; text-align: center; }.death-content > span { display: block; color: #e6a064; font-size: 42px; text-shadow: 0 0 18px rgba(224,89,62,.55); }.death-content p { margin: 9px 0; color: #efb28e; font-size: 10px; font-weight: 800; letter-spacing: .18em; }.death-content h2 { margin: 0 0 22px; color: #f1e4c7; font-family: var(--heading); font-size: clamp(23px, 4vw, 36px); font-weight: 400; }

.modal { position: fixed; z-index: 30; inset: 0; display: grid; place-items: center; padding: 20px; }.modal-backdrop { position: absolute; inset: 0; background: rgba(1,6,7,.74); backdrop-filter: blur(4px); }.modal-panel { position: relative; z-index: 1; width: min(440px, 100%); max-height: min(720px, calc(100dvh - 40px)); overflow-y: auto; padding: 29px; color: #dbe5d6; border: 1px solid rgba(166,220,191,.36); border-radius: 5px; background: linear-gradient(145deg, #132827, #091416 78%); box-shadow: 0 20px 70px rgba(0,0,0,.66), inset 0 1px rgba(255,255,255,.07); animation: modalIn .2s ease-out; }.modal-panel::before { content: ''; position: absolute; inset: 7px; pointer-events: none; border: 1px solid rgba(190,210,175,.11); }.modal-panel > * { position: relative; z-index: 1; }.modal-panel .eyebrow { margin-bottom: 11px; font-size: 8px; }.modal-panel h2 { margin: 0; color: #f0e3c4; font-family: var(--heading); font-size: 29px; font-weight: 500; text-align: center; }.modal-copy { margin: 10px auto 20px; color: #aebdae; font-size: 12px; line-height: 1.55; text-align: center; }.modal-close { position: absolute; z-index: 2; top: 8px; right: 10px; color: #acc5b5; border: 0; background: transparent; font-size: 26px; line-height: 1; }.modal-close:hover { color: #fff0cf; }.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin-bottom: 17px; border-radius: 3px; background: rgba(4,12,13,.66); }.auth-tabs button { padding: 8px; color: #9fb3a5; border: 0; border-radius: 2px; background: transparent; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }.auth-tabs button.active { color: #d9f0d8; background: rgba(76,145,118,.32); }.auth-form { display: grid; gap: 12px; }.auth-form label { display: grid; gap: 5px; color: #bcd0bf; font-size: 10px; font-weight: 750; letter-spacing: .04em; }.auth-form input { width: 100%; padding: 10px 11px; color: #e8eedc; border: 1px solid rgba(166,202,181,.26); border-radius: 3px; outline: 0; background: rgba(3,10,11,.58); font-size: 13px; transition: border-color .15s, background .15s; }.auth-form input::placeholder { color: #5f756b; }.auth-form input:focus { border-color: #82d9af; background: rgba(7,20,20,.78); }.full-button { width: 100%; margin-top: 5px; }.auth-security-note { margin: 17px 0 0; color: #7f9689; font-size: 9px; line-height: 1.4; text-align: center; } @keyframes modalIn { from { opacity: 0; transform: translateY(7px) scale(.985); } to { opacity: 1; transform: none; } }
.profile-menu { position: fixed; z-index: 20; top: 56px; left: 16px; display: grid; width: 207px; overflow: hidden; border: 1px solid rgba(167,211,184,.34); border-radius: 4px; background: #0b1819; box-shadow: 0 14px 32px rgba(0,0,0,.47); }.profile-menu p { margin: 0; padding: 10px; color: #b9caba; border-bottom: 1px solid rgba(164,206,180,.16); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }.profile-menu button { padding: 10px 11px; color: #c9dbca; text-align: left; border: 0; border-bottom: 1px solid rgba(164,206,180,.1); background: transparent; font-size: 11px; }.profile-menu button:last-child { border-bottom: 0; }.profile-menu button:hover { color: #f2ebcc; background: rgba(89,158,128,.17); }.profile-menu button.danger { color: #e59688; }.ranking-panel { width: min(500px, 100%); }.ranking-list { min-height: 130px; margin-top: 21px; border-top: 1px solid rgba(170,209,181,.21); }.ranking-loading { padding: 25px; color: #94aa9d; font-size: 12px; text-align: center; }.rank-row { display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; padding: 10px 3px; border-bottom: 1px solid rgba(171,202,181,.12); }.rank-place { color: #dfbb72; font-family: var(--heading); font-size: 18px; }.rank-name { display: grid; gap: 2px; min-width: 0; }.rank-name b { overflow: hidden; color: #e1e6d7; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.rank-name small { color: #829c8e; font-size: 9px; }.rank-score { color: #e5cc87; font-size: 10px; text-align: right; }.rank-score b { display: block; font-size: 12px; }.ranking-note { margin: 15px 0 0; color: #7f9588; font-size: 9px; text-align: center; }.ranking-empty { padding: 26px; color: #a5b8a9; font-size: 12px; text-align: center; }
.toast-stack { position: fixed; z-index: 50; top: max(12px, env(safe-area-inset-top)); left: 50%; display: grid; gap: 8px; width: min(380px, calc(100% - 32px)); translate: -50% 0; pointer-events: none; }.toast { padding: 10px 12px; color: #e5ecd9; border: 1px solid rgba(150,224,187,.42); border-radius: 4px; background: rgba(9,29,27,.95); box-shadow: 0 7px 20px rgba(0,0,0,.35); font-size: 11px; line-height: 1.35; animation: toastIn .22s ease-out; }.toast.error { color: #ffe0d1; border-color: rgba(240,116,98,.5); background: rgba(61,19,18,.94); }.toast.gold { color: #fff0bd; border-color: rgba(229,190,105,.54); background: rgba(52,42,18,.94); } @keyframes toastIn { from { opacity: 0; transform: translateY(-7px); } to { opacity: 1; transform: none; } }

@media (max-width: 920px) {
  .quest-card { right: max(15px, env(safe-area-inset-right)); top: 229px; width: 235px; }.minimap-frame { top: 73px; width: 161px; height: 125px; }.minimap-frame canvas { height: 104px; }.map-label { bottom: 4px; font-size: 7px; }.world-title { display: none; }.player-panel { top: 69px; }.profile-card { min-width: 177px; }.desktop-controls { display: none; }
}
@media (max-width: 640px), (pointer: coarse) and (max-height: 620px) {
  .game-screen { min-height: 500px; }.top-hud { top: max(7px, env(safe-area-inset-top)); left: max(8px, env(safe-area-inset-left)); right: max(8px, env(safe-area-inset-right)); }.profile-card { min-width: 151px; padding: 4px 7px 4px 4px; }.profile-seal { width: 27px; height: 27px; margin-right: 5px; font-size: 15px; }.profile-text b { max-width: 96px; font-size: 10px; }.profile-text small { font-size: 7px; }.icon-button { width: 28px; height: 28px; font-size: 15px; }.player-panel { top: 48px; left: max(8px, env(safe-area-inset-left)); width: 159px; padding: 6px 8px 8px; }.player-headline { margin-bottom: 4px; font-size: 7px; }.player-headline b { font-size: 7px; }.bar-group { margin-top: 5px; }.bar-label { margin-bottom: 2px; font-size: 8px; }.bar-label b { font-size: 8px; }.bar-track { height: 5px; }.xp-line { margin-top: 7px; height: 4px; }.xp-line b { bottom: 5px; font-size: 7px; }.minimap-frame { top: 42px; right: max(8px, env(safe-area-inset-right)); width: 127px; height: 100px; padding: 2px; }.minimap-frame canvas { height: 82px; }.minimap-frame::before { inset: 4px; }.map-label { bottom: 3px; font-size: 6px; letter-spacing: .1em; }.quest-card { top: 151px; right: max(8px, env(safe-area-inset-right)); width: min(215px, 60vw); padding: 7px 9px; }.quest-title { gap: 4px; font-size: 7px; }.quest-title span { font-size: 11px; }.quest-card h2 { margin: 3px 0; font-size: 14px; }.quest-card > p { font-size: 8px; line-height: 1.35; }.quest-progress { gap: 5px; margin-top: 5px; font-size: 7px; }.resource-strip { right: max(8px, env(safe-area-inset-right)); bottom: calc(9px + env(safe-area-inset-bottom)); gap: 3px; padding: 3px; }.resource-strip > span { font-size: 9px; }.resource-strip i { font-size: 13px; }.save-button { padding: 5px; font-size: 8px; }.save-button b { display: none; }.action-bar { bottom: calc(10px + env(safe-area-inset-bottom)); gap: 4px; }.ability-slot { width: 58px; height: 48px; }.ability-glyph { font-size: 21px; line-height: 21px; }.ability-slot b { max-width: 53px; font-size: 6px; }.slot-key { top: 2px; left: 3px; font-size: 5px; }.hint-bubble { bottom: 73px; padding: 5px 8px; font-size: 8px; }.touch-controls { position: absolute; z-index: 5; right: max(10px, env(safe-area-inset-right)); bottom: calc(67px + env(safe-area-inset-bottom)); display: flex; align-items: end; justify-content: space-between; width: calc(100% - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)); pointer-events: none; }.dpad { position: relative; width: 112px; height: 112px; pointer-events: auto; }.dpad button, .touch-actions button { display: grid; place-items: center; color: rgba(231,247,224,.9); border: 1px solid rgba(187,229,204,.33); border-radius: 50%; background: rgba(7,24,23,.6); box-shadow: inset 0 1px rgba(255,255,255,.07), 0 3px 8px rgba(0,0,0,.2); touch-action: none; }.dpad button { position: absolute; width: 41px; height: 41px; font-size: 13px; }.dpad [data-move=up] { left: 36px; top: 0; }.dpad [data-move=left] { left: 0; top: 36px; }.dpad [data-move=down] { left: 36px; bottom: 0; }.dpad [data-move=right] { right: 0; top: 36px; }.touch-actions { display: flex; align-items: end; gap: 6px; pointer-events: auto; }.touch-actions button { width: 47px; height: 47px; font-family: Georgia, serif; font-size: 22px; }.touch-actions .touch-skill { width: 56px; height: 56px; color: #c7d2ff; border-color: rgba(172,194,255,.55); background: rgba(28,38,85,.54); }.touch-actions .touch-attack { color: #f8dd91; border-color: rgba(239,200,117,.48); background: rgba(73,57,24,.5); }.touch-actions .touch-potion { color: #e8b2ff; font-size: 25px; }.encounter-banner { top: 31%; width: 100%; font-size: 12px; text-align: center; }.death-content { padding: 20px; }.death-content h2 { font-size: 25px; }.modal { padding: 12px; }.modal-panel { max-height: calc(100dvh - 24px); padding: 22px 18px; }.modal-panel h2 { font-size: 25px; }.modal-copy { font-size: 11px; }.profile-menu { top: 42px; left: 8px; }.toast-stack { top: 7px; }.toast { font-size: 10px; }
}
@media (max-width: 510px) and (max-height: 650px) { .quest-card { display: none; }.hint-bubble { display: none; } }
@media (max-width: 650px) and (orientation: portrait) { .class-selection { grid-template-columns: 1fr; gap: 7px; width: min(310px, 100%); margin: 18px auto 15px; }.class-card { min-height: 50px; padding: 7px 10px; }.class-mark { width: 27px; font-size: 21px; }.class-copy { grid-auto-flow: column; align-items: baseline; gap: 8px; }.class-copy strong { font-size: 14px; }.class-copy small { font-size: 9px; }.brand-lockup { margin-top: -14px; }.brand-lockup h1 { font-size: clamp(42px, 13vw, 61px); }.subtitle { margin-top: 16px; font-size: 12px; }.moon { top: 5%; width: 56vw; }.start-note { margin-top: 12px; font-size: 8px; }.banner { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; transition-duration: .001ms !important; } }
