:root {
  --bg: #1b2838;
  --bg-elevated: #16202d;
  --card: #2a3f5a;
  --card-hover: #33526e;
  --text: #c7d5e0;
  --text-dim: #8f98a0;
  --accent: #66c0f4;
  --discount: #a4d007;
  --discount-bg: #4c6b22;
  --original: #7d8388;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
}

header {
  padding: 24px 32px 16px;
  background: var(--bg-elevated);
  border-bottom: 1px solid #0e151c;
}

h1 {
  margin: 0 0 16px;
  font-size: 24px;
}

#homeLink {
  cursor: pointer;
}

.platform-nav {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
}

.platform-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 12px;
  border: 1px solid #3c5265;
}

.platform-nav a:hover {
  color: var(--text);
}

.platform-nav a.active {
  color: #08334f;
  background: var(--accent);
  border-color: var(--accent);
}

.platform-notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 4px;
  background: #4a3f1f;
  border: 1px solid #6b5a2a;
  color: #e0c789;
  font-size: 13px;
  line-height: 1.5;
}

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.controls input,
.controls select,
.controls button {
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #4a5a6a;
  background: #16202d;
  color: var(--text);
  font-size: 14px;
}

.controls input {
  flex: 1;
  min-width: 200px;
}

#limitInput {
  flex: 0 0 140px;
  min-width: 0;
}

.controls button {
  background: var(--accent);
  color: #08334f;
  border: none;
  font-weight: 600;
  cursor: pointer;
}

.controls button:hover {
  filter: brightness(1.1);
}

.meta {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--text-dim);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  padding: 24px 32px;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
}

.card {
  display: block;
  background: var(--card);
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, background 0.15s ease;
}

.card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
}

.thumb {
  width: 100%;
  aspect-ratio: 460 / 215;
  background: #0e151c;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.body {
  padding: 12px 14px 16px;
}

.body h2 {
  font-size: 15px;
  margin: 0 0 4px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.studio {
  font-size: 12px;
  color: var(--text-dim);
  margin: 0 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.review {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 2px;
  margin: 0 0 10px;
}

.review-good {
  color: #a4d007;
  background: #354a1b;
}

.review-mixed {
  color: #e0c04c;
  background: #4a4322;
}

.review-bad {
  color: #e06c6c;
  background: #4a2626;
}

.genre-tag {
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 10px;
  border: 1px solid #3c5265;
}

.price-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.discount {
  background: var(--discount-bg);
  color: var(--discount);
  font-weight: 700;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 2px;
  margin-right: auto;
}

.original {
  color: var(--original);
  text-decoration: line-through;
  font-size: 13px;
}

.final {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}
