* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, Arial, sans-serif;
  background: #101317;
  color: #eef2f7;
  display: grid;
  place-items: center;
  overflow-x: hidden;
}

.shell {
  width: min(1340px, 96vw);
}

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0;
}

header p {
  flex: 1;
  text-align: right;
}

h1 {
  margin: 0;
  font-size: 24px;
}

header p,
.notes {
  color: #aeb8c5;
}

.app-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.app-actions button {
  appearance: none;
  border: 1px solid rgba(116, 218, 255, 0.62);
  border-radius: 7px;
  padding: 7px 11px;
  background: rgba(21, 48, 63, 0.92);
  color: #dff8ff;
  font: 600 12px system-ui, sans-serif;
  cursor: pointer;
  touch-action: manipulation;
}

.app-actions button:hover,
.app-actions button:focus-visible {
  background: rgba(37, 76, 94, 0.98);
  outline: 2px solid rgba(135, 227, 255, 0.48);
  outline-offset: 2px;
}

canvas {
  width: 100%;
  height: auto;
  display: block;
  background: #1b2620;
  border: 1px solid #344239;
  border-radius: 12px;
  cursor: default;
}

.notes {
  margin-top: 10px;
  font-size: 14px;
}

.tablet-note {
  display: none;
}

.connection-status {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  border: 1px solid rgba(120, 222, 170, 0.6);
  border-radius: 8px;
  padding: 9px 12px;
  background: rgba(7, 24, 19, 0.94);
  color: #9df2bd;
  font-size: 13px;
}

.shell:fullscreen {
  width: 100vw;
  height: 100vh;
  display: grid;
  place-items: center;
  background: #070b10;
}

.shell:fullscreen header,
.shell:fullscreen .notes {
  display: none;
}

.shell:fullscreen canvas {
  width: min(100vw, calc(100vh * 16 / 9));
  max-height: 100vh;
  border: 0;
  border-radius: 0;
}

@media (max-width: 900px) {
  body {
    min-height: 100dvh;
    display: block;
  }

  .shell {
    width: 100vw;
  }

  header {
    align-items: center;
    margin: 0;
    padding: 8px 10px;
    background: #0b1118;
  }

  h1 {
    font-size: 19px;
  }

  header p {
    display: none;
  }

  .app-actions button {
    min-height: 38px;
  }

  canvas {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .notes {
    margin: 0;
    padding: 8px 10px;
    font-size: 12px;
  }

  .tablet-note {
    display: block;
    margin-top: 3px;
    color: #86d9ef;
  }
}
