/* ===== Mahalle Simülasyonu — Demo ===== */
:root {
  --bg: #0c1322;
  --panel: #16223a;
  --panel2: #1c2c4a;
  --line: #2a3c5e;
  --orange: #f39c12;
  --orange2: #e67e22;
  --green: #2ecc71;
  --txt: #eef2f8;
  --muted: #8fa3c2;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--txt);
  overflow: hidden; user-select: none;
}
button { font-family: inherit; color: inherit; background: none; border: none; cursor: pointer; }
b { font-weight: 700; }

/* ===== Üst HUD ===== */
.topbar {
  height: 58px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; background: linear-gradient(180deg, #182643, #121d33);
  border-bottom: 2px solid var(--line); position: relative; z-index: 20;
}
.brand-title {
  font-weight: 900; font-size: 13px; line-height: 1; letter-spacing: .5px;
  color: #fff; text-shadow: 0 2px 0 #000;
}
.brand-title span { color: var(--orange); font-size: 11px; }
.hud { display: flex; gap: 8px; flex: 1; justify-content: center; flex-wrap: nowrap; min-width: 0; }
.hud-item {
  background: #0e1830; border: 1px solid var(--line); border-radius: 10px;
  padding: 5px 8px; display: flex; align-items: center; gap: 5px;
  font-size: 13px; white-space: nowrap;
}
.hud-item .plus {
  background: var(--green); color: #fff; width: 17px; height: 17px; border-radius: 5px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 13px; cursor: pointer; margin-left: 2px;
}
.hud-level { flex-direction: row; }
.xpbar { width: 64px; height: 6px; background: #0a1224; border-radius: 3px; overflow: hidden; }
.xpfill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--orange2), var(--orange)); transition: width .4s; }
.icon-btn { position: relative; font-size: 19px; padding: 4px; }
.badge {
  position: absolute; top: -4px; right: -7px; background: #e74c3c; color: #fff;
  font-size: 10px; font-weight: 800; min-width: 16px; height: 16px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* ===== Yerleşim ===== */
.layout { display: flex; height: calc(100% - 58px); }

/* ===== Sol menü ===== */
.sidebar {
  width: 218px; min-width: 218px; background: #121d33; border-right: 2px solid var(--line);
  padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow-y: auto;
}
.profile-card {
  display: flex; gap: 9px; align-items: center; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 9px;
}
.avatar {
  width: 42px; height: 42px; border-radius: 50%; background: #24365c;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.pname { font-weight: 800; font-size: 14px; }
.ptitle { font-size: 11px; color: var(--muted); }
.pxp { font-size: 10px; color: var(--orange); font-weight: 700; }
.menu { display: flex; flex-direction: column; gap: 5px; }
.menu-item {
  position: relative; text-align: left; font-weight: 700; font-size: 13px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; transition: background .15s;
}
.menu-item:hover { background: var(--panel2); }
.menu-item.active { background: linear-gradient(90deg, var(--orange2), var(--orange)); color: #fff; border-color: transparent; }
.mbadge { position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  background: #8e44ad; color: #fff; font-size: 10px; font-weight: 800;
  min-width: 17px; height: 17px; border-radius: 9px; display: none;
  align-items: center; justify-content: center; padding: 0 4px; }
.mbadge.show { display: inline-flex; }
.daily-btn {
  position: relative; margin-top: auto; font-weight: 800; font-size: 13px; color: #fff;
  background: linear-gradient(90deg, #7d3c98, #9b59b6); border-radius: 10px; padding: 11px;
}

/* ===== Harita ===== */
.map-wrap { flex: 1; display: flex; flex-direction: column; padding: 10px; gap: 10px; min-width: 0; overflow: hidden; }
.map {
  position: relative; flex: 1; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line); background: #000; min-height: 0;
}
.map img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hotspot {
  position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%);
  width: 15%; height: 9%; min-width: 70px; min-height: 30px;
  border-radius: 10px; border: 2px solid transparent;
}
.hotspot:hover, .hotspot:active {
  border-color: var(--orange);
  box-shadow: 0 0 18px rgba(243, 156, 18, .65), inset 0 0 14px rgba(243, 156, 18, .25);
}
.festival {
  position: absolute; top: 2%; right: 1.2%; width: min(31%, 240px);
  background: linear-gradient(135deg, #4a148c, #7b1fa2 60%, #e91e63);
  border: 1px solid rgba(255,255,255,.35); border-radius: 10px;
  padding: 8px 10px; display: flex; align-items: center; gap: 8px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
}
.fest-text { font-size: 11px; font-weight: 700; line-height: 1.25; color: #ffd9f0; }
.fest-text b { color: #fff; font-size: 13px; }
.fest-text span { display: block; color: #ffe082; font-size: 10px; margin-top: 2px; }
.fest-btn { margin-left: auto; background: #6c2bd9; border: 1px solid #b388ff; color: #fff;
  font-size: 10px; font-weight: 800; border-radius: 7px; padding: 5px 8px; white-space: nowrap; }
.tasks-panel {
  position: absolute; right: 1.2%; top: 26%; width: min(30%, 230px);
  background: rgba(10, 17, 32, .92); border: 1px solid var(--line); border-radius: 12px;
  padding: 9px; backdrop-filter: blur(3px);
}
.tasks-title { text-align: center; font-weight: 800; font-size: 12px; letter-spacing: 1px; margin-bottom: 7px; cursor: pointer; user-select: none; }
.tasks-chev { display: inline-block; transition: transform .2s; color: var(--orange); }
.tasks-panel.collapsed .tasks-chev { transform: rotate(-90deg); }
.tasks-panel.collapsed #tasksList, .tasks-panel.collapsed .tasks-all { display: none; }
.tasks-panel.collapsed { padding-bottom: 4px; }
.tasks-panel.collapsed .tasks-title { margin-bottom: 2px; }
.task-row {
  display: flex; align-items: center; gap: 7px; background: #131f38;
  border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; margin-bottom: 6px;
  cursor: pointer; transition: background .15s;
}
.task-row:hover { background: var(--panel2); }
.task-row.done { opacity: .55; }
.task-ico { font-size: 17px; }
.task-name { font-size: 11px; font-weight: 700; flex: 1; line-height: 1.2; }
.task-name small { display: block; color: var(--green); font-weight: 800; }
.task-prog { font-size: 10px; color: var(--muted); font-weight: 700; }
.tasks-all {
  width: 100%; background: linear-gradient(90deg, var(--orange2), var(--orange));
  color: #fff; font-weight: 800; font-size: 11px; border-radius: 8px; padding: 7px;
}

/* ===== Alt kartlar ===== */
.cards-row { display: flex; gap: 8px; }
.card {
  flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; transition: background .15s, transform .1s;
}
.card:hover { background: var(--panel2); transform: translateY(-2px); }
.card-ico { font-size: 20px; }
.card small { color: var(--muted); font-size: 10px; text-align: center; }

/* ===== Alt nav (mobil) ===== */
.bottombar { display: none; }

/* ===== Modal ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(5, 9, 18, .78); z-index: 50;
  display: flex; align-items: center; justify-content: center; padding: 14px;
}
.overlay.hidden { display: none; }
.modal {
  width: 100%; max-width: 520px; max-height: 86vh; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 14px 50px rgba(0,0,0,.6); animation: pop .18s ease-out;
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h2 { font-size: 16px; }
.modal-close { font-size: 16px; color: var(--muted); padding: 4px 8px; }
.modal-body { padding: 13px 16px; overflow-y: auto; }

/* modal içi öğeler */
.list-item {
  display: flex; align-items: center; gap: 10px; background: #131f38;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px;
}
.list-item .li-ico { font-size: 24px; width: 34px; text-align: center; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 800; font-size: 13px; }
.list-item .li-sub { font-size: 11px; color: var(--muted); margin-top: 1px; }
.list-item .li-reward { font-size: 11px; color: var(--green); font-weight: 800; }
.btn-primary {
  background: linear-gradient(90deg, var(--orange2), var(--orange)); color: #fff;
  font-weight: 800; font-size: 13px; border-radius: 9px; padding: 9px 14px; white-space: nowrap;
}
.btn-primary:disabled, .btn-primary.disabled { filter: grayscale(.8); opacity: .55; cursor: not-allowed; }
.btn-green { background: linear-gradient(90deg, #1e8449, var(--green)); color: #fff;
  font-weight: 800; font-size: 13px; border-radius: 9px; padding: 9px 14px; white-space: nowrap; }
.btn-green:disabled { filter: grayscale(.8); opacity: .55; cursor: not-allowed; }
.progress { height: 9px; background: #0a1224; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--orange2), var(--orange)); transition: width .3s; }
.progress.green > div { background: linear-gradient(90deg, #1e8449, var(--green)); }
.muted { color: var(--muted); font-size: 12px; }
.modal-note {
  background: rgba(243, 156, 18, .1); border: 1px solid rgba(243, 156, 18, .35);
  border-radius: 9px; padding: 8px 10px; font-size: 11px; color: #ffd9a0; margin-bottom: 10px;
}
.rank-row { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 8px; font-size: 13px; }
.rank-row.me { background: rgba(243, 156, 18, .16); border: 1px solid rgba(243, 156, 18, .5); }
.rank-row .rr-no { width: 28px; font-weight: 800; color: var(--muted); }
.rank-row .rr-name { flex: 1; font-weight: 700; }
.rank-row .rr-pts { font-weight: 800; color: var(--orange); }
.online-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); display: inline-block; }
.off-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a6c8c; display: inline-block; }

/* ===== Hoşgeldin ===== */
.welcome-box {
  text-align: center; background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 30px 26px; max-width: 360px; width: 100%;
  box-shadow: 0 18px 60px rgba(0,0,0,.7);
}
.welcome-icon { font-size: 44px; }
.welcome-box h1 { font-size: 24px; font-weight: 900; margin-top: 6px; letter-spacing: .5px; }
.welcome-box h1 span { color: var(--orange); }
.welcome-tag { color: var(--muted); font-size: 13px; margin-top: 3px; }
.welcome-demo-note { color: var(--orange); font-size: 11px; font-weight: 800; letter-spacing: 1.5px; margin: 12px 0 4px; }
.welcome-box input {
  width: 100%; margin: 12px 0; background: #0e1830; border: 1px solid var(--line);
  border-radius: 10px; padding: 12px; color: var(--txt); font-size: 15px; text-align: center; outline: none;
}
.welcome-box input:focus { border-color: var(--orange); }
.welcome-box .btn-primary { width: 100%; font-size: 15px; padding: 12px; }
.welcome-foot { margin-top: 14px; font-size: 10px; color: var(--muted); }

/* ===== Sohbet ===== */
.chat-panel {
  position: fixed; right: 14px; bottom: 14px; width: 340px; max-width: calc(100vw - 28px);
  height: 440px; max-height: 70vh; z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  display: flex; flex-direction: column; box-shadow: 0 14px 50px rgba(0,0,0,.6);
  animation: pop .18s ease-out;
}
.chat-panel.hidden { display: none; }
.chat-head {
  display: flex; align-items: center; gap: 7px; padding: 11px 13px;
  border-bottom: 1px solid var(--line); font-weight: 800; font-size: 13px;
}
.chat-head #chatOnline { color: var(--green); font-size: 11px; font-weight: 700; flex: 1; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 11px; display: flex; flex-direction: column; gap: 8px; }
.cmsg { max-width: 86%; font-size: 12.5px; line-height: 1.35; }
.cmsg .cwho { font-size: 10.5px; font-weight: 800; color: var(--orange); margin-bottom: 1px; }
.cmsg .cbody { background: #131f38; border: 1px solid var(--line); border-radius: 0 10px 10px 10px; padding: 7px 10px; }
.cmsg.me { align-self: flex-end; }
.cmsg.me .cwho { color: var(--green); text-align: right; }
.cmsg.me .cbody { background: #173a2a; border-color: #2e5c44; border-radius: 10px 0 10px 10px; }
.cmsg.sys { align-self: center; color: var(--muted); font-size: 11px; font-style: italic; }
.chat-input { display: flex; gap: 7px; padding: 9px; border-top: 1px solid var(--line); }
.chat-input input {
  flex: 1; background: #0e1830; border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; color: var(--txt); font-size: 13px; outline: none;
}
.chat-input button {
  background: linear-gradient(90deg, var(--orange2), var(--orange)); color: #fff;
  border-radius: 9px; padding: 0 15px; font-size: 15px; font-weight: 800;
}

/* ===== Toast ===== */
.toasts { position: fixed; top: 68px; left: 50%; transform: translateX(-50%); z-index: 80;
  display: flex; flex-direction: column; gap: 7px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast {
  background: #16223af2; border: 1px solid var(--orange); color: var(--txt);
  border-radius: 10px; padding: 9px 16px; font-size: 13px; font-weight: 700;
  box-shadow: 0 6px 22px rgba(0,0,0,.55); animation: tin .25s ease-out;
}
.toast.green { border-color: var(--green); }
.toast.red { border-color: #e74c3c; }
@keyframes tin { from { transform: translateY(-12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ===== Seviye atlama ===== */
.levelup { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center;
  background: rgba(5, 9, 18, .6); }
.levelup.hidden { display: none; }
.levelup-inner {
  text-align: center; font-size: 50px; animation: lup .5s ease-out;
  background: var(--panel); border: 2px solid var(--orange); border-radius: 20px; padding: 30px 50px;
  box-shadow: 0 0 60px rgba(243, 156, 18, .45);
}
.levelup-inner b { display: block; font-size: 22px; color: var(--orange); margin-top: 6px; }
.levelup-inner span { display: block; font-size: 14px; color: var(--muted); margin-top: 5px; }
@keyframes lup { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== Demo şeridi ===== */
.demo-ribbon {
  position: fixed; bottom: 8px; left: 12px; z-index: 30; font-size: 10px;
  color: var(--muted); background: rgba(12, 19, 34, .8); border: 1px solid var(--line);
  border-radius: 7px; padding: 3px 9px; pointer-events: none;
}

/* ===== Mobil ===== */
@media (max-width: 860px) {
  body { overflow: auto; }
  .sidebar { display: none; }
  .layout { height: auto; min-height: calc(100% - 58px); }
  .map-wrap { padding: 8px 8px 76px; }
  .map { flex: none; height: 46vh; min-height: 320px; }
  .map img { height: 100%; }
  .topbar { padding: 0 8px; gap: 6px; }
  .hud { gap: 5px; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; }
  .hud::-webkit-scrollbar { display: none; }
  .hud-item { font-size: 10.5px; padding: 4px 5px; gap: 3px; }
  .hud-item .plus { width: 14px; height: 14px; font-size: 11px; }
  .xpbar { display: none; }
  .brand-title { display: none; }
  .tasks-panel { width: 44%; top: 30%; }
  .festival { width: 52%; }
  .cards-row { flex-wrap: wrap; }
  .card { min-width: calc(33% - 8px); }
  .bottombar {
    display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
    background: #121d33; border-top: 2px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .bb-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 17px; color: var(--muted); }
  .bb-item span { font-size: 9px; font-weight: 800; }
  .bb-item.active { color: var(--orange); }
  .bb-map { position: relative; top: -14px; background: linear-gradient(135deg, var(--orange2), var(--orange));
    border-radius: 50%; width: 54px; max-width: 54px; min-width: 54px; height: 54px; flex: none;
    justify-content: center; color: #fff; box-shadow: 0 4px 14px rgba(0,0,0,.5); margin: 0 6px; }
  .chat-panel { right: 8px; left: 8px; width: auto; bottom: 74px; }
  .demo-ribbon { bottom: auto; top: 62px; left: 8px; }
  .toasts { top: 96px; }
}
