@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYREGULAR.OTF") format("opentype");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYMEDIUM.OTF") format("opentype");
  font-weight: 500;
  font-style: normal;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYBOLD.OTF") format("opentype");
  font-weight: 700;
  font-style: normal;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYBLACKITALIC.OTF") format("opentype");
  font-weight: 900;
  font-style: italic;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYHEAVYITALIC.OTF") format("opentype");
  font-weight: 900;
  font-style: italic;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYLIGHTITALIC.OTF") format("opentype");
  font-weight: 300;
  font-style: italic;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYSEMIBOLDITALIC.OTF") format("opentype");
  font-weight: 600;
  font-style: italic;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYTHINITALIC.OTF") format("opentype");
  font-weight: 100;
  font-style: italic;
}
@font-face {
  font-family: "SF Pro Display";
  src: url("SFPRODISPLAYULTRALIGHTITALIC.OTF") format("opentype");
  font-weight: 200;
  font-style: italic;
}

:root {
  --bg: #140a0a;
  --card: #241012;
  --panel: #32161a;
  --text: #fff0f0;
  --muted: #d0a6a6;
  --accent: #e12020;
  --accent2: #ff5c3a;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: radial-gradient(1200px 800px at 50% -10%, #4a1414 0%, var(--bg) 60%);
  color: var(--text);
  font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
  padding: 32px 20px 140px;
  position: relative;
  overflow-x: hidden;
}

#rain {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

button, input { font-family: inherit; }

.logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin: 0 0 28px;
  color: var(--text);
  position: relative;
  z-index: 1;
}
.logo span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.filter {
  width: 100%;
  max-width: 400px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}
.filter-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 7px;
}
.filter-row {
  display: flex;
  gap: 8px;
}
.user-input {
  flex: 1;
  background: var(--card);
  border: 1px solid #3a2020;
  color: var(--text);
  font-size: 14px;
  padding: 11px 14px;
  border-radius: 12px;
  outline: none;
}
.user-input:focus { border-color: var(--accent); }
.user-input::placeholder { color: #8a6060; }
.user-input::-webkit-search-cancel-button { display: none; }
.rand-user {
  width: 42px;
  border: 1px solid #3a2020;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  font-size: 18px;
  border-radius: 12px;
  cursor: pointer;
  line-height: 1;
}
.rand-user:hover { filter: brightness(1.08); }
.clear {
  width: 42px;
  border: 1px solid #3a2020;
  background: var(--card);
  color: var(--muted);
  font-size: 20px;
  border-radius: 12px;
  cursor: pointer;
  line-height: 1;
}
.clear:hover { border-color: var(--accent2); color: var(--accent2); }

.stage {
  width: 100%;
  max-width: 400px;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.card {
  width: 100%;
  background: var(--card);
  border: 1px solid #3a2020;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.thumb-link {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--panel);
  overflow: hidden;
}
.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.body { padding: 16px 18px 18px; }

.title {
  font-size: 19px;
  margin: 0 0 6px;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

.desc {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.creator {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  min-width: 0;
}
.creator:hover { color: var(--accent); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--panel);
  flex-shrink: 0;
}

.stats {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}
.stat { display: flex; align-items: center; gap: 4px; }

.open {
  display: block;
  text-align: center;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 12px;
  border-radius: 12px;
}
.open:hover { filter: brightness(1.08); }

.empty {
  display: none;
  color: var(--muted);
  font-size: 16px;
  padding: 80px 0;
}
.card.spinning .thumb { visibility: hidden; }

.reroll {
  position: fixed;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 800;
  padding: 14px 34px;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(225, 32, 32, 0.45);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 2;
}
.reroll:hover { transform: translateX(-50%) translateY(-2px); box-shadow: 0 14px 38px rgba(225, 32, 32, 0.6); }
.reroll:active { transform: translateX(-50%) scale(0.97); }
.reroll:disabled { opacity: 0.6; cursor: default; }


.stage-shell {
  width: 100%;
  max-width: 1040px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  position: relative;
  z-index: 1;
}

.content {
  display: block;
  flex: 0 0 auto;
  border: 0;
  border-radius: 12px;
  background: rgba(36, 16, 18, 0.55);
}
.content-square { width: 300px; height: 300px; }
.content-vertical { width: 160px; height: 600px; }
.content-horizontal {
  width: min(728px, 100%);
  height: 90px;
  margin: 24px auto 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 920px) {
  .stage-shell { max-width: 728px; flex-direction: column; gap: 22px; }
  .stage { order: 1; }
  .content-square { display: block; order: 2; width: min(300px, calc(100vw - 40px)); height: auto; aspect-ratio: 1; }
  .content-vertical { display: none; }
}
@media (max-width: 500px) {
  .content-horizontal { height: 90px; }
}
