/* Сброс стилей */
:root {
    --urine-color: #d4b529;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: white;
    min-height: 100vh;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Динамическая механическая подложка */
.mechanical-background {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 999;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 70% 42%, rgba(89, 48, 25, 0.16), transparent 34%),
        radial-gradient(circle at 18% 78%, rgba(120, 74, 35, 0.1), transparent 30%),
        #050606;
}

body.methodology-open .mechanical-background {
    display: block;
}

body.methodology-open .test-controls {
    display: none;
}

.mechanical-gears {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    opacity: 0.52;
    filter: brightness(2) drop-shadow(0 0 18px rgba(139, 82, 42, 0.28));
}

.gear-spin {
    transform-box: fill-box;
    transform-origin: center;
    animation: mechanical-rotate 52s linear infinite;
}

.gear-spin-slow { animation-duration: 76s; }
.gear-spin-medium {
    animation-duration: 44s;
}
.gear-spin-small-meshed { animation: mechanical-rotate-reverse 22.8s linear infinite; }
.gear-spin-reverse { animation: mechanical-rotate-reverse 58s linear infinite; }
.gear-spin-reverse-slow { animation: mechanical-rotate-reverse 88s linear infinite; }

@keyframes mechanical-rotate {
    to { transform: rotate(360deg); }
}

@keyframes mechanical-rotate-reverse {
    to { transform: rotate(-360deg); }
}

.grand-clock {
    position: absolute;
    z-index: 4;
    left: -10vw;
    top: 92vh;
    width: 390vmin;
    height: 390vmin;
    transform: translate(-50%, -50%);
    opacity: 0.82;
    filter: brightness(2) drop-shadow(0 0 22px rgba(121, 70, 36, 0.28));
}

.grand-clock-face {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.clock-quarter-marks path:first-child {
    stroke-width: 13px;
}

.clock-quarter-numerals {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 108px;
    font-weight: 700;
}

.ornate-clock-hand {
    position: absolute;
    z-index: 2;
    left: calc(50% - 55px);
    bottom: 50%;
    width: 110px;
    height: 45%;
    transform-origin: 50% 100%;
    clip-path: polygon(50% 0, 68% 7%, 61% 15%, 84% 23%, 64% 30%, 79% 38%, 65% 45%, 70% 90%, 100% 96%, 100% 100%, 0 100%, 0 96%, 30% 90%, 35% 45%, 21% 38%, 36% 30%, 16% 23%, 39% 15%, 32% 7%);
    background:
        repeating-linear-gradient(135deg, transparent 0 18px, rgba(25, 14, 9, 0.5) 19px 27px, transparent 28px 44px),
        linear-gradient(90deg, #2d1a11 0%, #9f653a 22%, #4b2b1b 48%, #b27a47 72%, #2b1910 100%);
    box-shadow: 0 0 22px rgba(180, 108, 56, 0.24);
}

.ornate-clock-hand::after {
    content: '';
    position: absolute;
    left: 41px;
    top: 12%;
    bottom: 13%;
    width: 28px;
    background: repeating-linear-gradient(to bottom, rgba(12, 9, 7, 0.82) 0 26px, transparent 27px 48px);
    clip-path: polygon(50% 0, 100% 12%, 64% 25%, 100% 38%, 64% 51%, 100% 64%, 64% 77%, 100% 90%, 50% 100%, 0 90%, 36% 77%, 0 64%, 36% 51%, 0 38%, 36% 25%, 0 12%);
}

.ornate-minute-hand {
    height: 43%;
    animation: clock-crawl 4800s linear infinite;
}

.ornate-second-hand {
    height: 48%;
    opacity: 0.74;
    animation: clock-crawl 240s linear infinite;
}

.ornate-clock-hand {
    animation-play-state: paused;
}

.grand-clock.clock-randomized .ornate-clock-hand {
    animation-play-state: running;
}

.grand-clock-pin {
    position: absolute;
    z-index: 3;
    left: 50%;
    top: 50%;
    width: 146px;
    height: 146px;
    transform: translate(-50%, -50%);
    border: 18px solid #85512f;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, #a56a3e, #21140e 58%, #080706);
    box-shadow: 0 0 0 8px rgba(45, 27, 18, 0.72), 0 0 30px rgba(151, 87, 42, 0.24);
}

@keyframes clock-crawl {
    to { transform: rotate(360deg); }
}

.background-vignette {
    position: absolute;
    z-index: 3;
    inset: 0;
    background: radial-gradient(ellipse at center, transparent 25%, rgba(0, 0, 0, 0.62) 100%);
}

.container {
    display: flex;
    height: 100vh;
    max-width: none;
    margin: 0;
    position: relative;
    z-index: 1;
    background: white;
    box-shadow: 0 0 50px rgba(0,0,0,0.1);
}

/* Левая часть - изображение */
.left-section {
    flex: 1;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 10px solid white;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.grave-image {
    width: 130%;
    height: 130%;
    object-fit: cover;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

.grave-atmosphere,
.grave-supply-panel {
    display: none;
}

/* Широкая сцена используется только на главной странице в десктопной раскладке. */
@media (min-width: 769px) {
    .container {
        background: #5d4938 url('assets/pmg-desktop-wide-v5-photo-master-v6.webp') center center / cover no-repeat;
        overflow: hidden;
    }

    .grave-atmosphere {
        display: block;
        position: absolute;
        z-index: 0;
        inset: 0;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

    .container > .left-section,
    .container > .right-section {
        position: relative;
        z-index: 1;
    }

    .left-section {
        background: transparent;
    }

    .grave-supply-panel {
        display: flex;
        align-items: center;
        gap: clamp(5px, 1vw, 12px);
        position: absolute;
        top: clamp(16px, 4vh, 36px);
        left: 50%;
        transform: translateX(-50%);
        width: max-content;
        max-width: calc(100% - 20px);
        color: #fff9eb;
        font-size: clamp(.75rem, 1.25vw, 1rem);
        font-weight: 600;
        text-align: center;
    }

    .grave-supply-stock,
    .grave-game-link {
        padding: 10px clamp(7px, 1.2vw, 18px);
        border: 1px solid rgba(255, 249, 235, 0.45);
        border-radius: 999px;
    }

    .grave-supply-stock {
        background: rgba(36, 26, 19, 0.78);
    }

    .grave-game-link {
        flex: none;
        background: #624126;
        color: inherit;
        text-decoration: none;
        white-space: nowrap;
    }

    .grave-game-link:hover,
    .grave-game-link:focus-visible {
        background: #35271e;
        text-decoration: underline;
    }

    .grave-game-link:focus-visible {
        outline: 2px solid #fff9eb;
        outline-offset: 3px;
    }

    .container > .right-section {
        background: linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.5),
            rgba(255, 255, 255, 0.5)
        );
    }

    .container > .right-section > .header h1,
    .container > .right-section > .header .subtitle,
    .container > .right-section > .queue-section > h3 {
        text-shadow: 0 1px 2px rgba(255, 255, 255, 0.85);
    }

    .container > .right-section > .header .subtitle {
        color: #394752;
    }

    .image-container {
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .grave-image {
        visibility: hidden;
    }
}

.grave-stone {
    background: #2c3e50;
    width: 200px;
    height: 250px;
    border-radius: 10px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    text-align: center;
}

.grave-text {
    font-size: 18px;
    margin-bottom: 5px;
}

.grave-dates {
    font-size: 14px;
    opacity: 0.8;
}

.grave-mound {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 40px;
    background: #27ae60;
    border-radius: 50%;
    z-index: -1;
}


@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px); 
    }
    50% { 
        transform: translateY(var(--float-distance-y, -20px)) translateX(var(--float-distance-x, 0px)); 
    }
}

.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes roll {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Правая часть - контент */
.right-section {
    flex: 1;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    overflow-y: auto;
    background: white;
}

/* Не даём flex-колонке сжимать карточки друг на друга на невысоких экранах. */
.right-section > * {
    flex-shrink: 0;
}

.right-section > .header h1,
.right-section > .queue-section > h3,
.right-section > .share-section > h3 {
    color: #2c3e50;
    text-shadow: none;
}

.right-section > .header .subtitle {
    color: #7f8c8d;
}

.right-section .navigation-links,
.right-section .footer-separator {
    color: #6c757d;
}

.right-section .footer-link {
    color: #007bff;
}

.right-section .footer-link:hover {
    color: #0056b3;
}

@media (max-width: 768px) {
    .mechanical-gears {
        width: 150%;
        height: 150%;
        left: -25%;
        top: -25%;
        opacity: 0.42;
    }

    .grand-clock {
        left: -22vw;
        top: 46vh;
        width: 390vmin;
        height: 390vmin;
        opacity: 0.7;
    }

    .grand-clock-pin {
        width: 96px;
        height: 96px;
        border-width: 12px;
    }

}

.header {
    text-align: center;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* Статистика */
.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.stat-item {
    text-align: center;
    background: #f8f9fa;
    padding: 30px;
    border-radius: 20px;
    min-width: 160px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Анимация мерцания для блока "Ваш номер" */
.stat-item.blink {
    animation: blinkHighlight 1s ease-in-out 3; /* В 2 раза медленнее: 0.5s → 1s */
}

@keyframes blinkHighlight {
    0% {
        background: #f8f9fa;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        transform: scale(1);
    }
    50% {
        background: #fff3cd; /* Желтый */
        box-shadow: 0 4px 25px rgba(231, 76, 60, 0.4);
        transform: scale(1.02); /* Небольшое увеличение */
    }
    100% {
        background: #f8f9fa;
        box-shadow: 0 4px 15px rgba(0,0,0,0.15);
        transform: scale(1);
    }
}

.stat-number {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: #e74c3c;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 1.1rem;
    color: #7f8c8d;
    font-weight: 500;
}

/* Время ожидания */
.wait-time-section {
    margin: 8px 0; /* Уменьшено на 50%: 15px → 8px */
}

.wait-time-card {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 17px 35px; /* Увеличен горизонтальный padding для овала */
    border-radius: 50px; /* Увеличено для овальной формы: 15px → 50px */
    text-align: center;
    box-shadow: 0 4px 20px rgba(238, 90, 36, 0.3);
    animation: pulse 2s infinite;
    position: relative; /* Для позиционирования кнопки */
}

/* Десктопная версия - блок внизу фотографии */
@media (min-width: 769px) {
    .wait-time-section {
        position: fixed;
        left: 0;
        bottom: 50px;
        width: 50%; /* Ширина левой части */
        margin: 0;
        z-index: 100;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        padding: 0 40px;
        box-sizing: border-box;
    }
    
    .wait-time-card {
        width: 80%; /* 80% от ширины левой секции (фото) */
        max-width: none; /* Убираем фиксированную ширину */
        margin: 0 auto;
    }
}

/* Кнопка с вопросом в блоке "Сколько ждать" */
.wait-time-help-btn {
    position: absolute;
    top: 50%; /* Вертикальное центрирование */
    transform: translateY(-50%); /* Смещение для центрирования */
    right: 17px; /* Равен padding по вертикали */
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: white;
    font-size: 16px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.wait-time-help-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    border-color: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.1); /* Сохраняем центрирование при увеличении */
}

.wait-time-content {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px; /* Уменьшено: 8px → 6px */
}

.wait-time-label {
    font-size: 1rem; /* Уменьшено: 1.1rem → 1rem */
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.wait-time-value {
    font-size: 1rem; /* Уменьшено: 1.1rem → 1rem */
    font-weight: 600; /* Единый шрифт с label */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 20px rgba(238, 90, 36, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(238, 90, 36, 0.5);
    }
    100% {
        box-shadow: 0 4px 20px rgba(238, 90, 36, 0.3);
    }
}

/* Очередь */
.queue-section h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 15px;
    font-weight: 600;
}

.queue-list {
    position: relative;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    max-height: 400px; /* Увеличено на 100px: 300px → 400px */
    overflow-y: auto;
    overflow-anchor: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    scroll-behavior: smooth;
}

.queue-scroll-start {
    display: none;
}

@media (min-width: 769px) {
    .right-section > .header h1 {
        margin-bottom: 4px;
    }

    .right-section > .stats {
        /* 21px вместо стандартных 30px по обе стороны статистики. */
        margin-block: -9px;
    }

    .right-section > .stats .stat-item {
        padding-block: 16px;
    }

    .right-section > .queue-section > h3 {
        font-size: 1.1rem;
        margin-bottom: 6px;
    }

    .queue-list-panel {
        position: relative;
    }

    .queue-list-panel > .queue-list {
        padding-inline-end: 64px;
    }

    .queue-scroll-start {
        display: grid;
        place-items: center;
        position: absolute;
        z-index: 1;
        top: 20px;
        right: 20px;
        width: 36px;
        height: 28px;
        border: 1px solid #d3d9df;
        border-radius: 8px;
        background: #f8f9fa;
        color: #2c3e50;
        font-size: 1.15rem;
        cursor: pointer;
    }

    .queue-scroll-start:hover {
        background: #e9ecef;
    }

    .queue-scroll-start:focus-visible {
        outline: 2px solid #2c3e50;
        outline-offset: 2px;
    }
}

.queue-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0; /* Уменьшено ещё на 20%: 10px → 8px (итого -33% от 12px) */
    border-bottom: 1px solid #e9ecef;
    animation: slideIn 0.5s ease-out;
}

.queue-item:last-child {
    border-bottom: none;
}

.queue-item-own {
    background: #fff1d6;
    border-radius: 6px;
    box-shadow: inset 3px 0 #df9650;
}

.queue-item .number {
    background: #e74c3c;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 40px;
    text-align: center;
}

.item-content {
    flex: 1;
    min-width: 0;
    margin-left: 15px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    align-items: center;
}

.item-main {
    display: contents;
}

.item-main .name {
    grid-column: 1 / -1;
    font-weight: 500;
    color: #2c3e50;
}

.queue-item .urine {
    color: #7f8c8d;
    font-size: 0.8rem;
}

.queue-item .time {
    color: #7f8c8d;
    font-size: 0.8rem;
    white-space: nowrap;
}

.queue-item-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.queue-rank-link {
    border-radius: 6px;
    background: #faeac8;
    color: #634000;
    padding: 2px 5px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

@media (min-width: 769px) {
    .queue-item {
        align-items: center;
        padding-block: 6px;
        line-height: 1.15;
    }

    .item-main {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 1100px) {
    .queue-item-meta:has(.queue-rank-link:not([hidden])) {
        grid-column: 1 / -1;
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .queue-rank-link {
        white-space: normal;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Форма */
.form-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.form-container h3 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    font-weight: 600;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background-color: white;
    box-sizing: border-box;
    min-height: 48px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 18px;
    padding-right: 45px;
    line-height: 1.5;
}

.join-btn {
    width: 100%;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

.join-btn:active {
    transform: translateY(0);
}

.join-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Десктопная версия формы - два столбца */
@media (min-width: 769px) {
    .right-section > .form-section {
        padding: 20px;
    }

    #formContainer h3 {
        margin-bottom: 12px;
    }

    #queueForm {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        gap: 14px 16px;
    }

    #queueForm .form-group {
        margin-bottom: 0;
    }

    #queueForm label {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    #queueForm input,
    #queueForm select {
        height: 44px;
        min-height: 0;
        padding-block: 8px;
    }

    #queueForm .join-btn {
        grid-column: 1 / -1;
        padding: 9px 16px;
    }
}

/* Результат */
.result-container {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
}

.success-message h3 {
    color: #155724;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.success-message p {
    color: #155724;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.queue-info {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.info-label {
    font-weight: 500;
    color: #2c3e50;
}

.info-value {
    font-weight: 600;
    color: #e74c3c;
}

.share-section {
    display: flex;
    gap: 15px;
    margin: 5px 0;
}

.share-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #3498db;
    color: white;
}

.share-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
}

/* Страница шаринга */
.share-info {
    background: #e8f4fd;
    border: 1px solid #bee5eb;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 15px; /* Уменьшено в 2 раза с 30px */
}

.share-info h3 {
    color: #0c5460;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.share-info .user-info {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* Уведомления */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 3000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

/* Загрузка */
.loading {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 20px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        min-height: 100vh;
        height: auto;
    }
    
    .left-section {
        height: 100vw;
        min-height: 100vw;
        flex: none;
    }
    
    .image-container {
        width: 100vw;
        height: 100vw;
        border: none !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }
    
    .right-section {
        padding: 15px;
        gap: 15px;
        flex: 1;
        overflow-y: auto;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat-item {
        min-width: auto;
    }
    
    .share-section {
        flex-direction: column;
    }
    
    .grave-stone {
        width: 150px;
        height: 200px;
    }
    
    .grave-text {
        font-size: 16px;
    }
    
    .grave-dates {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .right-section {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .queue-list {
        max-height: 300px; /* Увеличено на 100px: 200px → 300px */
    }
    
    .grave-stone {
        width: 120px;
        height: 160px;
    }
    
    .grave-text {
        font-size: 14px;
    }
    
    .grave-dates {
        font-size: 10px;
    }
}

/* Стили для страницы шаринга */
.share-grave-image {
    max-width: 200px;
    max-height: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 20px;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

/* Мобильная адаптация для изображений */
@media (max-width: 768px) {
    .grave-image {
        width: 100%;
        height: 100%;
        object-fit: cover;
        animation: none !important;
    }

    .hourglass-video {
        width: 80vw;
        height: 100vw;
        max-width: none;
        object-fit: cover;
    }
    
    .share-grave-image {
        max-width: 120px;
        max-height: 120px;
        animation: none !important;
    }
}

.queue-supplies-card {
    container-type: inline-size;
}

.queue-supplies-card .stat-label {
    display: block;
    font-size: .8rem;
}

.queue-supplies-balance {
    display: block;
    margin: 3px 0 9px;
    color: #2c3e50;
    font-size: 2rem;
    font-size: min(2.8rem, 27cqw);
    font-variant-numeric: tabular-nums;
    line-height: 1;
    white-space: nowrap;
}

.queue-supplies-open {
    width: 100%;
    min-height: 36px;
    padding: 6px 4px;
    border: 1px solid #e5c783;
    border-radius: 8px;
    background: #fff5dd;
    color: #674300;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    text-wrap: balance;
    overflow-wrap: anywhere;
    cursor: pointer;
}

.queue-supplies-open:hover {
    background: #ffebbc;
}

@media (min-width: 769px) {
    .stats:has(.queue-supplies-card:not([hidden])) {
        gap: clamp(8px, 1.3vw, 20px);
    }

    .stats:has(.queue-supplies-card:not([hidden])) > .stat-item {
        flex: 1 1 0;
        min-width: 0;
        max-width: 160px;
        padding-inline: 6px;
    }
}

.coin-game-link {
    display: inline-block;
    margin-top: 6px;
    padding: 4px 0;
    color: white;
    font-size: clamp(.875rem, 2vw, 1rem);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: .16em;
}

.coin-game-link:focus-visible {
    outline: 2px solid white;
    outline-offset: 3px;
    border-radius: 4px;
}

.mobile-modal-header .header-left .coin-balance {
    margin-top: 10px;
    color: white;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    text-align: center;
    opacity: 1;
}

#mobileSuccessModal .mobile-modal-content {
    overflow: clip;
}

#mobileSuccessModal .mobile-modal-body:has(.queue-boost-buttons:not(.hidden)) {
    padding-bottom: 14px;
}

#mobileSuccessModal .mobile-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fffdf8;
}

#mobileSuccessModal .mobile-modal-footer::before {
    content: '';
    z-index: -1;
    max-height: 100%;
}

.coin-grant {
    position: fixed;
    z-index: 10000;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: min(92vw, 660px);
    padding: clamp(16px, 4vw, 32px);
    border: 2px solid #f4c55c;
    border-radius: 18px;
    background: #211407;
    box-shadow: 0 0 36px #e9905866;
    color: #ffe29a;
    text-align: center;
    font-size: clamp(1.25rem, 4vw, 2rem);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    pointer-events: none;
    animation: coin-grant-in 1140ms cubic-bezier(.18, .85, .35, 1.16);
}

@keyframes coin-grant-in {
    from { opacity: 0; transform: translate(-50%, -48%) scale(.7); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.grant-flying-coin {
    position: fixed;
    z-index: 10001;
    opacity: 0;
    font-size: 1.5rem;
    pointer-events: none;
}

.boost-btn .boost-price {
    display: block;
    position: absolute;
    z-index: 1;
    top: 5px;
    left: 5px;
    padding: 3px 4px;
    border-radius: 5px;
    background: #fff8e8;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.boost-btn:disabled {
    opacity: .54;
    cursor: not-allowed;
}

/* Футер */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 15px 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
}

.footer-link {
    border: 0;
    background: transparent;
    font: inherit;
    color: #007bff;
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #0056b3;
    text-decoration: underline;
}

.footer-separator {
    color: #dee2e6;
    margin: 0 5px;
}

/* Навигационные ссылки под "Поделиться" */
.navigation-links {
    text-align: center;
    font-size: 0.9rem;
    color: #6c757d;
    margin: 15px 0;
    padding: 10px 0;
}

@media (min-width: 769px) {
    .right-section > .navigation-links {
        align-self: center;
        max-width: 100%;
        padding: 10px 14px;
        background: white;
        border-radius: 15px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}

/* Модальные окна */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 2% auto;
    padding: 0;
    border-radius: 10px;
    width: 95%;
    max-width: 1200px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    animation: slideIn 0.3s ease;
}

/* Специальные стили для модального окна статистики */
#statsModal .modal-content {
    width: 98%;
    max-width: 1400px;
    max-height: 96vh;
}

.modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 20px;
    border-radius: 10px 10px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    background: transparent;
    border: 0;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.close:hover {
    opacity: 0.7;
}

.modal-body {
    padding: 20px;
    line-height: 1.6;
}

.modal-body h3 {
    color: #2c3e50;
    margin-top: 20px;
    margin-bottom: 10px;
}

.modal-body ul, .modal-body ol {
    margin: 10px 0;
    padding-left: 20px;
}

.modal-body li {
    margin: 8px 0;
}

/* Анимации для модальных окон */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        transform: translateY(-50px);
        opacity: 0;
    }
    to { 
        transform: translateY(0);
        opacity: 1;
    }
}

/* Мобильная адаптация для модальных окон */
@media (max-width: 768px) {
    .modal-content {
        margin: 10% auto;
        width: 95%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h2 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .footer-content {
        font-size: 0.8rem;
    }
    
    .footer-link {
        margin: 0 3px;
    }
    
    /* Мобильные стили для формы */
    .form-group input,
    .form-group select {
        min-height: 44px;
        font-size: 16px; /* Предотвращает зум на iOS */
    }
    
    .form-group select {
        padding-right: 40px;
        background-position: right 12px center;
        background-size: 16px;
    }
    
    /* Мобильные стили для модального окна статистики */
    #statsModal .modal-content {
        width: 95%;
        max-width: 100%;
        margin: 5% auto;
        max-height: 90vh;
    }
    
    #statsModal .modal-body {
        padding: 10px;
    }
    
    /* Мобильная адаптация для списков стран */
    .modal-body div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
}

/* Модальное окно с поздравлением */
.mobile-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

.mobile-modal-content {
    --modal-urine-fill-height: 0px;
    background-color: white;
    margin: 1% auto;
    padding: 0;
    border-radius: 20px;
    width: 99%;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: mobileModalSlideIn 0.4s ease-out;
    position: relative; /* Для позиционирования кнопки-крестика */
    overflow: hidden;
}

.mobile-modal-header,
.mobile-modal-body,
.mobile-modal-footer {
    position: relative;
    z-index: 2;
}

.modal-urine-fill,
#mobileSuccessModal .mobile-modal-footer::before {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--modal-urine-fill-height);
    background: var(--urine-color);
    box-shadow: inset 0 2px 0 rgba(118, 91, 8, 0.22);
    pointer-events: none;
    transition: height 180ms ease-out;
}

.modal-urine-fill {
    z-index: 1;
}

.modal-urine-drop {
    position: absolute;
    z-index: 4;
    width: var(--drop-width);
    height: var(--drop-height);
    border-radius: 50% 50% 58% 58%;
    opacity: 0;
    background: var(--urine-color);
    box-shadow: 0 1px 1px rgba(104, 78, 5, 0.22);
    pointer-events: none;
    animation: modalUrineDropFall var(--drop-duration) linear var(--drop-delay) forwards;
}

@keyframes modalUrineDropFall {
    0% {
        opacity: 0;
        transform: translate3d(0, -2px, 0) scale(0.7, 0.85);
    }
    12% {
        opacity: 0.95;
    }
    25% {
        opacity: 0.95;
        transform: translate3d(
            var(--drop-drift-25),
            var(--drop-distance-25),
            0
        ) scale(0.86, 0.95);
    }
    50% {
        opacity: 0.95;
        transform: translate3d(
            var(--drop-drift-50),
            var(--drop-distance-50),
            0
        ) scale(0.9, 1.05);
    }
    75% {
        opacity: 0.95;
        transform: translate3d(
            var(--drop-drift-75),
            var(--drop-distance-75),
            0
        ) scale(0.9, 1.2);
    }
    100% {
        opacity: 0;
        transform: translate3d(var(--drop-drift), var(--drop-distance), 0) scale(1.25, 0.55);
    }
}

/* Кнопка-крестик для закрытия модального окна */
.mobile-modal-close-x {
    position: absolute;
    top: 15px;
    left: 15px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(231, 76, 60, 0.8); /* Красный фон */
    color: white; /* Белый крестик */
    font-size: 24px;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 5;
}

.mobile-modal-close-x:hover {
    background: rgba(231, 76, 60, 1); /* Более яркий красный при наведении */
    color: white;
    transform: scale(1.1);
}

@keyframes mobileModalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.mobile-modal-header {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 30px 20px;
    border-radius: 20px 20px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.mobile-modal-header .header-left {
    flex: 1;
    text-align: center;
}

.mobile-modal-header .header-left h2 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    font-weight: bold;
}

.mobile-modal-header .header-left p {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.mobile-modal-header .header-right {
    flex-shrink: 0;
}

.ticket-number {
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px;
    padding: 15px 20px;
    text-align: center;
    min-width: 120px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.ticket-label {
    font-size: 0.85rem;
    opacity: 0.9;
    margin-bottom: 5px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ticket-value {
    font-size: 2.8rem;
    font-weight: bold;
    line-height: 1;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mobile-modal-body {
    padding: 7.5px 10px 30px 10px; /* Боковые отступы уменьшены в 2 раза: 20px → 10px */
}

.mobile-info-item {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    gap: 8px;
    font-size: 0.95rem;
    color: #666;
}

.mobile-info-item.wait-time-message {
    text-align: center;
    line-height: 1.5;
    display: block;
    margin-bottom: 15px;
}

/* Убираем margin у скрытых элементов */
.mobile-info-item.wait-time-message.hidden {
    margin: 0 !important;
    display: none !important;
}

.mobile-info-item.wait-time-message strong {
    color: #e74c3c;
    font-weight: 700;
}

@media (prefers-reduced-motion: no-preference) {
    #mobileSuccessModal[aria-hidden="false"] #suppliesInstructionBlock > span {
        animation: supplies-instruction-blink 0.75s ease-in-out 5;
    }

    @keyframes supplies-instruction-blink {
        50% { opacity: 0.35; }
    }
}

.mobile-label {
    font-weight: 500;
    color: #666;
    font-size: 0.95rem;
}

.mobile-value {
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

/* Кнопки увеличения очереди */
.queue-boost-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
}

/* Убираем margin у скрытых контейнеров */
.queue-boost-buttons.hidden {
    margin: 0 !important;
    display: none !important;
}

.boost-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 15px 10px;
    border: 2px solid #ddd;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 0;
    position: relative;
}

.boost-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #e74c3c;
    color: white;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.boost-badge.visible {
    opacity: 1;
    transform: scale(1);
}

.boost-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.boost-icon {
    font-size: 32px; /* Размер эмодзи */
    line-height: 1;
    flex-shrink: 0;
}

.milk-combo-icon {
    display: inline-flex;
    align-items: center;
}

.milk-combo-icon .milk-cucumbers {
    display: block;
    width: .68em;
    height: auto;
    margin-left: -.1em;
}

/* Копия иконки, которая летит к кнопке "Забрать боеприпасы" */
.supply-flyer {
    position: fixed;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    line-height: 1;
    pointer-events: none;
    user-select: none;
    will-change: transform, opacity, filter;
    animation: supplyFlyToCollect 650ms cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
}

@keyframes supplyFlyToCollect {
    0% {
        transform: translate3d(0, 0, 0) scale(1) rotate(0deg);
        opacity: 1;
        filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25));
    }
    55% {
        transform: translate3d(var(--supply-mid-x), var(--supply-mid-y), 0) scale(1.18) rotate(12deg);
        opacity: 1;
    }
    100% {
        transform: translate3d(var(--supply-end-x), var(--supply-end-y), 0) scale(0.35) rotate(28deg);
        opacity: 0;
        filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0));
    }
}

.boost-btn span {
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.beer-btn {
    border-color: #f39c12;
}

.beer-btn:hover {
    background: #fff8e1;
    border-color: #f39c12;
}

/* Цвет для эмодзи не нужен */

.cola-btn {
    border-color: #e74c3c;
}

.cola-btn:hover {
    background: #ffebee;
    border-color: #e74c3c;
}

/* Цвет для эмодзи не нужен */

.watermelon-btn {
    border-color: #e91e63;
}

.watermelon-btn:hover {
    background: #fce4ec;
    border-color: #e91e63;
}

/* Цвет для эмодзи не нужен */

.medicine-btn {
    border-color: #27ae60;
}

.medicine-btn:hover {
    background: #e8f5e9;
    border-color: #27ae60;
}

/* Цвет для эмодзи не нужен */

.medicine-text {
    font-size: 0.75rem !important;
    font-weight: 600;
}

.melon-btn {
    border-color: #ffd700;
}

.melon-btn:hover {
    background: #fffacd;
    border-color: #ffd700;
}

/* Цвет для эмодзи не нужен */

.tea-btn {
    border-color: #8b4513;
}

.tea-btn:hover {
    background: #ffefd5;
    border-color: #8b4513;
}

/* Цвет для эмодзи не нужен */

.coffee-btn {
    border-color: #6f4e37;
}

.coffee-btn:hover {
    background: #f5f5dc;
    border-color: #6f4e37;
}

/* Цвет для эмодзи не нужен */

.milk-btn {
    border-color: #3498db;
}

.milk-btn:hover {
    background: #ebf5fb;
    border-color: #3498db;
}

/* Цвет для эмодзи не нужен */

.milk-text {
    font-size: 0.7rem !important;
    font-weight: 600;
    line-height: 1.2;
}

/* Кнопки управления боеприпасами */
.collect-supplies-section {
    margin: 25px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* Убираем margin у скрытой секции управления */
.collect-supplies-section.hidden {
    margin: 0 !important;
    display: none !important;
}

.reset-supplies-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
}

.reset-supplies-btn:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(149, 165, 166, 0.4);
}

.collect-supplies-btn {
    --urine-fill-height: 0px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.collect-supplies-btn::before {
    content: '';
    position: absolute;
    z-index: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--urine-fill-height);
    background: var(--urine-color);
    pointer-events: none;
    transition: height 180ms ease-out;
}

.collect-supplies-label {
    position: relative;
    z-index: 2;
}

.urine-surface-impact,
.modal-liquid-impact {
    position: absolute;
    z-index: 3;
    width: 0;
    height: 0;
    pointer-events: none;
}

.urine-impact-ring {
    position: absolute;
    left: 0;
    top: 0;
    width: 13px;
    height: 5px;
    border: 1px solid rgba(255, 252, 207, 0.32);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0.35);
    animation: urineImpactRing 430ms ease-out forwards;
}

.urine-surface-wave {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--wave-width);
    height: var(--wave-height);
    border-top: 1.5px solid var(--urine-color);
    border-radius: 50% 50% 0 0;
    opacity: 0;
    transform: translate(-50%, -50%) scaleX(0.35);
    animation: urineSurfaceWave 650ms ease-out forwards;
}

@keyframes urineImpactRing {
    0% {
        opacity: 0.38;
        transform: translate(-50%, -50%) scale(0.35);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scaleX(2.25) scaleY(1.35);
    }
}

@keyframes urineSurfaceWave {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scaleX(0.35);
    }
    18% {
        opacity: 0.82;
    }
    70% {
        opacity: 0.55;
    }
    100% {
        opacity: 0;
        transform: translate(calc(-50% + var(--wave-distance)), -50%) scaleX(1.15);
    }
}

.collect-supplies-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
}

.collect-supplies-btn:active {
    transform: translateY(0);
}

/* Анимация мерцания для кнопки "Забрать" */
.collect-supplies-btn.pulsing {
    animation: collectPulse 1.5s ease-in-out infinite;
}

@keyframes collectPulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(40, 167, 69, 0.7), 0 0 20px rgba(40, 167, 69, 0.5);
        transform: scale(1.02);
    }
}

/* Сообщение после сбора */
.supplies-collected-message {
    margin: 0 0 5px 0; /* Минимальный нижний отступ */
    padding: 10px; /* Уменьшено в 2 раза: 20px → 10px */
    background: transparent; /* Прозрачный фон */
    border: none; /* Без рамки */
    text-align: center;
}

.supplies-collected-message p {
    margin: 0;
    color: #333; /* Обычный цвет текста */
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 500;
    white-space: pre-line; /* Поддержка переносов строк */
}

.supply-badge {
    display: inline-block;
    padding: 4px 10px;
    margin: 3px;
    border-radius: 8px;
    font-weight: normal;
}

/* Неактивные кнопки боеприпасов */
.boost-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.boost-btn.disabled:hover {
    transform: none;
    box-shadow: none;
}

.mobile-share-section {
    margin-top: 5px; /* Минимальный отступ сверху */
    text-align: center;
}

.mobile-share-title {
    margin: 0 0 20px 0;
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.mobile-social-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.mobile-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px; /* Фиксированная ширина для круга */
    height: 50px; /* Фиксированная высота для круга */
    padding: 0; /* Убираем padding */
    border: none;
    border-radius: 50%; /* Делаем круглой */
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-social-btn .social-icon {
    width: 24px; /* Увеличиваем иконку */
    height: 24px;
    flex-shrink: 0;
}

.mobile-social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mobile-social-btn.facebook {
    background: #1877f2;
    color: white;
}

.mobile-social-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.mobile-social-btn.vk {
    background: #0077ff;
    color: white;
}

.mobile-social-btn.telegram {
    background: #0088cc;
    color: white;
}

.mobile-social-btn.twitter {
    background: #000000;
    color: white;
}

.mobile-social-btn.copy-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.mobile-modal-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.mobile-close-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-close-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.4);
}

/* Десктопная версия модального окна */
@media (min-width: 769px) {
    .mobile-modal-content {
        max-width: 600px;
        margin: 2.5% auto; /* Уменьшено в 2 раза с 5% */
    }
    
    .mobile-modal-header {
        padding: 40px 30px;
    }
    
    .mobile-modal-header .header-left h2 {
        font-size: 2.2rem;
    }
    
    .mobile-modal-header .header-left p {
        font-size: 1.3rem;
    }
    
    .ticket-number {
        min-width: 140px;
        padding: 20px 25px;
    }
    
    .ticket-label {
        font-size: 0.95rem;
    }
    
    .ticket-value {
        font-size: 3.5rem;
    }
    
    .mobile-modal-body {
        padding: 10px 15px 40px 15px; /* Боковые отступы уменьшены в 2 раза: 30px → 15px */
    }
    
    .mobile-info-item {
        font-size: 1.05rem;
        margin-bottom: 25px;
    }
    
    .mobile-info-item.wait-time-message {
        font-size: 1.1rem;
    }
    
    .mobile-label {
        font-size: 1.05rem;
    }
    
    .mobile-value {
        font-size: 1.05rem;
    }
    
    .boost-btn {
        padding: 18px 15px;
    }
    
    .boost-btn .boost-icon {
        font-size: 48px !important; /* Размер эмодзи на десктопе (увеличен на 50%: 32px × 1.5 = 48px) */
    }
    
    .boost-btn span {
        font-size: 0.9rem;
    }
    
    .medicine-text {
        font-size: 0.75rem !important;
    }
    
    .mobile-share-title {
        font-size: 1.2rem;
        margin-bottom: 25px;
    }
    
    /* Увеличиваем только эмодзи в боеприпасах на десктопе */
    .supply-emoji {
        font-size: 1.5em; /* Увеличиваем эмодзи на 50% */
    }
    
    .mobile-social-buttons {
        gap: 15px;
    }
    
    .mobile-social-btn {
        width: 55px; /* Немного больше на десктопе */
        height: 55px;
    }
    
    .mobile-close-btn {
        padding: 16px 50px;
        font-size: 1.2rem;
    }
    
    .mobile-modal-footer {
        padding: 25px;
    }
}

.share-section h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.main-social-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    align-items: center;
    justify-content: center;
}

/* Десктопная версия - всё в одну строку */
@media (min-width: 769px) {
    .share-section {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important; /* Центрирование */
        gap: 20px !important;
    }
    
    .share-section h3 {
        margin: 0 !important;
        flex-shrink: 0;
    }
    
    .main-social-buttons {
        flex: 0 0 auto; /* Не растягивается */
        justify-content: center;
    }
}

.main-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px; /* Фиксированная ширина для круга */
    height: 50px; /* Фиксированная высота для круга */
    padding: 0; /* Убираем padding */
    border: none;
    border-radius: 50%; /* Делаем круглой */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.main-social-btn .social-icon {
    width: 24px; /* Увеличиваем иконку */
    height: 24px;
    flex-shrink: 0;
}

/* Методика: механический фон, часы слева и текст справа. */
#methodologyModal {
    z-index: 1000;
    background: rgba(0, 0, 0, 0.28);
}

#methodologyModal .modal-content {
    width: min(1240px, calc(100vw - 48px));
    max-width: none;
    max-height: calc(100vh - 48px);
    margin: 24px auto;
    overflow: hidden;
    color: #eadfce;
    background: rgba(8, 9, 9, 0.82);
    border: 1px solid rgba(183, 119, 67, 0.45);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.72);
}

#methodologyModal .modal-header {
    color: #f0dfc9;
    background: rgba(30, 20, 14, 0.84);
    border-bottom-color: rgba(183, 119, 67, 0.35);
}

#methodologyModal .methodology-body {
    padding: 0;
}

.methodology-layout {
    display: grid;
    grid-template-columns: minmax(360px, 0.9fr) minmax(0, 1.1fr);
    height: calc(100vh - 140px);
    min-height: 0;
    overflow: hidden;
}

.methodology-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 48%, rgba(154, 99, 56, 0.12), transparent 58%);
}

.methodology-hourglass {
    display: block;
    width: min(100%, 58vh);
    height: auto;
    max-height: calc(100vh - 170px);
    aspect-ratio: 4 / 5;
    object-fit: cover;
    background: transparent;
}

.methodology-copy {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding: 34px 38px 44px;
    line-height: 1.62;
    background: rgba(10, 10, 10, 0.46);
}

.methodology-copy h3 {
    color: #d6a06f;
}

.methodology-copy p,
.methodology-copy li {
    color: #eadfce;
}

@media (max-width: 768px) {
    #methodologyModal {
        overflow-y: auto;
    }

    #methodologyModal .modal-content {
        width: 100%;
        max-height: none;
        margin: 0;
        border: 0;
        border-radius: 0;
    }

    .methodology-layout {
        display: flex;
        flex-direction: column;
        height: auto;
        max-height: none;
        min-height: 0;
        overflow: visible;
    }

    .methodology-visual {
        min-height: 100vw;
        order: 1;
    }

    .methodology-hourglass {
        width: 88vw;
        max-height: none;
    }

    .methodology-copy {
        order: 2;
        overflow: visible;
        padding: 28px 22px 44px;
    }
}

.main-social-btn.facebook {
    background: #1877f2;
    color: white;
}

.main-social-btn.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.main-social-btn.vk {
    background: #0077ff;
    color: white;
}

.main-social-btn.telegram {
    background: #0088cc;
    color: white;
}

.main-social-btn.twitter {
    background: #000000;
    color: white;
}

.main-social-btn.copy-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

/* Временные элементы для тестирования */
.test-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
}

.delete-record-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.delete-record-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
}

.delete-record-btn:active {
    transform: translateY(0);
}

/* Мобильная адаптация кнопок управления боеприпасами */
@media (max-width: 768px) {
    .collect-supplies-section {
        flex-direction: column;
        gap: 10px;
    }
    
    .reset-supplies-btn {
        width: 100%;
        padding: 10px 20px;
    }
    
    .collect-supplies-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .supply-flyer {
        animation-duration: 650ms !important;
    }

    .modal-urine-drop {
        animation-duration: var(--drop-duration) !important;
        animation-delay: var(--drop-delay) !important;
    }

    .urine-impact-ring {
        animation-duration: 430ms !important;
    }

    .urine-surface-wave {
        animation-duration: 650ms !important;
    }

    .modal-urine-fill,
    #mobileSuccessModal .mobile-modal-footer::before,
    .collect-supplies-btn::before {
        transition-duration: 180ms !important;
    }
}

/* Мобильная адаптация кнопки тестирования */
@media (max-width: 768px) {
    .test-controls {
        bottom: 15px;
    }
    
    .delete-record-btn {
        padding: 10px 16px;
        font-size: 0.8rem;
    }
}
