*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-color: #fbd4da;
  --field-bg: #fbd4da;
  --field-hover: #f3c3cb;
  --field-focus: #efbcc5;
  --title-color: #f9331a;
  --border-tint: rgba(115, 8, 0, 0.35);
  --shadow-tint: rgba(74, 4, 0, 0.25);
}

/* Tema Friendship Tester */
.app.mode-friend {
  --bg-color: #fdf1c7;
  --field-bg: #fdf1c7;
  --field-hover: #f6e4aa;
  --field-focus: #f1dc96;
  --title-color: #e08600;
  --border-tint: rgba(122, 66, 0, 0.35);
  --shadow-tint: rgba(92, 48, 0, 0.24);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-color);
}

/* =========================================================
   SELECTOR PĂTRĂȚOS MARE ~2012 (DOAR ALB CU NEGRU)
   ========================================================= */
.selector-bar {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background-color: #ffffff;
  border: 2px solid #000000;
  border-radius: 0;
  box-shadow: 0 3px 0 #000000;
  z-index: 25;
}

.ui-select {
  height: 36px;
  padding: 0 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 600;
  color: #000000;
  background-color: #ffffff;
  border: 2px solid #000000;
  border-radius: 0;
  cursor: pointer;
  outline: none;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.ui-select:hover:not(:disabled) {
  background-color: #000000;
  color: #ffffff;
}

.ui-select:disabled {
  background-color: #e5e5e5;
  color: #666666;
  border-color: #666666;
  cursor: not-allowed;
}

.ui-apply-btn {
  height: 36px;
  padding: 0 16px;
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
  background-color: #000000;
  border: 2px solid #000000;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.ui-apply-btn:hover {
  background-color: #ffffff;
  color: #000000;
}

.ui-apply-btn:active {
  background-color: #222222;
  color: #ffffff;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 100;
}

.modal-backdrop.open {
  display: flex;
  animation: classicFadeIn 0.22s linear forwards;
}

.modal-card {
  width: 100%;
  max-width: 450px;
  background-color: #ffffff;
  border: 3px solid #000000;
  border-radius: 0;
  box-shadow: 0 6px 0 #000000;
  overflow: hidden;
}

.modal-header {
  padding: 13px 16px;
  background-color: #000000;
  border-bottom: 2px solid #000000;
}

.modal-title {
  font-size: 1.12rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.3px;
}

.modal-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background-color: #ffffff;
}

.option-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mode-card {
  padding: 14px 12px;
  border: 2px solid #000000;
  border-radius: 0;
  background-color: #ffffff;
  color: #000000;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.mode-card:hover {
  background-color: #eeeeee;
}

.mode-card.selected {
  background-color: #000000;
  color: #ffffff;
}

.mode-card-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.mode-card-sub {
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.82;
}

.pair-section {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.pair-section.visible {
  display: flex;
}

.pair-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: #000000;
}

.pair-pills {
  display: flex;
  gap: 8px;
}

.pair-pill {
  flex: 1;
  padding: 10px 6px;
  border: 2px solid #000000;
  border-radius: 0;
  background-color: #ffffff;
  color: #000000;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.pair-pill:hover {
  background-color: #eeeeee;
}

.pair-pill.active {
  background-color: #000000;
  color: #ffffff;
}

.modal-continue-btn {
  width: 100%;
  height: 44px;
  border: 2px solid #000000;
  border-radius: 0;
  background-color: #000000;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.12s linear, color 0.12s linear;
}

.modal-continue-btn:hover {
  background-color: #ffffff;
  color: #000000;
}

.modal-continue-btn:active {
  background-color: #222222;
  color: #ffffff;
}

/* =========================================================
   INTERFAȚA PRINCIPALĂ
   ========================================================= */
.screen {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  background-color: var(--bg-color);
}

.screen.active {
  display: flex;
}

.screen-form {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: clamp(42px, 5.2vh, 54px);
}

.title {
  font-family: 'Architects Daughter', cursive, sans-serif;
  font-size: clamp(2.65rem, 12.2vw, 4.9rem);
  font-weight: 400;
  color: var(--title-color);
  line-height: 1;
  letter-spacing: -1px;
  white-space: nowrap;
  user-select: none;
  z-index: 4;
}

.title-symbol {
  display: inline-block;
  color: var(--title-color);
  font-size: 0.96em;
  transform: translateY(2px);
  margin-right: 1px;
}

.shape-area {
  position: relative;
  width: 100%;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -14px;
}

.center-svg {
  display: none;
  width: min(95vw, 485px);
  height: auto;
}

.center-svg.active-shape {
  display: block;
}

.result-shape-area .center-svg {
  width: min(97vw, 505px);
}

.classic-fade-in {
  animation: classicFadeIn 0.22s linear forwards;
}

@keyframes classicFadeIn {
  0% { opacity: 0.35; }
  100% { opacity: 1; }
}

.inputs-overlay {
  position: absolute;
  top: 47.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(74vw, 355px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  z-index: 5;
}

.app.mode-friend .inputs-overlay {
  top: 52.5%;
  width: min(64vw, 295px);
  gap: 16px;
}

.field-box {
  width: 100%;
  height: 62px;
  background-color: var(--field-bg);
  border: 1px solid var(--border-tint);
  border-radius: 1px;
  text-align: center;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.42rem;
  font-weight: 400;
  color: #111111;
  outline: none;
  box-shadow: 0 4px 9px var(--shadow-tint);
  transition: background-color 0.12s linear;
}

.app.mode-friend .field-box {
  height: 52px;
  font-size: 1.28rem;
}

.field-box:hover {
  background-color: var(--field-hover);
}

.field-box:focus {
  background-color: var(--field-focus);
}

.start-btn {
  margin-top: 2px;
  width: 196px;
  height: 54px;
  background-color: #ffffff;
  border: 1px solid var(--border-tint);
  border-radius: 1px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.45rem;
  font-weight: 400;
  color: #111111;
  cursor: pointer;
  box-shadow: 0 4px 9px var(--shadow-tint);
  transition: background-color 0.12s linear;
}

.app.mode-friend .start-btn {
  width: 168px;
  height: 46px;
  font-size: 1.32rem;
}

.start-btn:hover {
  background-color: #e6e1e2;
}

.start-btn:active,
.start-btn.is-pressed {
  background-color: #d5ced0;
}

.person-left,
.person-right {
  position: absolute;
  bottom: 0;
  height: clamp(220px, 32.5vh, 300px);
  width: auto;
  pointer-events: none;
  z-index: 6;
}

.person-left {
  left: clamp(6px, 5vw, 34px);
}

.person-right {
  right: clamp(6px, 5vw, 34px);
}

@media (min-width: 560px) {
  .person-left {
    left: calc(50% - 245px);
  }
  .person-right {
    right: calc(50% - 245px);
  }
}

.screen-result {
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.percent-display {
  position: absolute;
  top: 47.5%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: clamp(2.8rem, 13.5vw, 4.5rem);
  font-weight: 400;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
  z-index: 6;
  user-select: none;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.app.mode-friend .percent-display {
  top: 52%;
}

/* =========================================================
   ANIMAȚII MESAJE REZULTAT
   ========================================================= */
.status-banner {
  display: none;
  position: absolute;
  top: clamp(22px, 6.5vh, 58px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 18px;
  font-family: 'Architects Daughter', cursive, sans-serif;
  font-size: clamp(1.7rem, 7.2vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  background-color: #000000;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  z-index: 12;
  pointer-events: none;
  letter-spacing: 1px;
}

.status-banner.show {
  display: block;
  animation: bannerPulse 0.65s linear infinite;
}

@keyframes bannerPulse {
  0% {
    transform: translateX(-50%) scale(0.93) rotate(-2deg);
    opacity: 0.85;
  }
  50% {
    transform: translateX(-50%) scale(1.07) rotate(2deg);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(0.93) rotate(-2deg);
    opacity: 0.85;
  }
}
