/* Отдельный файл стилей. Сохранены структура, пропорции и эффекты шаблона;
   салатовая палитра заменена сиреневой, добавлена адаптивная резиновая ширина. */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; overflow-x: hidden; }
body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #e4c8f7 0%, #f5ecfc 35%, #ffffff 100%);
    background-attachment: fixed;
    color: #33203f;
}
a { color: inherit; text-decoration: none; }
/* Исходная ширина шаблона с резиновой адаптацией для экранов разного размера. */
.page {
    display: block;
    width: 100%;
    max-width: 820px;
    min-width: 0;
    margin: 0 auto;
    padding: 16px 12px;
}

/* Все основные блоки и сетка могут сжиматься вместе с окном */
.top-section,
.banner-section,
.content,
.banner-grid,
.banner-button {
    min-width: 0;
    max-width: 100%;
}
.top-section {
    display: flex; flex-direction: column; width: 100%;
    border: 2px solid #b77be0; border-radius: 20px; background: #fff;
    box-shadow: 0 6px 20px rgba(132, 62, 180, .15); overflow: hidden;
}
.main-image {
    width: 100%; display: flex; align-items: center; justify-content: center;
    background: #f8f0ff; overflow: hidden; min-height: 120px;
}
.main-image img { display: block; width: 100%; height: auto; object-fit: cover; }
.content { width: 100%; padding: 16px; text-align: center; }
.content h1 {
    margin: 0 0 6px; color: #71349b; font-size: clamp(22px, 4vw, 32px);
    text-transform: uppercase; letter-spacing: 1px; font-weight: 800;
}
.content h2 { margin: 10px 0; color: #8040a8; font-size: clamp(15px, 3vw, 20px); font-weight: 700; }
.separator { height: 3px; background: linear-gradient(90deg, transparent, #a85cdb, transparent); margin: 8px auto 14px; width: 80%; border-radius: 3px; }
.main-buttons { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: 100%; }
.main-button {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    min-height: 76px; padding: 12px 10px; border: 2px solid #9b59c6; border-radius: 16px;
    background: linear-gradient(180deg, #f0e0fb 0%, #fff 50%, #f0e0fb 100%);
    color: #5d287f; text-align: center; box-shadow: 0 3px 8px rgba(132, 62, 180, .15);
    transition: all .25s cubic-bezier(.175, .885, .32, 1.275); cursor: pointer;
}
.main-button strong { font-size: clamp(14px, 2.2vw, 18px); font-weight: 800; }
.main-button span { margin-top: 4px; color: #7b399f; font-size: clamp(11px, 1.8vw, 14px); font-weight: 600; }
.main-button:hover {
    background: linear-gradient(180deg, #8e44c7 0%, #c17aeb 50%, #8e44c7 100%);
    border-color: #62258a; color: #fff; transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 18px rgba(132, 62, 180, .4);
}
.main-button:hover span { color: #fff7ff; }
.main-button:active { transform: translateY(1px) scale(.98); box-shadow: 0 2px 6px rgba(132, 62, 180, .3); }
.update-date {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
    margin-top: 16px; padding: 8px 18px; background: rgba(238, 218, 250, .6);
    border: 1px solid #c18ae5; border-radius: 30px;
}
.update-date #today { color: #54236f; font-size: clamp(14px, 2.3vw, 17px); font-weight: 800; letter-spacing: .5px; }
.update-date strong {
    background: linear-gradient(135deg, #7432a0 0%, #a95bd5 100%); color: #fff;
    padding: 3px 10px; border-radius: 12px; font-size: clamp(12px, 2vw, 14px);
    font-weight: 800; letter-spacing: .5px; box-shadow: 0 2px 6px rgba(116, 50, 160, .25);
}
.banner-section {
    width: 100%; margin-top: 16px; padding: 12px; border: 2px solid #b77be0;
    border-radius: 20px; background: #fff; box-shadow: 0 6px 20px rgba(132, 62, 180, .15);
}
.notice {
    margin-bottom: 14px; padding: 10px; text-align: center; color: #542d6c; font-size: 14px;
    background: #f8f0ff; border-radius: 14px; border: 1px dashed #b77be0;
}
.notice > strong { color: #71349b; font-size: 17px; display: block; margin-bottom: 4px; font-weight: 800; }
.notice p { margin: 4px 0; line-height: 1.4; }
.banner-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(4px, 0.8vw, 8px);
    width: 100%;
    min-width: 0;
    align-items: stretch;
}

/* Исходная схема шаблона: 2 колонки на узком экране, 4 на среднем, 6 на широком. */
@media (min-width: 480px) {
    .banner-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 720px) {
    .banner-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

.banner-button {
    position: relative; display: flex; align-items: center; justify-content: center; width: 100%;
    min-width: 0; aspect-ratio: 16 / 9; overflow: hidden; border: 2px solid #c99be8;
    border-radius: 12px; background: #fcf8ff;
    transition: all .25s cubic-bezier(.175, .885, .32, 1.275);
}
.banner-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.banner-button:hover { border-color: #7432a0; transform: translateY(-2px) scale(1.03); box-shadow: 0 6px 14px rgba(116, 50, 160, .3); z-index: 2; }
.banner-fallback {
    display: none; align-items: center; justify-content: center; width: 100%; height: 100%;
    padding: 2px; background: linear-gradient(180deg, #f0e0fb 0%, #fff 50%, #f0e0fb 100%);
    color: #5d287f; font-size: clamp(10px, 1.8vw, 15px); font-weight: 800; text-align: center;
    border: 2px solid #9b59c6; border-radius: 12px; box-sizing: border-box; transition: all .25s ease;
}
.banner-button:hover .banner-fallback { background: linear-gradient(180deg, #8e44c7 0%, #c17aeb 50%, #8e44c7 100%); color: #fff; border-color: #62258a; }
.banner-fallback.visible { display: flex; }
.image-fallback {
    padding: 30px; font-size: 20px; font-weight: 800; color: #5d287f;
    background: linear-gradient(180deg, #f0e0fb 0%, #fff 50%, #f0e0fb 100%);
    border: 2px solid #9b59c6; border-radius: 16px; width: 100%; text-align: center;
}
.admin-link { padding: 18px; text-align: center; font-size: 14px; }
.admin-link a {
    display: inline-block; padding: 10px 22px; color: #71349b; font-weight: 800;
    border: 2px solid #b77be0; border-radius: 30px; background: rgba(255,255,255,.9);
    box-shadow: 0 3px 10px rgba(132, 62, 180, .15); transition: all .25s ease;
}
.admin-link a:hover { color: #fff; background: linear-gradient(90deg, #8e44c7 0%, #71349b 100%); border-color: #62258a; box-shadow: 0 6px 16px rgba(113, 52, 155, .35); transform: translateY(-2px); }
/* Резиновая адаптация: макет центрирован, сужается на малых экранах. */
@media (max-width: 580px) {
    .page { padding: 10px 6px; }
    .content { padding: 12px; }
    .main-buttons { grid-template-columns: 1fr; }
    .main-button { min-height: 60px; }
    .banner-grid { gap: 5px; }
    .banner-section { padding: 8px; }
    .notice { font-size: 13px; }
}
@media (max-width: 360px) {
    .page { padding: 8px 4px; }
    .top-section, .banner-section { border-radius: 15px; }
    .banner-section { padding: 6px; }
    .banner-grid { gap: 4px; }
    .banner-button, .banner-fallback { border-radius: 8px; }
    .update-date { padding: 7px 10px; gap: 6px; }
}


/* Responsive access blocker */
body.access-locked { overflow: hidden; }
.access-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: block;
    padding: 0;
    background: rgba(18, 10, 24, 0.56);
    /* No blur: banner labels remain readable behind the dark overlay. */
    overflow: hidden;
    touch-action: none;
}
.access-dialog {
    zoom: 0.9; /* Reduce the whole access window by 10%. */
    position: absolute;
    left: 0;
    top: 0;
    width: min( min(420px, calc(100vw - 24px)), calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
    padding: clamp(18px, 4vw, 30px);
    border: 2px solid #71349b;
    border-radius: clamp(14px, 3vw, 22px);
    background: linear-gradient(145deg, #ffffff 0%, #f0e0fb 28%, #d3a9ed 65%, #a875d0 100%);
    color: #000000;
    text-align: center;
    box-shadow: 0 26px 70px rgba(0, 0, 0, .58), 0 10px 26px rgba(45, 12, 65, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
    will-change: transform;
}
.access-dialog h2 {
    margin: 0 0 10px;
    color: #ff172d;
    text-transform: none;
    text-shadow: none;
    font-size: clamp(24px, 5.5vw, 30px);
    font-weight: 600;
    line-height: 1.2;
}
.access-description {
    margin: 0 0 20px;
    color: #000000;
    text-shadow: none;
    font-size: clamp(13px, 3.5vw, 16px);
    line-height: 1.45;
}
.access-form { display: flex; flex-direction: column; align-items: stretch; gap: 10px; width: 100%; }
.access-form input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 12px 14px;
    border: 1px solid #b77be0;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: #33203f;
    font: inherit;
    font-size: 16px;
}
.access-form input:focus { border-color: #71349b; box-shadow: 0 0 0 3px rgba(142, 68, 199, .18); }
.access-unlock,
.access-buy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 36px;
    padding: 7px 10px;
    border: 1px solid #62258a;
    border-radius: 10px;
    background: linear-gradient(180deg, #8e44c7 0%, #c17aeb 50%, #8e44c7 100%);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 0 #4c1d70, 0 7px 12px rgba(45, 12, 65, .28), inset 0 1px 0 rgba(255, 255, 255, .72), inset 0 -2px 0 rgba(0, 0, 0, .14);
    text-shadow: 0 1px 1px rgba(0, 0, 0, .2);
    transition: filter .2s ease, transform .2s ease, box-shadow .2s ease;
}
.access-unlock {
    align-self: center;
    width: min(100%, 180px);
    border-color: #166534;
    background: linear-gradient(180deg, #bbf7d0 0%, #4ade80 24%, #22c55e 58%, #15803d 100%);
    box-shadow: 0 4px 0 #14532d, 0 7px 12px rgba(20, 83, 45, .3), inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 rgba(0, 0, 0, .16);
}
.access-purchase-description {
    margin: 5px 0 0;
    color: #000000;
    font-size: clamp(13px, 3.5vw, 16px);
    line-height: 1.45;
    text-shadow: none;
}
.access-buy {
    align-self: center;
    width: min(100%, 180px);
    border-color: #92400e;
    background: linear-gradient(180deg, #fde68a 0%, #fbbf24 22%, #d97706 75%, #92400e 100%);
    background: linear-gradient(180deg, #fff7c2 0%, #fcd34d 22%, #f59e0b 58%, #b45309 100%);
    box-shadow: 0 4px 0 #78350f, 0 7px 12px rgba(45, 12, 65, .28), inset 0 1px 0 rgba(255, 255, 255, .8), inset 0 -2px 0 rgba(0, 0, 0, .16);
}
.access-buy:hover,
.access-unlock:hover { filter: brightness(1.08); transform: translateY(-2px); }
.access-buy:active,
.access-unlock:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(45, 12, 65, .65), inset 0 2px 4px rgba(0, 0, 0, .2); }
/* Purchase description and BUY button sit below Unlock. */
.access-message { min-height: 1.2em; margin: 2px 0 0; color: #ff172d; font-size: clamp(13px, 3.5vw, 16px); line-height: 1.45; text-shadow: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 360px) {
    .access-dialog { padding: 16px 12px; }
    .access-description { margin-bottom: 12px; }
}
@media (max-height: 420px) {
    .access-dialog { padding: 12px 16px; }
    .access-dialog h2 { margin-bottom: 6px; }
    .access-description { margin-bottom: 8px; }
    .access-form { gap: 6px; }
    .access-form input, .access-unlock, .access-buy { min-height: 38px; padding-top: 7px; padding-bottom: 7px; }
}
