:root {
  --bg: #0e1117; --panel: #171c26; --card: #1b2130; --line: #2a3347;
  --text: #e6eaf2; --muted: #8b95aa; --accent: #66c0f4; --green: #a4d007;
  --red: #ff5b5b; --gold: #ffc857;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top, #1a2236, var(--bg) 40%); color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif; line-height: 1.5; }
a { color: var(--accent); }
.hero { text-align: center; padding: 40px 16px 16px; }
.hero h1 { margin: 0; font-size: clamp(1.5rem, 5vw, 2.4rem); }
.hero h1 span { color: var(--green); }
.hero p { margin: 6px 0 0; color: var(--muted); }
.updated { font-size: .85rem; }
main { max-width: 1200px; margin: 0 auto; padding: 0 16px 40px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; background: var(--panel); border: 1px solid var(--line);
  padding: 14px; border-radius: 12px; position: sticky; top: 0; z-index: 5; margin-top: 16px; }
.controls input, .controls select { background: #0f141d; color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 10px; font-size: .95rem; }
.controls input { flex: 1 1 220px; }
.controls label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; }
.count { color: var(--muted); font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  display: flex; flex-direction: column; transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--accent); }
.thumb { position: relative; aspect-ratio: 460 / 215; background: #0b0f16; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.badge { position: absolute; top: 8px; right: 8px; background: var(--green); color: #111; font-weight: 800;
  padding: 4px 10px; border-radius: 6px; font-size: 1.05rem; }
.score { position: absolute; top: 8px; left: 8px; background: rgba(0,0,0,.7); color: var(--gold);
  font-weight: 700; padding: 3px 8px; border-radius: 6px; font-size: .8rem; }
.body { padding: 12px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.title { margin: 0; font-size: 1rem; line-height: 1.3; overflow-wrap: anywhere; }
.price { display: flex; align-items: baseline; gap: 8px; }
.price .sale { font-size: 1.4rem; font-weight: 800; color: var(--green); }
.price .old { color: var(--muted); text-decoration: line-through; font-size: .9rem; }
.rating { font-size: .88rem; color: var(--muted); }
.rating b { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { background: #26314a; color: var(--gold); border-radius: 999px; padding: 2px 9px; font-size: .75rem; }
.actions { display: flex; gap: 8px; margin-top: auto; }
.btn { flex: 1; text-align: center; border: 0; border-radius: 8px; padding: 9px 6px; font-size: .85rem;
  font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.steam { background: linear-gradient(#66c0f4, #2a7db3); color: #08131c; }
.btn.copy { background: #262e42; color: var(--text); border: 1px solid var(--line); }
.btn.copy.done { background: var(--green); color: #111; }
.empty { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 40px 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-top: 28px; }
.panel h2 { margin-top: 0; }
.note { color: var(--muted); font-size: .85rem; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }
tr.next td { background: rgba(164, 208, 7, .1); }
.ad-slot .label { font-size: .75rem; color: var(--muted); }
.ad-box { margin: 8px 0; min-height: 110px; border: 2px dashed var(--line); border-radius: 10px;
  display: grid; place-items: center; color: var(--muted); }
.affi-row { display: flex; flex-wrap: wrap; gap: 8px; }
.affi { background: #262e42; padding: 8px 12px; border-radius: 8px; text-decoration: none; font-size: .88rem; }
footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 20px 16px 40px; }
@media (max-width: 520px) { .grid { grid-template-columns: 1fr; } .controls { position: static; } }
