:root {
  --bg: #120d0a;
  --bg-soft: #1d140f;
  --panel: rgba(34, 24, 17, 0.9);
  --panel-strong: rgba(22, 15, 10, 0.96);
  --line: rgba(255, 221, 177, 0.11);
  --text: #f4e7d2;
  --muted: #d4b38a;
  --gold: #d7a55d;
  --gold-soft: #f1d0a2;
  --shadow: rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  background:
    radial-gradient(ellipse at 50% -15%, rgba(199, 142, 78, 0.16), transparent 46%),
    linear-gradient(180deg, #120d0a 0%, #1a120d 100%);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
.page-shell { min-height: 100vh; }
.container { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid rgba(255, 221, 177, 0.14);
  background: rgba(24, 16, 11, 0.88);
  backdrop-filter: blur(14px);
}
.nav { display: flex; align-items: center; justify-content: space-between; min-height: 82px; gap: 24px; }
.brand-wrap, .nav-links, .topbar-actions { display: flex; align-items: center; }
.brand-wrap { gap: 18px; flex: 0 0 auto; }
.brand { display: inline-flex; align-items: center; min-width: 190px; }
.brand-logo { display: block; width: 190px; height: auto; filter: drop-shadow(0 5px 16px rgba(216, 180, 110, 0.2)); }
.online-badge {
  display: inline-flex;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid rgba(216, 180, 110, 0.35);
  background: rgba(216, 180, 110, 0.08);
  border-radius: 999px;
  color: var(--gold-soft);
  text-decoration: none;
  font-size: 0.61rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.online-badge:hover {
  background: rgba(101, 232, 138, 0.14);
  box-shadow: inset 0 0 14px rgb(215 164 20 / 16%), 0 0 18px rgb(255 186 31 / 24%);
  transform: translateY(-1px);
}
.online-dot, .offline-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; }
.online-dot { background: #4dff78; box-shadow: 0 0 6px #4dff78, 0 0 14px rgba(77, 255, 120, 0.9); }
.offline-dot { background: #ff0000; box-shadow: 0 0 6px #db091d, 0 0 14px rgb(157 35 35 / 90%); }
.online-badge strong { margin-left: -5px; font-size: 0.68rem; letter-spacing: 0.07em; color: var(--text); }
.nav-links { justify-content: flex-end; gap: clamp(12px, 2vw, 28px); color: var(--muted); font-size: 0.84rem; }
.nav-links a { transition: color 160ms ease; }
.nav-links a:hover { color: var(--gold-soft); }
.topbar-actions { gap: 14px; white-space: nowrap; }
.user-chip { color: var(--text); font-size: 0.84rem; }
.signout-link { padding: 9px 14px; border: 1px solid var(--line); border-radius: 8px; color: var(--gold-soft); }
.nav-button { padding: 10px 15px; border: 1px solid rgba(216, 180, 110, 0.36); border-radius: 8px; color: var(--text); background: rgba(216, 180, 110, 0.09); }
.page-layout-main {
  display: grid;
  grid-template-columns: 280px minmax(0, 760px);
  justify-content: center;
  align-items: start;
  gap: 28px;
  width: min(1180px, calc(100% - 40px));
  min-height: calc(100vh - 82px);
  margin: 0 auto;
  padding: 42px 0 76px;
}
.page-layout-main.is-public { grid-template-columns: minmax(0, 760px); }
.page-sidebar { position: sticky; top: 106px; padding: 25px 22px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); box-shadow: 0 18px 48px var(--shadow); }
.eyebrow { margin: 0 0 18px; color: var(--text); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; }
.sidebar-nav { display: flex; flex-direction: column; gap: 5px; }
.profile-nav-link, .sidebar-group summary { display: flex; align-items: center; min-height: 42px; padding: 9px 12px; border-left: 2px solid transparent; color: var(--muted); font-size: 0.88rem; line-height: 1.35; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; cursor: pointer; list-style: none; }
.profile-nav-link:hover, .profile-nav-link.is-active, .sidebar-group summary:hover { border-left-color: var(--gold); color: var(--text); background: rgba(216, 180, 110, 0.09); }
.sidebar-group { margin-top: 8px; border-bottom: 1px solid rgba(255, 221, 177, 0.08); }
.sidebar-group summary::-webkit-details-marker { display: none; }
.sidebar-group summary::after { content: "+"; margin-left: auto; color: var(--gold-soft); }
.sidebar-group[open] summary::after { content: "-"; }
.sidebar-submenu { display: grid; gap: 3px; padding: 3px 0 10px 14px; }
.sidebar-submenu .profile-nav-link { min-height: 38px; padding-left: 11px; font-size: 0.84rem; }
.sidebar-spacer { height: 15px; margin: 7px 0; border-bottom: 1px dashed rgba(255, 221, 177, 0.12); }
.profile-nav-link.sidebar-logout { margin-top: 12px; color: #e99b8b; }
.page-content { min-width: 0; }
.page-panel { min-height: 520px; padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 24px 56px rgba(0, 0, 0, 0.24); }
.wiki-article { min-width: 0; }
.wiki-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-bottom: 26px; color: var(--muted); font-size: 0.76rem; }
.wiki-breadcrumb a:hover { color: var(--gold-soft); }
.wiki-breadcrumb-sep { color: rgba(241, 208, 162, 0.42); }
.wiki-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.wiki-title-group { display: grid; gap: 12px; }
.wiki-title { margin: 0; color: var(--text); font-family: "Cormorant Garamond", Georgia, serif; font-size: clamp(1.8rem, 4vw, 2.45rem); font-weight: 700; line-height: 1.05; }
.wiki-badges { display: flex; flex-wrap: wrap; gap: 7px; }
.wiki-badge { display: inline-flex; align-items: center; min-height: 25px; padding: 4px 9px; border: 1px solid rgba(216, 180, 110, 0.2); border-radius: 999px; color: var(--muted); background: rgba(216, 180, 110, 0.06); font-size: 0.67rem; font-weight: 700; letter-spacing: 0.04em; }
.wiki-badge.is-primary { border-color: rgba(216, 180, 110, 0.38); color: var(--gold-soft); background: rgba(216, 180, 110, 0.13); }
.wiki-lead { margin: 0 0 22px; color: #e4d7c8; font-size: 0.92rem; line-height: 1.7; }
.profile-panel { display: grid; gap: 18px; margin-top: 22px; }
.profile-card { margin-top: 20px; min-width: 0; padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: rgba(26, 18, 12, 0.78); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); }
.profile-card + .profile-card { margin-top: 20px; }
.profile-user-header { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid rgba(255, 221, 177, 0.1); }
.profile-avatar { display: grid; place-items: center; width: 56px; height: 56px; flex: 0 0 56px; border: 1px solid rgba(216, 180, 110, 0.44); border-radius: 50%; color: var(--gold-soft); background: radial-gradient(circle at 35% 25%, #4b3421, #1a120d 74%); font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.7rem; font-weight: 700; }
.profile-user-name { margin: 0; color: var(--text); font-family: "Cormorant Garamond", Georgia, serif; font-size: 1.45rem; font-weight: 700; }
.profile-user-email { margin: 4px 0 0; color: var(--muted); font-size: 0.79rem; overflow-wrap: anywhere; }
.profile-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.profile-stat-box { display: flex; flex-direction: column; gap: 7px; min-width: 0; min-height: 86px; padding: 15px; border: 1px solid rgba(255, 221, 177, 0.08); border-radius: 10px; background: rgba(12, 8, 5, 0.4); }
.profile-stat-label { color: var(--muted); font-size: 0.72rem; }
.profile-stat-val { color: var(--gold-soft); font-size: 0.99rem; font-weight: 700; overflow-wrap: anywhere; }
.form-group { display: flex; flex-direction: column; gap: 0; margin-bottom: 16px; }
.form-label { color: var(--gold-soft); font-size: 0.84rem; font-weight: 600; display: block; margin-bottom: 10px; }
.form-control { width: 100%; min-height: 44px; padding: 10px 13px; border: 1px solid rgba(216, 180, 110, 0.3); border-radius: 9px; color: var(--text); background: rgba(12, 8, 5, 0.85); font: inherit; font-size: 0.9rem; transition: border-color 160ms ease, box-shadow 160ms ease; }
.form-control::placeholder { color: rgba(212, 179, 138, 0.56); }
.form-control:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(216, 180, 110, 0.13); }
.form-hint { margin-top: 10px; color: var(--muted); font-size: 0.76rem; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 18px; }
.players-live-indicator.shop-price { display: inline-grid; grid-template-columns: auto auto; align-items: center; column-gap: 10px; min-width: 132px; padding: 14px 16px; border: 1px solid rgba(101, 232, 138, 0.32); border-radius: 8px; background: rgba(61, 180, 96, 0.09); color: #a9f0b8; white-space: nowrap; }
.shop-price > span { color: #4dff78; font-size: 1rem; font-weight: 600; text-shadow: 0 0 12px rgba(77, 255, 120, 0.8); }
.shop-price > strong { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.shop-product-card { margin-bottom: 16px; }
.shop-product-title { display: flex; align-items: center; gap: 14px; margin: 0 0 18px; min-width: 0; }
.shop-item-art { display: grid; place-items: center; flex: 0 0 48px; width: 48px; min-height: 48px; }
.shop-order-product { display: flex; align-items: center; gap: 12px; min-width: 180px; }
.shop-order-art { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; }
.shop-order-art img { display: block; max-width: 44px; max-height: 44px; object-fit: contain; image-rendering: pixelated; }
.shop-order-status { white-space: nowrap; }
.shop-variants { display: flex; gap: 8px; margin: 0; padding: 0; border: 0; }
.shop-variants legend { margin-bottom: 8px; color: var(--gold-soft); font-size: 0.84rem; }
.shop-variant { display: grid; grid-template-columns: auto auto; align-items: center; justify-items: center; gap: 4px 8px; padding: 9px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.shop-variant:has(input:checked) { border-color: var(--gold); background: rgba(216,180,110,0.12); }
.shop-variant img { grid-column: 2; width: 42px; height: 42px; object-fit: contain; image-rendering: pixelated; }
.shop-item-card:has(.shop-variants) { flex-wrap: wrap; }
.shop-item-card:has(.shop-variants) > .account-form { flex-basis: 100%; }
.shop-product-title img { display: block; max-width: 48px; max-height: 48px; object-fit: contain; image-rendering: pixelated; }
.shop-item-card { display: flex; align-items: center; gap: 20px; }
.shop-item-card .shop-product-title { flex: 1; margin: 0; }
.shop-item-card > .account-form { flex: 0 0 auto; margin-left: auto; }
.shop-purchase-row { display: flex; align-items: center; gap: 12px; }
.shop-purchase-row > .form-control { flex: 1; min-width: 0; height: 44px; }
.form-actions.shop-purchase-actions { flex: 0 0 auto; flex-wrap: nowrap; justify-content: flex-end; gap: 10px; margin: 10px 0 0 auto; }
.shop-purchase-actions > .shop-price, .shop-purchase-actions > .btn-cabinet { height: 44px; min-height: 44px; width: auto; padding-block: 9px; box-sizing: border-box; }
.shop-purchase-actions > .shop-price { min-width: 116px; }
.shop-purchase-actions > .btn-cabinet { transform: none; }
.shop-animal-category { margin: 26px 0; }
.shop-animal-category > summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--gold-soft); font-size: 1.3rem; font-weight: 700; cursor: pointer; list-style: none; }
.shop-animal-category > summary::-webkit-details-marker { display: none; }
.shop-animal-category > summary::after { content: '▾'; }
.shop-animal-category[open] > summary::after { content: '▴'; }
.shop-animal-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.shop-animal-heading img { flex: 0 0 48px; object-fit: contain; image-rendering: pixelated; }
.shop-animal-heading i { color: var(--muted); font-size: 0.78rem; font-weight: 400; }
.shop-category-icons { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; }
.shop-animal-list { padding-top: 16px; }
.shop-animal-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 20px; }
.shop-animal-card > .account-form { display: contents; }
.shop-animal-card > .shop-purchase-actions { grid-column: 1 / -1; justify-self: end; }
.shop-animal-card .shop-purchase-row { grid-column: 2; }
.shop-animal-card:has(.shop-variants) .shop-purchase-row { grid-column: 1 / -1; margin-top: 12px; }
.shop-animal-card .form-hint { grid-column: 1 / -1; margin: 10px 0 0; min-width: 0; line-height: 1.5; overflow-wrap: anywhere; }
.shop-house-card .shop-item-art { flex-basis: 96px; width: 96px; min-height: 80px; }
.shop-house-card .shop-product-title img { max-width: 96px; max-height: 80px; image-rendering: auto; }
@media (max-width: 560px) {
  .shop-animal-card { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .shop-animal-card .shop-purchase-row { grid-column: 1; justify-content: flex-end; }
  .shop-animal-card .form-hint { margin-top: 0; }
}
@media (max-width: 560px) {
  .shop-item-card { flex-wrap: wrap; gap: 14px; }
  .shop-item-card .shop-product-title { flex-basis: 100%; }
  .shop-purchase-row { flex-wrap: wrap; }
  .shop-purchase-row > .form-control { flex-basis: 100%; }
  .shop-purchase-actions > .shop-price, .shop-purchase-actions > .btn-cabinet { width: auto; }
}
.btn-cabinet { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 10px 19px; border: 1px solid transparent; border-radius: 9px; color: #17110b; background: linear-gradient(180deg, #f1d79b 0%, #d6b065 100%); font-size: 0.87rem; font-weight: 800; text-align: center; cursor: pointer; transition: transform 160ms ease, box-shadow 160ms ease; }
.btn-cabinet:hover { transform: translateY(-1px); box-shadow: 0 5px 16px rgba(216, 180, 110, 0.28); }
.btn-cabinet:disabled { color: #85765f; background: #473b2a; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-cabinet-secondary { border-color: rgba(216, 180, 110, 0.3); color: var(--gold-soft); background: rgba(216, 180, 110, 0.09); }
.btn-cabinet-secondary:hover { border-color: var(--gold); color: #fff; background: rgba(216, 180, 110, 0.16); }
.status-mark { display: inline-flex; align-items: center; gap: 7px; }
.status-mark::before { width: 7px; height: 7px; border-radius: 50%; background: #65e88a; box-shadow: 0 0 10px rgba(101, 232, 138, 0.55); content: ""; }
.status-mark.is-pending::before { background: #e9b864; box-shadow: 0 0 10px rgba(233, 184, 100, 0.42); }
.wiki-table-wrap { max-width: 100%; margin: 8px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.wiki-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; text-align: left; }
.wiki-table th { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--gold-soft); background: rgba(30, 21, 14, 0.95); font-size: 0.73rem; font-weight: 700; white-space: nowrap; }
.wiki-table td { padding: 10px 15px; border-bottom: 1px solid rgba(255, 221, 177, 0.08); color: #ecd9c7; }
.wiki-table tr:last-child td { border-bottom: 0; }
.wiki-table tr:hover td { background: rgba(216, 180, 110, 0.06); }
.alert { margin: 0 0 20px; padding: 13px 16px; border: 1px solid; border-radius: 9px; font-size: 0.87rem; line-height: 1.5; }
.alert-success { border-color: rgba(101, 232, 138, 0.28); color: #bdeac9; background: rgba(44, 104, 60, 0.16); }
.alert-danger { border-color: rgba(239, 112, 95, 0.3); color: #ffc3b9; background: rgba(112, 42, 33, 0.18); }
.profile-section-block { display: block; }
@media (max-width: 900px) {
  .page-layout-main { grid-template-columns: 245px minmax(0, 1fr); gap: 18px; }
  .page-sidebar { padding: 22px 17px; }
}
@media (max-width: 680px) {
  .container, .page-layout-main { width: min(100% - 24px, 560px); }
  .nav-links { display: none; }
  .nav { min-height: 70px; }
  .brand { min-width: 0; }
  .brand-logo { width: 150px; }
  .page-layout-main { display: flex; flex-direction: column; gap: 16px; padding: 20px 0 48px; }
  .page-sidebar { position: static; width: 100%; padding: 16px; }
  .sidebar-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .sidebar-nav > .eyebrow { grid-column: 1 / -1; }
  .sidebar-group { grid-column: 1 / -1; }
  .page-content { width: 100%; }
  .page-panel { padding: 19px; border-radius: 15px; }
  .profile-card { padding: 17px; }
  .profile-grid-2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .profile-stat-box { padding: 12px; }
}
@media (max-width: 420px) {
  .topbar-actions { gap: 7px; }
  .user-chip { display: none; }
  .brand-wrap { gap: 8px; }
  .brand-logo { width: 105px; }
  .online-badge { gap: 6px; padding-inline: 8px; font-size: 0.55rem; letter-spacing: 0.06em; }
  .online-badge strong { font-size: 0.62rem; }
  .profile-grid-2 { grid-template-columns: 1fr; }
  .form-actions > * { width: 100%; }
}

.shop-payment-methods {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.shop-payment-methods img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: 0 0 32px;
}

.shop-payment-methods .payment-card-icon {
    filter: invert(1);
}
