@font-face {
  font-family: "Sora";
  src: url("Sora-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Sora";
  src: url("Sora-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("Inter-Regular.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0B1033;
  color: #F4F6FF;
  font-family: Sora, Inter, sans-serif;
}
canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#loading {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px;
  align-items: center; justify-content: center; color: #F4F6FF;
  font: 600 15px/1.4 Sora, Inter, sans-serif; pointer-events: none;
}
#loading .err { color: #FFA41B; white-space: pre-wrap; max-width: 70ch; pointer-events: auto; font-weight: 400; }
#fatal {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(11, 16, 51, 0.92); color: #F4F6FF; font: 14px/1.45 Inter, Sora, sans-serif; z-index: 10;
}
#fatal.on { display: flex; }
#fatal .box {
  max-width: min(78ch, calc(100vw - 32px));
  padding: 20px 24px;
  background: #141B44;
  border: 1px solid #2C3566;
  border-radius: 12px;
}
#fatal h1 { margin: 0 0 8px; font-family: Sora, Inter, sans-serif; font-size: 17px; color: #FFA41B; }
#fatal pre { max-height: 40vh; overflow: auto; white-space: pre-wrap; font-size: 12px; color: #B7BED6; }
#fatal button {
  font: 600 14px/1 Sora, Inter, sans-serif;
  padding: 8px 16px;
  border: 0;
  border-radius: 8px;
  background: #6D5BFF;
  color: #F4F6FF;
  cursor: pointer;
}
#fatal button:hover { background: #8A7CFF; }
#kal-bar {
  position: absolute; top: 0; left: 0; right: 0; height: 24px; z-index: 5;
  display: flex; align-items: center; gap: 8px; padding: 0 10px; box-sizing: border-box;
  background: #0B1033; border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  font: 600 12px/1 Sora, Inter, sans-serif; color: #F4F6FF;
}
#kal-beta { padding: 3px 8px; border-radius: 999px; background: #FFA41B; color: #0B1033; letter-spacing: 0.02em; }
#kalaakar_canvas { top: 24px; height: calc(100% - 24px); }
