/* ═══════════════════════════════════════════════════════════
   ninkd Tattoo Generator – Stylesheet (Light Theme)
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500&family=DM+Mono:wght@400;500&display=swap');

.tg-wrap {
  font-family: 'DM Mono', 'Courier New', monospace;
  color: #1a1a1a;
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

/* ── Header ──────────────────────────────────────────────── */
.tg-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.tg-header-label {
  font-size: 10px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #aaa;
  margin-bottom: 10px;
}

.tg-header-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(34px, 6vw, 54px);
  font-weight: 400;
  line-height: 1.1;
  color: #111;
}

.tg-header-sub {
  margin-top: 10px;
  font-size: 12px;
  color: #888;
  letter-spacing: 0.3px;
}

/* ── Generator Box ───────────────────────────────────────── */
.tg-gen-box {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  padding: 1.25rem;
  margin-bottom: 2rem;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.tg-gen-row {
  display: flex;
  gap: 10px;
}

.tg-input {
  flex: 1;
  background: #fcfcfc;
  border: 1px solid #ddd;
  border-radius: 9px;
  padding: 13px 15px;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  color: #1a1a1a;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tg-input::placeholder { color: #bbb; }

.tg-input:focus {
  border-color: #999;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.05);
}

.tg-btn {
  background: #1a1a1a;
  color: #fcfcfc;
  border: none;
  border-radius: 9px;
  padding: 13px 22px;
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.1s;
}

.tg-btn:hover  { opacity: 0.8; }
.tg-btn:active { transform: scale(0.97); }
.tg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* ── Status ──────────────────────────────────────────────── */
.tg-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #888;
  min-height: 20px;
  margin-top: 10px;
}

.tg-spinner {
  display: inline-block;
  width: 12px; height: 12px;
  border: 1.5px solid #ddd;
  border-top-color: #555;
  border-radius: 50%;
  animation: tg-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* ── Preview ─────────────────────────────────────────────── */
.tg-preview {
  display: none;
  margin-top: 1.25rem;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
}

.tg-preview.visible { display: block; }

.tg-preview-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  display: block;
  cursor: zoom-in;
}

.tg-preview-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 15px;
  background: #f8f8f8;
  border-top: 1px solid #eee;
  gap: 12px;
}

.tg-preview-prompt {
  font-size: 10px;
  color: #aaa;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.tg-save-btn {
  background: none;
  border: 1px solid #ccc;
  border-radius: 7px;
  padding: 6px 14px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.tg-save-btn:hover {
  background: #f0f0f0;
  border-color: #999;
}

/* ── Tabs ────────────────────────────────────────────────── */
.tg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 1.25rem;
}

.tg-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 9px 18px 11px;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #aaa;
  cursor: pointer;
  margin-bottom: -1px;
  transition: color 0.15s;
}

.tg-tab:hover  { color: #666; }
.tg-tab.active { color: #111; border-bottom-color: #111; }

/* ── Gallery ─────────────────────────────────────────────── */
.tg-gallery        { display: none; }
.tg-gallery.active { display: block; }

.tg-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: #bbb;
  font-size: 12px;
  line-height: 2;
}

/* ── Card ────────────────────────────────────────────────── */
.tg-card {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid #eee;
  border-radius: 12px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.tg-card:hover {
  border-color: #ccc;
  box-shadow: 0 2px 8px rgba(0,0,0,0.07);
}

.tg-card-rank {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: #ccc;
  width: 28px;
  text-align: center;
  flex-shrink: 0;
}

.tg-card-thumb {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 9px;
  border: 1px solid #eee;
  background: #fff;
  flex-shrink: 0;
  transition: transform 0.15s;
}

.tg-card:hover .tg-card-thumb { transform: scale(1.04); }

.tg-card-info { flex: 1; min-width: 0; }

.tg-card-idea {
  font-size: 13px;
  font-weight: 500;
  color: #1a1a1a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.tg-card-date {
  font-size: 10px;
  color: #bbb;
  letter-spacing: 0.3px;
  margin-bottom: 9px;
}

/* ── Votes ───────────────────────────────────────────────── */
.tg-votes {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tg-vote-btn {
  background: #f8f8f8;
  border: 1px solid #e8e8e8;
  border-radius: 7px;
  padding: 4px 12px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: #888;
  cursor: pointer;
  transition: all 0.15s;
}

.tg-vote-btn:hover { border-color: #bbb; color: #333; }

.tg-vote-btn.tg-up   { color: #1a7a5a; background: #eaf6f2; border-color: #a3d9c7; }
.tg-vote-btn.tg-down { color: #b84020; background: #fdf0ec; border-color: #f0b9a8; }

.tg-score {
  font-size: 14px;
  font-weight: 500;
  min-width: 26px;
  text-align: center;
  color: #333;
}

/* ── Lightbox ────────────────────────────────────────────── */
.tg-lb {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 99999;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  cursor: zoom-out;
  backdrop-filter: blur(4px);
}

.tg-lb.open { display: flex; }

.tg-lb-inner {
  max-width: 700px;
  width: 100%;
  position: relative;
  cursor: default;
}

.tg-lb-img {
  width: 100%;
  border-radius: 12px;
  display: block;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.tg-lb-caption {
  margin-top: 14px;
  text-align: center;
}

.tg-lb-idea {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: #fff;
  margin-bottom: 4px;
}

.tg-lb-prompt {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  font-style: italic;
}

.tg-lb-close {
  position: absolute;
  top: -14px; right: -14px;
  width: 34px; height: 34px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 50%;
  color: #555;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: color 0.15s;
}

.tg-lb-close:hover { color: #111; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 520px) {
  .tg-gen-row { flex-direction: column; }
  .tg-tab     { padding: 8px 10px 10px; font-size: 9px; }
  .tg-lb      { padding: 1rem; }
  .tg-lb-close { top: -10px; right: -10px; }
}
