@font-face {
  font-family: "Armagetron";
  src: url("../assets/textures/Armagetronad.ttf") format("truetype");
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #050505;
  --surface: #111114;
  --line: #303038;
  --white: #f7f6f1;
  --muted: #909097;
  --yellow: #ffcf18;
  --red: #ed1b24;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--white);
}

.tool-header {
  display: flex;
  height: 54px;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  background: #08080a;
}

.tool-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--white);
  font-family: "Armagetron", monospace;
  font-size: 15px;
  letter-spacing: 0.1em;
  text-decoration: none;
}

.tool-brand:hover {
  color: var(--yellow);
}

.tool-divider {
  width: 1px;
  height: 25px;
  background: var(--line);
}

.tool-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.1;
}

.tool-identity span {
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.tool-identity strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.tool-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.tool-actions a {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  border: 1px solid var(--line);
  padding: 0 10px;
  color: #b5b5ba;
  font-family: ui-monospace, monospace;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.tool-actions a:hover {
  border-color: var(--yellow);
  color: var(--white);
}

.tool-actions .exit-button {
  border-color: var(--yellow);
  background: var(--yellow);
  color: #050505;
}

.tool-stage {
  position: relative;
  width: 100%;
  height: calc(100% - 54px);
}

#tool-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  background: #08111c;
  transition: opacity 150ms ease;
}

#tool-frame.is-ready {
  opacity: 1;
}

.tool-loading {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  color: var(--muted);
  font-family: ui-monospace, monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: opacity 120ms ease;
}

.tool-loading i {
  width: 10px;
  height: 10px;
  background: var(--red);
  animation: pulse 700ms steps(2, end) infinite;
}

.tool-loading.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@keyframes pulse {
  50% { background: var(--yellow); transform: rotate(45deg); }
}

.mobile-warning {
  display: none;
}

@media (max-width: 760px) {
  .tool-identity,
  #switch-tool,
  #new-tab {
    display: none;
  }

  .mobile-warning {
    position: fixed;
    z-index: 20;
    inset: 54px 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(5, 5, 5, 0.96);
    text-align: center;
  }

  .mobile-warning.is-dismissed {
    display: none;
  }

  .mobile-warning strong {
    margin-bottom: 10px;
    color: var(--yellow);
    font-size: 20px;
    text-transform: uppercase;
  }

  .mobile-warning span {
    max-width: 480px;
    margin-bottom: 24px;
    color: var(--muted);
    font-size: 14px;
  }

  .mobile-warning button {
    min-height: 44px;
    border: 1px solid var(--yellow);
    border-radius: 0;
    padding: 0 18px;
    background: var(--yellow);
    color: #050505;
    font-family: ui-monospace, monospace;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
