/* cdog games — Amazon-style catalog */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Amazon Ember", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 14px;
  color: #0F1111;
  background: #EAEDED;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: #007185; text-decoration: none; }
a:hover { color: #C7511F; text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }

/* ---------- Icons ---------- */
.icon {
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---------- Header ---------- */
.header {
  background: #0F1111;
  background: linear-gradient(180deg, #131A22 0%, #131921 100%);
  color: #fff;
  display: flex;
  align-items: stretch;
  padding: 0 8px;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}
.header-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  height: calc(100% - 14px);
  margin: 7px 2px;
  color: #fff;
  text-decoration: none;
  transition: border-color 0.12s;
}
.header-cell:hover { border-color: #fff; text-decoration: none; color: #fff; }
.logo {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  font-style: italic;
  font-size: 28px;
  letter-spacing: -1px;
  color: #fff;
  padding: 0 12px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  margin: 7px 2px;
  height: calc(100% - 14px);
}
.logo:hover { border-color: #fff; color: #fff; text-decoration: none; }
.logo .brand-accent { color: #FF9900; }
.logo .logo-dot { color: #FF9900; font-size: 34px; line-height: 0.5; }

.header-cell.location .loc-ico { color: #fff; margin-right: 2px; }
.location small { color: #CCC; font-size: 12px; font-weight: 400; display: block; line-height: 1; }
.location strong { color: #fff; font-size: 14px; font-weight: 700; display: block; line-height: 1.3; }

.search {
  flex: 1;
  display: flex;
  align-items: stretch;
  margin: 12px 4px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  border: 2px solid transparent;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.search:focus-within { border-color: #FF9900; box-shadow: 0 0 0 3px rgba(255,153,0,0.35); }
.search select {
  background: #F3F3F3;
  border: none;
  border-right: 1px solid #CDCDCD;
  padding: 0 6px;
  font-size: 12px;
  color: #555;
  outline: none;
  cursor: pointer;
}
.search input {
  flex: 1;
  border: none;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  min-width: 0;
  color: #0F1111;
}
.search input::placeholder { color: #888; }
.search button {
  background: #FEBD69;
  border: none;
  padding: 0 16px;
  font-size: 18px;
  color: #0F1111;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s;
}
.search button:hover { background: #F3A847; }

.lang { font-size: 14px; font-weight: 700; }
.flag { width: 22px; height: 15px; background: linear-gradient(#b22234 33%, #fff 33%, #fff 66%, #3c3b6e 66%); margin-right: 6px; border: 1px solid rgba(255,255,255,0.25); border-radius: 1px; }

/* ---------- Sub-nav ---------- */
.subnav {
  background: #232F3E;
  color: #fff;
  display: flex;
  align-items: center;
  padding: 0 10px;
  height: 40px;
  gap: 2px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.subnav a, .subnav button {
  color: #fff;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid transparent;
  border-radius: 2px;
  background: transparent;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.12s;
}
.subnav a:hover, .subnav button:hover { border-color: #fff; color: #fff; text-decoration: none; }
.subnav a.active { color: #FF9900; font-weight: 700; }
.subnav .all { font-weight: 700; }
.subnav .upload-link { color: #FF9900; font-weight: 700; }

/* ---------- Hero / billboard ---------- */
.billboard {
  background:
    radial-gradient(ellipse at top left, rgba(255,153,0,0.15), transparent 50%),
    linear-gradient(180deg, #232F3E 0%, #37475A 100%);
  color: #fff;
  padding: 36px 28px 140px 28px;
  margin-bottom: -120px;
  position: relative;
  min-height: 320px;
}
.billboard h1 {
  font-size: 34px;
  margin: 0 0 6px 0;
  font-weight: 600;
  letter-spacing: -0.5px;
}
.billboard p { opacity: 0.85; margin: 0; font-size: 15px; }

/* ---------- Main body ---------- */
.main {
  padding: 14px;
  max-width: 1500px;
  margin: 0 auto;
}
.tile-row {
  background: #fff;
  padding: 24px;
  margin-bottom: 14px;
  border-radius: 6px;
  position: relative;
  z-index: 1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.tile-row h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 18px 0;
  color: #0F1111;
  letter-spacing: -0.2px;
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.card {
  background: #fff;
  border: 1px solid #E3E6E6;
  border-radius: 6px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.card:hover {
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  border-color: #d5d9d9;
  transform: translateY(-2px);
}
.card-cover {
  aspect-ratio: 4 / 3;
  background: #F7F7F7center/contain no-repeat;
  border-radius: 4px;
  margin-bottom: 12px;
  border: 1px solid #EEE;
  overflow: hidden;
  position: relative;
  display: block;
}
.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0,0,0,0.08));
  pointer-events: none;
}
.card-title {
  font-size: 15px;
  font-weight: 400;
  color: #0F1111;
  line-height: 1.35;
  margin: 0 0 4px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}
.card-title a { color: inherit; }
.card-title a:hover { color: #C7511F; text-decoration: underline; }
.card-genre { font-size: 12px; color: #565959; margin: 0 0 6px 0; }
.stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
  font-size: 13px;
}
.stars-svg { display: inline-flex; align-items: center; gap: 1px; }
.stars-svg .star { color: #DBDBDB; }
.stars-svg .star.on { color: #FFA41C; fill: #FFA41C; }
.stars-svg .star:not(.on) { fill: none; stroke: #BBB; stroke-width: 1.5; }
.stars .count { color: #007185; margin-left: 2px; font-size: 13px; font-weight: 400; }
.stars .count:hover { color: #C7511F; cursor: default; }
.card-price {
  font-size: 12px;
  color: #565959;
  margin-bottom: 10px;
}
.card-price .free { color: #007600; font-weight: 700; font-size: 14px; }
.card-price .muted { color: #565959; }
.card-actions { margin-top: auto; display: flex; flex-direction: column; gap: 6px; }

/* ---------- Buttons ---------- */
.btn {
  font-size: 13px;
  padding: 8px 12px;
  border-radius: 100px;
  border: 1px solid #FCD200;
  background: #FFD814;
  color: #0F1111;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn:hover { background: #F7CA00; border-color: #F2C200; text-decoration: none; color: #0F1111; }
.btn:active { background: #EDC100; }
.btn.btn-icon { gap: 6px; }
.btn-primary {
  background: #FFA41C;
  border-color: #FF8F00;
}
.btn-primary:hover { background: #FA8900; border-color: #E88B00; }
.btn-secondary {
  background: #F0F2F2;
  border: 1px solid #D5D9D9;
  color: #0F1111;
  box-shadow: 0 2px 5px 0 rgba(213,217,217,.3);
}
.btn-secondary:hover { background: #E3E6E6; border-color: #ADB1B8; }
.btn-danger {
  background: #fff;
  border: 1px solid #D5D9D9;
  color: #B12704;
}
.btn-danger:hover { background: #FFF8F8; border-color: #B12704; }
.btn-lg { font-size: 14px; padding: 10px 16px; }
.btn-block { display: flex; width: 100%; }

/* ---------- Detail page ---------- */
.breadcrumb {
  font-size: 12px;
  color: #565959;
  padding: 10px 0;
}
.breadcrumb a { color: #565959; }
.detail {
  background: #fff;
  border-radius: 6px;
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(280px, 420px) 1fr 300px;
  gap: 32px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.detail-cover img, .detail-cover .cover-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #F7F7F7;
  border: 1px solid #EEE;
  border-radius: 6px;
}
.detail-info h1 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 6px 0;
  color: #0F1111;
  line-height: 1.3;
  letter-spacing: -0.3px;
}
.detail-info .byline {
  font-size: 14px;
  color: #007185;
  margin-bottom: 6px;
}
.detail-info .stars-row {
  border-bottom: 1px solid #E7E7E7;
  padding-bottom: 12px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.detail-info h3 { font-size: 16px; font-weight: 700; margin: 18px 0 8px 0; }
.detail-info .desc { font-size: 14px; color: #0F1111; line-height: 1.55; }
.detail-info ul.facts { list-style: none; padding: 0; margin: 10px 0 0 0; }
.detail-info ul.facts li { padding: 4px 0; font-size: 14px; border-bottom: 1px solid #F2F2F2; }
.detail-info ul.facts li:last-child { border-bottom: none; }
.detail-info ul.facts li strong { display: inline-block; width: 140px; color: #0F1111; }
.buybox {
  border: 1px solid #D5D9D9;
  border-radius: 8px;
  padding: 18px;
  align-self: start;
  background: #fff;
}
.buybox .price {
  font-size: 22px;
  font-weight: 400;
  color: #0F1111;
  margin-bottom: 4px;
}
.buybox .price .free { color: #007600; font-weight: 700; font-size: 20px; }
.buybox .delivery { font-size: 13px; margin-bottom: 12px; color: #565959; line-height: 1.4; }
.buybox .delivery strong { color: #0F1111; }
.buybox .stock {
  color: #007600;
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.buybox .stock-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #007600;
  box-shadow: 0 0 0 3px rgba(0,118,0,0.15);
  display: inline-block;
}
.buybox .btn { width: 100%; margin-bottom: 8px; }

/* ---------- Upload page ---------- */
.form-card {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  max-width: 760px;
  margin: 0 auto;
  border: 1px solid #D5D9D9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.form-card h1 {
  font-size: 28px;
  font-weight: 500;
  border-bottom: 1px solid #E7E7E7;
  padding-bottom: 12px;
  margin: 0 0 20px 0;
  letter-spacing: -0.3px;
}
.tabs { display: flex; border-bottom: 1px solid #D5D9D9; margin-bottom: 20px; gap: 4px; }
.tab {
  padding: 10px 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 14px;
  font-weight: 700;
  color: #565959;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: -1px;
}
.tab.active { color: #C7511F; border-bottom-color: #C7511F; }
.tab:hover { color: #C7511F; }
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #0F1111;
  margin-bottom: 5px;
}
.field input[type="text"], .field textarea, .field select, .field input[type="password"] {
  width: 100%;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #888C8C;
  border-radius: 4px;
  background: linear-gradient(to bottom, #F7F8F8, #fff 4px);
  font-family: inherit;
  outline: none;
  box-shadow: 0 1px 0 rgba(255,255,255,0.5), 0 1px 2px rgba(15,17,17,0.15) inset;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: #007185;
  box-shadow: 0 0 3px 2px rgba(228,121,17,0.5);
}
.field textarea { min-height: 90px; resize: vertical; }
.field .hint { font-size: 12px; color: #565959; margin-top: 4px; }
.drop {
  border: 2px dashed #D5D9D9;
  border-radius: 8px;
  padding: 36px 16px 26px 16px;
  text-align: center;
  background: #FAFAFA;
  cursor: pointer;
  margin-bottom: 18px;
  transition: all 0.15s;
}
.drop:hover { border-color: #888C8C; background: #F7F8F8; }
.drop.drag { border-color: #C7511F; background: #FFF3E8; }
.drop-icon { color: #888C8C; margin-bottom: 10px; display: flex; justify-content: center; }
.drop .big { font-size: 18px; font-weight: 700; margin-bottom: 6px; color: #0F1111; }
.drop .hint { font-size: 13px; color: #565959; }
.drop .chosen { margin-top: 10px; color: #007600; font-size: 13px; font-weight: 700; }
input[type="file"] { display: none; }

.progress {
  background: #EEE;
  border-radius: 4px;
  height: 8px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-fill {
  background: linear-gradient(90deg, #FFA41C, #FF9900);
  height: 100%;
  width: 0%;
  transition: width 0.2s;
}

/* ---------- Login ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  background: #fff;
}
.login-logo {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 700;
  font-size: 36px;
  letter-spacing: -1px;
  color: #0F1111;
  margin-bottom: 14px;
  text-decoration: none;
  display: inline-block;
}
.login-logo:hover { text-decoration: none; color: #0F1111; }
.login-logo .dot { color: #FF9900; font-size: 42px; }
.login-box {
  border: 1px solid #DDD;
  border-radius: 8px;
  padding: 20px 26px 24px 26px;
  width: 360px;
  max-width: 94vw;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.login-box h1 {
  font-size: 26px;
  font-weight: 500;
  margin: 0 0 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.lock-ico { color: #FF9900; display: inline-flex; }
.login-intro { font-size: 13px; color: #565959; margin: 0 0 14px 0; line-height: 1.4; }
.login-sub { font-size: 13px; margin-top: 18px; color: #565959; text-align: center; }
.login-err {
  background: #FDEAEA;
  border: 1px solid #CA0000;
  color: #0F1111;
  padding: 10px;
  font-size: 13px;
  border-radius: 4px;
  margin-bottom: 12px;
  display: none;
}
.login-err.show { display: block; }
.login-err strong { color: #CA0000; display: block; margin-bottom: 2px; }
.login-footer {
  width: 360px;
  max-width: 94vw;
  margin-top: 18px;
  text-align: center;
  font-size: 12px;
  color: #555;
  border-top: 1px solid #E7E7E7;
  padding-top: 14px;
}

/* ---------- Launcher ---------- */
.launcher {
  background: #0F1111;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.launcher-bar {
  background: #131921;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #232F3E;
}
.launcher-bar .game-title {
  font-weight: 700;
  font-size: 15px;
  flex: 1;
  letter-spacing: 0.2px;
}
.launcher-frame {
  flex: 1;
  position: relative;
  background: #000;
  overflow: hidden;
}
.launcher-frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
}
.launcher-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFA41C;
  font-size: 18px;
  font-weight: 700;
  z-index: 5;
  pointer-events: none;
  letter-spacing: 0.3px;
}
.launcher-bar .btn { padding: 7px 14px; font-size: 13px; }

/* ---------- Empty / misc ---------- */
.empty {
  text-align: center;
  padding: 60px 20px;
  color: #565959;
}
.empty .big { font-size: 22px; font-weight: 400; color: #0F1111; margin-bottom: 8px; }

.notice {
  padding: 10px 14px;
  background: #FFF3E8;
  border: 1px solid #FFA41C;
  border-radius: 4px;
  margin-bottom: 14px;
  font-size: 13px;
}
.notice.err { background: #FDEAEA; border-color: #CA0000; color: #B12704; }
.notice.ok { background: #E8F7EE; border-color: #007600; color: #0F1111; }

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #232F3E;
  color: #fff;
  padding: 12px 18px;
  border-radius: 6px;
  z-index: 1000;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  max-width: 320px;
  font-size: 14px;
  animation: toastIn 0.25s ease-out;
}
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.toast.ok { border-left: 4px solid #007600; }
.toast.err { border-left: 4px solid #CA0000; background: #fff; color: #0F1111; }

.footer {
  background: #232F3E;
  color: #DDD;
  padding: 26px 20px;
  text-align: center;
  font-size: 12px;
  margin-top: 30px;
}
.footer .footer-top {
  background: #37475A;
  color: #fff;
  padding: 14px;
  margin: -26px -20px 20px -20px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.12s;
}
.footer .footer-top:hover { background: #485769; }

/* ---------- Small stuff ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }

@media (max-width: 900px) {
  .detail { grid-template-columns: 1fr; }
  .header-cell.location, .header-cell.lang { display: none; }
  .billboard { min-height: 180px; padding: 22px 16px 80px 16px; margin-bottom: -60px; }
  .billboard h1 { font-size: 24px; }
}
