@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0c0f1a;
  --surface: #151a28;
  --card-bg: #1a1f32;
  --accent: #ff6b6b;
  --like: #4ecdc4;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --radius: 20px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px 48px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

header h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

header p {
  color: var(--muted);
  font-size: 1rem;
}

.input-box {
  width: 100%;
  max-width: 560px;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  height: 140px;
  border-radius: var(--radius);
  padding: 16px;
  border: 2px solid var(--surface);
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s;
}

textarea:focus {
  outline: none;
  border-color: var(--like);
}

textarea::placeholder {
  color: var(--muted);
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.controls input {
  flex: 1;
  min-width: 140px;
}

input,
button {
  padding: 14px 18px;
  border-radius: 14px;
  border: none;
  font-size: 15px;
  font-family: inherit;
}

input {
  background: var(--surface);
  color: var(--text);
  border: 2px solid transparent;
}

input:focus {
  outline: none;
  border-color: var(--like);
}

button {
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.15s, box-shadow 0.15s;
}

button:hover {
  transform: scale(1.02);
}

button:active {
  transform: scale(0.98);
}

#viewer {
  margin-top: 28px;
  width: 100%;
  max-width: 480px;
  min-height: 520px;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

#card {
  width: 100%;
  aspect-ratio: 3/4;
  max-height: 75vh;
  border-radius: 24px;
  background: var(--card-bg);
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  cursor: grab;
  user-select: none;
}

#card:active {
  cursor: grabbing;
}

#card.swipe-right {
  transition: transform 0.28s ease-out;
}

#card.swipe-left {
  transition: transform 0.28s ease-out;
}

#card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 16px;
  object-fit: contain;
  pointer-events: none;
}

#card img:not([src]),
#card img[src=""] {
  display: none;
}

/* Tinder-style overlays on card */
.card-overlay {
  position: absolute;
  top: 24px;
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-20deg);
  transition: opacity 0.2s;
  pointer-events: none;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.card-overlay.nope {
  left: 24px;
  color: var(--accent);
  border: 4px solid var(--accent);
  padding: 8px 16px;
  border-radius: 12px;
}

.card-overlay.like {
  right: 24px;
  color: var(--like);
  border: 4px solid var(--like);
  padding: 8px 16px;
  border-radius: 12px;
}

#card.drag-left .card-overlay.nope,
#card.drag-right .card-overlay.like {
  opacity: 0.9;
}

.card-badge {
  position: absolute;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  z-index: 3;
  pointer-events: none;
}

.counter-badge {
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
}

.liked-badge {
  top: 16px;
  right: 16px;
  background: rgba(78, 205, 196, 0.9);
  color: #0c0f1a;
}

.actions {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  align-items: center;
}

.actions button {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

#nope {
  background: var(--surface);
  color: var(--accent);
  border: 3px solid var(--accent);
}

#nope:hover {
  background: rgba(255, 107, 107, 0.15);
  box-shadow: 0 8px 28px rgba(255, 107, 107, 0.25);
}

#undo {
  background: var(--surface);
  color: var(--muted);
  border: 3px solid var(--muted);
  font-size: 1.75rem;
}

#undo:hover {
  color: var(--text);
  border-color: var(--text);
}

#yes {
  background: var(--like);
  color: #0c0f1a;
  border: 3px solid var(--like);
}

#yes:hover {
  box-shadow: 0 8px 28px rgba(78, 205, 196, 0.4);
}

.keyboard-hint {
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}

.keyboard-hint kbd {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  background: var(--surface);
  font-family: inherit;
  font-size: 12px;
  margin: 0 2px;
}

.export {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.export button {
  background: var(--surface);
  color: var(--text);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.export button:hover {
  border-color: var(--like);
  color: var(--like);
}

footer {
  text-align: center;
  margin-top: 40px;
  padding: 20px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
}

footer button {
  background: #ffdd00;
  color: #000;
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s;
}

footer button:hover {
  transform: scale(1.05);
}

/* Loading / empty state */
#card .placeholder-text {
  color: var(--muted);
  font-size: 1.1rem;
  padding: 24px;
  text-align: center;
}
