:root { --bg: #050505; --panel: #111111; --border: #333; --accent: #00e5ff; --crit: #ff2a6d; --warn: #ffcc00; --ok: #05ffa1; --text: #eee; --iso: #555; }
body { background-color: var(--bg); color: var(--text); font-family: 'Roboto', sans-serif; margin: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; user-select: none; }

/* UTILS */
.crit { color: var(--crit); } .warn { color: var(--warn); } .ok { color: var(--ok); } .accent { color: var(--accent); }

/* UI STRUCTURE */
header { height: 50px; background: #080808; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 20px; z-index: 100; position:relative; }
.main-grid { display: grid; grid-template-columns: 320px 1fr; grid-template-rows: 1fr 240px; flex: 1; height: calc(100vh - 50px); overflow: hidden; }
.panel { background: var(--panel); border: 1px solid #222; display: flex; flex-direction: column; position: relative; overflow: hidden; }

/* HEADER ELEMENTS */
.brand { font-family: 'JetBrains Mono'; font-weight: 800; font-size: 1.3rem; color: #fff; letter-spacing: 1px; }
.clock-display { font-family: 'JetBrains Mono'; font-size: 1.5rem; font-weight: bold; color: var(--accent); border: 1px solid #333; padding: 2px 15px; background: #000; border-radius: 4px; box-shadow: 0 0 10px rgba(0,229,255,0.1); }
.hud { display: flex; gap: 15px; font-family: 'JetBrains Mono'; font-size: 0.8rem; color: #888; align-items: center; }
.hud b { color: #fff; margin-left: 3px; }
.vol-control { display: flex; gap: 5px; align-items: center; border-left: 1px solid #333; padding-left: 15px; }
.vol-control input { width: 50px; accent-color: var(--accent); }
.shift-bar { position: absolute; bottom: 0; left: 0; height: 2px; background: var(--accent); width: 100%; transition: width 1s linear; box-shadow: 0 0 10px var(--accent); }
.btn-pause { background: #222; border: 1px solid #444; color: #fff; width: 30px; height: 30px; border-radius: 4px; cursor: pointer; font-weight: bold; margin-left: 10px; }
.btn-pause:hover { background: var(--accent); color: #000; }

/* BONUS BUTTON FIXED */
.bonus-crate {
    position: fixed; 
    top: 70px; /* Header'ın hemen altı */
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    padding: 10px 30px; font-weight: bold; font-family: 'JetBrains Mono';
    cursor: pointer; border-radius: 50px; font-size: 1rem; text-align: center;
    transition: all 0.3s; box-shadow: 0 0 20px rgba(0,0,0,0.5); border: 2px solid #333;
}
.bonus-crate.disabled { background: #222; color: #555; pointer-events: none; opacity: 0.7; }
.bonus-crate.active { background: linear-gradient(45deg, #ffcc00, #ff9900); color: #000; border-color: #fff; pointer-events: all; opacity: 1; animation: bounce 2s infinite; box-shadow: 0 0 40px rgba(255, 204, 0, 0.6); }
.bonus-crate:hover { transform: translateX(-50%) scale(1.1); background: #fff; }
@keyframes bounce { 0%, 20%, 50%, 80%, 100% {transform: translateX(-50%) translateY(0);} 40% {transform: translateX(-50%) translateY(-5px);} 60% {transform: translateX(-50%) translateY(-2px);} }

/* START / PAUSE */
#start-overlay, #shift-report, #pause-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.98); z-index: 2000; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.modal-box { border: 1px solid var(--accent); padding: 40px; border-radius: 4px; width: 500px; background: #0a0a0a; box-shadow: 0 0 100px rgba(0, 229, 255, 0.15); text-align: center; }
h1 { font-family: 'JetBrains Mono'; color: var(--accent); margin: 0 0 5px 0; font-size: 2.5rem; letter-spacing: -1px; }
.subtitle { color: #666; font-size: 0.8rem; letter-spacing: 3px; margin-bottom: 30px; }
.form-group { text-align: left; margin-bottom: 20px; }
select { width: 100%; padding: 12px; background: #111; color: #fff; border: 1px solid #444; font-family:'JetBrains Mono'; font-size: 1rem; outline: none; }
.btn-start { background: var(--accent); color: #000; font-weight: 800; padding: 15px; width: 100%; border: none; cursor: pointer; font-family: 'JetBrains Mono'; font-size: 1.1rem; margin-top: 15px; text-transform: uppercase; }
.btn-start:hover { background: #fff; transform: translateY(-2px); }
.btn-start.small { width: auto; padding: 10px 30px; font-size: 1rem; margin-top: 10px; }
.btn-start.sec { background: transparent; border: 1px solid var(--accent); color: var(--accent); }
.btn-start.sec:hover { background: var(--accent); color: #000; }

/* LISTS & MAP */
.alarm-head { padding: 10px; background: #1a1a1a; font-family:'JetBrains Mono'; font-weight:bold; font-size: 0.8rem; color: #aaa; border-bottom:1px solid #333; display:flex; justify-content:space-between; }
.alarm-list { overflow-y: auto; flex: 1; }
.alarm-item { padding: 12px; border-bottom: 1px solid #222; cursor: pointer; border-left: 4px solid transparent; transition: 0.1s; font-size: 0.9rem; }
.alarm-item:hover { background: #151515; }
.alarm-item.selected { background: #1f1f1f; border-left-color: var(--accent); }
.badge { font-size: 0.7rem; padding: 2px 6px; border-radius: 2px; background: #333; color: #ccc; margin-right: 8px; font-weight: bold; font-family: 'JetBrains Mono'; }
.badge.TRANS { color: var(--crit); background: rgba(255, 42, 109, 0.1); }

#map-wrapper { flex: 1; position: relative; background: #000; overflow: hidden; cursor: crosshair; }
#map-transform-layer { transform-origin: 0 0; width: 3000px; height: 2000px; background-image: radial-gradient(#1a1a1a 1px, transparent 1px); background-size: 50px 50px; position: absolute; top:0; left:0; transition: transform 0.1s linear; }
.map-tabs { position: absolute; top: 15px; left: 15px; z-index: 500; display: flex; gap: 0; }
.tab-btn { background: rgba(0,0,0,0.8); border: 1px solid #333; color: #666; padding: 10px 20px; cursor: pointer; font-weight: bold; font-family: 'JetBrains Mono'; font-size: 0.8rem; }
.tab-btn:hover { color: #fff; }
.tab-btn.active { border-color: var(--accent); color: var(--accent); background: rgba(0, 229, 255, 0.1); }
.map-hint { position: absolute; bottom: 10px; right: 10px; color: #444; font-size: 0.7rem; font-family: 'JetBrains Mono'; pointer-events: none; z-index:500; background:rgba(0,0,0,0.8); padding:5px 10px; border-radius: 4px;}
.zoom-controls { position: absolute; bottom: 20px; right: 20px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.btn-zoom { width: 40px; height: 40px; background: rgba(0,0,0,0.8); border: 1px solid var(--accent); color: #fff; font-size: 1.5rem; font-weight: bold; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; }

/* SITES & LINKS */
.site { position: absolute; width: 14px; height: 14px; background: #000; border: 2px solid var(--ok); border-radius: 50%; transform: translate(-50%, -50%); z-index: 10; transition: 0.2s; }
.site.core { width: 24px; height: 24px; border-width: 3px; z-index: 12; }
.site.hub { width: 18px; height: 18px; border-radius: 3px; z-index: 11; }
.site:hover { transform: translate(-50%, -50%) scale(2); background: #fff; }
.site.selected { box-shadow: 0 0 30px #fff; background: #fff; transform: translate(-50%, -50%) scale(2.2); z-index: 20; border-color:#fff;}
.site.alarm { border-color: var(--warn); background: var(--warn); box-shadow: 0 0 15px var(--warn); animation: blink 1s infinite; }
.site.crit { border-color: var(--crit); background: var(--crit); box-shadow: 0 0 20px var(--crit); animation: blink 0.5s infinite; }
.site.iso { border-color: var(--iso); background: #222; opacity: 0.5; }
svg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
line.link { stroke: #222; stroke-width: 2; transition: stroke 0.3s; }
line.link.down { stroke: var(--crit); stroke-width: 5; stroke-dasharray: 10; animation: dash 1s linear infinite; opacity: 0.8;}
@keyframes blink { 50% { opacity: 0.3; } }
@keyframes dash { to { stroke-dashoffset: -20; } }

/* CONTROLS */
#controls { grid-column: 1 / -1; background: #0a0a0a; padding: 20px; display: flex; gap: 30px; border-top: 1px solid var(--border); z-index: 600; }
.info-panel { width: 280px; border-right: 1px solid #333; display: flex; flex-direction: column; justify-content: center; padding-right: 20px; }
.site-title { font-size: 1.4rem; font-weight: bold; color: #fff; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.site-id { color: #666; font-family:'JetBrains Mono'; font-size: 0.8rem; margin-bottom:10px; }
.site-stat { color: #888; font-family: 'JetBrains Mono'; font-weight: bold; }
.btn-grid { flex: 1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.act-btn { background: #151515; border: 1px solid #333; color: #666; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: 0.2s; position: relative; overflow: hidden;}
.act-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: #1a1a1a; box-shadow: 0 0 15px rgba(0,229,255,0.1); }
.act-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.act-btn strong { font-size: 0.85rem; margin-bottom: 5px; color: #eee; font-family: 'JetBrains Mono'; }
.act-btn span { font-size: 0.7rem; }

/* BATTERY */
.batt-container { margin-top: 15px; }
.batt-label { font-size: 0.75rem; color: #888; display: flex; justify-content: space-between; font-family:'JetBrains Mono'; margin-bottom: 5px;}
.batt-track { height: 6px; background: #222; border-radius: 3px; overflow: hidden; }
.batt-fill { height: 100%; background: var(--ok); width: 100%; transition: width 0.5s; }
.batt-fill.low { background: var(--crit); }

/* EMERGENCY BUTTON (MODIFIED FOR ITCH) */
.btn-ad { margin-top: 15px; background: linear-gradient(90deg, #222, #333); border: 1px solid var(--accent); color: var(--accent); padding: 10px; cursor: pointer; border-radius: 4px; display: flex; flex-direction: column; align-items: center; animation: pulse 2s infinite; }
.btn-ad span { font-weight: bold; font-family: 'JetBrains Mono'; }
.btn-ad small { color: #fff; font-size: 0.7rem; }
.btn-ad:hover { background: var(--accent); color: #000; }
.btn-ad:hover small { color: #000; }

/* OVERLAYS & GAMES */
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 1000; display: none; flex-direction: column; align-items: center; justify-content: center; }
.game-box { border: 1px solid var(--accent); padding: 30px; border-radius: 8px; text-align: center; background: #111; min-width: 400px; box-shadow: 0 0 50px rgba(0,0,0,0.8); }
.game-title { color: var(--accent); font-family: 'JetBrains Mono'; margin-bottom: 20px; font-size: 1.2rem; border-bottom: 1px solid #333; padding-bottom: 10px; }
.slider-track { width: 300px; height: 30px; background: #222; border: 2px solid #555; position: relative; margin: 20px auto; border-radius: 15px; overflow: hidden; }
.slider-target { position: absolute; left: 40%; width: 20%; height: 100%; background: rgba(0, 229, 255, 0.2); border-left: 2px solid var(--accent); border-right: 2px solid var(--accent); }
.slider-bar { position: absolute; left: 0; top: 0; width: 10px; height: 100%; background: #fff; box-shadow: 0 0 10px #fff; }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 20px auto; width: 180px; }
.key { height: 50px; background: #222; border: 1px solid #444; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; cursor: pointer; font-family:'JetBrains Mono'; transition:0.1s;}
.key:hover { background: var(--accent); color:#000; }
.key.flash { background: #fff; color:#000; box-shadow: 0 0 20px #fff; }
.key-zero { grid-column: 2; }
.gen-meter { width: 300px; height: 20px; background: #222; border: 2px solid #555; position: relative; margin: 20px auto; border-radius: 10px; overflow: hidden; }
.gen-target { position: absolute; left: 50%; width: 30%; height: 100%; background: rgba(5, 255, 161, 0.2); border-left: 2px solid var(--ok); border-right: 2px solid var(--ok); transform: translateX(-50%); }
.gen-fill { height: 100%; width: 0%; background: var(--accent); transition: width 0.05s linear; }
.in-game-batt { width: 300px; height: 4px; background: #333; margin: 0 auto 10px; border-radius: 2px; overflow: hidden; border: 1px solid #555;}
.igb-fill { height: 100%; width: 100%; background: var(--crit); transition: width 0.5s linear; }
.radar-screen { width: 150px; height: 150px; border: 2px solid #333; border-radius: 50%; position: relative; margin: 20px auto; background: #000; }
.radar-wedge { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border-radius: 50%; clip-path: polygon(50% 50%, 40% 0%, 60% 0%); background: rgba(0, 229, 255, 0.3); transform: rotate(0deg); }
.radar-line { position: absolute; top: 0; left: 50%; width: 2px; height: 50%; background: var(--crit); transform-origin: bottom center; transform: rotate(0deg); }
.fiber-screen { width: 350px; height: 150px; background: #000; border: 2px solid #444; position: relative; margin: 20px auto; overflow: hidden; }
.fiber-core { position: absolute; height: 4px; width: 120px; background: var(--accent); transition: top 0.1s linear; box-shadow: 0 0 10px var(--accent); }
.fiber-clad { position: absolute; height: 20px; width: 120px; background: rgba(255,255,255,0.1); border-top: 1px solid #555; border-bottom: 1px solid #555; }
.f-left { left: 0; } .f-right { right: 0; }
.splice-line { position: absolute; left: 50%; top: 0; height: 100%; width: 2px; border-left: 1px dashed #333; }
.fuse-flash { position: absolute; left: 50%; top: 50%; width: 50px; height: 50px; background: #fff; border-radius: 50%; transform: translate(-50%,-50%) scale(0); transition: transform 0.2s; z-index: 20; box-shadow: 0 0 50px #fff; }
.fiber-btns { display: flex; gap: 10px; justify-content: center; }
.f-btn { background: #222; color: #fff; border: 1px solid #444; padding: 10px; cursor: pointer; flex: 1; font-weight: bold; font-family: 'JetBrains Mono'; }
.f-btn:hover { background: #333; }
.f-btn.ready { background: var(--ok); color: #000; border-color: var(--ok); }

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; grid-template-rows: 150px 1fr 220px; height: calc(100vh - 50px); }
    .info-panel { display: none; }
    .alarm-list { font-size: 0.8rem; }
    #map-wrapper { touch-action: none; }
    .btn-grid { grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .act-btn { padding: 10px; }
    .act-btn strong { font-size: 0.7rem; }
    .act-btn span { display: none; }
    .bonus-crate { top: 60px; right: 10px; padding: 8px 15px; font-size: 0.8rem; }
    .modal-box { width: 90%; padding: 20px; }
    h1 { font-size: 1.5rem; }
    .game-box { min-width: 300px; width: 90%; }
    .slider-track, .gen-meter { width: 100%; }
}
/* Ana Menü Butonu Rengi (Kırmızı/Kritik) */
.btn-start.crit { background: transparent; border: 1px solid var(--crit); color: var(--crit); }
.btn-start.crit:hover { background: var(--crit); color: #fff; }