/* ZacsGames UI - blocky, dark, gold-accented network style */
:root {
  --gold: #ffaa00; --yellow: #ffff55; --aqua: #55ffff; --green: #55ff55; --red: #ff5555;
  --gray: #aaaaaa; --dgray: #555555; --purple: #ff55ff;
  --panel: rgba(12, 14, 26, 0.86); --edge: #2c3152;
  --px: 'Press Start 2P', monospace; --vt: 'VT323', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #fff; font-family: var(--vt); font-size: 22px; user-select: none; }
#view { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; image-rendering: pixelated; }
.hidden { display: none !important; }

.gold { color: var(--gold); } .yellow { color: var(--yellow); } .aqua { color: var(--aqua); } .green { color: var(--green); }
.red { color: var(--red); } .gray { color: var(--gray); } .dgray { color: var(--dgray); } .white { color: #fff; } .purple { color: var(--purple); }
.mc-shadow, .gold, .yellow, .aqua, .green, .red, .gray, .white, .purple { text-shadow: 2px 2px 0 rgba(0,0,0,.55); }

/* ---------- screens ---------- */
.screen { position: fixed; inset: 0; display: none; z-index: 10; }
.screen.show { display: flex; }
.screen.center { align-items: center; justify-content: center; flex-direction: column; }
.screen.dim { background: rgba(0, 0, 0, .55); z-index: 30; }
#loading { background: #0b0d18; z-index: 50; gap: 24px; }

/* ---------- logo ---------- */
.logo {
  font-family: var(--px); font-size: 54px; margin: 0; color: var(--gold); letter-spacing: 2px;
  text-shadow: 0 2px 0 #e08a00, 0 4px 0 #b86c00, 0 6px 0 #8a4f00, 0 8px 0 #5c3400, 6px 12px 0 rgba(0,0,0,.5);
}
.logo-wrap { position: relative; display: inline-block; }
.splash {
  position: absolute; right: -60px; bottom: -14px; font-family: var(--px); font-size: 12px; color: var(--yellow);
  text-shadow: 2px 2px 0 #3f3f15; transform: rotate(-14deg); animation: splash .6s ease-in-out infinite alternate; white-space: nowrap;
}
@keyframes splash { from { transform: rotate(-14deg) scale(1); } to { transform: rotate(-14deg) scale(1.1); } }
.subtitle { font-family: var(--px); font-size: 13px; letter-spacing: 6px; margin: 26px 0 18px; }
.load-bar { width: 360px; height: 18px; border: 2px solid #fff; padding: 2px; }
.load-bar i { display: block; height: 100%; width: 0; background: var(--green); transition: width .2s; }

/* ---------- panels ---------- */
.panel {
  background: var(--panel); border: 2px solid #000; box-shadow: inset 0 0 0 2px var(--edge), 0 6px 0 rgba(0,0,0,.35);
  padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px;
}
.panel-head {
  font-family: var(--px); font-size: 13px; color: var(--gold); text-shadow: 2px 2px 0 #3f2a00;
  padding-bottom: 10px; border-bottom: 2px solid var(--edge); margin-bottom: 4px; display: flex; justify-content: space-between; align-items: center;
}
.panel-head .gray { font-family: var(--vt); font-size: 20px; }
.mc-label { color: var(--gray); font-size: 20px; margin-bottom: -6px; }
.mc-input {
  font-family: var(--vt); font-size: 26px; color: #fff; background: #000; border: 2px solid #a0a0a0; padding: 4px 8px; outline: none;
}
.mc-input:focus { border-color: #fff; }
.hint { font-size: 18px; margin: 0; line-height: 1.15; }

/* ---------- buttons ---------- */
.mc-btn {
  font-family: var(--px); font-size: 11px; color: #e0e0e0; text-shadow: 2px 2px 0 #383838; cursor: pointer;
  background: #6f6f6f; border: 2px solid #000; padding: 12px 10px 13px; line-height: 1;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.35), inset -2px -4px 0 rgba(0,0,0,.35);
}
.mc-btn:hover { background: #7d88cc; color: var(--yellow); text-shadow: 2px 2px 0 #3f3f15; }
.mc-btn:active { box-shadow: inset -2px -2px 0 rgba(255,255,255,.25), inset 2px 3px 0 rgba(0,0,0,.4); }
.mc-btn.big { font-size: 16px; padding: 16px 10px 17px; }
.mc-btn.green { background: #3c8527; } .mc-btn.green:hover { background: #4ea535; }
.mc-btn.red { background: #8f2a2a; } .mc-btn.red:hover { background: #b03636; }
.mc-btn.gold { background: #b07a10; } .mc-btn.gold:hover { background: #d29318; }
.mc-btn.active, .tab.active { background: #3a3f66; color: var(--gold); text-shadow: 2px 2px 0 #3f2a00; }
.mc-btn.toggle::after { content: ': OFF'; color: var(--red); }
.mc-btn.toggle.active::after { content: ': ON'; color: var(--green); }
.mc-btn.toggle.active { background: #6f6f6f; color: #e0e0e0; }
.mc-btn:disabled { opacity: .5; cursor: default; }

/* ---------- main menu ---------- */
#menu { padding: 48px 56px; gap: 48px; align-items: flex-start; background: linear-gradient(90deg, rgba(5,7,16,.85) 0%, rgba(5,7,16,.4) 50%, rgba(5,7,16,0) 75%); }
.menu-col { display: flex; flex-direction: column; width: 470px; }
.menu-col .panel { width: 380px; }
.menu-games { margin-top: 150px; }
.menu-foot { position: absolute; left: 56px; right: 56px; bottom: 16px; display: flex; justify-content: space-between; font-size: 20px; }

/* inventory-style game picker */
.chest {
  background: #c6c6c6; padding: 10px 12px 14px; border: 3px solid; border-color: #fff #555 #555 #fff;
  box-shadow: 0 0 0 3px #000, 0 10px 0 rgba(0,0,0,.4); image-rendering: pixelated;
}
.chest-title { color: #3f3f3f; font-size: 26px; margin: 0 0 6px 2px; }
.slots { display: grid; grid-template-columns: repeat(9, 58px); gap: 0; }
.slot {
  width: 58px; height: 58px; background: #8b8b8b; border: 3px solid; border-color: #373737 #fff #fff #373737;
  display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative;
}
.slot:hover { background: #b5b5b5; }
.slot img { width: 44px; height: 44px; image-rendering: pixelated; pointer-events: none; }
.slot.empty { cursor: default; } .slot.empty:hover { background: #8b8b8b; }
.slot .count { position: absolute; right: 2px; bottom: -2px; font-size: 22px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }

.tooltip {
  position: fixed; z-index: 100; pointer-events: none; padding: 6px 10px 8px; max-width: 340px; line-height: 1.05;
  background: rgba(16, 0, 16, .94); border: 2px solid #2a0b5c; box-shadow: inset 0 0 0 2px #4b1ba6, 0 0 0 2px rgba(16,0,16,.94);
}
.tooltip .t-title { font-size: 24px; margin-bottom: 4px; }
.tooltip div { font-size: 21px; }

/* ---------- customizer ---------- */
#custom { pointer-events: none; }
#custom > * { pointer-events: auto; }
.cust-panel { position: absolute; left: 24px; top: 24px; bottom: 24px; width: 440px; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tab { font-family: var(--px); font-size: 9px; padding: 10px 2px; cursor: pointer; color: #ddd; background: #4c4c4c; border: 2px solid #000;
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.25), inset -2px -3px 0 rgba(0,0,0,.35); text-shadow: 2px 2px 0 #222; }
.tab:hover { background: #7d88cc; color: var(--yellow); }
.tab-body { flex: 1; overflow-y: auto; padding-right: 6px; display: flex; flex-direction: column; gap: 8px; }
.tab-body::-webkit-scrollbar { width: 10px; } .tab-body::-webkit-scrollbar-thumb { background: #6f6f6f; border: 2px solid #000; }
.cust-foot { display: grid; grid-template-columns: 1fr 1fr 1.6fr; gap: 6px; }
.cust-hint { position: absolute; right: 24px; bottom: 20px; font-size: 22px; color: var(--gray); text-shadow: 2px 2px 0 #000; }
.group-title { font-family: var(--px); font-size: 10px; color: var(--aqua); text-shadow: 2px 2px 0 #153f3f; margin: 8px 0 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.grid2 .mc-btn, .grid3 .mc-btn { font-size: 9px; padding: 10px 4px; }

.slider-row { display: flex; flex-direction: column; gap: 2px; }
.slider-row label { display: flex; justify-content: space-between; font-size: 20px; color: #ddd; }
.slider-row label b { color: var(--yellow); font-weight: normal; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; cursor: pointer; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 10px; background: #000; border: 2px solid #a0a0a0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; margin-top: -8px; background: #c6c6c6;
  border: 2px solid #000; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #555; }
input[type=range]::-moz-range-track { height: 6px; background: #000; border: 2px solid #a0a0a0; }
input[type=range]::-moz-range-thumb { width: 10px; height: 20px; background: #c6c6c6; border: 2px solid #000; border-radius: 0; }
input[type=range]:hover::-webkit-slider-thumb { background: #dfe3ff; }

.color-row { display: flex; align-items: center; justify-content: space-between; font-size: 22px; }
.color-row input[type=color] { width: 70px; height: 32px; border: 2px solid #000; padding: 0; background: #000; cursor: pointer; }
.swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border: 2px solid #000; box-shadow: inset 2px 2px 0 rgba(255,255,255,.3); cursor: pointer; }
.swatch:hover { outline: 2px solid var(--yellow); }
.tri-meter { height: 12px; border: 2px solid #a0a0a0; background: #000; }
.tri-meter i { display: block; height: 100%; background: var(--green); }

/* hair editor */
#hair-edit { position: fixed; left: 24px; top: 24px; z-index: 20; width: 400px; }
.hair-bar .row { display: flex; gap: 6px; }
.hair-bar .row .mc-btn { flex: 1; font-size: 9px; padding: 11px 4px; }

.settings-panel, .pause-panel { width: 440px; }
.cam-preview { position: fixed; right: 16px; bottom: 16px; width: 200px; transform: scaleX(-1); border: 3px solid #000; box-shadow: 0 0 0 2px var(--gold); z-index: 40; image-rendering: pixelated; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 5; pointer-events: none; }
.scoreboard { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.38); min-width: 230px; padding: 4px 10px 8px; }
.scoreboard .sb-title { font-family: var(--px); font-size: 12px; color: var(--gold); text-align: center; padding: 6px 0 8px; text-shadow: 2px 2px 0 #3f2a00; }
.scoreboard div { font-size: 22px; line-height: 1.05; white-space: pre; }
.chat { position: absolute; left: 8px; bottom: 60px; width: 560px; pointer-events: auto; }
.chat-lines { display: flex; flex-direction: column; }
.chat-line { background: rgba(0,0,0,.42); padding: 1px 6px; font-size: 22px; transition: opacity 1s; text-shadow: 2px 2px 0 #3f3f3f; }
.chat-line.faded { opacity: 0; }
.chat.open .chat-line.faded { opacity: 1; }
.chat-input { width: 100%; margin-top: 4px; font-family: var(--vt); font-size: 22px; color: #fff; background: rgba(0,0,0,.6); border: none; outline: none; padding: 4px 6px; }
.tablist { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.5); padding: 8px 12px; min-width: 300px; text-align: center; }
.tablist .tl-head { font-family: var(--px); font-size: 11px; color: var(--gold); margin-bottom: 6px; }
.tablist .tl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; text-align: left; }
.tablist .tl-grid div { background: rgba(255,255,255,.08); padding: 0 6px; font-size: 21px; }
.controls-hint { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 19px; }
.click-to-play { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); font-family: var(--px); font-size: 11px; color: var(--yellow); text-shadow: 2px 2px 0 #3f3f15; }

.title-box { position: absolute; left: 0; right: 0; top: 26%; text-align: center; transition: opacity .4s; }
.title-main { font-family: var(--px); font-size: 40px; text-shadow: 4px 4px 0 rgba(0,0,0,.6); }
.title-main span, .title-sub span { text-shadow: 4px 4px 0 rgba(0,0,0,.55); }
.title-sub { font-size: 30px; margin-top: 14px; }
.prompt { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); font-family: var(--px); font-size: 11px; color: var(--yellow);
  background: rgba(0,0,0,.45); padding: 8px 12px; text-shadow: 2px 2px 0 #3f3f15; white-space: nowrap; }
.prompt b { color: #fff; }
.actionbar { position: absolute; left: 0; right: 0; bottom: 112px; text-align: center; font-size: 24px; }
.hotbar { position: absolute; left: 50%; bottom: 36px; transform: translateX(-50%); display: flex; background: rgba(0,0,0,.35); border: 3px solid #000; box-shadow: inset 0 0 0 2px #8b8b8b; padding: 2px; }
.hb-slot { width: 52px; height: 52px; border: 2px solid; border-color: #373737 #8b8b8b #8b8b8b #373737; background: rgba(139,139,139,.55); display: flex; align-items: center; justify-content: center; position: relative; }
.hb-slot img { width: 36px; height: 36px; image-rendering: pixelated; }
.hb-slot .count { position: absolute; right: 2px; bottom: -3px; font-size: 22px; color: #fff; text-shadow: 2px 2px 0 #3f3f3f; }
.hb-slot.tier1 { box-shadow: inset 0 0 0 2px var(--gold); } .hb-slot.tier2 { box-shadow: inset 0 0 0 2px var(--aqua); }
#gui { z-index: 35; }
.settings-panel { max-height: 92vh; overflow-y: auto; }
.settings-panel .grid2 { align-items: center; }

#toasts { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(16,0,16,.94); border: 2px solid #2a0b5c; box-shadow: inset 0 0 0 2px #4b1ba6; padding: 6px 14px; font-size: 22px; animation: toast 2.6s forwards; }
@keyframes toast { 0% { opacity: 0; transform: translateY(-8px); } 10%, 80% { opacity: 1; transform: none; } 100% { opacity: 0; } }
