/* ==========================================================================
   game.css — Şirket Tycoon: harita + HUD + pencere içerikleri
   ========================================================================== */

:root {
    --panel-a: #3f6bd0;
    --panel-b: #213f95;
    --panel-line: rgba(173, 205, 255, 0.55);
    --gold: #ffd34a;
}

body { background: #2aa7c9; background-image: none; }
#map { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; padding-top: var(--safe-t); }
#hud button, #hud .side-panel, #hud .goal-card { pointer-events: auto; }
.hidden { display: none !important; }

/* ---------- Üst çubuk ---------- */
.top { position: absolute; left: 8px; right: 8px; top: calc(8px + var(--safe-t)); display: flex; align-items: center; gap: 6px; }
.lvl { position: relative; flex: 0.95; min-width: 0; display: flex; align-items: center; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; }
.star {
    position: relative; z-index: 2; flex: none; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; margin-right: -14px;
    background: radial-gradient(circle at 40% 35%, #ffe680, #f59e0b); color: #5a3300; font-size: 17px; font-weight: 900;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4));
}
.star b { margin-top: 2px; }
.xp { position: relative; flex: 1; height: 20px; border-radius: 0 12px 12px 0; background: rgba(15, 28, 70, 0.78); border: 2px solid var(--panel-line); border-left: 0; overflow: hidden; padding-left: 14px; }
.xp i { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(180deg, #5cc7ff, #2b8ae8); transition: width 0.4s; }
.xp em { position: relative; z-index: 1; font-style: normal; font-size: 11px; font-weight: 900; line-height: 16px; padding-left: 16px; text-shadow: 0 1px 2px #000; }

.cur {
    flex: 1.2; min-width: 0; display: flex; align-items: center; gap: 4px; height: 34px; padding: 0 3px 0 5px; border-radius: 12px;
    background: linear-gradient(180deg, rgba(20, 38, 92, 0.9), rgba(12, 24, 66, 0.9)); border: 2px solid var(--panel-line);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35);
}
.cur b { flex: 1; min-width: 0; font-size: 13px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; }
.plus { flex: none; width: 22px; height: 22px; border-radius: 7px; border: 0; background: linear-gradient(180deg, #5eea6e, #16a34a); color: #fff; font-size: 19px; font-weight: 900; line-height: 1; padding: 0 0 2px; cursor: pointer; box-shadow: 0 2px 0 #0b6b2c; }
.gear { flex: none; width: 36px; height: 36px; border-radius: 50%; padding: 0; border: 2px solid rgba(255, 255, 255, 0.7); background: radial-gradient(circle at 35% 30%, #7aa7ff, #2f56c7); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4); }
.gear svg { width: 20px; height: 20px; fill: #fff; }

.coin { flex: none; width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff1a8, #f5a400 70%); border: 2px solid #b87100; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15); position: relative; }
.coin::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1.5px solid rgba(160, 90, 0, 0.55); }
.coin.sm { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; margin-right: 3px; }
.bill { flex: none; width: 24px; height: 15px; border-radius: 3px; background: linear-gradient(135deg, #86efac, #16a34a); border: 2px solid #166534; position: relative; transform: rotate(-8deg); }
.bill::after { content: "$"; position: absolute; inset: 0; font-size: 9px; font-weight: 900; line-height: 11px; text-align: center; color: #14532d; }

/* ---------- Hedef kartı ---------- */
.goal-card { position: absolute; left: 8px; top: calc(56px + var(--safe-t)); width: 190px; border-radius: 14px; background: rgba(255, 255, 255, 0.95); color: #1f2937; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35); overflow: hidden; }
.goal-head { width: 100%; display: flex; align-items: center; gap: 6px; padding: 8px 10px; border: 0; background: linear-gradient(180deg, #3a4a6a, #263552); color: #fff; cursor: pointer; font-size: 13px; text-align: left; }
.goal-head b { flex: 1; }
.goal-head span { font-size: 11px; font-weight: 800; color: #fcd34d; }
.goal-head .chev { width: 8px; height: 8px; border-right: 2.5px solid #fff; border-bottom: 2.5px solid #fff; transform: rotate(45deg); margin: -3px 2px 0 0; transition: transform 0.2s; }
.goal-card.collapsed .chev { transform: rotate(-45deg); margin: 0 2px 0 0; }
.goal-card ul { list-style: none; margin: 0; padding: 6px 8px 8px; }
.goal-card.collapsed ul { display: none; }
.goal-card li { display: flex; align-items: center; gap: 7px; padding: 5px 2px; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid #e5e7eb; cursor: pointer; }
.goal-card li:last-child { border-bottom: 0; }
.goal-card li .chk { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #9ca3af; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 11px; font-weight: 900; }
.goal-card li.done .chk { background: #22c55e; border-color: #22c55e; }
.goal-card li.claimed { opacity: 0.55; text-decoration: line-through; }
.goal-card li.claimable { animation: glowRow 1s ease-in-out infinite alternate; }
.goal-card li small { margin-left: auto; color: #b45309; font-size: 10.5px; white-space: nowrap; }
@keyframes glowRow { to { background: rgba(250, 204, 21, 0.28); } }

/* ---------- Sol ray ---------- */
.rail { position: absolute; left: 8px; bottom: calc(92px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; }
.rail-btn {
    position: relative; width: 62px; height: 62px; border-radius: 16px; border: 2px solid var(--panel-line); cursor: pointer; padding: 0; color: #fff;
    background: linear-gradient(180deg, var(--panel-a), var(--panel-b)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}
.rail-btn .ri { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.35)); }
.rail-btn small { font-size: 9.5px; font-weight: 800; letter-spacing: 0.01em; }
.rail-btn:active { transform: scale(0.94); }
.badge { position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 99px; background: #ef4444; color: #fff; border: 2px solid #fff; font-style: normal; font-size: 11px; font-weight: 900; display: flex; align-items: center; justify-content: center; line-height: 1; }

/* ---------- Sağ panel ---------- */
.side-panel {
    position: absolute; right: 8px; top: calc(56px + var(--safe-t)); width: 142px; display: flex; flex-direction: column; gap: 6px; padding: 8px;
    border-radius: 16px; background: linear-gradient(180deg, rgba(40, 70, 150, 0.92), rgba(22, 42, 105, 0.92)); border: 2px solid var(--panel-line);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4);
}
.sp-row { padding: 6px 8px; border-radius: 10px; background: rgba(8, 18, 55, 0.5); color: #fff; text-align: left; border: 0; }
.sp-row small { display: block; font-size: 10.5px; font-weight: 800; color: #b7ccff; margin-bottom: 2px; }
.sp-row > div:not(.bar) { display: flex; align-items: center; font-size: 14px; font-weight: 900; }
.sp-row em { font-style: normal; font-size: 11px; font-weight: 700; color: #cbd5e1; margin-left: 3px; }
.sp-btn { cursor: pointer; font: inherit; width: 100%; }
.sp-btn:active { transform: scale(0.97); }
.up { width: 0; height: 0; margin-left: 6px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 9px solid #4ade80; }
.people { width: 16px; height: 14px; margin-right: 5px; background: radial-gradient(circle at 30% 30%, #7dd3fc 0 3.5px, transparent 4px), radial-gradient(circle at 70% 30%, #bae6fd 0 3px, transparent 3.5px), linear-gradient(#38bdf8, #38bdf8) 12% 100% / 6px 7px no-repeat, linear-gradient(#7dd3fc, #7dd3fc) 80% 100% / 6px 6px no-repeat; }
.bar { height: 6px; margin-top: 4px; border-radius: 99px; background: rgba(0, 0, 0, 0.4); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #4ade80, #22c55e); transition: width 0.3s; }

.boost-chip { position: absolute; right: 8px; top: calc(238px + var(--safe-t)); display: flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px; border: 2px solid #fcd34d; background: linear-gradient(180deg, #7c3aed, #4c1d95); color: #fff; cursor: pointer; font-size: 12px; animation: chipPulse 1.6s ease-in-out infinite; }
.boost-chip b { color: #fcd34d; }
.boost-chip em { font-style: normal; font-weight: 800; font-variant-numeric: tabular-nums; }
@keyframes chipPulse { 50% { transform: scale(1.05); } }

/* ---------- Konuşma balonu / yerleştirme çubuğu ---------- */
.speech { position: absolute; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); width: 72%; max-width: 300px; padding: 10px 14px; border-radius: 14px; background: #fff7e6; color: #5a3a12; font-weight: 800; font-size: 13.5px; text-align: center; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.35); transform-origin: bottom; animation: speechIn 0.4s ease-out; pointer-events: auto; }
@keyframes speechIn { from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.9); } }
.place-bar { position: absolute; left: 12px; right: 12px; bottom: calc(96px + var(--safe-b)); display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(20, 83, 45, 0.95); border: 2px solid #4ade80; box-shadow: 0 5px 14px rgba(0, 0, 0, 0.4); pointer-events: auto; }
.place-bar b { flex: 1; font-size: 14px; }

/* ---------- Alt eylemler ---------- */
.actions { position: absolute; left: 8px; right: 8px; bottom: calc(10px + var(--safe-b)); display: flex; gap: 8px; }
.act {
    position: relative; flex: 1; height: 64px; border-radius: 16px; border: 3px solid rgba(255, 255, 255, 0.85); cursor: pointer; padding: 0 6px; color: #fff;
    display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; font-weight: 900; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), 0 10px 18px rgba(0, 0, 0, 0.35), inset 0 3px 0 rgba(255, 255, 255, 0.35);
}
.act:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3); }
.act .ai { flex: none; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, 0.22); }
.act .ai svg { width: 24px; height: 24px; fill: #fff; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, 0.3)); }
.act.build { background: linear-gradient(180deg, #ffb52e, #e8820c); border-color: #ffe0a0; }
.act.up { background: linear-gradient(180deg, #4ade80, #16a34a); border-color: #bbf7d0; }
.act.research { background: linear-gradient(180deg, #a78bfa, #6d28d9); border-color: #ddd6fe; }
.act .dot { position: absolute; top: -8px; right: -4px; width: 22px; height: 22px; border-radius: 50%; background: #ef4444; border: 2.5px solid #fff; font-style: normal; font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center; }
.act .dot::after { content: "!"; }
.act.pulse { animation: actPulse 0.9s ease-in-out infinite; }
@keyframes actPulse { 50% { transform: scale(1.07); } }

/* ---------- Pencere içerikleri ---------- */
.modal-card { max-width: 360px; }
.modal-card.sheet { max-width: 380px; padding: 16px 14px 14px; }
.modal-card h2 small { display: block; font-size: 12px; color: #b7ccff; font-weight: 700; margin-top: 2px; }
.list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; margin: 4px -4px; padding: 2px 4px; }
.row-item { display: flex; align-items: center; gap: 10px; padding: 9px; border-radius: 14px; background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.14); text-align: left; }
.row-item.locked { opacity: 0.55; }
.row-item .thumb { flex: none; width: 58px; height: 58px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); display: flex; align-items: center; justify-content: center; font-size: 30px; overflow: hidden; }
.row-item .thumb canvas { max-width: 100%; max-height: 100%; }
.row-item .info { flex: 1; min-width: 0; }
.row-item .info b { display: block; font-size: 14px; }
.row-item .info small { display: block; font-size: 11px; color: #b7ccff; font-weight: 700; line-height: 1.35; }
.row-item .info .meta { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-top: 3px; font-size: 11px; font-weight: 800; color: #e2e8f0; }
.cost { display: inline-flex; align-items: center; gap: 4px; }
.btn-buy { flex: none; min-width: 78px; padding: 8px 10px; border-radius: 12px; font-size: 13px; }
.btn.poor { filter: grayscale(0.7) brightness(0.8); }
.tag { display: inline-block; padding: 2px 6px; border-radius: 6px; background: #ef4444; color: #fff; font-size: 9.5px; font-weight: 900; margin-left: 6px; vertical-align: 2px; }
.pillbar { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: rgba(0, 0, 0, 0.3); margin-bottom: 10px; }
.pillbar button { flex: 1; border: 0; border-radius: 11px; padding: 8px 4px; background: transparent; color: #b7ccff; font-weight: 800; font-size: 12.5px; cursor: pointer; }
.pillbar button.on { background: linear-gradient(180deg, #ffc23a, #f08a00); color: #3a2200; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-tile { padding: 10px; border-radius: 12px; background: rgba(255, 255, 255, 0.08); text-align: left; }
.stat-tile small { display: block; font-size: 10.5px; font-weight: 800; color: #b7ccff; }
.stat-tile b { font-size: 17px; }
.progress { height: 8px; border-radius: 99px; background: rgba(0, 0, 0, 0.35); overflow: hidden; margin: 4px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #4ade80, #16a34a); }
.big-num { font-size: 34px; font-weight: 900; color: var(--gold); text-align: center; margin: 6px 0 2px; }
.center { text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 8px 0; }
.chip { padding: 5px 10px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); border: 1.5px solid rgba(255, 255, 255, 0.2); font-size: 12px; font-weight: 800; }
.chip.good { background: rgba(34, 197, 94, 0.25); border-color: #22c55e; }
.tech { position: relative; }
.tech .state { font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.14); }
.tech.done .state { background: #16a34a; }
.tech.active .state { background: #7c3aed; }
.day-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.day { padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, 0.08); border: 1.5px solid rgba(255, 255, 255, 0.15); font-size: 10.5px; font-weight: 800; text-align: center; }
.day.today { border-color: var(--gold); background: rgba(255, 211, 74, 0.2); }
.day.past { opacity: 0.5; }
.day b { display: block; font-size: 13px; }
.fine { color: #94a3b8; font-size: 11px; text-align: center; margin: 8px 0 0; }
.field input[type="text"] { width: 100%; }
