:root {
  --bg-top: #1c1726;
  --bg-bottom: #3a2740;
  --ink: #ece7f2;
  --muted: #b3a6c4;
  --panel: #2a2335;
  --panel-edge: #4a3d59;
  --accent: #b98cd6;

  --white: #f4f0dc;
  --blue: #6ea4d8;
  --black: #8b8390;
  --red: #d77a6b;
  --green: #79b18a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.home {
  max-width: 760px;
  margin: 0 auto;
  padding: 22vh 24px 80px;
  text-align: center;
}

h1 {
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.25;
  margin: 0 0 2rem;
}
h1 strong {
  font-weight: 700;
}

.search {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #211b2c;
  border: 1px solid var(--panel-edge);
  border-radius: 10px;
  padding: 0 18px;
  height: 64px;
}
.search-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #2a1f33;
  font-size: 1.2rem;
}
.search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 1.1rem;
  outline: none;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 18px 0 22px;
}
.actions button {
  font: inherit;
  font-weight: 700;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--panel-edge);
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.actions button:hover:not(:disabled) {
  background: rgba(185, 140, 214, 0.25);
  border-color: var(--accent);
}
.actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.links {
  list-style: none;
  margin: 0;
  padding: 0;
  color: var(--muted);
  line-height: 2.1;
}
.links a {
  color: var(--muted);
}
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  background: var(--blue);
  color: #122;
  border-radius: 5px;
  padding: 1px 7px;
  margin-right: 6px;
  vertical-align: middle;
}

/* ---- random card ---- */
.result {
  margin-top: 36px;
}
.htmx-request#result {
  opacity: 0.5;
}

.card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 20px;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--panel-edge);
  border-left: 6px solid var(--card-color, var(--accent));
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}
.color-white {
  --card-color: var(--white);
}
.color-blue {
  --card-color: var(--blue);
}
.color-black {
  --card-color: var(--black);
}
.color-red {
  --card-color: var(--red);
}
.color-green {
  --card-color: var(--green);
}

.card-art {
  width: 100%;
  height: auto;
  border-radius: 10px;
  background: #181320;
  object-fit: contain;
}
.card-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.card-head h2 {
  margin: 0;
  font-size: 1.5rem;
}
.reminder {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #2a1f33;
  font-size: 0.9rem;
}

.value {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.die {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 4px;
  border-radius: 6px;
  font-weight: 700;
  background: #f4f0dc;
  color: #2a1f33;
}
.value.variable .die {
  background: #3a3340;
  color: #f4f0dc;
  border: 1px solid #6c6076;
}
.value-sep {
  color: var(--muted);
  margin: 0 2px;
}

.meta {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.pill {
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--panel-edge);
  border-radius: 20px;
  padding: 3px 10px;
  color: var(--muted);
}
.pill.timing {
  color: var(--ink);
}

.effect {
  margin: 0;
  line-height: 1.5;
}
.effect em,
.notes em {
  color: var(--muted);
  font-style: italic;
}

.notes summary {
  cursor: pointer;
  color: var(--muted);
}
.notes ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.5;
}

.card-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  border-top: 1px solid var(--panel-edge);
  padding-top: 10px;
}

@media (max-width: 560px) {
  .card {
    grid-template-columns: 1fr;
  }
  h1 {
    font-size: 2rem;
  }
}
