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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #050505;
  color: #f5f5f5;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px 24px 40px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.subtitle {
  color: #888;
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.45;
}

.heart-button {
  background: radial-gradient(circle at 35% 30%, #ff7a8a, #e63946 45%, #b91c1c);
  color: white;
  height: 150px;
  border-radius: 28px;
  font-size: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 20px auto 12px;
  width: 150px;
  border: none;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(230, 57, 70, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  user-select: none;
}

.heart-button:active {
  transform: scale(0.95);
  box-shadow: 0 8px 24px rgba(230, 57, 70, 0.5);
}

.heart-button.sent {
  animation: heartPop 0.45s ease;
}

@keyframes heartPop {
  0% { transform: scale(1); }
  35% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 16px 0 8px;
}

.choice-btn {
  aspect-ratio: 1;
  border: 2px solid #2a2a2a;
  background: #1a1a1a;
  border-radius: 20px;
  font-size: 44px;
  cursor: pointer;
  transition: all 0.12s ease;
  user-select: none;
}

.choice-btn:active,
.choice-btn.selected {
  border-color: #e63946;
  background: #2a1518;
  transform: scale(0.96);
}

.mood-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0;
}

.mood-btn {
  padding: 16px 10px;
  border: 2px solid #2a2a2a;
  background: #1a1a1a;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 550;
  color: #eee;
  cursor: pointer;
  transition: all 0.12s;
}

.mood-btn:active,
.mood-btn.selected {
  border-color: #e63946;
  background: #2a1518;
}

.status {
  text-align: center;
  color: #777;
  margin-top: 12px;
  font-size: 14px;
  min-height: 20px;
}

.waiting {
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.result-emoji {
  font-size: 68px;
  text-align: center;
  margin: 8px 0 4px;
}

.result-text {
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 16px;
}

.vs {
  display: flex;
  justify-content: space-around;
  align-items: center;
  margin: 16px 0 24px;
  font-size: 52px;
}

.vs div {
  text-align: center;
}

.vs small {
  display: block;
  font-size: 13px;
  color: #777;
  margin-top: 4px;
}

.big-button, .secondary {
  width: 100%;
  padding: 18px;
  border: none;
  border-radius: 16px;
  font-size: 16.5px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s;
  touch-action: manipulation;
}

.big-button {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: white;
  margin-top: 12px;
  box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
}

.big-button:active { transform: scale(0.98); }

.secondary {
  background: #1c1c1c;
  color: #ddd;
  margin-top: 10px;
  border: 1px solid #2a2a2a;
}

.secondary:active { background: #252525; }

input {
  width: 100%;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: white;
  font-size: 18px;
  text-align: center;
  letter-spacing: 4px;
  margin: 12px 0;
}

.pair-code {
  font-size: 40px;
  letter-spacing: 10px;
  text-align: center;
  margin: 12px 0 4px;
  font-weight: 650;
  color: #e63946;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f1f1f;
  color: white;
  padding: 14px 22px;
  border-radius: 24px;
  font-size: 14.5px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
  z-index: 100;
  border: 1px solid #333;
}

.toast.show { opacity: 1; }

/* Keep upright on stand */
@media (orientation: landscape) {
  #app {
    transform: rotate(90deg);
    transform-origin: center center;
    width: 100vh;
    height: 100vw;
    max-width: none;
    position: absolute;
    top: 50%;
    left: 50%;
    margin-left: -50vh;
    margin-top: -50vw;
  }
}