@import url('https://fonts.googleapis.com/css2?family=Creepster&family=Noto+Sans+KR:wght@300;400;700&display=swap');

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --purple: #9b59b6;
  --pink: #e91e8c;
  --ghost-white: #e8e8f0;
  --tombstone: #2c2c54;
  --tombstone-border: #706fd3;
  --gold: #f9ca24;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ghost-white);
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Floating ghost particles */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(155,89,182,0.3), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(233,30,140,0.2), transparent),
    radial-gradient(2px 2px at 60% 20%, rgba(155,89,182,0.3), transparent),
    radial-gradient(2px 2px at 80% 60%, rgba(233,30,140,0.2), transparent),
    radial-gradient(3px 3px at 10% 80%, rgba(249,202,36,0.15), transparent),
    radial-gradient(3px 3px at 90% 40%, rgba(249,202,36,0.15), transparent);
  pointer-events: none;
  z-index: 0;
  animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
  0% { opacity: 0.5; }
  100% { opacity: 1; }
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  z-index: 1;
}

/* Header */
header {
  text-align: center;
  padding: 40px 0 30px;
}

header h1 {
  font-family: 'Creepster', cursive;
  font-size: 3.5rem;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 20px rgba(155,89,182,0.4));
  letter-spacing: 4px;
}

header p {
  color: #888;
  margin-top: 8px;
  font-size: 0.95rem;
  font-weight: 300;
}

nav {
  text-align: center;
  margin: 20px 0 30px;
  display: flex;
  gap: 12px;
  justify-content: center;
}

nav a {
  color: var(--ghost-white);
  text-decoration: none;
  padding: 10px 24px;
  border: 1px solid var(--tombstone-border);
  border-radius: 25px;
  transition: all 0.3s;
  font-size: 0.9rem;
}

nav a:hover {
  background: var(--purple);
  border-color: var(--purple);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(155,89,182,0.4);
}

/* Graveyard Grid */
.graveyard {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
  padding: 20px 0;
}

/* Tombstone Card */
.tombstone {
  background: var(--tombstone);
  border: 1px solid var(--tombstone-border);
  border-radius: 80px 80px 12px 12px;
  padding: 30px 20px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.tombstone::before {
  content: '~';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: var(--tombstone-border);
  opacity: 0.5;
}

.tombstone:hover {
  transform: translateY(-8px);
  box-shadow:
    0 10px 30px rgba(155,89,182,0.3),
    0 0 60px rgba(155,89,182,0.1);
  border-color: var(--purple);
}

.tombstone .profile-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--tombstone-border);
  margin: 0 auto 12px;
  display: block;
  filter: grayscale(30%);
  transition: filter 0.3s;
}

.tombstone:hover .profile-pic {
  filter: grayscale(0%);
  border-color: var(--pink);
}

.tombstone .no-pic {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 3px solid var(--tombstone-border);
}

.tombstone h3 {
  font-size: 1.05rem;
  margin-bottom: 4px;
  color: var(--ghost-white);
}

.tombstone .handle {
  color: var(--purple);
  font-size: 0.8rem;
  margin-bottom: 8px;
}

.tombstone .epitaph {
  font-size: 0.78rem;
  color: #999;
  font-style: italic;
  line-height: 1.4;
}

.tombstone .rip {
  margin-top: 12px;
  font-family: 'Creepster', cursive;
  color: var(--tombstone-border);
  font-size: 0.85rem;
  letter-spacing: 3px;
}

/* Detail Page */
.grave-detail {
  max-width: 700px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--tombstone-border);
  border-radius: 20px;
  padding: 40px;
}

.grave-detail .profile-section {
  text-align: center;
  margin-bottom: 30px;
}

.grave-detail .profile-pic {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--purple);
  margin-bottom: 16px;
}

.grave-detail .no-pic-lg {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 4px solid var(--tombstone-border);
}

.grave-detail h2 {
  font-family: 'Creepster', cursive;
  font-size: 2rem;
  color: var(--ghost-white);
  letter-spacing: 2px;
}

.grave-detail .handle {
  color: var(--purple);
  font-size: 0.95rem;
}

.grave-detail .summary {
  background: rgba(155,89,182,0.1);
  border-left: 3px solid var(--purple);
  padding: 16px 20px;
  margin: 24px 0;
  border-radius: 0 8px 8px 0;
  line-height: 1.7;
}

.grave-detail .screenshot {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--tombstone-border);
  margin: 20px 0;
}

.grave-detail .meta {
  color: #666;
  font-size: 0.8rem;
  text-align: center;
  margin-top: 20px;
}

.grave-detail .epitaph-display {
  text-align: center;
  font-style: italic;
  color: var(--gold);
  font-size: 1.1rem;
  margin: 20px 0;
  padding: 16px;
  border-top: 1px solid rgba(155,89,182,0.2);
  border-bottom: 1px solid rgba(155,89,182,0.2);
}

/* Forms */
.form-container {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--tombstone-border);
  border-radius: 20px;
  padding: 40px;
}

.form-container h2 {
  font-family: 'Creepster', cursive;
  text-align: center;
  font-size: 1.8rem;
  margin-bottom: 24px;
  color: var(--purple);
  letter-spacing: 2px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: #aaa;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--tombstone);
  border: 1px solid var(--tombstone-border);
  border-radius: 10px;
  color: var(--ghost-white);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 10px rgba(155,89,182,0.2);
}

.form-group textarea {
  min-height: 100px;
  resize: vertical;
}

.form-group input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

.form-group input[type="file"]::file-selector-button {
  background: var(--purple);
  color: white;
  border: none;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  margin-right: 10px;
}

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Noto Sans KR', sans-serif;
  transition: all 0.3s;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(155,89,182,0.4);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.85rem;
}

.btn-approve {
  background: linear-gradient(135deg, #27ae60, #2ecc71);
}

.btn-reject {
  background: linear-gradient(135deg, #c0392b, #e74c3c);
}

.btn-block {
  display: block;
  width: 100%;
  text-align: center;
}

/* Admin */
.admin-card {
  background: var(--bg-card);
  border: 1px solid var(--tombstone-border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
}

.admin-card img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--tombstone-border);
}

.admin-card .info { flex: 1; }
.admin-card .info h4 { margin-bottom: 4px; }
.admin-card .info p { font-size: 0.85rem; color: #999; }

.admin-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.admin-actions input {
  padding: 8px 12px;
  background: var(--tombstone);
  border: 1px solid var(--tombstone-border);
  border-radius: 8px;
  color: var(--ghost-white);
  font-size: 0.85rem;
  width: 160px;
}

.section-title {
  font-family: 'Creepster', cursive;
  font-size: 1.4rem;
  color: var(--purple);
  margin: 30px 0 16px;
  letter-spacing: 2px;
}

/* Success page */
.success-page {
  text-align: center;
  padding: 60px 20px;
}

.success-page .ghost {
  font-size: 5rem;
  animation: float 2s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-15px); }
}

/* 404 */
.not-found {
  text-align: center;
  padding: 80px 20px;
}

.not-found h2 {
  font-family: 'Creepster', cursive;
  font-size: 4rem;
  color: var(--purple);
}

/* Empty state */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.empty .ghost-empty {
  font-size: 4rem;
  margin-bottom: 12px;
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  .container { padding: 12px; }
  header { padding: 28px 0 20px; }
  header h1 { font-size: 2.8rem; }
  .graveyard { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 18px; }
  .grave-detail { padding: 30px; }
  .admin-card { flex-wrap: wrap; }
  .admin-actions { flex-wrap: wrap; }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  header { padding: 20px 0 14px; }
  header h1 { font-size: 2rem; letter-spacing: 2px; }
  header p { font-size: 0.82rem; }
  nav { flex-wrap: wrap; gap: 8px; margin: 14px 0 20px; }
  nav a { padding: 8px 16px; font-size: 0.82rem; }
  .graveyard { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 10px 0; }
  .tombstone { padding: 18px 10px 16px; border-radius: 60px 60px 10px 10px; }
  .tombstone .profile-pic { width: 60px; height: 60px; }
  .tombstone .no-pic { width: 60px; height: 60px; font-size: 1.5rem; }
  .tombstone h3 { font-size: 0.9rem; }
  .tombstone .handle { font-size: 0.72rem; }
  .tombstone .epitaph { font-size: 0.7rem; }
  .tombstone .rip { font-size: 0.75rem; margin-top: 8px; }
  .form-container { padding: 20px 16px; margin: 0 4px; border-radius: 16px; }
  .form-container h2 { font-size: 1.4rem; margin-bottom: 18px; }
  .form-group input, .form-group textarea { padding: 10px 12px; font-size: 0.9rem; }
  .form-group label { font-size: 0.82rem; }
  .btn { padding: 10px 24px; font-size: 0.9rem; }
  .grave-detail { padding: 24px 16px; margin: 0 4px; border-radius: 16px; }
  .grave-detail h2 { font-size: 1.5rem; }
  .grave-detail .profile-pic { width: 90px; height: 90px; }
  .grave-detail .no-pic-lg { width: 90px; height: 90px; font-size: 2.2rem; }
  .grave-detail .summary { padding: 12px 14px; font-size: 0.9rem; }
  .admin-card { flex-direction: column; text-align: center; padding: 16px; gap: 12px; }
  .admin-actions { justify-content: center; flex-wrap: wrap; gap: 6px; }
  .admin-actions input { width: 100%; }
  .section-title { font-size: 1.2rem; }
  .success-page .ghost { font-size: 3.5rem; }
  .not-found h2 { font-size: 3rem; }
  .empty .ghost-empty { font-size: 3rem; }
  .back-link { font-size: 0.85rem; }
}

/* Small phones */
@media (max-width: 360px) {
  .graveyard { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .tombstone { padding: 14px 8px 12px; }
  .tombstone .profile-pic, .tombstone .no-pic { width: 50px; height: 50px; }
  header h1 { font-size: 1.7rem; }
}

/* Touch-friendly */
@media (hover: none) {
  .tombstone:active {
    transform: scale(0.97);
    transition: transform 0.1s;
  }
  nav a:active {
    background: var(--purple);
    border-color: var(--purple);
  }
  .btn:active {
    transform: scale(0.97);
  }
}

.error { color: #e74c3c; text-align: center; margin-bottom: 16px; }
.back-link { display: inline-block; margin: 20px 0; color: var(--purple); text-decoration: none; }
.back-link:hover { text-decoration: underline; }
