/* SHINIGAMI — Dark theme, blood red accents, Death Note aesthetic */

:root {
  --bg: #0a0a0a;
  --bg-card: #111111;
  --bg-card-hover: #1a1a1a;
  --blood: #8b0000;
  --blood-light: #cc1100;
  --blood-glow: #ff2200;
  --text: #d4d4d4;
  --text-dim: #666;
  --text-bright: #f0f0f0;
  --bone: #e8dcc8;
  --gold: #c9a84c;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px;
}

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

h1 {
  font-family: 'Special Elite', cursive;
  font-size: 3.5rem;
  color: var(--blood-light);
  text-shadow: 0 0 30px rgba(204, 17, 0, 0.4);
  letter-spacing: 8px;
  margin-bottom: 4px;
}

.subtitle {
  font-style: italic;
  color: var(--text-dim);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

#stats-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

#stats-bar .sep {
  color: #333;
}

#stat-burned {
  color: var(--blood-light);
}

/* Wallet */
#wallet-section {
  text-align: center;
  margin: 20px 0 30px;
}

#connect-btn {
  background: transparent;
  border: 1px solid var(--blood);
  color: var(--blood-light);
  padding: 10px 28px;
  font-family: 'Special Elite', cursive;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 2px;
}

#connect-btn:hover {
  background: var(--blood);
  color: var(--text-bright);
  box-shadow: 0 0 20px rgba(139, 0, 0, 0.5);
}

#wallet-addr {
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.hidden {
  display: none !important;
}

/* Book */
#book {
  margin-bottom: 40px;
}

#book h2, #graveyard h2 {
  font-family: 'Special Elite', cursive;
  font-size: 1.6rem;
  color: var(--bone);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

/* Slot cards */
.slot {
  background: var(--bg-card);
  border: 1px solid #222;
  border-left: 3px solid #222;
  padding: 16px 20px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  transition: all 0.2s;
  cursor: default;
  position: relative;
}

.slot:hover {
  background: var(--bg-card-hover);
}

.slot.occupied {
  border-left-color: var(--blood);
}

.slot.empty {
  border-left-color: #333;
  opacity: 0.5;
  cursor: pointer;
}

.slot.empty:hover {
  opacity: 0.8;
  border-left-color: var(--blood);
}

.slot-number {
  font-family: 'Special Elite', cursive;
  color: var(--text-dim);
  font-size: 0.85rem;
  min-width: 30px;
}

.slot-content {
  flex: 1;
  margin: 0 16px;
}

.slot-name {
  font-family: 'Special Elite', cursive;
  font-size: 1.3rem;
  color: var(--blood-light);
  text-shadow: 0 0 10px rgba(204, 17, 0, 0.2);
}

.slot-wish {
  font-style: italic;
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 4px;
  line-height: 1.4;
}

.slot-meta {
  font-size: 0.8rem;
  color: #444;
  margin-top: 6px;
}

.slot-right {
  text-align: right;
  min-width: 100px;
}

.slot-amount {
  font-family: 'Special Elite', cursive;
  color: var(--gold);
  font-size: 1rem;
}

.slot-replace-cost {
  font-size: 0.75rem;
  color: #555;
  margin-top: 2px;
}

.slot-action {
  margin-top: 8px;
}

.btn-write, .btn-replace {
  background: transparent;
  border: 1px solid var(--blood);
  color: var(--blood-light);
  padding: 4px 14px;
  font-family: 'Special Elite', cursive;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-write:hover, .btn-replace:hover {
  background: var(--blood);
  color: white;
}

.empty-text {
  color: #333;
  font-style: italic;
  font-size: 0.95rem;
}

/* Modal */
#modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
}

#modal-content {
  background: #111;
  border: 1px solid var(--blood);
  padding: 30px;
  max-width: 480px;
  width: 90%;
  position: relative;
}

.close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1.5rem;
  cursor: pointer;
}

.close-btn:hover {
  color: var(--blood-light);
}

#modal-content h3 {
  font-family: 'Special Elite', cursive;
  color: var(--blood-light);
  font-size: 1.4rem;
  margin-bottom: 6px;
}

#modal-info {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.field {
  margin-bottom: 16px;
  position: relative;
}

.field label {
  display: block;
  color: var(--bone);
  font-size: 0.9rem;
  margin-bottom: 6px;
  font-family: 'Special Elite', cursive;
  letter-spacing: 1px;
}

.optional {
  color: #555;
  font-family: 'Crimson Text', serif;
}

.field input, .field textarea {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #333;
  color: var(--text-bright);
  padding: 10px 12px;
  font-family: 'Crimson Text', serif;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

.field input:focus, .field textarea:focus {
  border-color: var(--blood);
}

.charcount {
  position: absolute;
  right: 8px;
  bottom: 8px;
  font-size: 0.75rem;
  color: #444;
}

.hint {
  font-size: 0.8rem;
  color: var(--gold);
  margin-top: 4px;
}

#submit-btn {
  width: 100%;
  background: var(--blood);
  border: none;
  color: white;
  padding: 12px;
  font-family: 'Special Elite', cursive;
  font-size: 1.1rem;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.3s;
}

#submit-btn:hover {
  background: var(--blood-light);
  box-shadow: 0 0 25px rgba(204, 17, 0, 0.4);
}

#submit-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.error {
  color: var(--blood-light);
  font-size: 0.9rem;
  margin-top: 10px;
  text-align: center;
}

/* Graveyard */
#graveyard {
  border-top: 1px solid #1a1a1a;
  padding-top: 30px;
  margin-bottom: 40px;
}

.graveyard-desc {
  color: #444;
  font-style: italic;
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.grave {
  background: #0d0d0d;
  border-left: 2px solid #222;
  padding: 12px 16px;
  margin-bottom: 6px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.grave:hover {
  opacity: 0.8;
}

.grave-name {
  font-family: 'Special Elite', cursive;
  color: #666;
  font-size: 1rem;
  text-decoration: line-through;
}

.grave-wish {
  font-style: italic;
  color: #444;
  font-size: 0.85rem;
}

.grave-meta {
  font-size: 0.75rem;
  color: #333;
  margin-top: 4px;
}

/* Footer */
footer {
  text-align: center;
  padding: 30px 0;
  border-top: 1px solid #1a1a1a;
}

footer p {
  color: #444;
  font-size: 0.85rem;
}

footer a {
  color: var(--blood-light);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.footer-sub {
  margin-top: 6px;
  font-size: 0.75rem !important;
  color: #333 !important;
}

/* Responsive */
@media (max-width: 600px) {
  h1 {
    font-size: 2.5rem;
    letter-spacing: 4px;
  }

  .slot {
    flex-wrap: wrap;
  }

  .slot-right {
    width: 100%;
    text-align: left;
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
}
