/* ===== Orange Games — shared styles ===== */
:root {
  --orange: #ff8c1a;
  --orange-dark: #a94f00;
  --blue: #1765c1;
  --blue-dark: #0f4f9b;
  --bg: #f0f2f5;
  --card: #ffffff;
  --text: #333333;
  --text-dim: #666666;
  --border: #e4e4e4;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Top navigation */
header {
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
header .logo {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 21px;
  font-weight: 700;
  color: var(--orange-dark);
  text-decoration: none;
}
header .tag { font-size: 13px; color: var(--text-dim); }

main { flex: 1; width: 100%; max-width: 1000px; margin: 0 auto; padding: 16px 12px 40px; }

/* Breadcrumb */
.crumbs { font-size: 13px; color: var(--text-dim); margin: 2px 2px 10px; }
.crumbs a { color: var(--blue); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

/* Title bar: title + like/dislike */
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  border-bottom: none;
  padding: 10px 14px;
}
.game-head h1 { font-size: 22px; }

/* Like / dislike pill */
.ytrate {
  display: inline-flex;
  align-items: center;
  background: #f2f2f2;
  border-radius: 19px;
  height: 36px;
  overflow: hidden;
}
.ytrate .ytbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 100%;
  padding: 0 13px;
  color: #606060;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  border: none;
  background: transparent;
  transition: background .15s ease;
}
.ytrate .ytbtn:hover { background: #e0e0e0; }
.ytrate .ytbtn.active { color: #065fd4; background: #e8f0fe; }
.ytrate .ytbtn svg { fill: currentColor; display: block; }
.ytrate .ytbtn:active svg { transform: scale(.82); }
.ytrate .ytdiv { width: 1px; height: 20px; background: #d0d0d0; }

/* Game area */
.game-window {
  position: relative;
  width: 100%;
  height: clamp(480px, 72vh, 800px);
  background: #333;
  border: 1px solid var(--border);
  overflow: hidden;
}
.game-window:fullscreen { height: 100%; }
.game-window iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #333;
}

/* Click-to-play cover */
.game-poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background-color: #1c2733;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  cursor: pointer;
  z-index: 2;
}
.game-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.35);
}
.game-poster > * { position: relative; }
.play-btn {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--orange);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(0,0,0,.45);
  transition: transform .15s ease, background .15s ease;
}
.play-btn:hover { transform: scale(1.1); background: var(--orange-dark); }
.play-btn svg { fill: #fff; margin-left: 8px; }
.game-poster .hint {
  font-size: 14px;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
  padding: 0 16px;
  text-align: center;
}

/* Toolbar (reload / fullscreen) */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  padding: 8px;
  margin-bottom: 22px;
  box-shadow: 0 2px 5px rgba(0,0,0,.08);
}
.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 6px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background .15s ease;
}
.tool-btn:hover { background: var(--blue-dark); }
.tool-btn svg { fill: none; stroke: currentColor; stroke-width: 2.5; }

/* Content sections */
.about, .faq {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  line-height: 1.8;
  margin-bottom: 18px;
}
.about h2, .faq h2, .related h2 { color: var(--orange-dark); margin-bottom: 10px; font-size: 19px; }
.about h3 { color: var(--orange-dark); margin: 14px 0 8px; font-size: 16px; }
.about p { font-size: 14px; margin-bottom: 12px; color: #444; }
.about ul { font-size: 14px; padding-left: 20px; color: #444; margin-bottom: 10px; }

/* Game info table */
.info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 6px 0 12px;
}
.info-table th, .info-table td {
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--border);
}
.info-table th { background: #faf7f2; color: var(--orange-dark); width: 140px; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq details:last-child { border-bottom: none; }
.faq summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
}
.faq summary:hover { color: var(--orange-dark); }
.faq details p { font-size: 14px; color: #444; margin-top: 8px; }

/* Game card grid (homepage + related games) */
.related { margin-bottom: 18px; }
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.game-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease;
}
.game-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0,0,0,.12);
}
.game-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #ddd;
}
.game-card .card-body { padding: 10px 12px 12px; }
.game-card .card-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.game-card .card-desc {
  font-size: 12.5px;
  color: var(--text-dim);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Homepage hero */
.hero {
  background: linear-gradient(135deg, #fff3e2, #ffffff);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 20px;
  text-align: center;
}
.hero h1 { font-size: 26px; margin-bottom: 8px; }
.hero h1 .accent { color: var(--orange-dark); }
.hero p { font-size: 14.5px; color: #555; max-width: 640px; margin: 0 auto; line-height: 1.7; }
.section-title { font-size: 19px; color: var(--orange-dark); margin: 4px 2px 12px; }

footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  background: var(--card);
}
footer a { color: var(--orange-dark); text-decoration: underline; }

/* Production-readiness corrections that preserve the adopted visual system. */
.game-head h1 { overflow-wrap: anywhere; }
.rating-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rating-label { color: #444; font-size: 14px; font-weight: 600; }
.ytrate { min-height: 44px; height: auto; }
.ytrate .ytbtn { min-width: 44px; min-height: 44px; }
.game-poster[hidden] { display: none; }
.game-state {
  position: absolute; z-index: 3; inset: 0; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 24px; color: #fff; text-align: center; background: #1c2733;
}
.game-state[hidden] { display: none; }
.game-state span { max-width: 620px; line-height: 1.6; }
.retry-btn, .action-link {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
  padding: 10px 18px; border: 0; border-radius: 6px; background: var(--blue);
  color: #fff; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.tool-btn { min-height: 44px; }
.provider-note {
  margin: -10px 0 18px; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: 8px; background: var(--card); color: #444; font-size: 13px; line-height: 1.6;
}
.provider-note a, .legal a { color: var(--blue-dark); }
.provider-note a, .legal p a {
  display: inline-flex; min-height: 44px; align-items: center;
  padding: 2px 4px; margin: 2px 1px; vertical-align: middle;
}
.legal .action-link,
.legal .action-link:visited,
.legal .action-link:hover,
.legal .action-link:active { color: #fff; }
.sr-status { min-height: 1px; }
.control-status {
  color: #8a3f00; background: #fff4e6; border: 1px solid #c45c00;
  border-radius: 6px; padding: 8px 10px; font-size: 13px; font-weight: 600;
  line-height: 1.4;
}
.control-status:empty {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.rating-status { flex: 1 0 100%; }
.fullscreen-status { flex: 1 0 100%; text-align: center; }
footer p { max-width: 900px; margin: 0 auto 6px; line-height: 1.6; }
.footer-links { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; }
.footer-links a { display: inline-flex; min-height: 44px; align-items: center; padding: 0 8px; }
.legal {
  overflow-wrap: anywhere; background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; padding: 24px; line-height: 1.75;
}
.legal h1 { color: var(--orange-dark); font-size: 26px; margin-bottom: 16px; }
.legal p { margin-bottom: 14px; }
.error-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }
.action-link.secondary { background: var(--orange-dark); }
:focus-visible { outline: 3px solid #111; outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }
.game-poster :focus-visible,
.game-state :focus-visible { outline-color: #fff; box-shadow: 0 0 0 6px #111; }

@media (max-width: 767px) {
  header { padding: 10px 12px; flex-wrap: wrap; }
  .game-window { height: clamp(280px, 58dvh, 520px); }
  .game-head { padding: 10px; }
  .game-head h1 { font-size: 19px; }
  .about, .faq, .legal { padding: 16px; }
  .toolbar { flex-wrap: wrap; }
  .tool-btn { flex: 1 1 140px; justify-content: center; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
  .info-table th, .info-table td { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .game-card:hover, .play-btn:hover { transform: none; }
}
