﻿:root {
  --home-bg: #f7f9fd;
  --home-surface: rgba(255, 255, 255, 0.9);
  --home-surface-strong: #ffffff;
  --home-border: #cfd9e7;
  --home-shadow: 0 20px 48px rgba(17, 31, 58, 0.12);
  --home-text: #16253d;
  --home-muted: #44566f;
  --home-button-bg: #ffffff;
  --home-button-bg-hover: #f2f6fb;
  --home-button-border: #c6d3e4;
  --home-button-text: #000000;
  --home-link: #0a58ca;
  --home-sticker-bg: #111111;
  --home-sticker-text: #ffffff;
}

:root[data-theme="dark"] {
  --home-bg: #13253d;
  --home-surface: rgba(17, 32, 54, 0.9);
  --home-surface-strong: #173055;
  --home-border: #37547a;
  --home-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
  --home-text: #e9f1ff;
  --home-muted: #c0d1eb;
  --home-button-bg: #23456f;
  --home-button-bg-hover: #2f5a8d;
  --home-button-border: #5579a8;
  --home-button-text: #f7fbff;
  --home-link: #9ac5ff;
  --home-sticker-bg: #ffffff;
  --home-sticker-text: #173055;
}

html {
  background: var(--home-bg);
}

body.home-body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(111, 167, 255, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(255, 179, 71, 0.12), transparent 26%),
    var(--home-bg);
  color: var(--home-text);
  font-family: Arial, Helvetica, sans-serif;
  overflow-x: hidden;
}

body.home-body.tamers-home-popup-open {
  overflow: hidden;
}

.home-page-shell {
  width: min(100% - 32px, 1080px);
  margin: 0 auto;
  padding: 24px 0 120px;
}

.home-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
  margin: 8px auto 22px;
}

.home-logo-link {
  display: inline-flex;
  justify-content: center;
}

.home-logo {
  display: block;
  width: min(100%, 720px);
  height: auto;
}

.home-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--home-muted);
}

.home-layout {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 520px) minmax(120px, 170px);
  gap: 28px;
  align-items: start;
  justify-content: center;
}

.home-side-card,
.home-main-card {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.home-side-card {
  padding: 0;
}

.home-main-card {
  padding: 0;
}

.home-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--home-button-border);
  background: var(--home-button-bg);
  color: var(--home-button-text);
  text-decoration: none;
  font: 700 14px/1 Arial, Helvetica, sans-serif;
  letter-spacing: 0.04em;
  text-align: center;
  border-radius: 10px;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.home-action:hover,
.home-action:focus-visible {
  background: var(--home-button-bg-hover);
  border-color: var(--home-button-bg-hover);
  transform: translateY(-1px);
}

:root:not([data-theme="dark"]) .home-action:hover,
:root:not([data-theme="dark"]) .home-action:focus-visible {
  color: #000000;
  border-color: #b7c9de;
}

.home-action:focus-visible {
  outline: 2px solid var(--home-link);
  outline-offset: 2px;
}

.home-patreon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.home-patreon-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.home-patreon-logo img {
  width: 104px;
  height: 104px;
  display: block;
}

.home-patreon-copy {
  margin: 0;
  color: var(--home-text);
  font-size: 14px;
  line-height: 1.55;
}

.home-patreon-copy + .home-patreon-copy {
  margin-top: -4px;
}

.home-patreon a,
.home-footer a,
.tamers-home-popup a {
  color: var(--home-link);
}

.home-side-spotlight {
  display: flex;
  justify-content: center;
}

.home-sticker {
  position: relative;
  width: 148px;
  aspect-ratio: 1 / 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transform: rotate(-7deg);
  transition: transform 0.18s ease;
}

.home-sticker:hover,
.home-sticker:focus-visible {
  transform: rotate(-6deg) translateY(-2px);
}

.home-sticker-badge {
  width: 100%;
  height: 100%;
  display: block;
  color: var(--home-sticker-bg);
  filter: drop-shadow(0 14px 30px rgba(17, 31, 58, 0.16));
}

.home-sticker-label {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--home-sticker-text);
  font: 900 21px/0.9 Arial, Helvetica, sans-serif;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
  transform: rotate(7deg);
}

.home-footer {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.home-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.home-socials a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
}

.home-socials img {
  width: 22px;
  height: 22px;
  display: block;
}

.home-thanks {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--home-text);
  text-align: center;
}

:root[data-theme="dark"] .home-patreon-logo img,
:root[data-theme="dark"] .home-socials img {
  filter: invert(1) hue-rotate(180deg) brightness(1.2);
}

.tamers-home-popup-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 12, 24, 0.72);
}

.tamers-home-popup-backdrop[hidden] {
  display: none !important;
}

.tamers-home-popup {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--home-border);
  background: var(--home-surface-strong);
  color: var(--home-text);
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.34);
  padding: 24px 24px 20px;
}

.tamers-home-popup h2 {
  margin: 0 0 12px;
  font: 700 28px/1.15 Georgia, "Times New Roman", serif;
}

.tamers-home-popup p {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
}

.tamers-home-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.tamers-home-popup-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--home-border);
  background: #f3f6fa;
  color: #13253d;
  font: 600 14px/1 Arial, Helvetica, sans-serif;
  text-decoration: none;
  cursor: pointer;
}

.tamers-home-popup-btn:hover,
.tamers-home-popup-btn:focus-visible {
  background: #e7edf5;
}

.tamers-home-popup-btn-primary {
  background: var(--home-button-bg);
  border-color: var(--home-button-bg);
  color: #ffffff !important;
}

.tamers-home-popup-btn-primary:hover,
.tamers-home-popup-btn-primary:focus-visible {
  background: var(--home-button-bg-hover);
  border-color: var(--home-button-bg-hover);
}

:root[data-theme="dark"] .tamers-home-popup-backdrop {
  background: rgba(3, 7, 16, 0.8);
}

:root[data-theme="dark"] .tamers-home-popup-btn {
  background: #173055;
  border-color: #42638f;
  color: #e9f1ff;
}

:root[data-theme="dark"] .tamers-home-popup-btn:hover,
:root[data-theme="dark"] .tamers-home-popup-btn:focus-visible {
  background: #24456f;
}

:root[data-theme="dark"] .tamers-home-popup-btn-primary {
  background: #f3f6fa;
  border-color: #f3f6fa;
  color: #13253d !important;
}

:root[data-theme="dark"] .tamers-home-popup-btn-primary:hover,
:root[data-theme="dark"] .tamers-home-popup-btn-primary:focus-visible {
  background: #ffffff;
  border-color: #ffffff;
}

@media (max-width: 960px) {
  .home-layout {
    grid-template-columns: minmax(150px, 200px) minmax(0, 1fr) 120px;
    gap: 20px;
  }

  .home-main-card {
    padding: 18px;
  }

  .home-sticker {
    width: 124px;
  }
}

:root.tamers-mobile-ui .home-page-shell {
  width: min(100% - 24px, 100%);
  padding: 18px 0 120px;
}

:root.tamers-mobile-ui .home-hero {
  margin-bottom: 18px;
  gap: 12px;
}

:root.tamers-mobile-ui .home-note {
  max-width: 320px;
  font-size: 11px;
}

:root.tamers-mobile-ui .home-layout {
  grid-template-columns: 1fr;
  gap: 16px;
}

:root.tamers-mobile-ui .home-main-card {
  order: 1;
  width: 100%;
  min-width: 0;
}

:root.tamers-mobile-ui .home-side-spotlight {
  order: 2;
}

:root.tamers-mobile-ui .home-patreon {
  order: 3;
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
}

:root.tamers-mobile-ui .home-main-card,
:root.tamers-mobile-ui .home-side-card {
  padding: 16px;
}

:root.tamers-mobile-ui .home-actions {
  width: 100%;
}

:root.tamers-mobile-ui .home-action {
  width: 100%;
  min-height: 46px;
  box-sizing: border-box;
  font-size: 13px;
}

:root.tamers-mobile-ui .home-sticker {
  width: 112px;
}

:root.tamers-mobile-ui .home-sticker-label {
  font-size: 18px;
}

:root.tamers-mobile-ui .home-patreon-logo img {
  width: 86px;
  height: 86px;
}

:root.tamers-mobile-ui .tamers-home-popup {
  padding: 20px 18px 18px;
}

:root.tamers-mobile-ui .tamers-home-popup h2 {
  font-size: 24px;
}

:root.tamers-mobile-ui .tamers-home-popup p {
  font-size: 15px;
}

:root.tamers-mobile-ui .tamers-home-popup-actions {
  justify-content: stretch;
}

:root.tamers-mobile-ui .tamers-home-popup-btn {
  width: 100%;
}

@media (max-width: 700px) {
  .home-page-shell {
    width: min(100% - 18px, 100%);
    padding: 12px 0 108px;
  }

  .home-hero {
    margin-bottom: 12px;
    gap: 9px;
  }

  .home-logo {
    width: min(100%, 300px);
  }

  .home-note {
    max-width: 270px;
    font-size: 10px;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .home-main-card {
    order: 1;
    width: 100%;
    min-width: 0;
  }

  .home-side-spotlight {
    order: 2;
  }

  .home-patreon {
    order: 3;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
  }

  .home-main-card,
  .home-side-card {
    padding: 8px;
  }

  .home-actions {
    width: 100%;
    gap: 8px;
  }

  .home-action {
    width: 100%;
    min-height: 40px;
    box-sizing: border-box;
    font-size: 12px;
    padding: 0 12px;
  }

  .home-sticker {
    width: 78px;
  }

  .home-sticker-label {
    font-size: 13px;
  }

  .home-patreon-logo img {
    width: 64px;
    height: 64px;
  }

  .home-patreon-copy {
    font-size: 12px;
    line-height: 1.45;
  }

  .home-footer {
    margin-top: 14px;
    gap: 10px;
  }

  .home-socials {
    gap: 12px;
  }
}

@media (max-width: 760px) and (pointer: coarse), (max-width: 760px) and (hover: none) {
  .home-page-shell {
    width: min(100% - 24px, 100%);
    padding: 18px 0 120px;
  }

  .home-hero {
    margin-bottom: 18px;
    gap: 12px;
  }

  .home-note {
    max-width: 320px;
    font-size: 11px;
  }

  .home-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .home-main-card {
    order: 1;
  }

  .home-side-spotlight {
    order: 2;
  }

  .home-patreon {
    order: 3;
  }

  .home-main-card,
  .home-side-card {
    padding: 16px;
  }

  .home-sticker {
    width: 112px;
  }

  .home-sticker-label {
    font-size: 18px;
  }

  .home-patreon-logo img {
    width: 86px;
    height: 86px;
  }

  .home-action {
    min-height: 46px;
    font-size: 13px;
  }

  .tamers-home-popup {
    padding: 20px 18px 18px;
  }

  .tamers-home-popup h2 {
    font-size: 24px;
  }

  .tamers-home-popup p {
    font-size: 15px;
  }

  .tamers-home-popup-actions {
    justify-content: stretch;
  }

  .tamers-home-popup-btn {
    width: 100%;
  }
}
