:root {
  color-scheme: light;
  --bg: #f2f4f8;
  --surface: #ffffff;
  --ink: #132033;
  --muted: #687386;
  --line: #dde4ee;
  --primary: #09a6d9;
  --primary-dark: #087ea4;
  --accent: #ffbd12;
  --danger: #dc2626;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: clip;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background: var(--bg);
  color: var(--ink);
}

body.drawer-is-open {
  overflow: hidden;
}

.public-body {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 18%, transparent 18% 100%),
    linear-gradient(28deg, transparent 0 60%, rgba(255, 255, 255, 0.2) 60% 74%, transparent 74%),
    linear-gradient(152deg, rgba(5, 150, 170, 0.18) 0 24%, transparent 24%),
    #8ef0df;
  background-attachment: fixed;
}

.corner-hub {
  position: sticky;
  top: 16px;
  z-index: 20;
  align-self: start;
  justify-self: stretch;
  width: 100%;
}

.hub-card-inner {
  display: grid;
  gap: 10px;
  height: 100%;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.44);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.12);
}

.hub-brand,
.hub-actions {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.hub-brand {
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 8px;
  color: #123f58;
  font-size: 1.1rem;
  font-weight: 950;
}

.hub-brand img {
  display: block;
  width: 100%;
  max-height: 44px;
  object-fit: contain;
}

.hub-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: hidden;
}

.hub-actions button {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--primary-dark);
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: 950;
}

.hub-actions button + button {
  border-left: 1px solid var(--line);
}

.hub-actions button:hover,
.hub-actions button:focus-visible {
  background: #ecf8fd;
  outline: 0;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(4, 44, 65, 0.58);
  backdrop-filter: blur(1px);
}

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

.side-drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 90;
  width: min(760px, 52vw);
  min-width: 560px;
  overflow-y: auto;
  padding: 44px 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0 18%, transparent 18% 100%),
    #7df4df;
  box-shadow: 22px 0 44px rgba(15, 23, 42, 0.18);
  transform: translateX(-104%);
  transition: transform 220ms ease;
}

.side-drawer[data-open="true"] {
  transform: translateX(0);
}

.drawer-close {
  position: absolute;
  top: 44px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.2);
  color: #5c6c82;
  cursor: pointer;
  font-size: 3rem;
  font-weight: 900;
  line-height: 1;
}

.drawer-search-form {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) 70px;
  align-items: center;
  height: 86px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.search-drawer .drawer-search-form {
  width: calc(100% - 104px);
}

.drawer-search-form input {
  width: 100%;
  border: 0;
  border-left: 1px solid #dbe4ef;
  outline: 0;
  padding: 0 24px;
  color: #17324d;
  font-size: 1.45rem;
  font-weight: 850;
}

.drawer-search-form input::placeholder {
  color: #b9c4d5;
}

.drawer-search-form button {
  height: 100%;
  border: 0;
  background: transparent;
  color: #b0bed0;
  cursor: pointer;
  font-size: 2.1rem;
  font-weight: 950;
}

.drawer-search-mark {
  display: grid;
  place-items: center;
  color: #083f67;
  font-size: 2.2rem;
  font-weight: 950;
}

.drawer-category-row {
  display: flex;
  gap: 14px;
  margin: 28px 0 22px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.drawer-category-row a {
  flex: 0 0 auto;
  min-width: 118px;
  padding: 13px 16px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.13);
  color: #17324d;
  font-weight: 950;
  text-align: center;
}

.drawer-hot h2 {
  margin: 0 0 18px;
  color: #083f67;
  font-size: 2rem;
}

.drawer-hot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.drawer-hot-grid a {
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

.drawer-hot-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.account-logo {
  display: grid;
  justify-items: center;
  margin: 0 0 64px;
}

.account-logo img {
  width: min(310px, 68%);
  max-height: 118px;
  object-fit: contain;
}

.account-panel {
  width: min(520px, 100%);
  margin: 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.account-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid #e6edf6;
}

.account-tabs button {
  min-height: 70px;
  border: 0;
  background: #eef4fb;
  color: #119ee0;
  cursor: pointer;
  font-size: 1.15rem;
  font-weight: 950;
}

.account-tabs button.is-active {
  background: #fff;
}

.account-tabs[hidden],
.auth-form[hidden],
.account-user[hidden] {
  display: none;
}

.account-card {
  display: grid;
  gap: 14px;
  padding: 34px 32px 26px;
}

.account-card h2 {
  margin: 0 0 16px;
  color: #0a3153;
  font-size: 1.5rem;
  text-align: center;
}

.provider-btn {
  display: grid;
  grid-template-columns: 40px 1fr;
  align-items: center;
  min-height: 54px;
  border: 3px solid #11a5eb;
  border-radius: 999px;
  background: #fff;
  color: #109ee3;
  cursor: pointer;
  font-weight: 950;
}

.provider-btn span {
  color: #0d1d2d;
  font-size: 1.3rem;
}

.account-card p {
  margin: 12px 0 0;
  color: #718096;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.account-message {
  min-height: 20px;
}

.account-message[data-state="error"] {
  color: #b91c1c;
}

.account-message[data-state="success"] {
  color: #08784f;
}

.account-user strong,
.account-user span {
  display: block;
  overflow-wrap: anywhere;
  text-align: center;
}

.account-user strong {
  color: #0a3153;
  font-size: 1.35rem;
}

.account-user span {
  color: #526070;
  font-weight: 800;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

.app-frame {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 100vh;
}

.side-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 22px;
  padding: 18px 12px;
  background: #fff;
  border-right: 1px solid var(--line);
}

.brand,
.mobile-brand {
  display: grid;
  place-items: center;
  min-height: 56px;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 950;
}

.side-rail nav {
  display: grid;
  align-content: start;
  gap: 8px;
}

.side-rail nav a {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 8px;
  color: #526070;
  font-size: 0.86rem;
  font-weight: 850;
}

.side-rail nav a:hover {
  background: #ecf8fd;
  color: var(--primary-dark);
}

.page-area {
  min-width: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  padding: 16px clamp(18px, 4vw, 42px) 8px;
  background: rgba(242, 244, 248, 0.9);
  backdrop-filter: blur(14px);
}

.mobile-brand {
  display: none;
}

.top-search,
.hero-search {
  display: flex;
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
}

.top-search:focus-within,
.hero-search:focus-within {
  border-color: var(--primary);
}

.top-search input,
.hero-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  background: transparent;
  padding: 15px 20px;
  outline: 0;
  font-weight: 750;
}

.top-search button,
.hero-search button,
.primary-btn,
.secondary-btn {
  border: 0;
  cursor: pointer;
  font-weight: 850;
}

.top-search button,
.hero-search button {
  padding: 0 22px;
  background: var(--primary);
  color: #fff;
}

main {
  width: min(1400px, calc(100% - 36px));
  margin: 0 auto;
  padding: 16px 0 60px;
}

.public-body main {
  width: min(1400px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
  padding-top: 16px;
}

.portal-home {
  --content-tile: clamp(112px, 9vw, 148px);
  --content-gap: 14px;
  --content-cols: 9;
  --aligned-content-width: min(100%, calc((var(--content-tile) * var(--content-cols)) + (var(--content-gap) * (var(--content-cols) - 1))));
  padding-top: 10px;
}

@media (min-width: 1640px) {
  .portal-home {
    --content-cols: 8;
  }
}

.hero-mosaic {
  --tile: clamp(104px, 8vw, 136px);
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--tile));
  grid-auto-rows: var(--tile);
  grid-auto-flow: dense;
  gap: 16px;
  align-items: start;
  align-content: start;
  justify-content: center;
  padding: 0 0 22px;
}

.command-card {
  display: grid;
  gap: 12px;
  align-content: center;
  aspect-ratio: 1 / 1;
  min-height: 0;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.command-card strong {
  color: #123f58;
  font-size: 1.45rem;
  font-weight: 950;
}

.compact-search {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compact-search input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 9px 10px;
}

.compact-search button {
  border: 0;
  background: var(--primary);
  color: #fff;
  padding: 0 10px;
  font-weight: 900;
}

.question-search {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 8px 0 18px;
}

.question-search h1 {
  margin: 0;
  color: #17324d;
  font-size: clamp(2rem, 5.8vw, 4.5rem);
  line-height: 1;
  text-align: center;
}

.hero-search {
  width: min(720px, 100%);
}

.category-strip {
  display: flex;
  gap: 12px;
  width: var(--aligned-content-width);
  margin: 12px auto 24px;
  overflow-x: auto;
  padding: 2px 0 10px;
  scrollbar-width: thin;
}

.category-strip a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 9px 15px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.07);
  color: #26364a;
  font-weight: 900;
}

.category-strip a span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.content-band {
  width: var(--aligned-content-width);
  margin-left: auto;
  margin-right: auto;
  margin-top: 22px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  margin-bottom: 14px;
}

.section-title h1,
.section-title h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
}

.section-title span {
  color: var(--muted);
  font-weight: 800;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(134px, 1fr));
  gap: 14px;
}

.game-grid.mosaic {
  grid-template-columns: repeat(auto-fill, var(--content-tile));
  grid-auto-rows: var(--content-tile);
  grid-auto-flow: dense;
  gap: var(--content-gap);
  justify-content: start;
}

.game-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(126px, 1fr));
}

.game-card {
  min-width: 0;
  width: 100%;
  height: 100%;
  align-self: stretch;
  justify-self: stretch;
  aspect-ratio: 1 / 1;
}

.game-card.is-large {
  grid-column: span 2;
  grid-row: span 2;
}

.game-card a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.2);
}

.game-card img {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  transition: transform 180ms ease, filter 180ms ease;
}

.game-card a:hover img {
  transform: scale(1.04);
  filter: saturate(1.08);
}

.public-body .game-card a {
  display: block;
  height: 100%;
}

.public-body .game-card img {
  height: 100%;
}

.public-body .game-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 8px 8px;
  background: linear-gradient(transparent, rgba(8, 18, 30, 0.72));
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.public-body .game-card a:hover .game-title,
.public-body .game-card a:focus-visible .game-title {
  opacity: 1;
}

.game-title {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 8px 9px 9px;
  background: #fff;
  color: #172033;
  display: -webkit-box;
  font-weight: 900;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.12;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.public-body .game-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px 8px 8px;
  background: linear-gradient(transparent, rgba(8, 18, 30, 0.72));
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  max-width: calc(100% - 16px);
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--primary-dark);
  font-size: 0.7rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-badge + .card-badge {
  top: 34px;
}

.ad-slot {
  display: grid;
  place-items: center;
  min-height: 120px;
  border: 1px dashed rgba(19, 32, 51, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.45);
  color: #526070;
  font-size: 0.85rem;
  font-weight: 850;
}

.hero-mosaic .ad-slot {
  min-height: 0;
  aspect-ratio: 1 / 1;
}

.category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 20px;
}

.category-head > div:first-child,
.related-category-card {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.category-head > div:first-child {
  display: grid;
  align-content: center;
  min-height: 120px;
  padding: 22px;
}

.category-head h1,
.category-head p {
  margin: 0;
}

.category-head p {
  color: var(--muted);
}

.related-category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.related-category-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 12px;
}

.related-category-card span {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent);
}

.all-games-list {
  display: grid;
  gap: 16px;
}

.letter-group {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
}

.letter-group h2 {
  margin: 0;
}

.letter-group div {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.letter-group a {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f7;
  font-weight: 800;
}

.game-page {
  width: min(1460px, calc(100% - 28px));
}

.play-shell {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.side-recommendations,
.game-right-rail {
  display: grid;
  gap: 12px;
}

.side-recommendations .game-card,
.game-right-rail .game-card {
  min-width: 0;
}

.side-recommendations .game-title,
.game-right-rail .game-title {
  font-size: 0.78rem;
}

.player-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.game-info-bar {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
}

.game-info-bar img {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  object-fit: cover;
}

.game-info-bar h1,
.game-info-bar p {
  margin: 0;
}

.game-info-bar p {
  color: var(--muted);
}

.vote-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--primary-dark);
  font-size: 0.88rem;
  font-weight: 900;
}

.game-detail-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  margin-top: 24px;
}

.listing {
  min-height: 58vh;
}

.seo-band {
  margin-top: 40px;
  padding: 24px 0 0;
  border-top: 1px solid var(--line);
  color: #526070;
  line-height: 1.7;
}

.seo-band h2 {
  margin: 0 0 8px;
  color: var(--ink);
}

.play-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.player-frame {
  overflow: hidden;
  background: #111827;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.16);
}

.player-frame iframe {
  display: block;
  width: 100%;
  min-height: 460px;
  aspect-ratio: 16 / 10;
  border: 0;
}

.game-panel,
.auth-card,
.editor,
.table-panel,
.stat-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.game-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.game-panel img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.game-panel h1,
.game-panel p {
  margin: 0;
}

.game-panel p,
.hint {
  color: var(--muted);
}

.game-panel dl {
  display: grid;
  gap: 9px;
  margin: 0;
}

.game-panel dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.game-panel dt {
  color: var(--muted);
}

.game-panel dd {
  margin: 0;
  font-weight: 850;
}

.tag-row,
.form-actions,
.check-row,
.row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-row span {
  padding: 6px 9px;
  border-radius: 999px;
  background: #eef3f7;
  color: #334155;
  font-size: 0.84rem;
  font-weight: 800;
}

.primary-btn,
.secondary-btn,
.danger-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 14px;
  border-radius: 8px;
}

.primary-btn {
  background: var(--primary);
  color: #fff;
}

.primary-btn:hover {
  background: var(--primary-dark);
}

.secondary-btn {
  background: #edf2f7;
  color: #243244;
}

.danger-btn {
  border: 0;
  background: #fee2e2;
  color: var(--danger);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-page {
  display: grid;
  min-height: 72vh;
  place-items: center;
}

.auth-card {
  display: grid;
  gap: 14px;
  width: min(420px, 100%);
  padding: 24px;
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  font-weight: 800;
}

.hint {
  margin: 0;
  font-size: 0.88rem;
}

.admin-shell {
  width: min(1380px, calc(100% - 32px));
}

.admin-top,
.stat-grid,
.admin-grid {
  display: grid;
  gap: 16px;
}

.admin-top {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.admin-top h1,
.admin-top p {
  margin: 0;
}

.admin-top > div:first-child {
  display: grid;
  gap: 6px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.stat-grid {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin: 18px 0;
}

.stat-grid article,
.editor,
.table-panel {
  padding: 16px;
}

.stat-grid span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

.admin-grid {
  grid-template-columns: minmax(360px, 460px) minmax(0, 1fr);
  align-items: start;
}

.editor,
.table-panel {
  display: grid;
  gap: 12px;
}

.editor h2,
.table-panel h2 {
  margin: 0;
}

.upload-editor input[type="file"] {
  padding: 9px;
  border-style: dashed;
  background: #f8fafc;
}

.thumbnail-preview {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.thumbnail-preview img {
  width: 72px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
}

.thumbnail-preview span {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.advanced-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.advanced-editor summary {
  cursor: pointer;
  color: var(--primary-dark);
  font-weight: 900;
}

.advanced-editor[open] summary {
  margin-bottom: 10px;
}

.form-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.form-status[data-state="success"] {
  color: #08784f;
}

.form-status[data-state="error"] {
  color: #b91c1c;
}

label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 11px;
  outline: 0;
}

textarea {
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(9, 166, 217, 0.13);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-row label {
  display: flex;
  gap: 8px;
  align-items: center;
}

.check-row input {
  width: auto;
}

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

.admin-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-row img {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
}

.admin-row strong,
.admin-row span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-row span {
  color: var(--muted);
  font-size: 0.9rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

.pagination span {
  color: var(--muted);
  font-weight: 800;
}

.pagination div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.pagination button {
  min-width: 40px;
}

.secondary-btn.is-active {
  background: var(--primary);
  color: #fff;
}

.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 980px) {
  .side-drawer {
    width: min(720px, 72vw);
    min-width: 0;
  }

  .app-frame {
    grid-template-columns: 1fr;
  }

  .side-rail {
    position: static;
    height: auto;
    display: block;
    padding: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .side-rail .brand {
    display: none;
  }

  .side-rail nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
  }

  .side-rail nav a {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 13px;
  }

  .site-header {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    justify-content: stretch;
    padding: 12px;
  }

  .mobile-brand {
    display: grid;
    min-height: 48px;
    padding: 0 12px;
  }

  .play-layout,
  .play-shell,
  .category-head,
  .game-detail-grid,
  .admin-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .side-recommendations {
    display: none;
  }

  .game-right-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .player-frame iframe {
    min-height: 360px;
  }
}

@media (max-width: 620px) {
  main,
  .admin-shell {
    width: min(100% - 20px, 1260px);
  }

  .portal-home {
    --content-tile: calc((100vw - 56px) / 3);
    --content-gap: 10px;
    --content-cols: 3;
  }

  .hub-brand {
    padding: 7px 5px;
  }

  .hub-actions button {
    min-height: 30px;
  }

  .side-drawer {
    width: 100vw;
    min-width: 0;
    padding: 34px 18px;
  }

  .drawer-close {
    top: 18px;
    right: 16px;
    width: 54px;
    height: 54px;
    font-size: 2.3rem;
  }

  .drawer-search-form {
    grid-template-columns: 56px minmax(0, 1fr) 52px;
    height: 68px;
    border-radius: 14px;
  }

  .search-drawer .drawer-search-form {
    width: 100%;
    margin-top: 58px;
  }

  .drawer-search-form input {
    padding: 0 14px;
    font-size: 1rem;
  }

  .drawer-hot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }

  .account-logo {
    margin-bottom: 34px;
  }

  .account-panel {
    margin-top: 44px;
  }

  .account-card {
    padding: 26px 18px 22px;
  }

  .top-search button,
  .hero-search button {
    padding: 0 14px;
  }

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

  .hero-mosaic {
    --tile: calc((100vw - 56px) / 3);
    grid-template-columns: repeat(3, var(--tile));
    grid-auto-rows: var(--tile);
    gap: 10px;
    min-height: auto;
  }

  .game-grid.mosaic {
    grid-template-columns: repeat(3, var(--content-tile));
    grid-auto-rows: var(--content-tile);
  }

  .game-title {
    padding: 8px;
    font-size: 0.82rem;
  }

  .game-info-bar {
    grid-template-columns: 48px minmax(0, 1fr);
  }

  .vote-row {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .game-right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .letter-group {
    grid-template-columns: 1fr;
  }

  .admin-row {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .row-actions {
    grid-column: 1 / -1;
  }
}
