* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: #111111;
  color: #f8f5ef;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 18px clamp(20px, 5vw, 72px);
  background: rgba(17, 17, 17, 0.9);
  border-bottom: 1px solid rgba(248, 245, 239, 0.14);
  backdrop-filter: blur(18px);
}

.brand {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: 0;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid rgba(248, 245, 239, 0.2);
  border-radius: 8px;
  background: #1c1c1c;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 700;
  list-style: none;
}

.nav-dropdown summary::-webkit-details-marker {
  display: none;
}

.nav-dropdown summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid #f2c94c;
  border-bottom: 2px solid #f2c94c;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 160ms ease;
}

.nav-dropdown[open] summary::after {
  transform: rotate(225deg) translateY(-1px);
}

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  display: grid;
  gap: 6px;
  width: 180px;
  padding: 8px;
  background: #f8f5ef;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.28);
}

.dropdown-menu a {
  padding: 10px 12px;
  border-radius: 6px;
  color: #111111;
  font-size: 0.95rem;
  font-weight: 650;
}

.dropdown-menu a:hover,
.dropdown-menu a:focus-visible {
  background: #2bb673;
  color: #07130d;
  outline: none;
}

.home {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(56px, 10vw, 112px) 0 64px;
}

.hero {
  min-height: 52vh;
  display: grid;
  align-content: center;
  gap: 20px;
}

.eyebrow {
  margin: 0;
  color: #f2c94c;
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 920px;
  color: #ffffff;
  font-size: clamp(4rem, 12vw, 9rem);
  line-height: 0.92;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 620px;
  color: #d8d1c4;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
}

.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.placeholder-grid article {
  min-height: 160px;
  padding: 22px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.placeholder-grid h2 {
  color: #ffffff;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.placeholder-grid p {
  margin-top: 12px;
  color: #cfc8bc;
  line-height: 1.6;
}

.tool-page {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 64px;
}

.tool-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}

.tool-hero h1 {
  max-width: 760px;
  margin-top: 6px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.tool-hero .hero-copy {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.45;
}

.refresh-button {
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(248, 245, 239, 0.22);
  border-radius: 8px;
  background: #f2c94c;
  color: #111111;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 800;
}

.refresh-button:hover,
.refresh-button:focus-visible {
  background: #2bb673;
  outline: none;
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.secondary-button {
  background: #1c1c1c;
  color: #f8f5ef;
}

.stats-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metric-card {
  min-height: 92px;
  padding: 16px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.metric-card span {
  display: block;
  color: #aeb8ca;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  color: #ffffff;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.tool-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #181818;
}

.watcher-controls {
  grid-template-columns: minmax(220px, 1fr) minmax(160px, 220px) auto auto;
}

.stacked-controls {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.search-field,
.select-field {
  display: grid;
  gap: 8px;
}

.search-field span,
.select-field span {
  color: #aeb8ca;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-field input,
.select-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #0f0f0f;
  color: #ffffff;
  outline: none;
}

.search-field input {
  padding: 0 14px;
}

.select-field select {
  padding: 0 38px 0 14px;
}

.search-field input:focus,
.select-field select:focus {
  border-color: #2bb673;
  box-shadow: 0 0 0 3px rgba(43, 182, 115, 0.18);
}

.toggle-field {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #0f0f0f;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.94rem;
  font-weight: 750;
  white-space: nowrap;
}

.toggle-field input {
  width: 18px;
  height: 18px;
  accent-color: #2bb673;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 12px;
}

.section-heading h2 {
  color: #ffffff;
  font-size: 1.35rem;
}

.section-heading p {
  color: #aeb8ca;
  font-size: 0.95rem;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
}

.game-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: #1a1a1a;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  border-color: rgba(43, 182, 115, 0.78);
  outline: none;
  transform: translateY(-2px);
}

.game-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

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

.game-thumb-empty::before {
  content: "s&";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 2rem;
  font-weight: 900;
}

.player-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 34px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(11, 12, 15, 0.86);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 850;
  text-align: center;
}

.ai-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 42px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(11, 12, 15, 0.88);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 900;
  text-align: center;
}

.ai-badge.clean,
.ai-inline-score.clean,
.ai-badge.pending,
.ai-inline-score.pending {
  color: #aeb8ca;
}

.ai-badge.low,
.ai-inline-score.low {
  color: #76d7a3;
}

.ai-badge.medium,
.ai-inline-score.medium {
  color: #f2c94c;
}

.ai-badge.high,
.ai-inline-score.high {
  color: #ff7b7b;
}

.game-body {
  min-height: 76px;
  padding: 11px 12px 13px;
}

.ai-card-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
}

.ai-inline-score {
  flex: none;
  padding-top: 1px;
  font-size: 0.75rem;
  font-weight: 900;
  white-space: nowrap;
}

.game-body h3 {
  color: #ffffff;
  font-size: 0.95rem;
  line-height: 1.2;
  letter-spacing: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-body p {
  margin-top: 6px;
  color: #aeb8ca;
  font-size: 0.82rem;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-body .player-share {
  color: #8d998f;
  font-size: 0.76rem;
  font-weight: 750;
}

.empty-state {
  grid-column: 1 / -1;
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
  color: #cfc8bc;
  text-align: center;
}

.analytic-page {
  padding-bottom: 96px;
}

.admin-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto minmax(220px, 0.9fr);
  align-items: end;
  gap: 12px;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #181818;
}

.admin-panel p {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: #aeb8ca;
  font-size: 0.95rem;
  line-height: 1.35;
}

.error-text {
  color: #ff7d7d !important;
}

.analytics-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  margin-bottom: 28px;
}

.analytics-column {
  min-width: 0;
}

.admin-game-list {
  display: grid;
  gap: 10px;
}

.admin-game-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.admin-game-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

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

.admin-game-body {
  min-width: 0;
}

.admin-game-body h3 {
  color: #ffffff;
  font-size: 0.98rem;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-body p {
  margin-top: 6px;
  color: #aeb8ca;
  font-size: 0.82rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-game-actions {
  display: flex;
  gap: 8px;
}

.text-button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 8px;
  background: #0f0f0f;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 800;
}

.text-button:hover,
.text-button:focus-visible {
  border-color: #2bb673;
  outline: none;
}

.danger-button:hover,
.danger-button:focus-visible {
  border-color: #ff7d7d;
  color: #ffb3b3;
}

.daily-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 190px));
  gap: 16px;
  justify-content: start;
}

.daily-card {
  display: block;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.daily-card:hover,
.daily-card:focus-visible {
  border-color: rgba(43, 182, 115, 0.78);
  outline: none;
  transform: translateY(-2px);
}

.daily-card h3 {
  color: #ffffff;
  font-size: 1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-card p {
  margin-top: 7px;
  color: #aeb8ca;
  font-size: 0.84rem;
  line-height: 1.45;
}

.analytics-game-card {
  overflow: hidden;
  padding: 0;
}

.analytics-game-card.compare-selectable {
  cursor: pointer;
}

.analytics-game-card.selected-for-compare {
  border-color: #f2c94c;
  box-shadow: 0 0 0 2px rgba(242, 201, 76, 0.18);
}

.compare-checkmark {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(242, 201, 76, 0.92);
  color: #111111;
  font-size: 0.75rem;
  font-weight: 900;
}

.analytics-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

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

.analytics-card-body {
  min-height: 74px;
  padding: 11px 12px 13px;
}

.analytics-card-body .analytics-share-text {
  color: #91a2c9;
  font-size: 0.78rem;
  font-weight: 800;
}

.compact-empty {
  min-height: 96px;
}

.game-detail-page {
  width: min(1320px, calc(100% - 40px));
}

.back-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 18px;
  color: #aeb8ca;
  font-size: 0.92rem;
  font-weight: 800;
}

.back-link:hover,
.back-link:focus-visible {
  color: #f2c94c;
  outline: none;
}

.game-detail-hero {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(18px, 4vw, 42px);
  margin-bottom: 20px;
}

.detail-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(43, 182, 115, 0.36), transparent),
    #242424;
}

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

.game-detail-hero h1 {
  max-width: 900px;
  margin-top: 8px;
  font-size: clamp(2.7rem, 7vw, 5.8rem);
  line-height: 0.94;
}

.detail-stats {
  margin-bottom: 22px;
}

.chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.ai-scan-layout {
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
}

.ai-score-ring {
  --score: 0%;
  width: min(220px, 100%);
  aspect-ratio: 1;
  margin: 18px auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#2bb673 var(--score), rgba(248, 245, 239, 0.12) 0);
  border: 1px solid rgba(248, 245, 239, 0.12);
}

.ai-score-ring[data-risk="medium"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#f2c94c var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring[data-risk="high"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#ff7b7b var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring[data-risk="clean"] {
  background:
    radial-gradient(circle at center, #171717 0 58%, transparent 59%),
    conic-gradient(#91a2c9 var(--score), rgba(248, 245, 239, 0.12) 0);
}

.ai-score-ring span {
  color: #ffffff;
  font-size: 2rem;
  font-weight: 950;
}

.chart-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 380px;
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.chart-heading-actions {
  align-items: end;
}

.chart-heading-actions > div {
  min-width: 0;
}

.compact-select {
  min-width: 150px;
}

.compact-select select {
  min-height: 38px;
  font-size: 0.9rem;
}

.wide-chart {
  grid-column: 1 / -1;
}

.chart-canvas-frame {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 300px;
}

.wide-canvas-frame {
  height: 340px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  max-width: 100%;
  height: 100% !important;
}

.chart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.chart-floating-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: rgba(17, 17, 17, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.chart-action-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 850;
  white-space: nowrap;
}

.chart-action-button:hover,
.chart-action-button:focus-visible {
  border-color: #f2c94c;
  color: #f2c94c;
  outline: none;
}

.chart-modal {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.chart-modal[hidden] {
  display: none;
}

.chart-modal-open {
  overflow: hidden;
}

.chart-modal-panel {
  width: min(1440px, 100%);
  height: min(860px, calc(100vh - 48px));
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
}

.chart-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.chart-modal-header h2 {
  color: #ffffff;
  font-size: 1.5rem;
}

.chart-modal-actions {
  flex: 0 0 auto;
}

.chart-modal-frame {
  position: relative;
  flex: 1;
  min-height: 0;
}

.chart-modal-frame canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.detail-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

.detail-table th,
.detail-table td {
  padding: 13px 14px;
  border-bottom: 1px solid rgba(248, 245, 239, 0.1);
  text-align: left;
}

.detail-table th {
  color: #aeb8ca;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.detail-table td {
  color: #f8f5ef;
  font-size: 0.94rem;
}

.detail-table tr:last-child td {
  border-bottom: 0;
}

.site-footer {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 34px;
  border-top: 1px solid rgba(248, 245, 239, 0.14);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #aeb8ca;
}

.site-footer div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-footer strong {
  color: #ffffff;
}

.storage-usage {
  padding-left: 12px;
  border-left: 1px solid rgba(248, 245, 239, 0.14);
  color: #91a2c9;
  font-size: 0.86rem;
  font-weight: 750;
}

.site-footer nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-setting-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #aeb8ca;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
  white-space: nowrap;
}

.footer-setting-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #f2c94c;
}

.footer-setting-toggle:hover,
.footer-setting-toggle:focus-within {
  color: #f2c94c;
}

.site-footer a,
.footer-admin-button {
  border: 0;
  background: transparent;
  color: #aeb8ca;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 750;
}

.site-footer a:hover,
.site-footer a:focus-visible,
.footer-admin-button:hover,
.footer-admin-button:focus-visible {
  color: #f2c94c;
  outline: none;
}

.admin-drawer {
  position: fixed;
  left: 50%;
  bottom: 20px;
  z-index: 40;
  width: min(1120px, calc(100% - 40px));
  max-height: min(82vh, 760px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}

.admin-drawer[hidden] {
  display: none;
}

.admin-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.admin-drawer-header h2 {
  color: #ffffff;
  font-size: 1.35rem;
}

.admin-drawer .admin-panel {
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 0.8fr);
}

.compare-mode {
  padding-bottom: 118px;
}

.compare-toolbar {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 38;
  width: min(1280px, calc(100% - 32px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(248, 245, 239, 0.18);
  border-radius: 8px;
  background: #111111;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.58);
  transform: translateX(-50%);
}

.compare-toolbar[hidden] {
  display: none;
}

.compare-toolbar-main {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.compare-toolbar-main strong {
  color: #ffffff;
}

.compare-toolbar-main > span {
  color: #aeb8ca;
  font-size: 0.88rem;
}

.compare-selected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.compare-chip {
  max-width: 170px;
  overflow: hidden;
  padding: 6px 8px;
  border: 1px solid rgba(242, 201, 76, 0.34);
  border-radius: 8px;
  background: rgba(242, 201, 76, 0.12);
  color: #f8f5ef;
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.compare-toolbar-actions .refresh-button,
.compare-toolbar-actions .text-button {
  min-width: 112px;
}

.compare-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 18px;
}

.compare-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(248, 245, 239, 0.12);
  border-radius: 8px;
  background: #1c1c1c;
  color: #aeb8ca;
}

.compare-legend-item span:first-child {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
}

.compare-legend-item strong {
  max-width: 180px;
  overflow: hidden;
  color: #ffffff;
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-legend-item span:last-child {
  font-size: 0.78rem;
  white-space: nowrap;
}

.skeleton {
  min-height: 186px;
  background:
    linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, 0.08) 50%, transparent 65%),
    #1a1a1a;
  background-size: 220% 100%;
  animation: shimmer 1.2s linear infinite;
}

.game-page {
  width: min(1100px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.sbusiness-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.sbusiness-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.sbusiness-title-block img {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  object-fit: cover;
  background: #242424;
}

.sbusiness-title-block h1 {
  max-width: 760px;
  margin-top: 4px;
  font-size: clamp(2.8rem, 7vw, 5.2rem);
}

.sbusiness-title-block p:last-child {
  margin-top: 8px;
  color: #cbd6f0;
  line-height: 1.45;
}

.sbusiness-actions {
  flex: 0 0 auto;
}

.sbusiness-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  align-items: start;
  gap: 24px;
}

.sbusiness-main {
  min-width: 0;
  display: grid;
  gap: 22px;
}

.media-stage,
.sbusiness-panel {
  min-width: 0;
}

.media-viewer {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #050505;
}

.media-viewer img,
.media-viewer video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(248, 245, 239, 0.16);
  border-radius: 6px;
  background: #111111;
  cursor: pointer;
}

.media-thumb.active,
.media-thumb:hover,
.media-thumb:focus-visible {
  border-color: #2f7cff;
  outline: none;
}

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

.media-thumb span {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(11, 12, 15, 0.86);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 850;
}

.sbusiness-panel {
  padding: 18px;
  border: 1px solid rgba(248, 245, 239, 0.14);
  border-radius: 8px;
  background: #1c1c1c;
}

.sbusiness-panel h2 {
  color: #ffffff;
  font-size: 1.18rem;
}

.sbusiness-description {
  color: #d8d1c4;
  line-height: 1.58;
}

.sbusiness-description h1,
.sbusiness-description h2 {
  max-width: none;
  margin: 22px 0 10px;
  color: #ffffff;
  font-size: 1.45rem;
  line-height: 1.15;
}

.sbusiness-description div,
.sbusiness-description p,
.sbusiness-description ul {
  margin-top: 10px;
}

.sbusiness-description figure {
  margin: 18px 0;
}

.sbusiness-description img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.sbusiness-description figcaption {
  display: none;
}

.leaderboard-controls {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 170px) minmax(130px, 170px) auto;
  align-items: end;
  gap: 12px;
  margin: 16px 0;
}

.leaderboard-summary {
  min-height: 22px;
  margin-bottom: 10px;
  color: #aeb8ca;
  font-size: 0.92rem;
  font-weight: 750;
}

.leaderboard-table {
  min-width: 700px;
}

.leaderboard-player {
  display: grid;
  gap: 3px;
}

.leaderboard-player strong {
  color: #ffffff;
}

.leaderboard-player small {
  color: #8090ad;
  font-size: 0.78rem;
}

.leaderboard-value {
  color: #ffd34f;
  font-weight: 850;
}

.leaderboard-empty {
  color: #aeb8ca;
  text-align: center;
}

.sbusiness-sidebar {
  display: grid;
  gap: 12px;
}

.info-list {
  display: grid;
  gap: 11px;
  margin-top: 14px;
}

.info-list div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #aeb8ca;
  font-size: 0.88rem;
}

.info-list strong {
  color: #ffffff;
  text-align: right;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-list span {
  padding: 5px 8px;
  border-radius: 999px;
  background: #27324b;
  color: #dce5ff;
  font-size: 0.78rem;
  font-weight: 750;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

@media (max-width: 700px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    align-items: stretch;
  }

  .nav-dropdown {
    flex: 1;
  }

  .nav-dropdown summary {
    justify-content: space-between;
    width: 100%;
  }

  .dropdown-menu {
    left: 0;
    right: auto;
    width: min(220px, 90vw);
  }

  .home {
    width: min(100% - 32px, 1120px);
    padding-top: 48px;
  }

  .game-page {
    width: min(100% - 32px, 1100px);
  }

  .placeholder-grid {
    grid-template-columns: 1fr;
  }

  .tool-page {
    width: min(100% - 32px, 1280px);
    padding-top: 36px;
  }

  .tool-hero,
  .section-heading,
  .sbusiness-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .refresh-button {
    width: 100%;
  }

  .stats-panel,
  .tool-controls,
  .admin-panel,
  .analytics-layout {
    grid-template-columns: 1fr;
  }

  .games-grid {
    grid-template-columns: 1fr;
  }

  .daily-stats-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .site-footer,
  .site-footer div,
  .site-footer nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer nav {
    gap: 10px;
  }

  .footer-setting-toggle {
    white-space: normal;
  }

  .storage-usage {
    padding-left: 0;
    border-left: 0;
  }

  .admin-drawer {
    bottom: 12px;
    width: min(100% - 24px, 1120px);
    padding: 14px;
  }

  .admin-drawer .admin-panel {
    grid-template-columns: 1fr;
  }

  .compare-mode {
    padding-bottom: 190px;
  }

  .compare-toolbar {
    bottom: 12px;
    align-items: stretch;
    flex-direction: column;
    width: min(100% - 24px, 1280px);
  }

  .compare-toolbar-actions {
    width: 100%;
  }

  .compare-toolbar-actions .refresh-button,
  .compare-toolbar-actions .text-button {
    flex: 1;
    width: 100%;
  }

  .game-detail-hero,
  .chart-layout,
  .sbusiness-layout {
    grid-template-columns: 1fr;
  }

  .leaderboard-controls {
    grid-template-columns: 1fr;
  }

  .sbusiness-title-block {
    align-items: flex-start;
  }

  .sbusiness-title-block img {
    width: 72px;
    height: 72px;
  }

  .chart-card,
  .wide-chart {
    grid-column: auto;
    min-height: 320px;
  }

  .chart-actions {
    width: 100%;
    flex-wrap: wrap;
    margin-left: 0;
  }

  .chart-floating-actions {
    top: 6px;
    right: 6px;
    max-width: calc(100% - 12px);
    overflow-x: auto;
  }

  .chart-actions .chart-action-button {
    flex: 1 1 auto;
  }

  .chart-floating-actions .chart-action-button {
    flex: 0 0 auto;
  }

  .chart-modal {
    padding: 12px;
  }

  .chart-modal-panel {
    height: calc(100vh - 24px);
    padding: 14px;
  }

  .chart-modal-header {
    flex-direction: column;
  }

  .chart-modal-actions {
    width: 100%;
  }

  .chart-canvas-frame,
  .wide-canvas-frame {
    height: 250px;
  }

  .admin-game-card {
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .admin-game-actions {
    grid-column: 1 / -1;
  }

  .admin-game-actions .text-button {
    flex: 1;
  }
}
