/* styles.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #fff;
  overflow-x: hidden;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Tab menü */
.tabs {
  display: flex;
  gap: 0;
  padding: 0.75rem 1rem 0;
  width: 100%;
  max-width: min(90vw, 480px);
  margin: 0 auto;
}
.tab {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.8);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 500;
  cursor: pointer;
  border-radius: 12px 12px 0 0;
  transition: background 0.2s, color 0.2s;
}
.tab:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.tab.active {
  background: rgba(255, 182, 193, 0.25);
  color: #fff;
}
.tab-panel {
  display: none;
  flex: 1;
  width: 100%;
  max-width: min(90vw, 520px);
  margin: 0 auto;
  padding: 1rem;
}
.tab-panel.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.container {
  text-align: center;
  padding: clamp(1rem, 5vw, 2rem);
  max-width: min(90vw, 480px);
  width: 100%;
}

.title {
  font-size: clamp(1.1rem, 4vw, 1.8rem);
  font-weight: 300;
  letter-spacing: 0.05em;
  margin-bottom: clamp(1rem, 4vw, 1.5rem);
  opacity: 0.95;
  line-height: 1.3;
}

.photo-wrapper {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

#photo {
  width: min(320px, 85vw);
  height: min(320px, 85vw);
  max-width: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 182, 193, 0.6);
  box-shadow: 0 0 40px rgba(255, 182, 193, 0.3),
              0 0 80px rgba(255, 105, 180, 0.15);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
}

#photo:hover {
  transform: scale(1.03);
  box-shadow: 0 0 50px rgba(255, 182, 193, 0.45),
              0 0 100px rgba(255, 105, 180, 0.25);
}

#photo:active {
  transform: scale(0.98);
}

.compliment {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: clamp(0.75rem, 3vw, 1rem) clamp(1rem, 4vw, 1.5rem);
  background: rgba(255, 182, 193, 0.95);
  color: #1a1a2e;
  border-radius: 12px;
  font-size: clamp(0.9rem, 2.8vw, 1.3rem);
  font-weight: 600;
  white-space: normal;
  max-width: min(90vw, 280px);
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  z-index: 10;
  animation: popIn 0.4s ease;
  word-wrap: break-word;
}

.compliment.hidden {
  display: none;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  70% {
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.hint {
  margin-top: clamp(1rem, 4vw, 1.5rem);
  font-size: clamp(0.85rem, 2.5vw, 0.95rem);
  opacity: 0.8;
  line-height: 1.4;
  padding: 0 0.5rem;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1000;
}

/* Fotoğraf eşleştirme oyunu */
.game-container {
  text-align: center;
  width: 100%;
}
.game-title {
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 400;
  margin-bottom: 0.5rem;
}
.game-hint {
  font-size: 0.9rem;
  opacity: 0.85;
  margin-bottom: 0.5rem;
}
.match-counter {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #ffb6c1;
}
.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(0.5rem, 2vw, 0.75rem);
  max-width: 340px;
  margin: 0 auto;
}
.card {
  aspect-ratio: 1;
  border-radius: 12px;
  cursor: pointer;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.35s ease;
}
.card.flipped {
  transform: rotateY(180deg);
}
.card.matched {
  display: none !important;
  visibility: hidden !important;
}
.card-face {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid rgba(255, 182, 193, 0.4);
}
.card-back {
  background: linear-gradient(145deg, #2a2a4e, #1a1a2e);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-front {
  transform: rotateY(180deg);
}

/* Eşleşme modal — ortadaki resim */
.match-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  animation: fadeIn 0.3s ease;
}
.match-modal.hidden {
  display: none;
}
.match-modal-content {
  text-align: center;
  animation: popIn 0.4s ease;
}
.match-photo {
  width: min(220px, 70vw);
  height: min(220px, 70vw);
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid rgba(255, 182, 193, 0.8);
  box-shadow: 0 0 40px rgba(255, 182, 193, 0.4);
}
.match-text {
  margin-top: 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffb6c1;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobil: küçük ekranlar */
@media (max-width: 380px) {
  .container {
    padding: 0.75rem;
  }
  .title {
    font-size: 1.05rem;
  }
  #photo {
    width: min(280px, 88vw);
    height: min(280px, 88vw);
  }
  .compliment {
    font-size: 0.9rem;
    max-width: 85vw;
  }
  .cards-grid {
    gap: 0.4rem;
    max-width: 280px;
  }
  .tab {
    padding: 0.6rem 0.5rem;
    font-size: 0.8rem;
  }
}

/* Yatay (landscape) mobil */
@media (max-height: 500px) and (orientation: landscape) {
  .container {
    padding: 0.5rem;
  }
  .title {
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
  .hint {
    margin-top: 0.5rem;
    font-size: 0.8rem;
  }
  #photo {
    width: min(180px, 35vh);
    height: min(180px, 35vh);
  }
}
