/* Table Games — black + violet + orange */
:root {
  --tg-bg: #0a0a0c;
  --tg-bg-elevated: #121218;
  --tg-ink: #f4f0ff;
  --tg-muted: #a89bb8;
  --tg-line: rgba(168, 85, 247, 0.22);
  --tg-violet: #8b5cf6;
  --tg-violet-deep: #6d28d9;
  --tg-orange: #f97316;
  --tg-orange-hot: #ea580c;
  --tg-danger: #ef4444;
  --tg-radius: 12px;
  --tg-font: "Outfit", system-ui, sans-serif;
  --tg-display: "Syne", "Outfit", sans-serif;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body.tg-body {
  font-family: var(--tg-font);
  color: var(--tg-ink);
  background: var(--tg-bg);
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.tg-body--app {
  display: block;
}

.tg-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 12, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--tg-line);
}

.tg-brand {
  font-family: var(--tg-display);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--tg-ink) !important;
  text-decoration: none;
}

.tg-nav-link {
  color: var(--tg-muted) !important;
  font-weight: 500;
}

.tg-nav-link:hover {
  color: var(--tg-ink) !important;
}

.tg-toggler {
  border-color: var(--tg-line);
}

.tg-toggler .navbar-toggler-icon {
  filter: invert(1);
}

.tg-lang__btn {
  background: transparent;
  border: 1px solid var(--tg-line);
  color: var(--tg-muted);
  border-radius: 8px;
  padding: 0.25rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tg-lang__btn.is-active {
  border-color: var(--tg-violet);
  color: var(--tg-ink);
  background: rgba(139, 92, 246, 0.2);
}

.tg-btn {
  border-radius: 999px;
  font-weight: 600;
  padding: 0.55rem 1.25rem;
  border: none;
}

.tg-btn--orange {
  background: linear-gradient(135deg, var(--tg-orange), var(--tg-orange-hot));
  color: #12080a !important;
}

.tg-btn--orange:hover {
  filter: brightness(1.08);
  color: #12080a !important;
}

.tg-btn--violet {
  background: linear-gradient(135deg, var(--tg-violet), var(--tg-violet-deep));
  color: #fff !important;
}

.tg-btn--ghost {
  background: transparent;
  border: 1px solid var(--tg-line);
  color: var(--tg-ink) !important;
}

.tg-link-muted {
  color: var(--tg-muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.tg-link-muted:hover {
  color: var(--tg-orange);
}

.tg-main {
  flex: 1 0 auto;
}

.tg-main--flush {
  padding: 0;
}

.tg-footer {
  border-top: 1px solid var(--tg-line);
  color: var(--tg-muted);
}

.tg-footer__brand {
  font-family: var(--tg-display);
  font-weight: 700;
  color: var(--tg-violet);
}

.tg-alert {
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--tg-line);
  color: var(--tg-ink);
  border-radius: var(--tg-radius);
}

.tg-muted {
  color: var(--tg-muted);
}

/* Hero */
.tg-hero {
  position: relative;
  min-height: calc(100vh - 4.5rem);
  display: flex;
  align-items: center;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(109, 40, 217, 0.35), transparent 55%),
    radial-gradient(ellipse 70% 50% at 85% 70%, rgba(249, 115, 22, 0.22), transparent 50%),
    linear-gradient(180deg, #0a0a0c 0%, #100818 50%, #0a0a0c 100%);
}

.tg-hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
}

.tg-hero__glow--violet {
  width: 42vw;
  height: 42vw;
  top: -10%;
  left: -8%;
  background: rgba(139, 92, 246, 0.35);
  animation: tgPulse 8s ease-in-out infinite;
}

.tg-hero__glow--orange {
  width: 36vw;
  height: 36vw;
  bottom: -12%;
  right: -6%;
  background: rgba(249, 115, 22, 0.28);
  animation: tgPulse 10s ease-in-out infinite reverse;
}

@keyframes tgPulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.08); opacity: 1; }
}

.tg-hero__inner {
  position: relative;
  z-index: 1;
  padding: 4rem 1rem 5rem;
  max-width: 720px;
}

.tg-hero__brand {
  font-family: var(--tg-display);
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0 0 0.75rem;
  background: linear-gradient(105deg, #fff 20%, var(--tg-violet) 55%, var(--tg-orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: tgFadeUp 0.7s ease-out both;
}

.tg-hero__title {
  font-family: var(--tg-display);
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  font-weight: 600;
  margin: 0 0 1rem;
  color: var(--tg-ink);
  animation: tgFadeUp 0.7s ease-out 0.12s both;
}

.tg-hero__lead {
  color: var(--tg-muted);
  font-size: 1.05rem;
  max-width: 36rem;
  margin: 0 0 1.75rem;
  animation: tgFadeUp 0.7s ease-out 0.22s both;
}

.tg-hero__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  animation: tgFadeUp 0.7s ease-out 0.32s both;
}

@keyframes tgFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Auth */
.tg-body--auth {
  background:
    radial-gradient(ellipse at top right, rgba(109, 40, 217, 0.25), transparent 50%),
    var(--tg-bg);
}

.tg-auth-card {
  max-width: 420px;
  margin: 0 auto;
  background: var(--tg-bg-elevated);
  border: 1px solid var(--tg-line);
  border-radius: 16px;
  padding: 2rem;
}

.tg-auth-card h1 {
  font-family: var(--tg-display);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tg-auth-note {
  color: var(--tg-muted);
  margin-bottom: 1.5rem;
}

.tg-form-label {
  color: var(--tg-muted);
  font-size: 0.85rem;
}

.tg-input {
  background: #0a0a0c !important;
  border: 1px solid var(--tg-line) !important;
  color: var(--tg-ink) !important;
  border-radius: 10px !important;
}

.tg-input:focus {
  border-color: var(--tg-violet) !important;
  box-shadow: 0 0 0 0.2rem rgba(139, 92, 246, 0.25) !important;
}

/* App shell: full-width header first, sidebar + main under it */
.tg-app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.tg-app-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  flex-wrap: wrap;
  padding: 0.65rem 1.1rem;
  border-bottom: 1px solid var(--tg-line);
  background: rgba(12, 10, 18, 0.96);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
}

.tg-app-topbar__left,
.tg-app-topbar__right {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  min-width: 0;
}

.tg-brand--bar {
  font-size: 1.15rem;
  white-space: nowrap;
}

.tg-app-body {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex: 1;
  min-height: 0;
  min-width: 0;
  transition: grid-template-columns 0.2s ease;
}

.tg-app-shell--nav-hidden .tg-app-body {
  grid-template-columns: 0 1fr;
}

.tg-app-sidebar {
  background: var(--tg-bg-elevated);
  border-right: 1px solid var(--tg-line);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.tg-app-shell--nav-hidden .tg-app-sidebar {
  opacity: 0;
  pointer-events: none;
  border-right: none;
  transform: translateX(-0.5rem);
}

.tg-sidebar-toggle,
.tg-sidebar-show {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--tg-line);
  background: rgba(139, 92, 246, 0.12);
  color: var(--tg-ink);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  position: static;
  margin: 0;
  box-shadow: none;
}

.tg-sidebar-toggle:hover,
.tg-sidebar-show:hover {
  background: rgba(139, 92, 246, 0.22);
  border-color: var(--tg-violet, #8b5cf6);
}

.tg-app-shell--nav-hidden .tg-sidebar-toggle {
  display: none !important;
}

.tg-sidebar-toggle[hidden],
.tg-sidebar-show[hidden] {
  display: none !important;
}

.tg-radio {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.45rem 0.2rem 0.25rem;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.08);
  max-width: 100%;
}

.tg-radio__play {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--tg-orange), var(--tg-orange-hot));
  color: #12080a;
  font-size: 0.7rem;
  cursor: pointer;
  flex-shrink: 0;
}

.tg-radio__play.is-playing {
  background: linear-gradient(135deg, var(--tg-violet), var(--tg-violet-deep));
  color: #fff;
}

.tg-radio__select {
  max-width: 11.5rem;
  border: none;
  background: transparent;
  color: var(--tg-ink);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.15rem 0.1rem;
  outline: none;
  cursor: pointer;
}

.tg-radio__select option {
  color: #111;
}

.tg-radio__label {
  font-size: 0.68rem;
  color: var(--tg-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.tg-radio__vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin: 0;
  padding: 0 0.2rem 0 0.1rem;
  cursor: pointer;
}

.tg-radio__vol-icon {
  font-size: 0.72rem;
  color: var(--tg-muted);
  line-height: 1;
}

.tg-radio__volume {
  width: 4.25rem;
  height: 0.35rem;
  margin: 0;
  padding: 0;
  accent-color: var(--tg-orange);
  cursor: pointer;
  vertical-align: middle;
}

.tg-lang--bar {
  display: inline-flex;
  gap: 0.25rem;
}

.tg-account {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.25rem 0.35rem 0.25rem 0.65rem;
  border: 1px solid var(--tg-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  min-width: 0;
}

.tg-account__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}

.tg-account__name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--tg-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10rem;
}

.tg-account__role {
  font-size: 0.68rem;
  color: var(--tg-muted);
  white-space: nowrap;
}

.tg-account__logout {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--tg-muted);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
}

.tg-account__logout:hover {
  color: var(--tg-ink);
  border-color: var(--tg-line);
  background: rgba(139, 92, 246, 0.12);
}

@media (max-width: 720px) {
  .tg-radio__label {
    display: none;
  }

  .tg-radio__volume {
    width: 3.25rem;
  }

  .tg-account__role {
    display: none;
  }
}

.tg-app-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.tg-app-nav__menu {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.tg-app-nav__menu--root {
  margin-top: 0.75rem;
}

.tg-app-nav__menu--sub {
  margin-top: 0.35rem;
}

.tg-app-nav__parent {
  margin: 0;
  padding: 0.35rem 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tg-muted);
}

.tg-app-nav__parent--sub {
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 600;
  color: var(--tg-ink);
  opacity: 0.72;
}

.tg-app-nav__menu.is-open > .tg-app-nav__parent {
  color: var(--tg-violet, #8b5cf6);
  opacity: 1;
}

.tg-app-nav__submenu {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding-left: 0.65rem;
  border-left: 1px solid var(--tg-line);
  margin-left: 0.75rem;
}

.tg-app-nav__link {
  display: block;
  color: var(--tg-muted);
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-weight: 500;
  width: 100%;
}

.tg-app-nav__link:hover,
.tg-app-nav__link.is-active {
  color: var(--tg-ink);
  background: rgba(139, 92, 246, 0.15);
}

.tg-app-nav__link.is-active {
  border-left: 3px solid var(--tg-orange);
}

.tg-app-main {
  padding: 2rem 1.5rem 3rem;
  max-width: 960px;
}

.tg-app-main:has(.tg-wg),
.tg-app-main:has(.tg-ms),
.tg-app-main:has(.tg-chess) {
  max-width: 1080px;
}

/* Minesweeper */
.tg-ms__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.tg-ms__diff {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--tg-muted);
  font-size: 0.9rem;
}

.tg-ms__select {
  background: var(--tg-bg-elevated);
  color: var(--tg-ink);
  border: 1px solid var(--tg-line);
  border-radius: 8px;
  padding: 0.35rem 0.55rem;
}

.tg-ms__stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  color: var(--tg-muted);
  font-size: 0.9rem;
}

.tg-ms__status {
  margin: 0;
  font-weight: 600;
  color: var(--tg-ink);
}

.tg-ms__board-wrap {
  overflow: auto;
  padding-bottom: 0.5rem;
}

.tg-ms__board {
  --ms-cell: max(1.3rem, min(1.7rem, calc((100vw - 3rem) / var(--ms-cols, 9))));
  display: grid;
  grid-template-columns: repeat(var(--ms-cols, 9), var(--ms-cell));
  gap: 2px;
  width: max-content;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--tg-line);
}

.tg-ms__cell {
  width: var(--ms-cell);
  height: var(--ms-cell);
  padding: 0;
  border: none;
  border-radius: 4px;
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.35), rgba(30, 20, 45, 0.9));
  color: var(--tg-ink);
  font-size: clamp(0.62rem, calc(var(--ms-cell) * 0.45), 0.78rem);
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}

.tg-ms__cell:hover:not(.is-open) {
  filter: brightness(1.15);
}

.tg-ms__cell.is-open {
  background: rgba(255, 255, 255, 0.06);
  cursor: default;
}

.tg-ms__cell.is-flag {
  color: var(--tg-orange);
}

.tg-ms__cell.is-mine,
.tg-ms__cell.is-mine-reveal {
  background: rgba(220, 60, 60, 0.45);
  color: #fff;
}

.tg-ms__cell[data-n="1"] { color: #60a5fa; }
.tg-ms__cell[data-n="2"] { color: #4ade80; }
.tg-ms__cell[data-n="3"] { color: #f87171; }
.tg-ms__cell[data-n="4"] { color: #a78bfa; }
.tg-ms__cell[data-n="5"] { color: #fb923c; }
.tg-ms__cell[data-n="6"] { color: #22d3ee; }
.tg-ms__cell[data-n="7"] { color: #e2e8f0; }
.tg-ms__cell[data-n="8"] { color: #94a3b8; }

.tg-ms__hint {
  margin-top: 1rem;
  font-size: 0.85rem;
}

/* Chess */
.tg-chess__lobby {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.tg-chess__panel {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--tg-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.tg-chess__field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.85rem;
  color: var(--tg-muted);
}

.tg-chess__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
  margin-bottom: 1rem;
}

.tg-chess__status {
  margin: 0;
  font-weight: 600;
}

.tg-chess__play {
  display: grid;
  grid-template-columns: minmax(0, 480px) minmax(180px, 240px);
  gap: 1.25rem;
  align-items: start;
}

.tg-chess__board-frame {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr);
  gap: 0.25rem 0.35rem;
  width: min(100%, 480px);
}

.tg-chess__ranks {
  display: grid;
  grid-template-rows: repeat(8, 1fr);
  align-items: stretch;
  padding-bottom: 1.2rem;
}

.tg-chess__ranks .tg-chess__coord {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 0.15rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tg-muted);
  line-height: 1;
}

.tg-chess__board-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.tg-chess__files {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.tg-chess__files .tg-chess__coord {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--tg-muted);
  line-height: 1;
}

.tg-chess__board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  aspect-ratio: 1;
  border: 2px solid var(--tg-line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.tg-chess__sq {
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  aspect-ratio: 1;
}

.tg-chess__sq.is-light {
  background: #e8d5b5;
}

.tg-chess__sq.is-dark {
  background: #b58863;
}

.tg-chess__sq.is-selected {
  box-shadow: inset 0 0 0 3px var(--tg-orange);
}

.tg-chess__piece {
  font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", "DejaVu Sans", serif;
  font-size: clamp(1.35rem, 5.2vw, 2.35rem);
  line-height: 1;
  display: block;
  transform: translateY(0);
  user-select: none;
  pointer-events: none;
}

.tg-chess__piece.is-white {
  color: #f7f2e8;
  -webkit-text-stroke: 1.25px #2a2118;
  paint-order: stroke fill;
  text-shadow: none;
  filter: none;
}

.tg-chess__piece.is-black {
  color: #1a1410;
  -webkit-text-stroke: 0;
  text-shadow: none;
  filter: none;
}

.tg-chess__log {
  border: 1px solid var(--tg-line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.85rem 0.9rem;
  min-height: 220px;
  max-height: 480px;
  display: flex;
  flex-direction: column;
}

.tg-chess__log-title {
  font-family: var(--tg-display);
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.65rem;
}

.tg-chess__moves {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  flex: 1;
  font-variant-numeric: tabular-nums;
  font-size: 0.9rem;
}

.tg-chess__moves-empty {
  color: var(--tg-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0;
}

.tg-chess__move-row {
  display: grid;
  grid-template-columns: 2rem 1fr 1fr;
  gap: 0.35rem;
  padding: 0.28rem 0.2rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.tg-chess__move-num {
  color: var(--tg-muted);
  font-weight: 600;
}

.tg-chess__move {
  color: var(--tg-ink);
  font-weight: 500;
}

.tg-chess__hint {
  margin-top: 0.85rem;
  font-size: 0.85rem;
}

.tg-chess__error {
  margin-top: 0.75rem;
  color: #f87171;
  font-weight: 600;
}

@media (max-width: 800px) {
  .tg-chess__play {
    grid-template-columns: 1fr;
  }

  .tg-chess__log {
    max-height: 220px;
  }
}

.tg-app-page__head h1 {
  font-family: var(--tg-display);
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.tg-app-page__category {
  font-family: var(--tg-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.75rem 0 0.35rem;
  color: var(--tg-ink);
}

.tg-app-page__sub {
  font-size: 0.95rem;
  color: var(--tg-muted);
  margin: 1rem 0 0.75rem;
  font-weight: 600;
}

.tg-game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.tg-game-tile {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border-radius: var(--tg-radius);
  border: 1px solid var(--tg-line);
  background: linear-gradient(160deg, rgba(139, 92, 246, 0.12), rgba(249, 115, 22, 0.08));
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tg-game-tile:hover {
  transform: translateY(-3px);
  border-color: var(--tg-orange);
  color: inherit;
}

.tg-game-tile__title {
  font-family: var(--tg-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.tg-game-tile__desc {
  color: var(--tg-muted);
  font-size: 0.92rem;
}

.tg-game-tile__badge {
  align-self: flex-start;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.18);
  color: #fdba74;
}

.tg-wg__hero {
  text-align: center;
  margin-bottom: 1.25rem;
}

.tg-wg__day {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--tg-muted);
}

.tg-wg__guess {
  display: flex;
  gap: 0.5rem;
  max-width: 420px;
  margin: 0 auto 1.5rem;
}

.tg-wg__input {
  flex: 1;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--tg-line);
  border-radius: 10px;
  color: var(--tg-ink);
  padding: 0.7rem 0.9rem;
  font-size: 1rem;
}

.tg-wg__input:focus {
  outline: 2px solid rgba(139, 92, 246, 0.45);
  border-color: var(--tg-violet, #8b5cf6);
}

.tg-wg__submit {
  min-width: 3rem;
  font-size: 1.15rem;
}

.tg-wg__win {
  text-align: center;
  margin-bottom: 1.25rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.tg-wg__board-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 1rem;
  border-radius: 12px;
  border: 1px solid var(--tg-line);
}

.tg-wg__board {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0.3rem;
  padding: 0.45rem;
  margin: 0;
}

@media (max-width: 720px) {
  .tg-wg__board {
    min-width: 560px;
  }
}

.tg-wg__board th {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--tg-muted);
  font-weight: 600;
  text-align: center;
  padding: 0.2rem 0.1rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tg-wg__weapon,
.tg-wg__cell {
  text-align: center;
  vertical-align: middle;
  border-radius: 8px;
  padding: 0.35rem 0.15rem;
  font-size: 0.68rem;
  font-weight: 600;
  min-width: 0;
  color: #fff;
  overflow: hidden;
  word-break: break-word;
}

.tg-wg__weapon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  min-width: 0;
}

.tg-wg__weapon img {
  object-fit: contain;
  max-width: 100%;
  height: auto;
}

.tg-wg__cell-val {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tg-wg__arrow {
  display: block;
  font-size: 0.75rem;
  line-height: 1;
  opacity: 0.95;
}

.tg-wg__cell.is-correct,
.tg-wg__weapon.is-correct,
.tg-wg__swatch.is-correct {
  background: #1f9d55;
}

.tg-wg__cell.is-partial,
.tg-wg__swatch.is-partial {
  background: #c9a227;
}

.tg-wg__cell.is-wrong,
.tg-wg__weapon.is-wrong,
.tg-wg__swatch.is-wrong {
  background: #c0392b;
}

.tg-wg__empty td {
  text-align: center;
  color: var(--tg-muted) !important;
  background: transparent !important;
  padding: 1.5rem 0.5rem;
  white-space: normal;
  word-break: normal;
  font-weight: 500;
  font-size: 0.9rem;
}

.tg-wg__legend {
  display: inline-block;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--tg-line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
}

.tg-wg__legend-title {
  font-weight: 600;
  margin: 0 0 0.4rem;
}

.tg-wg__legend ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.1rem;
}

.tg-wg__legend li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--tg-muted);
}

.tg-wg__swatch {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 3px;
  display: inline-block;
}

.tg-wg__arrow-demo {
  font-weight: 700;
  color: var(--tg-ink);
}

.tg-admin__meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.tg-admin__meta dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tg-muted);
}

.tg-admin__meta dd {
  margin: 0.2rem 0 0;
  font-weight: 600;
  font-size: 1.05rem;
}

.tg-mafia__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.tg-mafia__panel {
  background: var(--tg-bg-elevated);
  border: 1px solid var(--tg-line);
  border-radius: var(--tg-radius);
  padding: 1.25rem;
}

.tg-mafia__panel h2 {
  font-family: var(--tg-display);
  font-size: 1.15rem;
  margin-bottom: 1rem;
}

.tg-room-code {
  font-family: ui-monospace, monospace;
  color: var(--tg-orange);
  letter-spacing: 0.12em;
}

.tg-player-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.tg-player-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--tg-line);
}

.tg-badge {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--tg-violet);
  border: 1px solid var(--tg-violet);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.tg-camera__video {
  width: 100%;
  max-width: 420px;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--tg-radius);
  border: 1px solid var(--tg-line);
  object-fit: cover;
  display: block;
  margin-bottom: 0.75rem;
}

.tg-camera__error {
  color: var(--tg-danger);
}

.tg-camera__actions {
  display: flex;
  gap: 0.5rem;
}

.tg-legal {
  max-width: 42rem;
}

.tg-legal h1 {
  font-family: var(--tg-display);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.tg-legal h2 {
  font-family: var(--tg-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin: 1.75rem 0 0.5rem;
  color: var(--tg-ink);
}

.tg-legal__lead {
  font-size: 1.1rem;
  line-height: 1.55;
  color: var(--tg-muted);
  margin-bottom: 1.25rem;
}

.tg-legal p {
  line-height: 1.65;
  margin-bottom: 1rem;
  color: var(--tg-ink);
}

/* Admin */
.tg-admin__title {
  font-family: var(--tg-display);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.tg-admin__lead,
.tg-admin__muted {
  color: var(--tg-muted);
}

.tg-admin__link {
  color: var(--tg-violet);
}

.tg-admin-panel {
  background: var(--tg-bg-elevated);
  border: 1px solid var(--tg-line);
  border-radius: 12px;
  padding: 1.25rem;
}

.tg-admin-panel__title {
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tg-muted);
  margin-bottom: 0.75rem;
}

.tg-admin-hr {
  border-color: var(--tg-line);
  opacity: 1;
  margin: 1.25rem 0;
}

.tg-table {
  color: var(--tg-ink);
  --bs-table-bg: transparent;
  --bs-table-color: var(--tg-ink);
  --bs-table-border-color: var(--tg-line);
}

.tg-table thead th {
  color: var(--tg-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.tg-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.18);
  color: #ddd6fe;
  font-size: 0.8rem;
}

.tg-code {
  color: var(--tg-orange);
  font-size: 0.8rem;
}

.tg-btn--danger {
  background: transparent;
  border: 1px solid var(--tg-danger);
  color: var(--tg-danger);
}

.tg-btn--danger:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #fecaca;
}

.tg-modal {
  background: var(--tg-bg-elevated);
  color: var(--tg-ink);
  border: 1px solid var(--tg-line);
}

.tg-modal .modal-header,
.tg-modal .modal-footer {
  border-color: var(--tg-line);
}

@media (max-width: 768px) {
  .tg-app-body {
    grid-template-columns: 1fr;
  }

  .tg-app-shell--nav-hidden .tg-app-body {
    grid-template-columns: 1fr;
  }

  .tg-app-shell--nav-hidden .tg-app-sidebar {
    display: none;
  }

  .tg-app-sidebar {
    border-right: none;
    border-bottom: 1px solid var(--tg-line);
  }

  .tg-app-nav {
    flex-direction: column;
    flex-wrap: nowrap;
  }
}
