/* Сундучки на главной и страницы-разделы */

.chests {
  max-width: 1080px;
  margin: 38px auto 6px;
  padding: 0 20px;
}
.chests-title {
  margin: 0 0 4px;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(24px, 4vw, 34px);
  color: #f6e7d4;
  text-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.chests-sub {
  margin: 0 0 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(246, 231, 212, .72);
}
.chests-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 820px) {
  .chests-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

.chest {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 24px;
  text-decoration: none;
  color: #f6e7d4;
  background: linear-gradient(180deg, rgba(46, 32, 24, .72) 0%, rgba(30, 21, 16, .82) 100%);
  border: 1px solid rgba(214, 180, 140, .3);
  box-shadow: 0 22px 44px rgba(0, 0, 0, .32);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.chest:hover {
  transform: translateY(-4px);
  border-color: rgba(233, 201, 155, .6);
  box-shadow: 0 30px 56px rgba(0, 0, 0, .42);
}

.chest-img {
  aspect-ratio: 16 / 10;
  background-size: cover;
  background-position: center;
}
.chest-img.reviews { background-image: url('/assets/chest-reviews'); }
.chest-img.bonus { background-image: url('/assets/chest-bonus'); }
.chest-img.birthday { background-image: url('/assets/chest-birthday'); }

.chest-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 14px 16px 16px;
}
.chest-kicker {
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #d8b071;
}
.chest-title {
  font-family: Georgia, serif;
  font-size: 22px;
  color: #fdf3e6;
}
.chest-text {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(246, 231, 212, .72);
}
.chest-go {
  margin-top: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #e9c99b;
}

/* ── внутренние страницы ── */
.chest-page {
  --clay: #8a3b2a;
  --clay-deep: #6a2a1d;
  --sand: #ecd8ba;
  --cream: #fdf9f3;
  --gold: #b8893c;
  --ink: #3a2f28;
  background:
    radial-gradient(700px 400px at 100% 0%, #fbe3d4 0%, transparent 60%),
    radial-gradient(600px 360px at 0% 100%, #f7ecd8 0%, transparent 60%),
    var(--cream);
  color: var(--ink);
  min-height: 100vh;
}
.chest-page h1, .chest-page h2, .chest-page h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  color: var(--clay-deep);
}
.cp-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 900px;
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px 10px;
}
.cp-brand {
  font-family: Georgia, serif;
  letter-spacing: .26em;
  font-size: 12px;
  text-transform: uppercase;
  color: #a66b72;
}
.cp-wrap { max-width: 900px; margin: 0 auto; padding: 8px 20px 40px; }

.cp-hero { margin-bottom: 22px; }
.cp-kicker {
  margin: 0 0 6px;
  font-size: 10.5px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}
.cp-title {
  margin: 0 0 8px;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.05;
}
.cp-lead {
  margin: 0;
  max-width: 620px;
  font-size: 15px;
  line-height: 1.6;
  color: #6a5a4d;
}

.cp-card {
  background: #fffaf2;
  border: 1px solid #e6cfae;
  border-radius: 26px;
  padding: 20px;
  box-shadow: 0 18px 40px rgba(106, 42, 29, .1);
  margin-bottom: 16px;
}

/* отзывы */
.reviews-list { display: grid; gap: 12px; margin: 0 0 20px; }
.review-card {
  background: #fffaf2;
  border: 1px solid #e6cfae;
  border-radius: 20px;
  padding: 16px 18px;
  box-shadow: 0 12px 28px rgba(106, 42, 29, .08);
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
}
.review-name { font-weight: 700; color: #6a2a1d; font-size: 15px; }
.review-stars { color: #b8893c; letter-spacing: 2px; font-size: 14px; }
.review-text { margin: 0 0 6px; font-size: 14.5px; line-height: 1.6; color: #4a3d33; }
.review-date { font-size: 11px; color: #a08a6e; }

.reviews-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 22px;
}
.reviews-pager.hidden { display: none; }
.pager-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid #e0c9ab;
  background: #fffaf2;
  color: #8a3b2a;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s ease, opacity .15s ease;
}
.pager-btn:hover:not(:disabled) { background: #f7ead6; }
.pager-btn:disabled { opacity: .35; cursor: default; }
.pager-label { font-size: 13px; color: #8d7c6c; }

.review-form { display: grid; gap: 10px; }
.review-form input,
.review-form textarea,
.bonus-form input,
.bonus-form textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #dfc6a2;
  background: #fffdf8;
  font: inherit;
  font-size: 14.5px;
  color: #3a2c20;
}
.review-form textarea:focus,
.review-form input:focus,
.bonus-form input:focus {
  outline: none;
  border-color: #b5614c;
  box-shadow: 0 0 0 3px rgba(181, 97, 76, .15);
}
.chest-page .btn.primary {
  background: linear-gradient(180deg, #b5614c 0%, #6a2a1d 100%);
  color: #fff6ea;
  box-shadow: 0 12px 26px rgba(106, 42, 29, .28);
}
.chest-page .btn.ghost {
  background: #fffaf2;
  color: #6a2a1d;
  border: 1px solid #e0c9ab;
}

.review-form .btn,
.bonus-form .btn { justify-self: start; }

.bonus-form { display: flex; gap: 8px; flex-wrap: wrap; }
.bonus-form input { flex: 1 1 200px; }
.star-row { display: flex; gap: 6px; }
.star-row button {
  border: 1px solid #e0c9ab;
  background: #fffdf8;
  color: #cbb08a;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.star-row button.on { background: #f6e3c8; color: #b8893c; border-color: #d8b071; }

.empty-note {
  text-align: center;
  color: #a08a6e;
  font-size: 14px;
  padding: 26px 10px;
}

/* бонусы */
.bonus-hero {
  display: grid;
  gap: 18px;
  align-items: center;
}
@media (min-width: 720px) { .bonus-hero { grid-template-columns: 1fr 1fr; } }
.bonus-number {
  font-family: Georgia, serif;
  font-size: clamp(52px, 9vw, 84px);
  line-height: 1;
  color: var(--clay);
}
.bonus-number span { font-size: 20px; color: #9c7f61; }
.bonus-bar {
  height: 14px;
  border-radius: 999px;
  background: #f0e0c9;
  overflow: hidden;
  margin: 12px 0 8px;
}
.bonus-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #b8893c 0%, #8a3b2a 100%);
  transition: width .5s ease;
}
.bonus-hint { margin: 0; font-size: 13px; color: #8d7c6c; }

.rules-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 8px; }
.rules-list li {
  position: relative;
  padding-left: 24px;
  font-size: 14px;
  line-height: 1.55;
  color: #55473d;
}
.rules-list li::before {
  content: '✿';
  position: absolute;
  left: 2px;
  color: #b5614c;
  font-size: 12px;
}
.rules-list b { color: #6a2a1d; }

/* день рождения */
.birthday-box {
  text-align: center;
  padding: 30px 20px;
  border-radius: 28px;
  border: 1px dashed #dcc09a;
  background: linear-gradient(180deg, #fffaf2 0%, #f7ecdc 100%);
}
.birthday-lock { font-size: 44px; line-height: 1; margin-bottom: 10px; }
.birthday-box h2 { font-size: clamp(24px, 4.6vw, 34px); margin-bottom: 8px; }
.birthday-box p { color: #6a5a4d; font-size: 14.5px; max-width: 460px; margin: 0 auto 8px; }
.birthday-date { color: #b8893c; font-weight: 700; }
.birthday-open {
  border: 1px solid #e3c9a6;
  background:
    radial-gradient(420px 220px at 50% 0%, #ffe6d3 0%, transparent 65%),
    linear-gradient(180deg, #fffaf2 0%, #f6e3c8 100%);
}
.gift-note { margin: 14px auto 0 !important; font-size: 12px !important; color: #a08a6e !important; }

.rewards-title { margin: 20px 0 10px; font-size: 20px; }
.rewards { display: grid; gap: 8px; }
.reward {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid #ecd9bd;
  border-radius: 16px;
  background: #fffaf2;
}
.reward.locked { opacity: .62; }
.reward-cost {
  min-width: 44px;
  font-family: Georgia, serif;
  font-size: 20px;
  color: #8a3b2a;
  text-align: center;
}
.reward-title { flex: 1; font-size: 14px; line-height: 1.4; color: #4a3d33; }
.reward .btn { flex: 0 0 auto; }
.reward .btn:disabled { opacity: .55; cursor: default; }

@media (max-width: 560px) {
  .reward { flex-wrap: wrap; }
  .reward-title { flex: 1 1 60%; }
}

.hidden { display: none !important; }

/* ── вертикальные сундучки-кнопки ── */
.chest-stack {
  max-width: 1080px;
  margin: 18px auto 8px;
  padding: 0 20px;
  text-align: center;
}
.chest-stack-title {
  margin: 0 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  font-size: clamp(24px, 4vw, 32px);
  color: #f6e7d4;
  text-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.chest-stack-list {
  display: flex;
  gap: 26px;
  justify-content: center;
  align-items: stretch;
  overflow-x: auto;
  padding: 4px 4px 8px;
  margin-top: 12px;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.chest-stack-list::-webkit-scrollbar { display: none; }

.chest-btn {
  position: relative;
  flex: 0 0 clamp(230px, 27vw, 310px);
  scroll-snap-align: center;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100px;
  padding: 0 18px 14px;
  border-radius: 12px 12px 14px 14px;
  overflow: hidden;
  text-decoration: none;
  background:
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, #9c6238 0%, #7b4826 55%, #653a1e 100%);
  border: 2px solid #452814;
  box-shadow:
    inset 0 -14px 24px rgba(0, 0, 0, .28),
    inset 0 6px 10px rgba(255, 220, 170, .12),
    0 18px 34px rgba(0, 0, 0, .38);
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}
.chest-btn:hover {
  transform: translateY(-3px);
  filter: brightness(1.07);
  box-shadow:
    inset 0 -14px 24px rgba(0, 0, 0, .28),
    inset 0 6px 10px rgba(255, 220, 170, .16),
    0 24px 42px rgba(0, 0, 0, .46);
}
.chest-btn:active { transform: translateY(-1px) scale(.995); }

.chest-lid {
  position: absolute;
  left: -2px;
  right: -2px;
  top: -2px;
  height: 38px;
  border-radius: 12px 12px 4px 4px;
  background: linear-gradient(180deg, #b87c48 0%, #8d5530 100%);
  border: 2px solid #452814;
  border-bottom: 2px solid #3a2110;
  box-shadow: inset 0 -8px 12px rgba(0, 0, 0, .22);
}

.chest-strap {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 9px;
  background: linear-gradient(180deg, #e3c07a 0%, #b8893c 50%, #9a7128 100%);
  opacity: .9;
  box-shadow: inset 0 0 0 1px rgba(80, 55, 18, .35);
}
.chest-strap.left { left: 26px; }
.chest-strap.right { right: 26px; }

.chest-lock {
  position: absolute;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  width: 20px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, #f2d493 0%, #c09845 100%);
  border: 1.5px solid #6d5119;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}
.chest-lock::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 7px;
  width: 4px;
  height: 9px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #6d5119;
}

.chest-label {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(22px, 4vw, 27px);
  letter-spacing: .04em;
  line-height: 1;
  color: #fff1d9;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .55);
}

@media (max-width: 640px) {
  .cp-top { padding-top: calc(40px + env(safe-area-inset-top, 0px)); }
  .cp-card { padding: 16px; }
}

/* ── компактные резные ларчики ── */
.chest-stack { max-width: 1080px; margin: -26px auto 4px; padding: 0 20px; }
@media (max-width: 820px) {
  .chest-stack { margin: 0 auto 4px; }
}
.chest-stack-list {
  display: grid;
  grid-template-columns: repeat(3, clamp(230px, 27vw, 310px));
  justify-content: center;
  gap: 26px;
  overflow: visible;
  margin-top: 0;
  padding: 0;
}
.chest-btn {
  width: clamp(132px, 15vw, 158px);
  height: 82px;
  justify-self: center;
  flex: none;
  padding: 0 8px 9px;
  border-radius: 7px 7px 11px 11px;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='34' height='34' viewBox='0 0 34 34'%3E%3Cg fill='none' stroke='%23f0d3a2' stroke-width='.9' opacity='.22'%3E%3Cpath d='M17 3c4 5 4 9 0 14-4-5-4-9 0-14z'/%3E%3Cpath d='M3 17c5-4 9-4 14 0-5 4-9 4-14 0z'/%3E%3Cpath d='M31 17c-5 4-9 4-14 0 5-4 9-4 14 0z'/%3E%3Ccircle cx='17' cy='28' r='2.4'/%3E%3C/g%3E%3C/svg%3E"),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .13) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #a2673b 0%, #7b4826 55%, #5e341a 100%);
  box-shadow:
    inset 0 -9px 16px rgba(0, 0, 0, .35),
    inset 0 3px 6px rgba(255, 225, 180, .18),
    0 14px 26px rgba(0, 0, 0, .48),
    0 5px 0 -1px #3a2110;
}
.chest-lid {
  height: 25px;
  border-radius: 50% 50% 4px 4px / 85% 85% 4px 4px;
  background: linear-gradient(180deg, #c48d55 0%, #9d6336 60%, #84502b 100%);
  box-shadow:
    inset 0 4px 6px rgba(255, 235, 200, .28),
    inset 0 -5px 7px rgba(0, 0, 0, .28);
}
.chest-strap { width: 6px; }
.chest-strap.left { left: 16px; }
.chest-strap.right { right: 16px; }
.chest-lock { width: 13px; height: 15px; top: 18px; border-radius: 3px; }
.chest-lock::after { top: 5px; width: 3px; height: 6px; }
.chest-label { font-size: clamp(13px, 1.5vw, 15px); letter-spacing: .02em; }

@media (max-width: 820px) {
  .chest-stack-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .chest-btn { width: 100%; max-width: 150px; }
}
