/* Creeper Adventure — stylesheet */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
html,body { width:100%; height:100%; overflow:hidden; background:#0b0f0a; font-family:'Segoe UI',Arial,sans-serif; }
.hidden { display:none !important; }

/* ---------- screens ---------- */
.screen { position:fixed; inset:0; z-index:50; display:flex; align-items:center; justify-content:center;
  background:radial-gradient(ellipse at 50% 30%, #1d3317 0%, #0b120a 70%);
  overflow:auto; }
.custom-panel { background:rgba(12,20,10,.92); border:3px solid #3a5c2e; border-radius:14px;
  padding:26px 34px; max-width:860px; width:94%; box-shadow:0 0 60px rgba(60,160,60,.25); color:#cfe6c4; }
.game-title { font-size:42px; letter-spacing:4px; color:#7ed957; text-shadow:0 0 18px rgba(90,220,80,.6), 3px 3px 0 #1a2f12; text-align:center; }
.subtitle { text-align:center; color:#8fae83; margin:4px 0 18px; font-style:italic; }
.custom-body { display:flex; gap:28px; flex-wrap:wrap; justify-content:center; }
.custom-left { flex:0 0 340px; }
#preview-canvas { border-radius:10px; background:linear-gradient(#87b5d8 0%, #b9d8ea 55%, #6a9c50 55%, #4d7a38 100%); border:2px solid #3a5c2e; }
.custom-right { flex:1; min-width:300px; }
.field-label { display:block; font-size:12px; letter-spacing:2px; color:#9fc48f; margin:10px 0 4px; }
#player-name, #final-name { width:100%; padding:10px 12px; font-size:18px; background:#16240f; color:#d9f0cc;
  border:2px solid #3a5c2e; border-radius:6px; outline:none; }
#player-name:focus, #final-name:focus { border-color:#7ed957; }
.color-section { display:flex; gap:24px; margin-top:6px; flex-wrap:wrap; }
.color-block { text-align:center; }
.color-wheel { cursor:crosshair; border-radius:50%; box-shadow:0 0 10px rgba(0,0,0,.6); }
.light-slider { width:130px; margin-top:8px; accent-color:#7ed957; }
.swatch { width:130px; height:18px; border-radius:4px; margin-top:6px; border:2px solid rgba(255,255,255,.25); }
.btn-row { display:flex; gap:14px; margin-top:20px; flex-wrap:wrap; justify-content:center; }
.btn { padding:13px 26px; font-size:17px; font-weight:bold; letter-spacing:1px; border:none; border-radius:8px;
  cursor:pointer; transition:transform .08s, box-shadow .15s; }
.btn:active { transform:scale(.96); }
.btn-go { background:linear-gradient(#8be05f,#4e9a2e); color:#122408; box-shadow:0 4px 0 #2d5c18; }
.btn-go:hover { box-shadow:0 4px 0 #2d5c18, 0 0 22px rgba(120,220,90,.5); }
.btn-alt { background:linear-gradient(#5a6b52,#394633); color:#dfeeda; box-shadow:0 4px 0 #222b1e; }
.hint-text { text-align:center; margin-top:18px; font-size:12px; color:#7b9370; letter-spacing:1px; }

/* ---------- game ---------- */
#game-container { position:fixed; inset:0; }
#game-canvas { width:100%; height:100%; display:block; }

/* ---------- HUD ---------- */
#hud { position:absolute; inset:0; pointer-events:none; z-index:10; }
#crosshair { position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  color:rgba(255,255,255,.85); font-size:26px; text-shadow:0 0 4px #000; }
#hud-topleft { position:absolute; top:14px; left:14px; }
#portrait-canvas { display:block; width:110px; height:110px; margin-bottom:8px; border-radius:10px;
  background:rgba(10,20,8,.45); border:2px solid rgba(126,217,87,.4); }
#hud-topright { position:absolute; top:14px; right:14px; text-align:right; }
.bar-wrap { width:220px; height:20px; background:rgba(0,0,0,.55); border:2px solid rgba(255,255,255,.35);
  border-radius:5px; position:relative; overflow:hidden; margin-bottom:6px; }
.bar-wrap.big { width:min(520px, 70vw); height:24px; }
.bar { height:100%; width:100%; background:linear-gradient(#ff7360,#c62f1d); transition:width .2s; }
#health-bar { background:linear-gradient(#8be05f,#3f8a22); }
.bar.boss { background:linear-gradient(#b04ce6,#6b1f96); }
.bar-label { position:absolute; inset:0; text-align:center; font-size:13px; font-weight:bold; color:#fff;
  text-shadow:1px 1px 2px #000; line-height:18px; }
#armor-row { display:flex; gap:4px; margin-bottom:6px; }
.armor-pip { width:16px; height:16px; background:#9fb7c9; border:1px solid #34495e; border-radius:3px; box-shadow:inset 0 2px 2px rgba(255,255,255,.5); }
#friend-bars .fbar { width:150px; height:12px; margin-bottom:4px; }
#friend-bars .fbar .bar { background:linear-gradient(#7ed957,#2e6b18); }
#friend-bars .fname { font-size:11px; color:#cfe6c4; text-shadow:1px 1px 2px #000; }
#friend-bars .fname.hurt { animation:hurtFlash 1.6s ease-in-out infinite; }
@keyframes hurtFlash { 0%,100% { color:#cfe6c4; } 50% { color:#ff5545; } }
#score-display { font-size:32px; font-weight:bold; color:#ffe27a; text-shadow:2px 2px 2px #000; }
#weapon-display { margin-top:8px; font-size:20px; color:#fff; text-shadow:1px 1px 2px #000; }
#weapon-display .wname { font-weight:bold; }
#objective-display { margin-top:8px; font-size:17px; color:#a8d8ff; text-shadow:1px 1px 2px #000; max-width:360px; }
#interact-prompt { position:absolute; left:50%; top:60%; transform:translateX(-50%);
  background:rgba(0,0,0,.7); color:#ffe27a; padding:8px 18px; border-radius:6px; font-size:16px; }
/* large, centered notifications */
#toast-area { position:absolute; left:50%; top:20%; transform:translateX(-50%); text-align:center;
  width:min(760px, 92vw); pointer-events:none; }
.toast { display:block; background:rgba(8,20,6,.55); color:#e8f5df; border:2px solid rgba(78,122,60,.6);
  padding:14px 30px; border-radius:12px; margin:0 auto 10px; font-size:23px; font-weight:bold;
  letter-spacing:.5px; text-shadow:1px 1px 3px #000; box-shadow:0 4px 24px rgba(0,0,0,.35);
  animation:toastIn .3s ease-out; max-width:100%; }
.toast.gold { color:#ffe27a; border-color:rgba(201,162,58,.7); box-shadow:0 0 30px rgba(255,215,90,.25); }
.toast.minor { font-size:16px; padding:7px 18px; background:rgba(8,20,6,.4);
  border-width:1px; font-weight:normal; box-shadow:none; }
@keyframes toastIn { from { opacity:0; transform:translateY(-14px) scale(.92);} to { opacity:1; transform:none;} }
#damage-vignette { position:absolute; inset:0; pointer-events:none; opacity:0; transition:opacity .3s;
  background:radial-gradient(ellipse at center, transparent 55%, rgba(200,20,10,.55) 100%); }
#boss-bar-wrap { position:absolute; top:16px; left:50%; transform:translateX(-50%); text-align:center; }
.boss-name { color:#d9a8f0; font-weight:bold; letter-spacing:3px; text-shadow:0 0 8px #7b2fa8, 1px 1px 2px #000; margin-bottom:4px; }
#rod-banner { position:absolute; top:64px; left:50%; transform:translateX(-50%);
  background:rgba(40,30,4,.55); color:#ffe27a; border:2px solid rgba(201,162,58,.7);
  padding:8px 22px; border-radius:10px; font-size:16px; font-weight:bold;
  text-shadow:1px 1px 2px #000; white-space:nowrap; max-width:94vw; overflow:hidden;
  text-overflow:ellipsis; animation:rodPulse 2.2s ease-in-out infinite; }
@keyframes rodPulse { 0%,100% { box-shadow:0 0 8px rgba(255,215,90,.25);} 50% { box-shadow:0 0 26px rgba(255,215,90,.6);} }

/* ---------- overlays ---------- */
.overlay { position:absolute; inset:0; z-index:20; background:rgba(5,10,4,.78); display:flex;
  align-items:center; justify-content:center; overflow:auto; }
.center-panel { background:rgba(14,24,10,.96); border:3px solid #3a5c2e; border-radius:12px;
  padding:28px 40px; text-align:center; color:#cfe6c4; max-width:520px; width:92%; }
.center-panel.wide { max-width:640px; }
.center-panel h2 { margin-bottom:16px; letter-spacing:2px; }
.center-panel .btn { margin:8px 6px; }
.red { color:#ff6b5a; } .gold { color:#ffe27a; }
.pause-opts { background:#16240f; border:2px solid #2c4423; border-radius:8px; padding:12px 16px; margin-bottom:14px; text-align:left; }
.opt-row { display:flex; align-items:center; gap:12px; margin:8px 0; }
.opt-row label { width:76px; font-size:13px; letter-spacing:1px; color:#9fc48f; }
.opt-row input[type=range] { flex:1; accent-color:#7ed957; }
.opt-btn { padding:8px 16px; font-size:14px; }
#gfx-label { width:44px; text-align:right; color:#ffe27a; font-weight:bold; font-size:14px; }
.opt-hint { font-size:11px; color:#7b9370; margin-top:4px; }
#player-panel { display:flex; gap:18px; align-items:center; background:#141f0e; border:2px solid #2c4423;
  border-radius:10px; padding:14px 16px; margin-bottom:16px; }
#player-panel.drop-ok { border-color:#ffe27a; background:#22300f; }
#inv-portrait { width:150px; height:150px; border-radius:10px; background:linear-gradient(#2c4423,#16240f);
  border:2px solid #3a5c2e; flex:0 0 auto; }
.slot-col { flex:1; min-width:160px; }
.pslot { display:flex; align-items:center; gap:10px; background:#1b2a12; border:2px dashed #3a5c2e;
  border-radius:8px; padding:9px 12px; margin-bottom:8px; cursor:pointer; transition:border-color .12s; }
.pslot .slot-name { flex:1; }
.pslot:hover { border-color:#e06050; }
.pslot.drop-ok { border-color:#ffe27a; border-style:solid; background:#2c3a14; }
.slot-label { font-size:10px; letter-spacing:2px; color:#9fc48f; width:56px; }
.slot-icon { font-size:22px; }
.slot-name { font-size:13px; color:#e8f5df; }
.slot-hint { font-size:11px; color:#7b9370; line-height:1.5; }
#death-tip { color:#8fae83; margin-bottom:14px; font-size:14px; }

/* ---------- inventory ---------- */
.inv-panel { background:rgba(14,22,10,.97); border:3px solid #3a5c2e; border-radius:12px;
  width:min(680px,94vw); max-height:86vh; overflow:auto; color:#cfe6c4; }
.inv-panel.wide { width:min(1040px,96vw); max-height:88vh; display:flex; flex-direction:column; overflow:hidden; }
.inv-tabs { display:flex; align-items:center; border-bottom:2px solid #3a5c2e; background:#141f0e; flex:0 0 auto; }
.inv-title { flex:1; padding:14px 18px; color:#7ed957; font-weight:bold; letter-spacing:2px; font-size:15px; }
.inv-x { width:52px; align-self:stretch; background:none; border:none; color:#c96; font-size:20px; cursor:pointer; }
.inv-x:hover { color:#ff6b5a; background:rgba(255,90,70,.08); }
.inv-columns { display:flex; flex:1; min-height:0; }
.inv-main { flex:1.5; min-width:0; overflow-y:auto; padding:16px 20px 24px; }
.inv-side { flex:1; min-width:250px; overflow-y:auto; padding:16px 18px 24px; border-left:2px solid #2c4423; background:rgba(0,0,0,.14); }
.inv-main::-webkit-scrollbar, .inv-side::-webkit-scrollbar { width:9px; }
.inv-main::-webkit-scrollbar-thumb, .inv-side::-webkit-scrollbar-thumb { background:#3a5c2e; border-radius:5px; }
.inv-main::-webkit-scrollbar-track, .inv-side::-webkit-scrollbar-track { background:rgba(0,0,0,.25); }
.sec-h { color:#7ed957; letter-spacing:2px; margin:20px 0 10px; font-size:13px;
  border-bottom:1px solid #2c4423; padding-bottom:6px; }
.sec-h:first-child { margin-top:0; }
#friend-count { color:#c9b26a; }
@media (max-width:780px) {
  .inv-panel.wide { display:block; overflow:auto; }
  .inv-columns { flex-direction:column; }
  .inv-side { border-left:none; border-top:2px solid #2c4423; min-width:0; width:100%; overflow:visible; }
}
.fslots { display:flex; gap:8px; margin-top:6px; }
.fslot { flex:1; display:flex; gap:6px; align-items:center; background:#141f0e; border:2px dashed #3a5c2e;
  border-radius:6px; padding:5px 8px; cursor:pointer; font-size:11px; color:#9fc48f; min-height:34px; }
.fslot .ic { font-size:17px; }
.fslot.filled { border-style:solid; color:#e8f5df; }
.fslot.filled:hover { border-color:#e06050; }
.fslot.drop-ok { border-color:#ffe27a; border-style:solid; background:#2c3a14; }
.item-grid { display:grid; grid-template-columns:repeat(auto-fill, 74px); gap:10px; min-height:90px; }
.item-cell { width:74px; height:86px; background:#1b2a12; border:2px solid #3a5c2e; border-radius:8px;
  display:flex; flex-direction:column; align-items:center; justify-content:center; cursor:grab;
  user-select:none; position:relative; transition:border-color .12s, transform .12s; }
.item-cell:hover { border-color:#7ed957; transform:translateY(-2px); }
.item-cell .icon { font-size:30px; }
.item-cell .count { position:absolute; bottom:20px; right:6px; font-size:13px; font-weight:bold; color:#ffe27a; text-shadow:1px 1px 1px #000; }
.item-cell .iname { font-size:10px; color:#9fc48f; margin-top:2px; text-align:center; }
.item-cell.dragging { opacity:.4; }
.inv-hint { margin-top:14px; font-size:12px; color:#7b9370; }
.craft-row { display:flex; align-items:center; gap:12px; background:#1b2a12; border:2px solid #3a5c2e;
  border-radius:8px; padding:10px 14px; margin-bottom:8px; }
.craft-row .icon { font-size:30px; flex:0 0 44px; text-align:center; }
.craft-info { flex:1; min-width:0; }
.craft-row .craft-btn { flex:0 0 auto; margin-left:auto; }
.craft-info .cname { font-weight:bold; color:#e8f5df; }
.craft-info .cdesc { font-size:12px; color:#8fae83; }
.craft-info .creq { font-size:12px; color:#c9b26a; margin-top:2px; }
.craft-info .creq .lack { color:#e06050; }
.craft-btn { padding:8px 16px; }
.craft-btn:disabled { opacity:.35; cursor:not-allowed; box-shadow:none; }
.rarity-common { border-left:5px solid #9aa; } .rarity-uncommon { border-left:5px solid #6bd45f; }
.rarity-rare { border-left:5px solid #5aa8ff; } .rarity-epic { border-left:5px solid #b565e8; }
.rarity-legendary { border-left:5px solid #ffb545; }
.friend-card { background:#1b2a12; border:2px solid #3a5c2e; border-radius:8px; padding:10px 12px;
  margin-bottom:8px; transition:border-color .12s; }
.friend-card.drop-ok { border-color:#ffe27a; background:#2c3a14; }
.friend-card .fhead { display:flex; justify-content:space-between; align-items:center; }
.friend-card .ftitle { font-weight:bold; color:#bfe8a8; }
.friend-card .fhp { font-size:12px; color:#8fae83; }
.friend-hp-wrap { height:10px; background:#0d160a; border-radius:4px; overflow:hidden; margin:6px 0; }
.friend-hp { height:100%; background:linear-gradient(#7ed957,#2e6b18); }
.equip-row { display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.equip-btn { font-size:12px; padding:6px 10px; background:#2a3a20; color:#cfe6c4; border:1px solid #4e7a3c;
  border-radius:5px; cursor:pointer; }
.equip-btn.equipped { background:#4e7a3c; color:#fff; }

/* ---------- victory ---------- */
#score-breakdown { text-align:left; margin:10px auto 16px; max-width:420px; }
.score-line { display:flex; justify-content:space-between; padding:4px 2px; border-bottom:1px dashed #2c4423; font-size:15px; }
.score-line.total { font-size:20px; font-weight:bold; color:#ffe27a; border-bottom:none; margin-top:6px; }
.name-edit-row { margin:12px 0; display:flex; gap:10px; align-items:center; justify-content:center; }
.name-edit-row input { max-width:220px; }
#submit-status { margin:8px 0; font-size:14px; color:#8fae83; min-height:20px; }
#leaderboard-box { margin-top:10px; }
#leaderboard-box h3 { color:#ffe27a; margin-bottom:8px; }
.lb-row { display:flex; gap:10px; padding:5px 8px; font-size:15px; border-bottom:1px solid #22331a; }
.lb-row.me { background:rgba(126,217,87,.15); border-radius:4px; }
.lb-rank { width:34px; color:#c9b26a; font-weight:bold; }
.lb-name { flex:1; text-align:left; }
.lb-score { font-weight:bold; color:#ffe27a; }

/* ---------- touch ---------- */
#touch-ui { position:absolute; inset:0; z-index:15; pointer-events:none; }
#joystick-zone, #look-zone, .tbtn, #game-canvas { touch-action:none; }
#joystick-zone { position:absolute; left:0; bottom:0; width:45%; height:55%; pointer-events:auto; }
#look-zone { position:absolute; right:0; bottom:0; width:55%; height:100%; pointer-events:auto; }
#joystick-base { position:absolute; width:120px; height:120px; border-radius:50%;
  background:rgba(255,255,255,.12); border:2px solid rgba(255,255,255,.3); display:none; }
#joystick-knob { position:absolute; left:35px; top:35px; width:50px; height:50px; border-radius:50%;
  background:rgba(255,255,255,.4); }
.tbtn { position:absolute; width:62px; height:62px; border-radius:50%; border:2px solid rgba(255,255,255,.4);
  background:rgba(20,40,15,.55); color:#fff; font-size:22px; pointer-events:auto; z-index:16; }
.tbtn:active { background:rgba(126,217,87,.5); }
.tbtn-big { width:84px; height:84px; font-size:30px; }
#tbtn-fire { right:24px; bottom:90px; }
#tbtn-jump { right:130px; bottom:40px; }
#tbtn-sprint { right:130px; bottom:170px; }
#tbtn-interact { right:36px; bottom:200px; }
#tbtn-inv { right:16px; top:70px; width:52px; height:52px; font-size:18px; }
#tbtn-pause { right:16px; top:132px; width:52px; height:52px; font-size:18px; }
#tbtn-tnt { right:118px; bottom:110px; }
#tbtn-bolt { right:100px; bottom:190px; }
.tbtn.on { background:rgba(126,217,87,.6); }

@media (max-width:720px) {
  .game-title { font-size:30px; }
  .custom-panel { padding:18px; }
  #hud-topleft .bar-wrap { width:150px; }
}
