/* Prod Down at 3 AM - an on-call terminal: GitHub-dark, alert orange, outage red, all-green green */
:root { --night: #0D1117; --moon: #E6EDF3; --itch: #F0B429; --sheet: #F85149; --coil: #3FB950; --bite: #F85149; --mono: ui-monospace, 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace; }

/* Screens: scrolling log lines instead of Bzzz Off's coil */
.screen { background:
  repeating-linear-gradient(0deg, rgba(63,185,80,.05) 0 2px, transparent 2px 22px),
  radial-gradient(circle at 50% 36%, #1f2a37 0%, var(--night) 72%); }
.screen.dim { background: radial-gradient(circle at 50% 40%, rgba(31,42,55,.94) 0%, rgba(13,17,23,.97) 70%); }
.mascot svg { animation: flicker 1.4s steps(2) infinite; }
@keyframes flicker { 50% { filter: brightness(1.25); } }
.menu-grid a.ghost { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 10px; font-size: 18px; text-decoration: none; }
.page.boss { background: var(--sheet); color: #fff; }
.pest .big-emoji { font-size: 56px; line-height: 105px; height: 105px; }
.pest.hazard { background: var(--coil); }
.pest code, .rules code { font-family: var(--mono); font-size: 12.5px; background: rgba(0,0,0,.15); padding: 1px 5px; border-radius: 5px; }
html, body { background: var(--night); }

/* ---------- The dashboard ---------- */
#play { position: fixed; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; padding: max(8px, env(safe-area-inset-top)) 8px max(8px, env(safe-area-inset-bottom));
  background: var(--night); overflow-y: auto; }
#play.boom { animation: boom .5s; }
@keyframes boom { 20% { box-shadow: inset 0 0 0 9999px rgba(248,81,73,.3); transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-4px); } }
.top { width: 100%; max-width: 900px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip small { opacity: .7; font-weight: 700; }
.chip.warn { border-color: var(--itch); } .chip.danger { border-color: var(--bite); background: #3d1618; }
.dash { width: 100%; max-width: 900px; flex: 1; display: flex; flex-direction: column; gap: 8px; margin-top: 8px; min-height: 0; }
#servers { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 6px; }
.srv { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 6px 8px; background: #161b22; border: 2px solid #30363d; border-radius: 10px; font-family: var(--mono); }
.srv .ic { grid-row: 1 / span 2; font-size: 22px; }
.srv b { font-size: 12px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv small { font-size: 10.5px; font-weight: 800; color: var(--coil); }
.srv .hp { grid-column: 2 / span 2; height: 6px; border-radius: 4px; background: #30363d; overflow: hidden; }
.srv .hp i { display: block; height: 100%; background: var(--coil); transition: width .2s; }
.srv.alert { border-color: var(--itch); } .srv.alert small { color: var(--itch); } .srv.alert .hp i { background: var(--itch); }
.srv.down { border-color: var(--bite); background: #2a1215; animation: pulse .6s ease-in-out infinite alternate; } .srv.down small { color: var(--bite); }
@keyframes pulse { to { box-shadow: 0 0 14px rgba(248,81,73,.6); } }
.cols { display: grid; grid-template-columns: 1fr 260px; gap: 8px; min-height: 0; }
#incidents { display: flex; flex-direction: column; gap: 6px; min-height: 120px; }
.inc { padding: 8px 10px; background: #161b22; border: 2px solid var(--itch); border-radius: 12px; animation: slide .25s ease-out; }
.inc.down { border-color: var(--bite); background: #2a1215; }
.inc.trap { border-color: var(--bite); border-style: dashed; background: #1c1012; }
.inc.typing { box-shadow: 0 0 0 3px rgba(63,185,80,.5); }
.inc.trap.typing { box-shadow: 0 0 0 3px rgba(248,81,73,.8); animation: shake .3s; }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.inc .head { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.inc .head b { font-family: var(--mono); font-size: 12.5px; }
.inc .head span { opacity: .75; font-weight: 700; font-size: 12.5px; }
.inc.trap .head span { color: var(--bite); opacity: 1; font-weight: 900; }
.inc code { display: block; margin: 5px 0 6px; font-family: var(--mono); font-size: 16px; font-weight: 700; color: #79c0ff; word-break: break-all; }
.inc.trap code { color: #ff7b72; text-decoration: line-through wavy rgba(248,81,73,.6); }
.inc code mark { background: var(--coil); color: var(--night); border-radius: 3px; }
.inc .timer { display: block; height: 4px; border-radius: 3px; background: #30363d; overflow: hidden; }
.inc .timer i { display: block; height: 100%; background: var(--itch); }
#chat { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: #161b22; border: 2px solid #30363d; border-radius: 12px; font-size: 13px; font-weight: 700; align-self: start; min-height: 60px; }
#chat:empty::before { content: "💬 Sharma Sir is typing..."; opacity: .4; }
#chat p { margin: 0; max-width: none; font-size: 13px; line-height: 1.35; }
#chat .boss { color: var(--moon); } #chat .need { font-family: var(--mono); color: var(--itch); } #chat .me { color: var(--coil); text-align: right; } #chat .bad { color: var(--bite); }
#chat.typing { border-color: var(--coil); }
.term { background: #010409; border: 2px solid #30363d; border-radius: 12px; padding: 8px 10px; font-family: var(--mono); }
#log p { margin: 0; max-width: none; font-family: var(--mono); font-size: 12.5px; line-height: 1.45; color: #8b949e; white-space: pre-wrap; word-break: break-word; }
#log .me { color: var(--moon); } #log .good { color: var(--coil); } #log .bad { color: var(--bite); } #log .warn { color: var(--itch); } #log .dim { opacity: .6; }
.prompt { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.prompt span { color: var(--coil); font-weight: 700; font-size: 14px; white-space: nowrap; }
#cmd { flex: 1; min-width: 0; font-family: var(--mono); font-size: 17px; font-weight: 700; color: var(--moon); background: transparent; border: 0; border-bottom: 2px solid #30363d; padding: 6px 2px; caret-color: var(--coil); }
#cmd:focus { outline: none; border-color: var(--coil); }
#hint { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%); width: max-content; max-width: 88vw; background: rgba(13,17,23,.95);
  border: 3px dashed var(--moon); border-radius: 16px; padding: 10px 18px; font-weight: 800; font-size: 15px; text-align: center; pointer-events: none; z-index: 2; }
.toast { position: fixed; left: 50%; top: 14%; transform: translate(-50%, -10px); opacity: 0; pointer-events: none; z-index: 4; font-weight: 900; font-size: 16px;
  padding: 6px 14px; border-radius: 12px; border: 2px solid var(--night); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: var(--coil); color: var(--night); } .toast.bad { background: var(--bite); color: #fff; }
.big-word { position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%) scale(0); z-index: 5; pointer-events: none; font-family: var(--comic); font-size: clamp(48px, 12vw, 120px);
  color: var(--coil); text-shadow: var(--outline), 6px 6px 0 #1f6feb; letter-spacing: .04em; white-space: nowrap; }
.big-word.show { animation: big .5s cubic-bezier(.3, 1.8, .5, 1) forwards; }
.big-word.bad { color: var(--bite); text-shadow: var(--outline), 6px 6px 0 #6e1b1b; }
@keyframes big { to { transform: translate(-50%, -50%) scale(1) rotate(-4deg); } }

@media (max-width: 700px) {
  .cols { grid-template-columns: 1fr; }
  #chat { order: -1; min-height: 0; }
  .inc code { font-size: 14px; }
  #servers { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .srv .ic { font-size: 18px; }
  .srv b { font-size: 10.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .mascot svg, .srv.down, .inc, .inc.trap.typing, #play.boom { animation: none; }
  .big-word.show { animation: none; transform: translate(-50%, -50%) scale(1); }
}
