* {
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: #0d0f14;
  color: #e8eaf0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 20px;
}

.hidden {
  display: none !important;
}

#app {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* ---------- Top form ---------- */

.load-form,
.options-row,
.ctl-row,
.history-head {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
}

.load-form > * + *,
.options-row > * + * {
  margin-left: 12px;
}

.url-input,
.key-input {
  height: 60px;
  padding: 0 18px;
  font-size: 22px;
  color: #fff;
  background: #1c2030;
  border: 2px solid #343a52;
  border-radius: 10px;
  outline: none;
}

.url-input {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  min-width: 0;
}

.url-input:focus,
.key-input:focus {
  border-color: #4f8cff;
}

.options-row {
  margin: 14px 0 18px;
  -webkit-flex-wrap: wrap;
  flex-wrap: wrap;
}

.key-input {
  height: 50px;
  width: 280px;
  font-size: 18px;
}

.check {
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  min-height: 50px;
  padding: 0 14px;
  background: #1c2030;
  border-radius: 10px;
  cursor: pointer;
}

.check input {
  width: 28px;
  height: 28px;
  margin: 0 10px 0 0;
}

.notice {
  color: #ffcf5c;
  font-size: 18px;
}

/* ---------- Buttons ---------- */

.btn {
  min-width: 60px;
  height: 60px;
  padding: 0 16px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  background: #262b3d;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  outline: none;
}

.btn:focus,
.btn:hover,
.ctl-select:focus,
.ctl-select:hover {
  border-color: #4f8cff;
}

.btn:active {
  background: #3a4260;
}

.icon {
  display: inline-block;
  width: 30px;
  height: 30px;
  vertical-align: middle;
}

.big-play .icon {
  width: 70px;
  height: 70px;
}

.audio-icon .icon {
  width: 150px;
  height: 150px;
}

.ctl-select:disabled {
  opacity: 1;
  color: #cdd3e6;
  cursor: default;
}

.btn-primary {
  background: #2f6bff;
  min-width: 120px;
}

.btn-small {
  height: 48px;
  font-size: 18px;
}

.btn.active {
  background: #2f6bff;
}

.ctl-select {
  height: 60px;
  padding: 0 10px;
  font-size: 20px;
  color: #fff;
  background: #262b3d;
  border: 2px solid transparent;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

/* ---------- Player ---------- */

.player {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

.player video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

/* Separate rules: an unknown pseudo-class would drop the whole selector list */
.player.fake-fs {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
  z-index: 1000;
}

.player:-webkit-full-screen {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
}

.player:fullscreen {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 0;
}

.player.idle {
  cursor: none;
}

.audio-panel,
.empty-panel {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 110px;
  display: -webkit-box;
  display: -webkit-flex;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-flex-direction: column;
  flex-direction: column;
  -webkit-box-align: center;
  -webkit-align-items: center;
  align-items: center;
  -webkit-box-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  text-align: center;
  pointer-events: none;
}

.empty-panel {
  color: #6c7390;
  font-size: 26px;
}

.audio-panel {
  background: -webkit-linear-gradient(top, #1b2238, #0b0d14);
  background: linear-gradient(to bottom, #1b2238, #0b0d14);
}

.audio-icon {
  font-size: 140px;
  line-height: 1;
  color: #4f8cff;
}

.audio-title {
  margin-top: 20px;
  padding: 0 40px;
  font-size: 26px;
  word-break: break-all;
  max-width: 100%;
}

.big-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 130px;
  margin: -100px 0 0 -65px;
  padding: 0;
  line-height: 0;
  color: #fff;
  background: rgba(47, 107, 255, 0.9);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  outline: none;
}

.spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80px;
  height: 80px;
  margin: -75px 0 0 -40px;
  border: 8px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  -webkit-animation: spin 0.9s linear infinite;
  animation: spin 0.9s linear infinite;
  pointer-events: none;
}

@-webkit-keyframes spin {
  to { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-box {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 80%;
  margin-left: -40%;
  padding: 18px 22px;
  font-size: 20px;
  line-height: 1.4;
  color: #fff;
  background: rgba(190, 40, 50, 0.95);
  border-radius: 10px;
  text-align: center;
}

/* ---------- Controls ---------- */

.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px 14px;
  background: -webkit-linear-gradient(top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85) 40%);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.85) 40%);
  -webkit-transition: opacity 0.3s;
  transition: opacity 0.3s;
}

.player.idle .controls {
  opacity: 0;
  pointer-events: none;
}

.ctl-row > * + * {
  margin-left: 8px;
}

.ctl {
  min-width: 64px;
  background: rgba(38, 43, 61, 0.9);
}

.ctl-play {
  min-width: 80px;
  font-size: 26px;
}

.spacer {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
}

.time {
  margin-left: 14px;
  font-size: 22px;
  white-space: nowrap;
}

.live {
  height: 40px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: bold;
  color: #fff;
  background: #555;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.live.at-edge {
  background: #d4202c;
}

/* Bars: tall invisible hit area, thin visible track */

.bar {
  position: relative;
  height: 44px;
  cursor: pointer;
}

.bar-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 12px;
  margin-top: -6px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 6px;
}

.bar-buffer,
.bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0;
  border-radius: 6px;
}

.bar-buffer {
  background: rgba(255, 255, 255, 0.4);
}

.bar-fill {
  background: #4f8cff;
}

.bar-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  background: #fff;
  border-radius: 50%;
}

.seek-bar {
  margin-bottom: 6px;
}

.seek-tip {
  position: absolute;
  bottom: 44px;
  padding: 4px 10px;
  font-size: 18px;
  background: rgba(0, 0, 0, 0.85);
  border-radius: 6px;
  -webkit-transform: translateX(-50%);
  transform: translateX(-50%);
  white-space: nowrap;
}

.vol-bar {
  width: 160px;
}

/* ---------- History ---------- */

.history {
  margin-top: 24px;
}

.history-head h2 {
  -webkit-box-flex: 1;
  -webkit-flex: 1;
  flex: 1;
  margin: 0;
  font-size: 24px;
}

.history-list {
  margin-top: 12px;
}

.history-item {
  display: block;
  width: 100%;
  min-height: 60px;
  margin-bottom: 8px;
  padding: 12px 18px;
  font-size: 19px;
  text-align: left;
  color: #cdd3e6;
  background: #1c2030;
  border: 2px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  word-break: break-all;
  outline: none;
}

.history-item:hover,
.history-item:focus {
  border-color: #4f8cff;
}

.history-item small {
  color: #7b829c;
  margin-left: 8px;
}

.history-empty {
  color: #6c7390;
}

/* Narrow screens: let the control row wrap */
@media (max-width: 900px) {
  .ctl-row {
    -webkit-flex-wrap: wrap;
    flex-wrap: wrap;
  }
  .ctl-row > * {
    margin-bottom: 6px;
  }
  .player {
    height: auto;
    padding-bottom: 0;
    min-height: 420px;
  }
  .player video {
    position: relative;
    height: auto;
    min-height: 260px;
  }
  .controls {
    position: relative;
  }
}
