:root {
  color-scheme: light;
  --page-bg: #eaf3ff;
  --paper: #ffffff;
  --text: #1e2b3a;
  --muted: #58708a;
  --border: #c8d8ea;
  --accent: #1f6feb;
  --accent-dark: #1959be;
  --control: rgba(255, 255, 255, 0.92);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

body.unscrollable {
  overflow: hidden;
}

button,
textarea,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #14314f;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2b7cff, #0f5bd7);
  color: #ffffff;
  font-weight: 800;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 64px;
}

.prompt-editor {
  display: grid;
  gap: 18px;
  place-items: center;
}

#contentInput {
  width: 100%;
  min-height: 340px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: var(--paper);
  color: #14314f;
  padding: 24px;
  font-size: 22px;
  line-height: 1.55;
  outline: none;
  box-shadow: 0 18px 42px rgba(31, 111, 235, 0.12);
}

#contentInput::placeholder {
  color: #a2a2a2;
}

#contentInput:focus {
  border-color: var(--accent);
  box-shadow: 0 18px 42px rgba(31, 111, 235, 0.18);
}

.prompt-button {
  min-width: 180px;
  min-height: 54px;
  border: 0;
  border-radius: 3px;
  background: var(--accent);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(31, 111, 235, 0.24);
}

.prompt-button:hover {
  background: var(--accent-dark);
}

#prompterContainer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: #000000;
  color: #ffffff;
}

#prompterContainer.showPrompter {
  display: block;
}

#prompterZone {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  transform-origin: center center;
}

#prompterHighlight {
  position: fixed;
  left: 0;
  right: 0;
  top: 50%;
  height: 220px;
  margin-top: -110px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.18);
  pointer-events: none;
}

.highlight-triangle {
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -30px;
  border-top: 30px solid transparent;
  border-bottom: 30px solid transparent;
  filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.25));
}

.highlight-triangle-left {
  left: 6px;
  border-left: 44px solid rgba(255, 255, 255, 0.42);
}

.highlight-triangle-right {
  right: 6px;
  border-right: 44px solid rgba(255, 255, 255, 0.42);
}

#prompterViewport {
  position: absolute;
  inset: 0;
  display: block;
  padding: 52vh 8vw 35vh;
}

#prompterContent {
  position: relative;
  z-index: 5;
  width: min(72ch, 100%);
  margin: 0 auto;
  color: #ffffff;
  text-align: left;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 64px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: 0;
  transform: translateY(0px);
  will-change: transform;
}

#prompterContainer.flipped #prompterZone {
  transform: scaleX(-1);
}

#prompterContainer.yflipped #prompterZone {
  transform: scaleY(-1);
}

#prompterContainer.aflipped #prompterZone {
  transform: scale(-1, -1);
}

#prompterControls {
  position: fixed;
  left: 8px;
  right: auto;
  top: 8px;
  z-index: 1002;
  display: none;
  pointer-events: none;
}

.control-bar {
  width: auto;
  margin: 0;
  pointer-events: auto;
}

.main-controls {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  margin-bottom: 0;
  padding: 5px 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(15, 15, 15, 0.82);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.settings-controls {
  position: fixed;
  top: 8px;
  left: 164px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  max-width: calc(100vw - 210px);
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
  background: rgba(15, 15, 15, 0.72);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.stepper-control {
  display: grid;
  gap: 4px;
  min-width: 126px;
}

.font-control {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.stepper-label {
  font-size: 10px;
  line-height: 1;
  color: #ffffff;
  letter-spacing: 0;
}

.stepper {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.stepper-btn {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  color: #111111;
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.stepper input[type="number"] {
  width: 34px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  font-size: 10px;
  text-align: center;
  padding: 0 2px;
  appearance: textfield;
}

.stepper input[type="number"]::-webkit-outer-spin-button,
.stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.font-control select {
  width: 100%;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  font-size: 10px;
  padding: 0 3px;
}

.font-import-btn {
  align-self: end;
  min-width: 24px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.95);
  color: #111111;
  font-size: 11px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.font-import-btn:hover {
  filter: brightness(0.94);
}

.font-status {
  min-width: 120px;
  align-self: end;
  color: #cfcfcf;
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.9);
  color: #111111;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.icon-button.primary {
  background: #12b05b;
  color: #ffffff;
}

.icon-button:hover,
.icon-button.primary:hover {
  filter: brightness(0.94);
}

#pausePrompt {
  display: none;
}

.check-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  font-size: 10px;
  white-space: nowrap;
}

.check-control input {
  width: 13px;
  height: 13px;
  accent-color: var(--accent);
}

.time-readout {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 105px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 10px;
  color: #ffffff;
}

@media (max-width: 880px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 0;
  }

  #contentInput {
    min-height: 300px;
    font-size: 19px;
  }

  #prompterZone {
    padding-inline: 5vw;
  }

  #prompterContent {
    font-size: 52px;
  }
}

@media (max-width: 560px) {
  .brand {
    font-size: 19px;
  }

  .prompt-button {
    width: 100%;
  }

  .settings-controls {
    justify-content: flex-start;
  }

  .stepper-control {
    width: 100%;
    min-width: 0;
  }

  .stepper {
    width: 100%;
  }

  #prompterContent {
    font-size: 40px;
  }
}
