/* Classic 2016-style layout shared by the Games, Catalog, Download and
   Profile pages. Loaded together with /js/classic/layout.js. */
:root {
  --c-blue: #0074bd;
  --c-blue-dark: #005f9c;
  --c-link: #00a2ff;
  --c-green: #02b757;
  --c-green-dark: #029a49;
  --c-red: #d86868;
  --c-page: #e3e3e3;
  --c-card: #ffffff;
  --c-text: #191919;
  --c-muted: #757575;
  --c-faint: #b8b8b8;
  --c-line: #e3e3e3;
  --c-shadow: 0 1px 4px rgba(25, 25, 25, 0.25);
  --c-header-h: 40px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--c-page);
  color: var(--c-text);
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
}

body { display: flex; flex-direction: column; min-height: 100vh; }

a { color: var(--c-link); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
button, input, select { font-family: inherit; font-size: inherit; }

/* ---------- header ---------- */
.c-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--c-blue);
  color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
.c-header-row {
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--c-header-h);
  padding: 0 16px;
  max-width: 1200px;
  margin: 0 auto;
}
.c-logo { display: flex; align-items: center; }
.c-logo img { height: 28px; width: auto; display: block; }
.c-nav { display: flex; gap: 4px; }
.c-nav a {
  color: #fff;
  font-weight: 600;
  padding: 0 14px;
  line-height: var(--c-header-h);
  display: block;
}
.c-nav a:hover, .c-nav a.active { background: var(--c-blue-dark); text-decoration: none; }
.c-search { flex: 1; max-width: 360px; display: flex; }
.c-search input {
  flex: 1;
  min-width: 0;
  height: 26px;
  border: 0;
  border-radius: 3px 0 0 3px;
  padding: 0 8px;
  color: var(--c-text);
}
.c-search button {
  height: 26px;
  width: 32px;
  border: 0;
  border-radius: 0 3px 3px 0;
  background: #fff;
  color: var(--c-text);
  cursor: pointer;
}
.c-account { margin-left: auto; display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.c-account a.c-plain { color: #fff; font-weight: 600; }
.c-currency { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.c-menu { position: relative; }
.c-menu > button {
  background: none;
  border: 0;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
}
.c-menu-list {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  min-width: 170px;
  background: #fff;
  border-radius: 3px;
  box-shadow: var(--c-shadow);
  padding: 6px 0;
  margin: 4px 0 0;
  list-style: none;
}
.c-menu.open .c-menu-list { display: block; }
.c-menu-list a, .c-menu-list button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 14px;
  color: var(--c-text);
  background: none;
  border: 0;
  cursor: pointer;
}
.c-menu-list a:hover, .c-menu-list button:hover { background: #f2f2f2; text-decoration: none; }

/* ---------- buttons & inputs ---------- */
.c-btn {
  display: inline-block;
  border: 1px solid var(--c-faint);
  background: #fff;
  color: var(--c-text);
  border-radius: 3px;
  padding: 4px 12px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.4;
}
.c-btn:hover { border-color: var(--c-muted); text-decoration: none; }
.c-btn:disabled { color: var(--c-faint); cursor: default; border-color: var(--c-line); }
.c-btn-green { background: var(--c-green); border-color: var(--c-green); color: #fff; }
.c-btn-green:hover { background: var(--c-green-dark); border-color: var(--c-green-dark); }
.c-btn-blue { background: var(--c-link); border-color: var(--c-link); color: #fff; }
.c-select, .c-input {
  height: 34px;
  border: 1px solid var(--c-faint);
  border-radius: 3px;
  background: #fff;
  padding: 0 10px;
  color: var(--c-text);
}

/* ---------- page shell ---------- */
.c-main { flex: 1 0 auto; width: 100%; max-width: 1000px; margin: 0 auto; padding: 20px 16px 40px; }
.c-main.wide { max-width: 1200px; }
.c-title { font-size: 32px; font-weight: 400; margin: 0 0 12px; }
.c-section-title { font-size: 22px; font-weight: 400; margin: 18px 0 8px; }
.c-card { background: var(--c-card); box-shadow: var(--c-shadow); border-radius: 3px; }
.c-pad { padding: 14px 16px; }
.c-muted { color: var(--c-muted); }
.c-empty { color: var(--c-muted); padding: 30px 16px; text-align: center; }
.c-alert {
  padding: 10px 14px;
  border-radius: 3px;
  margin-bottom: 12px;
  background: #fff4e5;
  border: 1px solid #f5c98b;
}
.c-alert.error { background: #fdecea; border-color: #f0a9a4; }
.c-alert.ok { background: #e7f6ec; border-color: #8fd3a8; }

/* ---------- footer ---------- */
.c-footer { background: #fff; border-top: 1px solid var(--c-line); padding: 24px 16px; }
.c-footer-links { display: flex; justify-content: center; gap: 32px; flex-wrap: wrap; font-size: 20px; }
.c-footer-links a { color: var(--c-faint); }
.c-footer p { max-width: 760px; margin: 12px auto 0; text-align: center; font-size: 12px; color: var(--c-faint); }

/* ---------- games ---------- */
.c-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.c-filters .c-select { min-width: 165px; }
.c-game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.c-game-card { display: block; color: var(--c-text); }
.c-game-card:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(25, 25, 25, 0.35); }
.c-game-thumb { aspect-ratio: 16 / 9; background: #f2f2f2; overflow: hidden; border-radius: 3px 3px 0 0; }
.c-game-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.c-game-info { padding: 8px 6px 6px; }
.c-game-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 16px; }
.c-game-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--c-muted); }
.c-vote { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--c-muted); }
.c-vote-bar { flex: 0 0 80px; height: 4px; background: repeating-linear-gradient(90deg, #8f8f8f 0 13px, transparent 13px 16px); }

/* ---------- catalog ---------- */
.c-catalog { display: grid; grid-template-columns: 180px 1fr; gap: 20px; }
.c-cat-side h3 { font-size: 22px; font-weight: 400; margin: 0 0 6px; }
.c-cat-side ul { list-style: none; padding: 0; margin: 0 0 18px; }
.c-cat-side li { padding: 3px 0; font-size: 14px; }
.c-cat-side li a { color: var(--c-text); font-weight: 600; }
.c-cat-side li a.active { color: var(--c-link); }
.c-cat-side li.sub a { font-weight: 400; padding-left: 10px; }
.c-cat-side li .c-soon { color: var(--c-faint); font-weight: 600; cursor: default; }
.c-cat-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.c-cat-top .c-heading { color: var(--c-link); font-size: 18px; }
.c-cat-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.c-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.c-item { display: block; color: var(--c-text); }
.c-item:hover { text-decoration: none; box-shadow: 0 2px 8px rgba(25, 25, 25, 0.35); }
.c-item-thumb { aspect-ratio: 1; background: #f2f2f2; padding: 8px; border-radius: 3px 3px 0 0; }
.c-item-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.c-item-info { padding: 6px 8px 8px; font-size: 13px; }
.c-item-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-price { color: var(--c-green); font-weight: 600; display: flex; align-items: center; gap: 3px; }
.c-price.off { color: var(--c-muted); font-weight: 400; }
.c-badge-new {
  position: absolute; top: 6px; right: 6px; background: #f68802; color: #fff;
  font-size: 11px; font-weight: 600; padding: 0 5px; border-radius: 2px;
}
.c-item-thumb { position: relative; }

/* ---------- download ---------- */
.c-dl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.c-dl-card { padding: 22px 16px; text-align: center; }
.c-dl-card .c-dl-icon { height: 110px; display: flex; align-items: center; justify-content: center; }
.c-dl-card h3 { font-size: 18px; font-weight: 400; margin: 14px 0 4px; }
.c-dl-card p { margin: 0 0 12px; font-size: 13px; color: var(--c-muted); }

/* ---------- profile ---------- */
.c-profile-head { display: flex; gap: 18px; align-items: center; padding: 16px; position: relative; }
.c-avatar-circle {
  width: 128px; height: 128px; border-radius: 50%; background: #e8e8e8; overflow: hidden;
  border: 1px solid var(--c-line); flex: none; display: flex; align-items: center; justify-content: center;
}
.c-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.c-profile-name { font-size: 28px; margin: 0; display: flex; align-items: center; gap: 8px; }
.c-role { font-size: 12px; background: var(--c-link); color: #fff; padding: 1px 6px; border-radius: 2px; }
.c-online { font-size: 12px; color: var(--c-green); font-weight: 600; }
.c-blurb-line { margin: 4px 0 10px; color: var(--c-muted); font-style: italic; word-break: break-word; }
.c-counts { display: flex; gap: 28px; }
.c-counts div { text-align: center; }
.c-counts .c-label { font-size: 13px; color: var(--c-muted); }
.c-counts .c-num { font-size: 20px; color: var(--c-link); }
.c-profile-actions { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 6px; }
.c-tabs { display: flex; margin-top: 12px; }
.c-tabs button {
  flex: 1; background: #fff; border: 0; border-bottom: 3px solid transparent; padding: 8px;
  cursor: pointer; font-size: 15px; color: var(--c-text);
}
.c-tabs button.active { border-bottom-color: var(--c-link); }
.c-about { white-space: pre-wrap; word-break: break-word; }
.c-wearing { display: grid; grid-template-columns: 1fr 1fr; }
.c-wearing-avatar { display: flex; align-items: center; justify-content: center; min-height: 300px; padding: 16px; }
.c-wearing-avatar img { width: 100%; max-width: 280px; height: 280px; object-fit: contain; }
.c-wearing-items { background: #4a7aa7; padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; align-content: start; }
.c-wearing-items a { background: #fff; border-radius: 3px; aspect-ratio: 1; padding: 6px; display: block; }
.c-wearing-items img { width: 100%; height: 100%; object-fit: contain; }
.c-wearing-items .c-empty { color: #fff; grid-column: 1 / -1; }
.c-friend-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; padding: 16px; }
.c-friend { text-align: center; font-size: 12px; color: var(--c-muted); }
.c-friend .c-avatar-circle { width: 64px; height: 64px; margin: 0 auto 4px; }
.c-friend-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.c-badges { display: flex; gap: 12px; flex-wrap: wrap; padding: 16px; }
.c-badge { width: 84px; text-align: center; font-size: 12px; }
.c-badge-icon {
  width: 84px; height: 84px; border: 1px solid var(--c-line); border-radius: 3px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.c-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); text-align: center; padding: 16px; }
.c-stats .c-label { color: var(--c-faint); font-size: 13px; }
.c-stats .c-num { font-size: 16px; }

/* ---------- small screens ---------- */
@media (max-width: 860px) {
  .c-header-row { flex-wrap: wrap; height: auto; padding-top: 6px; padding-bottom: 0; row-gap: 0; }
  .c-search { order: 2; max-width: none; flex-basis: 40%; }
  .c-account { order: 3; }
  .c-nav { order: 4; width: 100%; justify-content: space-around; }
  .c-catalog { grid-template-columns: 1fr; }
  .c-wearing { grid-template-columns: 1fr; }
  .c-profile-head { flex-direction: column; text-align: center; padding-bottom: 60px; }
  .c-counts { justify-content: center; }
  .c-profile-actions { left: 16px; justify-content: center; }
}
@media (max-width: 480px) {
  .c-nav a { padding: 0 8px; }
  .c-search { flex-basis: 100%; order: 5; padding-bottom: 6px; }
  .c-avatar-circle { width: 96px; height: 96px; }
}
