.fyrka-live-shell {
  --fyrka-shell-bg: #f8faf7;
  --fyrka-shell-ink: #121413;
  --fyrka-shell-muted: #5d6460;
  --fyrka-shell-line: rgba(18, 20, 19, 0.16);
  --fyrka-shell-accent: #0f7b63;
  --fyrka-shell-danger: #b23b3b;
  color: var(--fyrka-shell-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  pointer-events: none;
}

.fyrka-live-shell *,
.fyrka-live-shell *::before,
.fyrka-live-shell *::after {
  box-sizing: border-box;
}

.fyrka-live-shell__scrim {
  position: absolute;
  inset: 0;
  background: rgba(9, 12, 11, 0.58);
  opacity: 0;
  transition: opacity 160ms ease;
}

.fyrka-live-shell__panel {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(720px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 28px));
  overflow: auto;
  transform: translate(-50%, -48%) scale(0.98);
  opacity: 0;
  border: 1px solid var(--fyrka-shell-line);
  border-radius: 8px;
  background: var(--fyrka-shell-bg);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  transition: opacity 160ms ease, transform 160ms ease;
}

.fyrka-live-shell.is-open {
  pointer-events: auto;
}

.fyrka-live-shell.is-open .fyrka-live-shell__scrim {
  opacity: 1;
}

.fyrka-live-shell.is-open .fyrka-live-shell__panel {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.fyrka-live-shell__launcher {
  position: absolute;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: none;
  min-width: 58px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(14, 20, 18, 0.84);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: auto;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.fyrka-live-shell__home-link,
.fyrka-live-shell__native-home {
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2147482001;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: min(180px, calc(100vw - 32px));
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 8px;
  background: rgba(14, 20, 18, 0.84);
  color: #ffffff;
  font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  text-decoration: none;
  pointer-events: auto;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  white-space: nowrap;
}

.fyrka-live-shell__home-link {
  display: none;
}

.fyrka-live-shell:not(.is-open) .fyrka-live-shell__launcher {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fyrka-live-shell.has-started:not(.is-open) .fyrka-live-shell__home-link {
  display: inline-flex;
}

.fyrka-live-shell__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 22px 16px;
  border-bottom: 1px solid var(--fyrka-shell-line);
}

.fyrka-live-shell__eyebrow {
  margin: 0 0 6px;
  color: var(--fyrka-shell-accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.fyrka-live-shell h1,
.fyrka-live-shell h2,
.fyrka-live-shell h3,
.fyrka-live-shell p {
  margin-top: 0;
}

.fyrka-live-shell h1 {
  margin-bottom: 0;
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.fyrka-live-shell h2 {
  margin-bottom: 14px;
  font-size: 22px;
}

.fyrka-live-shell h3 {
  margin-bottom: 10px;
  font-size: 14px;
  text-transform: uppercase;
}

.fyrka-live-shell__lead,
.fyrka-live-shell__note {
  color: var(--fyrka-shell-muted);
  font-size: 15px;
  line-height: 1.5;
}

.fyrka-live-shell__tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fyrka-shell-line);
  scrollbar-width: thin;
}

.fyrka-live-shell button,
.fyrka-live-shell__button,
.fyrka-live-shell input,
.fyrka-live-shell select {
  font: inherit;
  letter-spacing: 0;
}

.fyrka-live-shell button,
.fyrka-live-shell__button {
  border: 1px solid var(--fyrka-shell-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--fyrka-shell-ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  min-height: 40px;
  padding: 9px 13px;
  text-decoration: none;
}

.fyrka-live-shell button:hover,
.fyrka-live-shell button:focus-visible,
.fyrka-live-shell__button:hover,
.fyrka-live-shell__button:focus-visible,
.fyrka-live-shell__home-link:hover,
.fyrka-live-shell__home-link:focus-visible,
.fyrka-live-shell__native-home:hover,
.fyrka-live-shell__native-home:focus-visible {
  border-color: rgba(15, 123, 99, 0.62);
  outline: 2px solid rgba(15, 123, 99, 0.24);
  outline-offset: 2px;
}

.fyrka-live-shell button.is-active,
.fyrka-live-shell button.fyrka-live-shell__primary,
.fyrka-live-shell .fyrka-live-shell__primary {
  background: var(--fyrka-shell-ink);
  color: #ffffff;
}

.fyrka-live-shell__icon-button {
  width: 40px;
  min-width: 40px;
  padding: 0;
}

.fyrka-live-shell__body {
  padding: 22px;
}

.fyrka-live-shell__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.fyrka-live-shell__status-grid,
.fyrka-live-shell__columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.fyrka-live-shell__columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fyrka-live-shell__status-grid p,
.fyrka-live-shell__columns > div {
  margin: 0;
  min-width: 0;
  border: 1px solid var(--fyrka-shell-line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}

.fyrka-live-shell__status-grid span {
  display: block;
  color: var(--fyrka-shell-muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.fyrka-live-shell__status-grid b {
  display: block;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.fyrka-live-shell__list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.fyrka-live-shell__list li {
  color: var(--fyrka-shell-muted);
  line-height: 1.45;
}

.fyrka-live-shell__field {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--fyrka-shell-muted);
  font-size: 13px;
  font-weight: 700;
}

.fyrka-live-shell__settings:not([hidden]) {
  display: grid;
  gap: 12px;
}

.fyrka-live-shell__field input,
.fyrka-live-shell__field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--fyrka-shell-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--fyrka-shell-ink);
  padding: 8px 10px;
}

.fyrka-live-shell__check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 42px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--fyrka-shell-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--fyrka-shell-muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.fyrka-live-shell__check input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

body[data-fyrka-live-shell="native"]::after {
  content: "FYRKA Arcade";
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 2147481999;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 8px;
  background: rgba(14, 20, 18, 0.84);
  color: #ffffff;
  font: 800 12px/1 Inter, ui-sans-serif, system-ui, sans-serif;
  padding: 12px 14px;
  pointer-events: none;
}

.fyrka-control-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fyrka-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 6px 9px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(12, 16, 19, 0.72);
  color: #f8fbff;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  font: 850 12px/1.1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.fyrka-control b {
  color: inherit;
  font: inherit;
  white-space: nowrap;
}

.fyrka-key,
.fyrka-keyset kbd {
  display: grid;
  place-items: center;
  min-width: 25px;
  height: 24px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-bottom-color: rgba(0, 0, 0, 0.46);
  border-radius: 5px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04)),
    rgba(28, 33, 37, 0.96);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 2px 0 rgba(0, 0, 0, 0.36);
  color: #ffffff;
  font: 900 11px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}

.fyrka-key--wide {
  min-width: 48px;
  padding-inline: 8px;
}

.fyrka-keyset {
  display: grid;
  gap: 2px;
}

.fyrka-keyset--wasd {
  grid-template-columns: repeat(3, 20px);
}

.fyrka-keyset--wasd kbd:nth-child(1) {
  grid-column: 2;
}

.fyrka-keyset--wasd kbd:nth-child(n + 2) {
  grid-row: 2;
}

.fyrka-keyset--arrows {
  grid-template-columns: repeat(3, 20px);
}

.fyrka-keyset--arrows kbd:nth-child(1) {
  grid-column: 2;
}

.fyrka-keyset--arrows kbd:nth-child(n + 2) {
  grid-row: 2;
}

.fyrka-mouse {
  position: relative;
  width: 20px;
  height: 29px;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 12px 12px 9px 9px;
  background:
    linear-gradient(90deg, transparent 48%, rgba(255, 255, 255, 0.32) 49% 51%, transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.04)),
    rgba(28, 33, 37, 0.96);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.36);
}

.fyrka-mouse::after {
  position: absolute;
  top: 6px;
  left: 50%;
  width: 3px;
  height: 6px;
  transform: translateX(-50%);
  border-radius: 3px;
  background: #20d7ad;
  content: "";
}

@media (max-width: 680px) {
  .fyrka-live-shell__panel {
    width: calc(100vw - 18px);
    max-height: calc(100vh - 18px);
  }

  .fyrka-live-shell__header,
  .fyrka-live-shell__body {
    padding: 16px;
  }

  .fyrka-live-shell__status-grid,
  .fyrka-live-shell__columns {
    grid-template-columns: 1fr;
  }

  .fyrka-live-shell__actions button,
  .fyrka-live-shell__actions .fyrka-live-shell__button {
    flex: 1 1 150px;
  }

  .fyrka-control-strip {
    gap: 6px;
  }

  .fyrka-control {
    min-height: 36px;
    padding: 5px 7px;
    font-size: 11px;
  }
}
