@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Marcellus&display=swap');
:root{--ink:#173c39;--dark:#102f2d;--cream:#fcf5e4;--gold:#e8b35d;--mint:#79c7ad}*{box-sizing:border-box}body{margin:0;background:var(--dark);color:var(--ink);font-family:'DM Sans',sans-serif}button,input{font:inherit}button{cursor:pointer;border:0;border-radius:12px;padding:12px 18px;background:var(--cream);color:var(--ink);font-weight:700;transition:.15s}button:hover{filter:brightness(1.07);transform:translateY(-1px)}button:disabled{cursor:default;opacity:.45;transform:none}button:focus-visible{outline:3px solid #e5ac52;outline-offset:3px}h1,h2,h3{font-family:Marcellus,Georgia,serif;font-weight:400}h1{font-size:clamp(44px,6vw,82px);line-height:1.05;margin:18px 0}h2{font-size:30px;margin:0 0 14px}p{line-height:1.6}.primary{background:var(--gold);color:#302b1e}.dark{background:var(--ink);color:var(--cream)}.muted{color:#71847b;font-size:13px}.eyebrow{font-size:11px;letter-spacing:3px;font-weight:700;text-transform:uppercase}.hero{min-height:100dvh;display:flex;align-items:center;padding:6vw;background:linear-gradient(90deg,#082f30f5,#082f30ad 48%,#082f3025),url(assets/village.png) center/cover;color:var(--cream)}.hero-content{max-width:560px}.hero p{max-width:440px;color:#d8e4d5}.hero .primary{font-size:17px;padding:17px 30px}.hero-footer{position:absolute;bottom:24px;left:6vw;color:#c4d1bd;font-size:12px}.logo{display:inline-flex;align-items:center;gap:12px;letter-spacing:2px}.logo i{font-style:normal;color:var(--gold);font-size:30px}.creator{min-height:100dvh;background:radial-gradient(ellipse at 25% 30%,#315d54,#102f2d 70%);color:var(--cream);padding:35px 6vw}.creator-grid{display:grid;grid-template-columns:1fr 1fr;gap:60px;max-width:1100px;margin:25px auto}.creature-stage{display:grid;place-items:center;background:radial-gradient(ellipse at center,#aac6a320,transparent 70%);min-height:380px}.creature-stage svg{width:min(360px,80%);filter:drop-shadow(0 20px 20px #0003);animation:bob 3s ease-in-out infinite}@keyframes bob{50%{transform:translateY(-8px)}}.form-panel{background:#fcf5e4;color:var(--ink);border-radius:22px;padding:30px}.form-panel label{display:block;margin:16px 0 7px;font-size:13px;font-weight:700}.form-panel input{width:100%;padding:12px;border:1px solid #ccd2bf;background:#fffaf0;border-radius:9px}.options{display:flex;gap:8px;flex-wrap:wrap}.options button{border:1px solid #cbd1c0;padding:9px 13px}.options .selected{background:var(--ink);color:#fff}.swatch{width:38px;height:38px;border-radius:50%;padding:0!important}.swatch.selected{outline:3px solid var(--ink);outline-offset:2px}.game{height:100dvh;display:flex;flex-direction:column;overflow:hidden}.topbar{height:78px;flex-shrink:0;background:var(--dark);color:var(--cream);display:flex;gap:20px;align-items:center;padding:12px 24px;border-bottom:1px solid #ffffff15}.brand{min-width:190px}.brand b{font-family:Marcellus;font-size:23px;display:block}.brand small{font-size:10px;letter-spacing:2px;color:#9ab7a7}.resources{display:flex;gap:10px;flex:1;justify-content:center}.resource{display:flex;gap:10px;align-items:center;padding:7px 16px;background:#ffffff09;border:1px solid #ffffff0b;border-radius:12px;min-width:110px}.resource i{font-style:normal;font-size:25px}.resource small{display:block;font-size:10px;color:#b1c7ba}.resource strong{font-size:17px}.topbar button{padding:10px}.main{display:flex;flex:1;min-height:0;position:relative}.scene{flex:1;min-width:0;position:relative;overflow:hidden;background:#d7b77c}.village{position:absolute;inset:0;background:url(assets/village.png) center/cover}.scene-title{position:absolute;top:24px;left:26px;z-index:2;background:#fff6e5e8;padding:12px 20px;border-radius:14px;box-shadow:0 4px 15px #163f3220;pointer-events:none}.scene-title h2{font-size:24px;margin:0}.scene-title small{font-size:11px;color:#6a7862}.plot{position:absolute;transform:translate(-50%,-50%);width:130px;height:112px;background:transparent;padding:0;border-radius:40%;filter:drop-shadow(0 6px 4px #573b2429)}.plot:hover{transform:translate(-50%,-54%)}.plot svg{width:100%;height:100%}.plot .name{position:absolute;bottom:-13px;left:50%;transform:translateX(-50%);background:#fff7e9eb;padding:5px 10px;border-radius:7px;white-space:nowrap;font-size:11px;box-shadow:0 2px 3px #402c2220}.plot .badge{position:absolute;right:0;top:0;border:2px solid #f6dfaa;background:#214f44;color:white;border-radius:50%;width:25px;height:25px;display:grid;place-items:center;font-size:11px}.plot .collect{position:absolute;top:0;left:50%;transform:translate(-50%,-60%);background:var(--gold);padding:5px 10px;border-radius:8px;white-space:nowrap;font-size:11px}.plot .progress{position:absolute;bottom:8px;left:15%;width:70%;height:7px;background:#233d31;border-radius:8px;overflow:hidden}.progress span{display:block;background:var(--gold);height:100%}.sidebar{width:310px;flex-shrink:0;background:var(--cream);padding:24px;overflow:auto;border-left:1px solid #d6d9c1}.sidebar h2{font-size:25px}.sidebar h3{font-size:21px;margin:24px 0 12px}.sidebar p{font-size:13px;color:#637768}.sidebar button{width:100%;margin:5px 0}.pill{display:inline-block;font-size:10px;letter-spacing:1px;background:#dce7d4;padding:6px 9px;border-radius:6px;margin-bottom:14px}.costs{display:flex;gap:10px;flex-wrap:wrap;margin:16px 0;font-size:13px}.stat{display:flex;justify-content:space-between;padding:9px 0;border-bottom:1px solid #dbe0ce;font-size:13px}.bottom{height:70px;background:var(--dark);display:flex;align-items:center;justify-content:space-between;padding:10px 24px;gap:12px;color:#cad8c9}.tabs{display:flex;gap:8px}.tabs button{background:transparent;color:#b9cebd;min-width:115px}.tabs .active{background:var(--cream);color:var(--ink)}.save-status{font-size:11px}.quests{position:absolute;bottom:20px;left:24px;width:280px;background:#113c35eb;color:var(--cream);padding:16px 18px;border:1px solid #aac79955;border-radius:14px;font-size:12px;pointer-events:none}.quests strong{display:block;color:#e9be79;margin-bottom:7px}.troops{position:absolute;bottom:22%;left:42%;display:flex;gap:0;pointer-events:none}.troops svg{width:40px;height:48px;margin-left:-8px;filter:drop-shadow(2px 3px 2px #5c402544)}canvas{width:100%;height:100%;display:block;touch-action:none}.map-tools{position:absolute;bottom:22px;left:24px;display:flex;gap:8px}.map-tools button{box-shadow:0 3px 12px #0002}.report{background:#e9eddd;border-radius:10px;padding:12px;margin-bottom:10px;font-size:12px}.report b{display:block;margin-bottom:5px}dialog{border:0;border-radius:20px;padding:30px;max-width:560px;width:calc(100% - 30px);background:var(--cream);color:var(--ink);box-shadow:0 30px 100px #0007}dialog::backdrop{background:#082c2b99;backdrop-filter:blur(5px)}dialog p{font-size:14px}#toast{position:fixed;bottom:88px;left:50%;transform:translateX(-50%);z-index:30;background:var(--dark);color:var(--cream);padding:14px 24px;border:1px solid #b8ca9d;border-radius:12px;box-shadow:0 6px 25px #0004;opacity:0;pointer-events:none;transition:.2s;max-width:90vw}#toast.show{opacity:1}.intro-quote{border-left:2px solid var(--gold);padding-left:20px;margin:25px 0}.range{width:100%}a{color:inherit}.empty{font-size:12px;color:#7f8b79;padding:15px 0}.mission{font-size:12px;background:#e3ead8;padding:11px;margin:8px 0;border-radius:9px}.mission button{padding:7px;font-size:11px}.settings-row{display:flex;gap:8px;margin-top:15px}.settings-row button{flex:1}.selected-portrait{width:90px;height:90px;margin:0 auto 10px;display:block}body.world .quests{display:none}
@media(max-width:900px){.sidebar{width:250px;padding:18px}.brand{min-width:125px}.resource{min-width:76px;padding:6px;gap:6px}.resource i{font-size:20px}.topbar{padding:10px;gap:10px}.plot{width:105px;height:95px}.quests{width:230px;font-size:11px}}
@media(max-width:650px){.creator-grid{grid-template-columns:1fr;gap:10px}.creature-stage{min-height:190px}.creature-stage svg{width:170px}.creator{padding:20px}.form-panel{padding:20px}.hero{padding:28px}.hero-footer{left:28px}.topbar{height:108px;flex-wrap:wrap;justify-content:space-between;gap:4px}.brand{flex:1}.brand b{font-size:19px}.resources{order:3;flex-basis:100%;gap:5px}.resource{flex:1;min-width:0;padding:4px 7px}.resource strong{font-size:13px}.resource small{font-size:9px}.resource i{font-size:18px}.main{flex-direction:column}.sidebar{width:100%;height:210px;border-left:0;border-top:1px solid #d0d6c0;padding:14px 20px}.sidebar h2{font-size:20px}.sidebar p{margin:5px 0}.sidebar h3{margin:10px 0}.scene{min-height:320px}.scene-title{top:10px;left:12px;padding:8px 12px}.scene-title h2{font-size:18px}.plot{width:75px;height:72px}.plot .name{font-size:9px;padding:3px 5px;bottom:-8px}.plot .badge{width:20px;height:20px;font-size:9px}.plot .collect{font-size:9px}.quests{display:none}.bottom{height:60px;padding:6px 10px}.tabs button{min-width:80px;padding:10px}.save-status{font-size:9px;max-width:90px}.troops svg{width:29px}.map-tools{left:10px;bottom:10px}.map-tools button{padding:7px 12px}.costs{margin:7px 0}.sidebar .stat{padding:5px 0}}

.chat-widget{position:fixed;right:22px;bottom:82px;z-index:12}.chat-toggle{background:#183f3b;color:#fbf0d9;border:1px solid #d4b578;box-shadow:0 5px 20px #0003}.chat-panel{position:absolute;right:0;bottom:58px;width:350px;height:420px;max-height:65dvh;background:#fcf5e4;border:1px solid #b0c0a8;border-radius:16px;box-shadow:0 12px 50px #082d2966;display:flex;flex-direction:column;overflow:hidden}.chat-head{display:flex;gap:10px;align-items:center;background:#183f3b;color:#fcf5e4;padding:10px 14px}.chat-head button{margin-left:auto;padding:4px 11px;background:transparent;color:#fff;font-size:20px}.test-label{font-size:9px;letter-spacing:2px;background:#e8b35d;color:#183f3b;padding:4px 6px;border-radius:4px}.chat-hint{font-size:10px;padding:8px 14px;color:#667d6d;border-bottom:1px solid #dbe1cf}.chat-list{flex:1;overflow:auto;padding:10px 14px;min-height:0}.chat-message{padding:8px 0;border-bottom:1px solid #dbe1cf}.chat-author{display:flex;justify-content:space-between;gap:12px;font-size:11px}.chat-author time{font-size:10px;color:#84917d}.chat-message p{font-size:12px;margin:4px 0 0;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message.local{color:#8b602b}.chat-form{display:flex;gap:6px;padding:10px}.chat-form input{width:0;flex:1;min-width:0;background:#fffaf0;border:1px solid #becbb6;padding:10px;border-radius:8px;font-size:12px}.chat-form button{padding:9px 12px;font-size:12px}.chat-help{font-size:10px;padding:0 10px 10px;background:none;color:#6e816b;align-self:flex-start}.chat-empty{font-size:12px;color:#84917d}
@media(max-width:650px){.chat-widget{right:12px;bottom:70px}.chat-toggle{font-size:11px;padding:9px 12px}.chat-panel{width:min(350px,calc(100vw - 24px));bottom:46px;max-height:65dvh}}

.login-link{display:inline-block;text-decoration:none;border-radius:12px;padding:17px 30px;font-weight:700;font-size:17px}

.auth-dialog{max-width:440px;padding:30px}.auth-heading{position:relative;padding-right:25px}.auth-close{position:absolute;right:-12px;top:-15px;font-size:24px;background:none;padding:5px 10px}.auth-tabs{display:flex;background:#e9ecdd;padding:4px;border-radius:10px;margin:20px 0}.auth-tabs button{flex:1;background:none;font-size:13px}.auth-tabs .selected{background:#173c39;color:#fff}.auth-dialog h2{margin-top:18px}.auth-subtitle{font-size:13px;color:#6c7f6b}.auth-dialog label{display:block;font-size:12px;font-weight:700;margin:13px 0}.auth-dialog input,.auth-dialog select{display:block;width:100%;padding:12px;border:1px solid #bccbb3;border-radius:9px;background:#fffaf0;margin-top:6px;color:#173c39}.auth-dialog form>button{width:100%;margin-top:8px}.auth-error{font-size:12px;color:#ad4d3b;min-height:16px;overflow-wrap:anywhere}.auth-forgot{padding:10px 0;font-size:12px;background:none;text-decoration:underline;font-weight:500}.auth-dialog details{font-size:12px;margin-top:14px;border-top:1px solid #d7deca;padding-top:12px}.auth-dialog summary{cursor:pointer}.auth-dialog .auth-confirm{display:flex;align-items:center;gap:8px;font-weight:400}.auth-confirm input{display:inline-block;width:18px;height:18px;margin:0}.recovery-code{white-space:pre-wrap;overflow-wrap:anywhere;background:#e7eadb;padding:16px;border-radius:9px;font-size:15px;line-height:1.6;user-select:all}.auth-dialog>button{margin:4px}.auth-dialog .primary:disabled{opacity:.45}

.research-dialog{max-width:820px;width:calc(100% - 24px);max-height:90dvh;overflow:auto}.research-dialog>p{font-size:13px;color:#647a68}.research-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:20px 0}.tech-card{background:#f4eedc;border:1px solid #d7d9be;border-radius:14px;padding:18px}.tech-card h3{margin:8px 0;font-size:22px}.tech-card p{font-size:12px;line-height:1.5}.tech-card small{font-size:10px;color:#72816c;line-height:1.5;display:block}.tech-card .costs{font-size:11px;margin:12px 0}.tech-card.done{background:#e2ecda;border-color:#a5b995}.tech-card.studying{border:2px solid #ccaa68}.tech-done{font-size:12px;color:#43806b}.tech-card button{font-size:12px;width:100%;padding:10px}.army-choice{display:flex;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid #d8dec9}.army-choice span{flex:1}.army-choice b{font-size:14px}.army-choice small{display:block;font-size:10px;color:#71806a;margin-top:5px}.army-choice input{width:85px;padding:11px;border:1px solid #bacab2;border-radius:8px;background:#fffaf0}.army-summary{background:#e2ead9;border-radius:9px;padding:14px;margin-top:16px;font-size:13px;font-weight:700}.army-actions{display:flex;gap:8px;margin-bottom:12px}.army-actions button{font-size:12px;padding:8px 12px}.reports-dialog{max-width:660px;max-height:90dvh;overflow:auto}.battle-table{width:100%;border-collapse:collapse;font-size:10px;table-layout:auto}.battle-table th,.battle-table td{padding:7px 3px;text-align:right;border-bottom:1px solid #c7d2bc}.battle-table th:first-child,.battle-table td:first-child{text-align:left}.report details summary{cursor:pointer;font-size:12px;font-weight:700}.report h4{font-size:13px;margin:15px 0 6px}.report>small{display:block;font-size:9px;color:#7c8c74}.sidebar select{padding:8px;border-radius:8px;border:1px solid #bcc9b2;background:#fffaf0}.sidebar input[type=number]{padding:9px;border:1px solid #bcc9b2;border-radius:8px;background:#fffaf0}.plot{width:112px;height:102px}.plot .name{font-size:10px}.troops{bottom:14%;left:46%}
@media(max-width:650px){.research-dialog{padding:20px}.research-grid{grid-template-columns:1fr}.tech-card{padding:15px}.plot{width:66px;height:66px}.plot .name{font-size:8px;max-width:95px;white-space:normal;min-width:55px;line-height:1.2}.bottom .tabs{flex:1;gap:2px}.bottom .tabs button{min-width:0;padding:9px 5px;font-size:10px;flex:1}.bottom .save-status{max-width:55px;font-size:8px}.battle-table{font-size:9px}.reports-dialog{padding:18px}.army-choice input{width:70px}.troops svg{width:23px}}
