* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: radial-gradient(circle at top, #34495e 0%, #1e2b37 100%);
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: manipulation;
    overscroll-behavior: none;
}

/* Основная карточка игры */
.game-container {
    text-align: center;
    width: 92%;
    max-width: 410px;
    background: rgba(52, 73, 94, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 24px 20px;
    border-radius: 24px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
    position: relative;
    backdrop-filter: blur(6px);
}

.game-container h1, #gameTitle {
    margin: 0 0 14px 0;
    font-size: clamp(22px, 6vw, 28px);
    font-weight: 900;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

/* Зона с маршруткой */
.bus-container {
    position: relative;
    height: 155px;
    margin: 10px 0 18px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(26, 37, 47, 0.45);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.bus {
    font-size: 96px;
    line-height: 1;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    cursor: pointer;
    touch-action: none;
    filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
}

.bus.charging {
    animation: bus-charge 0.14s infinite alternate;
}

@keyframes bus-charge {
    0% { transform: scale(1) rotate(-4deg); filter: drop-shadow(0 0 12px #f1c40f); }
    100% { transform: scale(1.1) rotate(4deg); filter: drop-shadow(0 0 22px #e67e22); }
}

.bus.angry-shake {
    animation: angry-bus 0.28s ease-in-out;
}

@keyframes angry-bus {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px) rotate(-4deg); }
    50% { transform: translateX(8px) rotate(4deg); }
    75% { transform: translateX(-5px) rotate(-2deg); }
}

.bus.shake-bus {
    animation: eat-bounce 0.28s ease-out;
}

@keyframes eat-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.bus.doshirak-pop {
    animation: pop-transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes pop-transform {
    0% { transform: scale(0.3) rotate(-180deg); }
    60% { transform: scale(1.3) rotate(15deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.bus.drive-away {
    animation: bus-leave 1.2s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes bus-leave {
    0% { transform: translateX(0) rotate(0deg); opacity: 1; }
    20% { transform: translateX(15px) rotate(4deg); opacity: 1; }
    100% { transform: translateX(-500px) rotate(-6deg); opacity: 0; }
}

.bus-two {
    position: absolute;
    right: -450px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    font-size: 85px;
}

.bus-two.ramming {
    visibility: visible;
    animation: bus-ram 0.9s cubic-bezier(0.55, 0.055, 0.675, 0.19) forwards;
}

@keyframes bus-ram {
    0% { right: -450px; opacity: 1; transform: rotate(0deg); }
    70% { opacity: 1; transform: rotate(-12deg) scale(1.1); }
    100% { right: 120px; opacity: 1; transform: rotate(0deg) scale(1.1); }
}

.driver-shout {
    background-color: #f1c40f;
    color: #c0392b;
    font-size: 14px;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 14px;
    border: 2px solid #c0392b;
    white-space: nowrap;
    margin-bottom: -6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease-out;
    z-index: 5;
}

.driver-shout.active {
    opacity: 1;
    transform: scale(1);
}

.smoke {
    position: absolute;
    width: 60px;
    height: 60px;
    background: transparent;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

/* Шкала ярости / сытости */
.rage-label {
    margin-bottom: 8px;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 1px;
    color: #ecf0f1;
}

.rage-bar-outer {
    width: 100%;
    height: 22px;
    background-color: #1e2b37;
    border-radius: 12px;
    overflow: hidden;
    padding: 3px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

.rage-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #e67e22, #e74c3c);
    transition: width 0.15s ease-out, background 0.3s;
    border-radius: 9px;
}

.rage-bar-inner.satiety-bar {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

/* Главная кнопка под большой палец */
.shout-btn {
    width: 100%;
    min-height: 60px;
    padding: 16px 18px;
    margin-top: 20px;
    font-size: 18px;
    font-weight: 900;
    color: white;
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 100%);
    border: none;
    border-bottom: 4px solid #922b21;
    border-radius: 18px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(192, 57, 43, 0.45);
    transition: transform 0.12s, filter 0.15s;
    touch-action: none;
}

.shout-btn:active:not(:disabled) {
    transform: translateY(2px) scale(0.98);
    border-bottom-width: 2px;
    filter: brightness(0.95);
}

.shout-btn.eat-mode {
    background: linear-gradient(180deg, #2ecc71 0%, #27ae60 100%);
    border-bottom-color: #1e8449;
    box-shadow: 0 6px 18px rgba(39, 174, 96, 0.45);
    font-size: 16px;
}

.shout-btn:disabled {
    background: #7f8c8d;
    border-bottom-color: #626e70;
    box-shadow: none;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Текст результата */
.result-text {
    margin-top: 18px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(18px, 5.2vw, 23px);
    font-weight: 900;
    color: #f1c40f;
    text-shadow: 0 2px 10px rgba(241, 196, 15, 0.4);
    line-height: 1.2;
}

.bus.exploded {
    animation: explode-bus 0.6s ease-out forwards;
}

@keyframes explode-bus {
    0% { transform: scale(1); }
    40% { transform: scale(2.2) rotate(15deg); filter: brightness(2); }
    100% { transform: scale(1.5); opacity: 0.9; }
}

.shake-screen {
    animation: screen-shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes screen-shake {
    10%, 90% { transform: translate3d(-4px, -2px, 0); }
    20%, 80% { transform: translate3d(6px, 4px, 0); }
    30%, 50%, 70% { transform: translate3d(-8px, -4px, 0); }
    40%, 60% { transform: translate3d(8px, 4px, 0); }
}

/* Сцена с Верити */
.verity-scene {
    position: fixed;
    bottom: max(14px, env(safe-area-inset-bottom));
    left: max(14px, env(safe-area-inset-left));
    z-index: 600;
    pointer-events: none;
    display: none;
    transform: scale(0.85);
    transform-origin: bottom left;
}

.verity-box {
    font-size: 60px;
    position: relative;
    z-index: 2;
    animation: box-drop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes box-drop {
    0% { transform: translateY(-120px) scale(0.4); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.verity-box.shaking {
    animation: box-shake 0.12s infinite alternate;
}

@keyframes box-shake {
    0% { transform: rotate(-8deg) scale(1.05); }
    100% { transform: rotate(8deg) scale(1.05); }
}

.verity-box.hit {
    animation: box-fly-away 0.8s ease-out forwards !important;
}

@keyframes box-fly-away {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(-320px, -240px) rotate(540deg) scale(0.4); }
}

.verity-char {
    position: absolute;
    bottom: 10px;
    left: 65px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    transform: translate(-40px, 20px) scale(0.2);
}

.verity-char.pop-out {
    animation: verity-jump 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes verity-jump {
    0% { opacity: 0; transform: translate(-45px, 25px) scale(0.2); }
    60% { opacity: 1; transform: translate(0, -35px) scale(1.1); }
    100% { opacity: 1; transform: translate(0, 0) scale(1); }
}

.verity-char.hit {
    animation: verity-fly-away 0.8s ease-out forwards !important;
}

@keyframes verity-fly-away {
    0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
    100% { opacity: 0; transform: translate(-250px, -350px) rotate(-720deg) scale(0.3); }
}

.verity-emoji { font-size: 52px; line-height: 1; }

.verity-speech {
    background-color: #ffffff;
    color: #2c3e50;
    font-size: 14px;
    font-weight: 900;
    padding: 6px 12px;
    border-radius: 14px;
    border: 2px solid #2c3e50;
    white-space: nowrap;
    margin-bottom: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease-out;
}

.verity-speech.active { opacity: 1; transform: scale(1); }

.verity-bus {
    position: fixed;
    bottom: 18px;
    left: 110vw;
    font-size: 75px;
    z-index: 4;
    display: none;
}

.verity-bus.attack {
    display: block;
    animation: verity-bus-drive 1.1s linear forwards;
}

@keyframes verity-bus-drive {
    0% { left: 105vw; }
    100% { left: -200px; }
}

/* Бомба и Супернова */
.corner-bomb {
    position: fixed;
    bottom: max(18px, env(safe-area-inset-bottom));
    right: max(18px, env(safe-area-inset-right));
    font-size: 54px;
    cursor: pointer;
    z-index: 500;
    display: none;
    touch-action: none;
    transform-origin: bottom right;
    animation: bomb-appear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
bomb-pulse 0.6s infinite alternate 0.4s;
filter: drop-shadow(0 0 12px rgba(231, 76, 60, 0.9));
}
.corner-bomb.charging { animation: none !important; }
@keyframes bomb-appear {
0% { transform: scale(0) rotate(-180deg); opacity: 0; }
100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes bomb-pulse {
0% { transform: scale(1); filter: drop-shadow(0 0 10px #e74c3c); }
100% { transform: scale(1.18); filter: drop-shadow(0 0 25px #f1c40f); }
}
.supernova-core {
position: fixed;
top: 50%;
left: 50%;
width: 10px;
height: 10px;
border-radius: 50%;
background: radial-gradient(circle, #ffffff 0%, #fff7ae 25%, #ff9f1a 55%, #00d2ff 80%, transparent 100%);
transform: translate(-50%, -50%) scale(0);
opacity: 0;
pointer-events: none;
z-index: 9500;
}
.supernova-core.active {
animation: supernova-expand 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes supernova-expand {
0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
40% { transform: translate(-50%, -50%) scale(220); opacity: 1; }
100% { transform: translate(-50%, -50%) scale(350); opacity: 0; }
}
.supernova-wave {
position: fixed;
top: 50%;
left: 50%;
width: 20px;
height: 20px;
border-radius: 50%;
border: 4px solid #70a1ff;
box-shadow: 0 0 40px #1e90ff, inset 0 0 40px #ffffff;
transform: translate(-50%, -50%) scale(0);
opacity: 0;
pointer-events: none;
z-index: 9600;
}
.supernova-wave.active {
animation: wave-expand 1.6s ease-out forwards;
}
@keyframes wave-expand {
0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
100% { transform: translate(-50%, -50%) scale(140); opacity: 0; }
}
.flash-overlay {
position: fixed;
inset: 0;
background: #000000;
opacity: 0;
pointer-events: none;
z-index: 9800;
}
.flash-overlay.active {
animation: screen-blackout 1.2s ease-out forwards;
}
@keyframes screen-blackout {
0% { opacity: 0; }
10% { opacity: 1; }
100% { opacity: 1; }
}
.nuke-message, .supernova-text {
position: fixed;
top: 50%;
left: 50%;
width: 90%;
transform: translate(-50%, -50%) scale(0.5);
font-size: clamp(26px, 7.5vw, 40px);
font-weight: 900;
text-align: center;
opacity: 0;
pointer-events: none;
z-index: 10000;
transition: all 0.4s ease-out;
}
.nuke-message {
color: #e74c3c;
text-shadow: 0 0 25px #000, 0 0 15px #f1c40f;
}
.supernova-text {
color: #f1c40f;
text-shadow: 0 0 25px #000, 0 0 15px #ff9f1a;
}
.nuke-message.show, .supernova-text.show {
opacity: 1;
transform: translate(-50%, -50%) scale(1);
}
/* Календарь и мем */
.falling-calendar {
position: fixed;
top: -100px;
left: 50%;
transform: translateX(-50%);
font-size: 62px;
cursor: pointer;
z-index: 800;
display: none;
touch-action: none;
filter: drop-shadow(0 8px 15px rgba(0, 0, 0, 0.6));
}
.falling-calendar.dropped {
display: block;
animation: calendar-drop 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
@keyframes calendar-drop {
0% { top: -100px; transform: translateX(-50%) rotate(-30deg) scale(0.5); }
100% { top: max(68px, calc(env(safe-area-inset-top) + 52px)); transform: translateX(-50%) rotate(0deg) scale(1); }
}
.meme-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.88);
display: none;
justify-content: center;
align-items: center;
z-index: 10500;
backdrop-filter: blur(5px);
}
.meme-overlay.active {
display: flex;
animation: fade-in-meme 0.3s ease-out forwards;
}
@keyframes fade-in-meme {
from { opacity: 0; transform: scale(0.85); }
to { opacity: 1; transform: scale(1); }
}
.meme-box {
position: relative;
max-width: 88vw;
max-height: 82dvh;
background: #fff;
padding: 8px;
border-radius: 16px;
box-shadow: 0 0 40px rgba(231, 76, 60, 0.8);
}
.meme-box img {
max-width: 100%;
max-height: 76dvh;
display: block;
border-radius: 10px;
}
.close-meme-btn {
position: absolute;
top: -14px;
right: -14px;
width: 38px;
height: 38px;
border-radius: 50%;
border: none;
background: #e74c3c;
color: white;
font-size: 18px;
font-weight: bold;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}
/* Картошка */
.corner-potato {
position: fixed;
top: max(14px, env(safe-area-inset-top));
right: max(14px, env(safe-area-inset-right));
font-size: 50px;
cursor: pointer;
z-index: 1050;
display: none;
touch-action: none;
animation: potato-appear 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
potato-wobble 1.2s infinite ease-in-out 0.5s;
filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.5));
}
.corner-potato.active-potato {
animation: potato-panic 0.12s infinite alternate !important;
filter: drop-shadow(0 0 25px #e67e22) brightness(1.3);
}
@keyframes potato-appear {
0% { transform: scale(0) rotate(180deg); opacity: 0; }
100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
@keyframes potato-wobble {
0%, 100% { transform: rotate(-6deg); }
50% { transform: rotate(6deg); }
}
@keyframes potato-panic {
0% { transform: scale(1.25) rotate(-12deg); }
100% { transform: scale(1.35) rotate(12deg); }
}
.game-container.potato-shrink {
transition: transform 3s cubic-bezier(0.55, 0.055, 0.675, 0.19) !important;
transform: scale(0.45) rotate(-5deg) !important;
}
/* Кнопка достижений */
.ach-open-btn {
position: fixed;
top: max(14px, env(safe-area-inset-top));
left: max(14px, env(safe-area-inset-left));
z-index: 900;
display: flex;
align-items: center;
gap: 8px;
background: rgba(52, 73, 94, 0.95);
color: #f1c40f;
border: 2px solid #f1c40f;
border-radius: 14px;
padding: 8px 14px;
font-size: 16px;
font-weight: 900;
cursor: pointer;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.ach-open-btn:active {
transform: scale(0.95);
}
.ach-open-btn img {
width: 24px;
height: 24px;
object-fit: contain;
}
/* Всплывающее уведомление о достижении */
.ach-toast {
position: fixed;
top: -130px;
left: 50%;
transform: translateX(-50%);
z-index: 11000;
display: flex;
align-items: center;
gap: 12px;
background: linear-gradient(135deg, #2c3e50, #1a252f);
border: 2px solid #f1c40f;
border-radius: 16px;
padding: 12px 16px;
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.75);
transition: top 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275);
pointer-events: none;
width: 90%;
max-width: 360px;
}
.ach-toast.show {
top: max(16px, env(safe-area-inset-top));
}
.ach-toast img {
width: 40px;
height: 40px;
object-fit: contain;
flex-shrink: 0;
}
.ach-toast-label {
font-size: 10px;
font-weight: 900;
color: #f1c40f;
letter-spacing: 0.8px;
}
.ach-toast-title {
font-size: 15px;
font-weight: bold;
color: #ffffff;
margin-top: 2px;
}
.ach-toast-desc {
font-size: 12px;
color: #bdc3c7;
}
/* Модальное окно списка достижений */
.ach-modal {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.82);
z-index: 10800;
display: none;
justify-content: center;
align-items: center;
backdrop-filter: blur(5px);
}
.ach-modal.active {
display: flex;
}
.ach-modal-box {
background: #34495e;
border: 2px solid #f1c40f;
border-radius: 20px;
width: 92%;
max-width: 420px;
max-height: 80dvh;
display: flex;
flex-direction: column;
padding: 18px;
box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
}
.ach-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
border-bottom: 1px solid #4a627a;
padding-bottom: 10px;
}
.ach-modal-header h2 {
margin: 0;
font-size: 20px;
color: #f1c40f;
}
.ach-header-actions {
display: flex;
align-items: center;
gap: 8px;
}
.ach-reset-btn {
background: #c0392b;
color: #ffffff;
border: 1px solid #e74c3c;
border-radius: 10px;
padding: 6px 10px;
font-size: 12px;
font-weight: bold;
cursor: pointer;
}
.ach-close-btn {
background: #e74c3c;
color: white;
border: none;
width: 34px;
height: 34px;
border-radius: 50%;
font-weight: bold;
cursor: pointer;
}
.ach-list {
overflow-y: auto;
display: flex;
flex-direction: column;
gap: 10px;
padding-right: 2px;
}
.ach-item {
display: flex;
align-items: center;
gap: 12px;
background: #2c3e50;
padding: 12px;
border-radius: 12px;
border: 1px solid #465c71;
text-align: left;
}
.ach-item.locked {
opacity: 0.45;
filter: grayscale(100%);
}
.ach-item img {
width: 36px;
height: 36px;
object-fit: contain;
flex-shrink: 0;
}
.ach-item-title {
font-weight: bold;
font-size: 15px;
color: #f1c40f;
}
.ach-item.locked .ach-item-title {
color: #ecf0f1;
}
.ach-item-desc {
font-size: 12px;
color: #bdc3c7;
margin-top: 2px;
}
/* Аккуратный дисклеймер внизу экрана, чтобы не мешал кнопкам сверху */
.disclaimer, .disclaimer1, .disclaimer2 {
position: fixed;
left: 50%;
transform: translateX(-50%);
width: 92%;
text-align: center;
font-size: 9px;
line-height: 1.2;
color: rgba(255, 255, 255, 0.35);
pointer-events: none;
z-index: 100;
}
.disclaimer { bottom: max(28px, calc(env(safe-area-inset-bottom) + 22px)); }
.disclaimer1 { bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px)); }
.disclaimer2 { bottom: max(4px, env(safe-area-inset-bottom)); }