:root {
  --page-bg: #000000;
  --card-bg: #d58690;
  --border-color: #ff00ff;
  --text-color: #ffff00;
  --card-width: 400px;
  --card-height: 300px;
  --text-size: 28px;
  --card-font: Arial, Helvetica, sans-serif;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text-color);
  background: var(--page-bg);
}

button,
input,
select {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-rows: minmax(520px, 1fr) auto;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 18px 42px;
}

.card {
  width: min(var(--card-width), calc(100vw - 36px));
  min-height: min(var(--card-height), 64vh);
  height: min(var(--card-height), 64vh);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  padding: 26px 32px;
  border: 5px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 0;
  outline: none;
}

.card p {
  width: 100%;
  margin: 0;
  color: var(--text-color);
  font-family: var(--card-font);
  font-size: var(--text-size);
  line-height: 1.25;
  text-align: center;
  overflow-wrap: anywhere;
}

.replay {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  border: 0;
  background: transparent;
  color: var(--text-color);
  cursor: pointer;
}

.replay:hover {
  text-decoration: underline;
}

.source-status {
  min-height: 20px;
  margin: 0 0 4px;
  color: var(--text-color);
  font-size: 14px;
  text-align: center;
}

.navigator {
  width: min(560px, calc(100vw - 36px));
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 36px;
  margin-top: 8px;
}

.arrow-button {
  width: 112px;
  height: 88px;
  justify-self: end;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
}

.arrow-button::before {
  content: "";
  position: absolute;
  inset: 22px 20px 22px 42px;
  background: var(--border-color);
}

.arrow-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  border-top: 44px solid transparent;
  border-bottom: 44px solid transparent;
  border-right: 56px solid var(--border-color);
}

.arrow-button--next {
  justify-self: start;
  transform: rotate(180deg);
}

.counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 27px;
  white-space: nowrap;
}

.counter input {
  width: 64px;
  min-height: 38px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-color);
  text-align: center;
  appearance: textfield;
}

.counter input:focus {
  outline: none;
  border-bottom-color: var(--border-color);
}

.controls-panel {
  border-top: 5px solid var(--border-color);
  padding: 58px 22px 36px;
}

.controls-panel h1 {
  margin: 0 0 32px;
  font-size: clamp(42px, 7vw, 66px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  letter-spacing: 0;
}

.control-grid {
  width: min(980px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 16px;
}

.control-grid label {
  display: grid;
  gap: 7px;
  color: var(--text-color);
  font-size: 15px;
}

.control-grid input,
.control-grid select {
  width: 100%;
  min-height: 40px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  padding: 6px 8px;
  color: #111;
  background: rgba(255, 255, 255, 0.78);
}

.control-grid input[type="color"] {
  padding: 3px;
}

.voice-control,
.file-control {
  grid-column: span 2;
}

@media (max-width: 680px) {
  .app {
    grid-template-rows: minmax(430px, 1fr) auto;
  }

  .navigator {
    grid-template-columns: 1fr 1fr;
    gap: 10px 20px;
  }

  .counter {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .arrow-button {
    grid-row: 2;
    width: 92px;
    height: 72px;
  }

  .arrow-button::before {
    inset: 18px 18px 18px 35px;
  }

  .arrow-button::after {
    border-top-width: 36px;
    border-bottom-width: 36px;
    border-right-width: 46px;
  }

  .voice-control,
  .file-control {
    grid-column: auto;
  }
}
