* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; color: #eef2f6;
  font-family: "Segoe UI", "Arial Hebrew", Arial, Helvetica, sans-serif; user-select: none; }
#app canvas { display: block; }
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }

/* טעינה */
#loading { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, #1d3b4a, #0b1116 70%); z-index: 50; }
#loading .logo { font-size: 54px; font-weight: 800; letter-spacing: 1px; }
#loading .sub { opacity: .7; margin-bottom: 28px; font-size: 18px; }
#loading .bar { width: 340px; height: 8px; background: #ffffff1a; border-radius: 6px; overflow: hidden; }
#loadbar { height: 100%; width: 0; background: linear-gradient(90deg, #2bc4a8, #3b8cff); transition: width .2s; }
#loadtext { margin-top: 12px; opacity: .7; font-size: 14px; }

/* HUD */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }
#topbar { position: absolute; top: 10px; right: 10px; left: 10px; display: flex; gap: 8px; align-items: center; pointer-events: none; }
#topbar > * { pointer-events: auto; }
#topbar .spacer { flex: 1; pointer-events: none; }
.chip { background: #0d1318d9; border: 1px solid #ffffff1f; padding: 8px 14px; border-radius: 10px; font-size: 15px; backdrop-filter: blur(4px); }
.chip.money b { color: #6ee7a8; }
.chip.rep b { color: #ffd166; }
.chip.job { max-width: 46vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#topbar button { background: #0d1318d9; color: #fff; border: 1px solid #ffffff2a; padding: 8px 14px; border-radius: 10px; font-size: 15px; }
#topbar button:hover { background: #1c2a36; }
#btn-return { border-color: #3ddc8466 !important; }

#tooltip { position: absolute; background: #0b1016f0; border: 1px solid #ffffff22; border-radius: 10px; padding: 9px 12px; font-size: 14px;
  max-width: 340px; pointer-events: none; line-height: 1.45; box-shadow: 0 6px 24px #0008; }
#tooltip .t { font-weight: 700; font-size: 15px; margin-bottom: 3px; }
#tooltip .s { color: #9fb3c8; }
#tooltip .ok { color: #6ee7a8; }
#tooltip .bad { color: #ff8080; }

#toasts { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: #0d1318ee; border: 1px solid #ffffff22; border-right: 4px solid #3b8cff; padding: 9px 14px; border-radius: 8px; font-size: 15px;
  max-width: 70vw; animation: tin .25s ease-out; }
.toast.warn { border-right-color: #ffb020; }
.toast.bad { border-right-color: #ff4d4d; }
.toast.ok { border-right-color: #3ddc84; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

#toolbar { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: #0b1016d9;
  padding: 8px; border-radius: 14px; border: 1px solid #ffffff1a; }
.tool { width: 62px; height: 62px; border-radius: 10px; background: #18222c; border: 2px solid transparent; color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 24px; position: relative; }
.tool small { font-size: 10px; opacity: .75; margin-top: 2px; white-space: nowrap; max-width: 58px; overflow: hidden; text-overflow: ellipsis; }
.tool .k { position: absolute; top: 2px; right: 5px; font-size: 10px; opacity: .55; }
.tool .dot { position: absolute; bottom: 4px; left: 6px; width: 8px; height: 8px; border-radius: 50%; }
.tool.sel { border-color: #3b8cff; background: #1f3346; }
.tool:hover { background: #22303d; }
#toolname { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); font-size: 14px; color: #cfe0f0; text-shadow: 0 1px 3px #000; pointer-events: none; }
#hint { position: absolute; bottom: 4px; right: 12px; font-size: 11px; opacity: .45; pointer-events: none; }

#panel, #diag { position: absolute; top: 64px; left: 12px; width: 330px; max-height: calc(100vh - 190px); overflow: auto; background: #0b1016f2;
  border: 1px solid #ffffff22; border-radius: 12px; padding: 14px; font-size: 14px; }
#diag { left: auto; right: 12px; }
#panel h3, #diag h3 { margin: 0 0 6px; font-size: 17px; }
#panel .row, #diag .row { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #ffffff10; }
.btn { background: #24384a; color: #fff; border: 1px solid #ffffff22; border-radius: 8px; padding: 8px 10px; font-size: 14px; width: 100%; margin-top: 6px; text-align: right; }
.btn:hover { background: #2e4a62; }
.btn.primary { background: #1f6f4f; }
.btn.primary:hover { background: #26875f; }
.btn:disabled { opacity: .45; cursor: default; }
.ok { color: #6ee7a8; } .bad { color: #ff8080; } .muted { color: #8aa0b4; }
.closex { float: left; background: none; border: none; color: #aaa; font-size: 18px; }

/* מחשב */
#pc { position: fixed; inset: 0; z-index: 30; background: #000c; display: flex; align-items: center; justify-content: center; animation: fadein .25s; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
#pc-screen { width: min(1280px, 96vw); height: min(760px, 92vh); border-radius: 12px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #0d3b66, #1b998b); border: 10px solid #15171a; box-shadow: 0 20px 80px #000; }
#pc-desktop { position: absolute; inset: 0 0 48px 0; padding: 22px; display: grid; grid-template-columns: repeat(auto-fill, 110px); grid-auto-rows: 110px; gap: 10px; align-content: start; }
.icon { display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 12px; color: #fff; text-align: center; font-size: 13px; cursor: pointer; position: relative; }
.icon:hover { background: #ffffff1f; }
.icon .ic { font-size: 40px; margin-bottom: 6px; filter: drop-shadow(0 2px 4px #0006); }
.icon .badge { position: absolute; top: 8px; left: 22px; background: #ff4d4d; border-radius: 10px; padding: 1px 7px; font-size: 12px; font-weight: 700; }
#pc-taskbar { position: absolute; bottom: 0; left: 0; right: 0; height: 48px; background: #0b0f14e6; display: flex; align-items: center; gap: 8px; padding: 0 10px; }
#pc-taskbar .spacer { flex: 1; }
#pc-taskbar button { background: #1d2a36; color: #fff; border: none; border-radius: 8px; padding: 8px 12px; }
#pc-apps { display: flex; gap: 6px; }
#pc-money { color: #6ee7a8; font-weight: 700; }
#pc-clock { opacity: .8; min-width: 54px; text-align: center; }
#pc-window { position: absolute; top: 24px; right: 24px; left: 24px; bottom: 72px; background: #f4f6f9; color: #1a2330; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; box-shadow: 0 10px 40px #0007; }
.win-title { background: #1d2a36; color: #fff; padding: 10px 14px; display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.win-title button { background: #c0392b; color: #fff; border: none; border-radius: 6px; width: 30px; height: 26px; }
#win-body { flex: 1; overflow: auto; padding: 16px; }
#win-body h2 { margin: 0 0 10px; font-size: 20px; }
.card { background: #fff; border: 1px solid #dde3ea; border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.card .meta { color: #66788a; font-size: 13px; }
.card .actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.wbtn { background: #2a6fd1; color: #fff; border: none; border-radius: 8px; padding: 7px 14px; font-size: 14px; }
.wbtn.green { background: #1f8a5a; } .wbtn.gray { background: #8a96a3; } .wbtn.red { background: #c0392b; }
.wbtn:disabled { opacity: .45; cursor: default; }
.tabs { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs button { background: #e3e8ee; border: none; border-radius: 8px; padding: 7px 14px; font-size: 14px; }
.tabs button.on { background: #1d2a36; color: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.shop-item .price { font-weight: 700; color: #1f6f4f; }
.shop-item .q { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 6px; background: #e8f0fb; color: #2a6fd1; margin-inline-start: 6px; }
.shop-item .q.copy { background: #fdf0e1; color: #b8670f; }
.cartbar { position: sticky; bottom: -16px; background: #1d2a36; color: #fff; padding: 10px 14px; border-radius: 10px; display: flex; gap: 10px; align-items: center; margin-top: 10px; }
.cartbar .spacer { flex: 1; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t td, table.t th { padding: 6px 8px; border-bottom: 1px solid #e3e8ee; text-align: right; }
.plus { color: #1f8a5a; font-weight: 700; } .minus { color: #c0392b; font-weight: 700; }
.guide li { margin-bottom: 6px; line-height: 1.5; }
.stars { color: #e0a106; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: #fff; box-shadow: 0 0 4px #000; pointer-events: none; }
#prompt { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); background: #0b1016d9; border: 1px solid #ffffff33; padding: 8px 16px; border-radius: 10px; font-size: 16px; pointer-events: none; }

body.walk #toolbar, body.walk #toolname, body.walk #hint, body.walk #btn-power, body.walk #btn-return { display: none; }

#labels { position: absolute; inset: 0; pointer-events: none; }
.hlabel { position: absolute; transform: translate(-50%, -130%); background: #0b1016e8; border: 2px solid #3ddc84; color: #fff; font-size: 13px;
  padding: 3px 8px; border-radius: 8px; white-space: nowrap; animation: hpulse 0.9s ease-in-out infinite alternate; }
.hlabel.miss { border-color: #ffb020; }
.hlabel::after { content: ''; position: absolute; left: 50%; bottom: -8px; margin-left: -6px; border: 6px solid transparent; border-top-color: #3ddc84; border-bottom: 0; }
.hlabel.miss::after { border-top-color: #ffb020; }
@keyframes hpulse { from { opacity: .75; } to { opacity: 1; transform: translate(-50%, -150%); } }
#btn-hint { border-color: #ffd16666 !important; }
