@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #16213a;
  --muted: #657188;
  --line: #d9e4f4;
  --green: #22c55e;
  --green-dark: #16a34a;
  --navy: #111827;
  --blue-soft: #edf5ff;
  --pink: linear-gradient(90deg, #f04aa5 0%, #7b88a8 100%);
  --shadow: 0 12px 30px rgba(27, 43, 74, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top center, rgba(164, 221, 183, 0.18), transparent 24%),
    linear-gradient(180deg, #fffef9 0%, var(--bg) 18%, #eef4fb 100%);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
}

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

img {
  display: block;
  max-width: 100%;
}

.site-shell {
  min-height: 100vh;
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 28px 18px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(80, 116, 162, 0.18);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 20px;
  font-weight: 700;
}

.brand img {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: cover;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.nav-toggle {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(80, 116, 162, 0.22);
  border-radius: 14px;
  background: #ffffff;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: #23395d;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.is-open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav-links a {
  padding: 10px 12px;
  border-radius: 12px;
  font-weight: 500;
  color: #23395d;
}

.nav-links a:hover,
.nav-links .active-link {
  background: #eef5ff;
}

.page-wrap,
.content-page,
.admin-layout {
  width: min(1540px, calc(100% - 22px));
  margin: 12px auto 0;
  padding-bottom: 40px;
}

.telegram-box {
  margin-top: 12px;
  padding: 12px 14px;
  border: 2px solid #3398ff;
  background: #eaf3ff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 16px;
}

.telegram-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 700;
}

.telegram-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #2a9afb;
  color: #ffffff;
  font-size: 11px;
}

.join-btn,
.primary-btn,
.download-btn,
.delete-btn {
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.join-btn {
  padding: 14px 24px;
  background: linear-gradient(90deg, #37d25f, #1aae45);
  color: #ffffff;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 28px 0 8px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.tab {
  min-width: 182px;
  padding: 14px 20px;
  border-radius: 12px;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(90deg, #31c95f, #16a34a);
  box-shadow: 0 10px 24px rgba(37, 163, 75, 0.18);
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.tab:hover,
.tab.is-active,
.tab.is-active-dark {
  background: linear-gradient(90deg, #ef4444, #dc2626);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.22);
  transform: translateY(-1px);
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-bar input,
.admin-form input,
.admin-form select {
  width: min(100%, 458px);
  padding: 18px 16px;
  border: 1px solid #d8dfe9;
  border-radius: 10px;
  background: #ffffff;
  color: var(--text);
  font: inherit;
}

.search-bar button,
.primary-btn {
  padding: 16px 28px;
  background: #152033;
  color: #ffffff;
  font-size: 16px;
}

.result-count {
  margin: 6px 0 8px;
  color: #5c697e;
  font-size: 16px;
}

.section-title {
  margin: 18px 0 12px;
  font-size: clamp(24px, 3vw, 40px);
  line-height: 1.1;
}

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

.game-card,
.panel-card {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(173, 189, 212, 0.38);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.game-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 14px 14px 18px;
}

.rank-badge {
  position: absolute;
  top: 5px;
  left: 8px;
  min-width: 22px;
  height: 22px;
  border-radius: 4px;
  background: #ff6a1f;
  color: #ffffff;
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.game-main {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}

.game-thumb {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(12, 24, 45, 0.15);
}

.game-copy h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.game-copy p {
  margin: 0;
  line-height: 1.35;
  font-weight: 700;
}

.bonus-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ff4f5b;
}

.withdraw-line {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #29be66;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 28px;
  background: var(--pink);
  color: #ffffff;
  white-space: nowrap;
}

.empty-state {
  padding: 28px;
  background: #ffffff;
  border: 1px dashed #b3c5df;
  border-radius: 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state a {
  color: var(--green-dark);
  font-weight: 700;
}

.site-footer {
  display: grid;
  gap: 10px;
  width: min(1540px, calc(100% - 22px));
  margin: 0 auto;
  padding: 0 0 28px;
  color: #67758b;
  line-height: 1.6;
}

.site-footer p {
  margin: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 22px;
}

.panel-card {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

.panel-head h1,
.panel-head h2 {
  margin: 4px 0 0;
  font-size: 28px;
}

.eyebrow {
  margin: 0;
  color: var(--green-dark);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 12px;
}

.panel-pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: #ebfff2;
  color: var(--green-dark);
  font-weight: 700;
}

.flash {
  margin-bottom: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
}

.success-flash {
  background: #ebfff2;
  color: #166534;
}

.error-flash {
  background: #fff1f2;
  color: #be123c;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form label {
  display: grid;
  gap: 8px;
}

.admin-form span {
  font-weight: 600;
}

.admin-form input,
.admin-form select {
  width: 100%;
}

.admin-table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 12px;
  border-bottom: 1px solid #e5edf8;
  text-align: left;
  vertical-align: middle;
}

.admin-table th {
  color: #57647c;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-game {
  display: flex;
  align-items: center;
  gap: 12px;
}

.table-game img {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
}

.table-game strong,
.table-game small {
  display: block;
}

.table-game small {
  margin-top: 4px;
  color: var(--muted);
}

.delete-btn {
  padding: 10px 16px;
  background: #fff1f2;
  color: #be123c;
}

.prose-card h1 {
  margin-top: 0;
}

.prose-card p {
  color: #45536b;
  line-height: 1.75;
}

@media (max-width: 920px) {
  .site-footer,
  .panel-head,
  .admin-layout {
    display: block;
  }

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

  .nav-toggle {
    display: inline-block;
  }

  .nav-links {
    display: none;
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(80, 116, 162, 0.18);
    justify-content: flex-start;
  }

  .nav-links.is-open {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 10px;
  }

  .tab {
    min-width: 0;
    width: 100%;
    padding: 11px 10px;
    border-radius: 10px;
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
  }

  .telegram-box,
  .panel-card {
    padding: 18px;
  }

  .primary-btn {
    display: inline-flex;
    margin-top: 14px;
  }

  .search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .search-bar input {
    padding: 13px 12px;
    font-size: 14px;
  }

  .search-bar button {
    display: inline-flex;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 13px 14px;
    font-size: 14px;
  }

  .telegram-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .telegram-label {
    min-width: 0;
    gap: 8px;
    font-size: 14px;
    line-height: 1.3;
  }

  .join-btn {
    display: inline-flex;
    flex: 0 0 auto;
    margin-top: 0;
    padding: 11px 14px;
    font-size: 14px;
    white-space: nowrap;
  }

  .game-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 10px 14px 10px;
  }

  .game-main {
    margin-bottom: 0;
    align-items: flex-start;
    gap: 10px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .game-thumb {
    width: 54px;
    height: 54px;
    border-radius: 12px;
  }

  .game-copy {
    min-width: 0;
    padding-right: 0;
  }

  .game-copy h2 {
    margin-bottom: 6px;
    font-size: 16px;
  }

  .game-copy p {
    font-size: 11px;
    line-height: 1.35;
  }

  .download-btn {
    flex: 0 0 auto;
    min-width: 112px;
    margin-top: 0;
    padding: 11px 14px;
    border-radius: 8px;
    font-size: 15px;
  }

  .search-bar input {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-footer {
    padding-bottom: 24px;
  }
}
