html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  background: linear-gradient(
    180deg,
    #d675ff 0%,
    #443170 57%,
    #0d183a 79%,
    #171717 100%
  );
  background-attachment: fixed;
  margin: 0;
  padding: 0;
}

.content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 50px;
  max-width: 100%;
  padding-top: 100px;
  margin: auto;
}

h2 {
  background-color: #4a4be7;
  color: #ffffff;
  padding: 10px;
  font-family: arial;
  text-align: center;
  border-radius: 5px;
  box-shadow: 4px 4px #ee9be4;
}

.btn {
  height: 50px;
  width: 150px;
  font-size: 18px;
  color: #ffffff;
  background-color: #ee9be4;
  box-shadow: 4px 4px #4a4be7;
  padding: 5px;
  border-radius: 5px;
  cursor: pointer;
  border: none;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.card {
  padding: 15px 30px;
  width: 500px;
  max-width: calc(100vw - 48px);
  text-align: center;
  background-color: #f2e6ff;
  border-radius: 5px;
  border-top: #ee9be4 5px solid;
  box-sizing: border-box;
}

button:focus {
  outline: none;
}

p {
  font-family: Segoe UI;
  font-size: 20px;
}

.author {
  font-family: Segoe UI;
  font-size: 16px;
  font-weight: bold;
  color: #4a4be7;
}

/*  Loading card  */
.loader-card {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
  min-height: 180px;
}

.loader-logo-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: #4a4be7;
  border-right-color: #ee9be4;
  animation: spin 1s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
}

.loader-ring-outer {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-bottom-color: rgba(74, 75, 231, 0.25);
  animation: spin 1.8s linear infinite reverse;
}

.loader-logo-img {
  width: 40px !important;
  height: 40px !important;
  border-radius: 50%;
  animation: logo-pulse 1.4s ease-in-out infinite;
  z-index: 1;
}

@keyframes logo-pulse {
  0%, 100% { transform: scale(1);    opacity: 1;    filter: drop-shadow(0 0 0px #4a4be7); }
  50%       { transform: scale(0.92); opacity: 0.75; filter: drop-shadow(0 0 8px #4a4be7); }
}

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

/* only target decorative quote images, not the loader logo */
.card:not(.loader-card) img {
  height: 25px;
  width: 25px;
}

.footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  padding: 15px 0;
  height: auto;
  background-color: #171717;
  color: #f2e6ff;
}

.footer center a {
  text-decoration: none;
  color: #f2e6ff;
}

.enter-hint {
  margin: 15px 0 0;
  font-family: Segoe UI;
  font-size: 12px;
  color: #9b8ab0;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  font-size: 11px;
  font-family: Segoe UI;
  color: #7c6d99;
  background: rgba(74, 75, 231, 0.08);
  border: 1px solid rgba(74, 75, 231, 0.2);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(74, 75, 231, 0.15);
  line-height: 1.4;
}

/* Quote card transition */
#quote {
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#quote.fade-out {
  opacity: 0;
  transform: translateY(10px);
}

/* Quote action buttons  */
.quote-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-family: Segoe UI;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  background: rgba(74, 75, 231, 0.1);
  color: #4a4be7;
}

.action-btn:hover  { opacity: 0.8; transform: translateY(-1px); }
.action-btn:active { transform: scale(0.96); }
.action-btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.action-btn.fav-active { color: #e74a9b; background: rgba(231, 74, 155, 0.1); }

/* Favourites trigger (top-right)  */
.fav-trigger {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 200;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.fav-trigger:hover { background: rgba(255, 255, 255, 0.25); }

.fav-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #e74a9b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  pointer-events: none;
}

/* Favourites overlay  */
.fav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 300;
}

.fav-overlay.open { display: block; }

/* Favourites panel  */
.fav-panel {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 340px;
  max-width: 90vw;
  background: #1e1030;
  z-index: 400;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.4);
}

.fav-panel.open { transform: translateX(0); }

.fav-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 14px;
  font-family: Segoe UI;
  font-size: 18px;
  font-weight: 700;
  color: #f2e6ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.fav-close {
  background: none;
  border: none;
  color: #9b8ab0;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  line-height: 1;
}

.fav-close:hover { color: #f2e6ff; }

.fav-list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 12px 0;
}

.fav-list::-webkit-scrollbar { width: 4px; }
.fav-list::-webkit-scrollbar-track { background: transparent; }
.fav-list::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 2px; }

.fav-item {
  padding: 14px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.fav-item-text {
  font-family: Segoe UI;
  font-size: 14px;
  color: #f2e6ff;
  line-height: 1.5;
  margin: 0 0 4px;
}

.fav-item-author {
  font-family: Segoe UI;
  font-size: 12px;
  color: #9b8ab0;
  font-style: italic;
  margin: 0;
  padding-right: 20px;
}

.fav-item-remove {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: #9b8ab0;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  padding: 2px 5px;
  line-height: 1;
}

.fav-item:hover .fav-item-remove { opacity: 1; }

/* always visible on touch */
@media (hover: none) {
  .fav-item-remove { opacity: 0.5; }
}

.fav-empty {
  padding: 40px 20px;
  text-align: center;
  font-family: Segoe UI;
  font-size: 14px;
  color: #6b5e80;
  line-height: 1.7;
  margin: 0;
}

/* Responsive  */
@media (max-width: 560px) {
  .content {
    gap: 30px;
    padding-top: 60px;
    padding-bottom: 80px;
  }

  .card {
    width: 100%;
    max-width: calc(100vw - 32px);
    padding: 15px 20px;
  }

  h2 { font-size: 18px; }
  p  { font-size: 17px; }

  .btn {
    width: 100%;
    max-width: 200px;
  }

  .enter-hint { display: none; }
  .enter-hint.swipe-hint { display: flex; }
  .fav-trigger { top: 12px; right: 12px; }
}
