* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    image-rendering: pixelated;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Press Start 2P', monospace;
    background: #111;
    color: #ffffff;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-image: 
        linear-gradient(0deg, transparent 24%, 
            rgba(32, 32, 32, .3) 25%, 
            rgba(32, 32, 32, .3) 26%, 
            transparent 27%, transparent 74%, 
            rgba(32, 32, 32, .3) 75%, 
            rgba(32, 32, 32, .3) 76%, 
            transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, 
            rgba(32, 32, 32, .3) 25%, 
            rgba(32, 32, 32, .3) 26%, 
            transparent 27%, transparent 74%, 
            rgba(32, 32, 32, .3) 75%, 
            rgba(32, 32, 32, .3) 76%, 
            transparent 77%, transparent);
    background-size: 50px 50px;
}

.game-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 10px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0 0 10px 0;
}

/* ===== ВЕРХНИЙ БЛОК СТАТИСТИКИ ===== */
.stats-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #333;
    width: 100%;
    border-radius: 5px;
    margin: 10px auto;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 4px;
    text-align: center;
}

.stat-label {
    font-size: 0.7em;
    color: #888;
}

.stat-value {
    font-size: 0.9em;
    color: #fff;
    min-width: 5em;
    display: inline-block;
    text-align: center;
}

#budget .stat-value, 
#readers .stat-value,
#turn-counter .stat-value {
    min-width: 6em;
    font-variant-numeric: tabular-nums;
}

/* ===== ЦЕНТРАЛЬНЫЙ БЛОК С КАРТОЧКОЙ ===== */
.card-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 5px 0;
    position: relative;
}

.card {
    width: 100%;
    max-width: 600px;
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    max-height: 650px;
    background: #222;
    border: 2px solid #444;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    margin: 0 auto;
    cursor: grab;
    user-select: none;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.3s ease, opacity 0.3s ease;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
    touch-action: pan-x;
    overflow: hidden;
}

.card.dragging {
    cursor: grabbing;
    transition: none;
}

.card.swiped {
    pointer-events: none;
    transition: none;
}

.card.swiped-left {
    animation: swipeLeft 0.7s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.card.swiped-right {
    animation: swipeRight 0.7s cubic-bezier(0.33, 1, 0.68, 1) forwards;
}

.card.returning {
    animation: returnToCenter 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.card.new-card {
    animation: cardAppear 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    transform: translateX(0) rotate(0deg);
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.95) rotate(0deg);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1) rotate(0deg);
    }
}

@keyframes swipeLeft {
    0% {
        transform: translateX(var(--drag-x, 0)) rotate(var(--drag-rotate, 0deg));
        opacity: var(--current-opacity, 1);
    }
    100% {
        transform: translateX(-150%) rotate(-30deg);
        opacity: 0;
    }
}

@keyframes swipeRight {
    0% {
        transform: translateX(var(--drag-x, 0)) rotate(var(--drag-rotate, 0deg));
        opacity: var(--current-opacity, 1);
    }
    100% {
        transform: translateX(150%) rotate(30deg);
        opacity: 0;
    }
}

@keyframes returnToCenter {
    0% {
        transform: translateX(var(--drag-x)) rotate(var(--drag-rotate));
    }
    100% {
        transform: translateX(0) rotate(0deg);
    }
}

/* ===== СОДЕРЖИМОЕ КАРТОЧКИ ===== */
.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    position: relative;
}

#situation-text {
    font-size: 0.8em;
    line-height: 1.6;
    margin: 0 0 20px 0;
    padding: 10px 30px;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-align: center;
    overflow-y: auto;
    max-height: 100%;
    scrollbar-width: none;
}

#situation-text::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

/* ===== ИНДИКАТОРЫ СВАЙПА ===== */
.swipe-indicators {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.swipe-indicator {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 2.5em;
    opacity: 0.9;
    pointer-events: none;
    z-index: 10;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

.swipe-left-indicator {
    left: 20px;
    color: #ff4444;
}

.swipe-right-indicator {
    right: 20px;
    color: #44ff44;
}

.card.dragging .swipe-indicator {
    opacity: 1;
}

/* ===== КНОПКИ ВЫБОРА ===== */
#choices-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    align-items: center;
    position: relative;
    z-index: 5;
    margin-top: auto;
    padding-top: 10px;
}

.choice-button {
    background: rgba(60, 60, 60, 0.95);
    border: 2px solid #666;
    color: white;
    padding: 12px 20px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    font-size: 0.7em;
    transition: all 0.2s ease;
    text-align: center;
    max-width: 90%;
    width: fit-content;
    display: flex;
    align-items: center;
    border-radius: 4px;
    min-height: 44px;
    margin: 0 auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    padding-left: 35px;
    padding-right: 35px;
    min-width: 200px;
    justify-content: center;
}

.choice-button::after {
    content: none;
}

.choice-button.negative::after {
    content: none;
}

.choice-button.positive {
    color: #7cff7c;
}

.choice-button.negative {
    color: #ff7c7c;
}

.choice-button:hover::after {
    transform: translateY(-50%) scale(1.2);
    text-shadow: 0 0 8px currentColor;
}

.choice-button:active {
    transform: scale(0.97);
}

/* ===== НИЖНИЙ БЛОК МЕТРИК ===== */
.hidden-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #333;
    width: 100%;
    border-radius: 5px;
    margin: 5px auto;
    box-sizing: border-box;
}

.metric {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px;
}

.metric-label {
    font-size: 0.7em;
    color: #888;
    text-align: center;
}

.metric-bar {
    height: 10px;
    background: #333;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin: 5px 0;
}

.metric-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: var(--value, 0%);
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
}

/* ===== ТЕКСТ РЕШЕНИЯ ===== */
.decision-text {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
    font-weight: bold;
    pointer-events: none;
    z-index: 100;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 10px;
    border: 2px solid;
    max-width: 80%;
    text-align: center;
    word-wrap: break-word;
    white-space: normal;
    opacity: 0;
    transition: opacity 0.2s ease;
}

body .decision-text.left {
    color: #ff4444;
    border-color: #ff4444;
}

body .decision-text.right {
    color: #44ff44;
    border-color: #44ff44;
}

.decision-text.visible {
    opacity: 1;
}

/* ===== ЭКРАНЫ ОКОНЧАНИЯ ИГРЫ ===== */
.game-over-message, .victory-message {
    background: rgba(34, 34, 34, 0.95);
    color: #fff;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    margin: 20px;
    text-align: center;
    white-space: pre-line;
    line-height: 1.5;
    font-size: 1.2em;
    border: 2px solid #444;
}

.victory-message {
    background: linear-gradient(135deg, #2d5a2d, #1a3a1a);
    border: 2px solid #4CAF50;
}

.game-over-screen, .victory-screen {
    width: 100%;
    max-width: 600px;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    padding: 25px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100vh - 180px);
    height: calc(100dvh - 180px);
    max-height: 650px;
    position: relative;
}

.victory-screen {
    background: rgba(20, 60, 20, 0.9);
    border: 2px solid #4CAF50;
}

.game-over-content, .victory-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 25px;
    overflow-y: auto;
    scrollbar-width: none;
    padding: 10px;
}

.game-over-content::-webkit-scrollbar, 
.victory-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.game-over-text, .victory-text {
    color: #fff;
    text-align: center;
    white-space: pre-line;
    line-height: 1.6;
    font-size: 1em;
    margin-bottom: 10px;
    padding: 0 10px;
}

.victory-text {
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7);
}

.restart-button, .victory-button {
    background: rgba(100, 100, 100, 0.95);
    border: 2px solid #888;
    padding: 15px 25px;
    font-size: 0.8em;
    transition: all 0.2s ease;
    border-radius: 4px;
    margin-top: 15px;
    min-height: 44px;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.restart-button:hover {
    background: #777;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.restart-button:active {
    transform: translateY(0);
}

.victory-button {
    background: rgba(60, 120, 60, 0.95);
    border: 2px solid #4CAF50;
}

.victory-button:hover {
    background: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.victory-button:active {
    transform: translateY(0);
}

.victory-button::after {
    content: none;
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .card, .game-over-screen, .victory-screen {
        width: 100%;
        max-width: none;
        border-radius: 10px;
        padding: 15px;
    }
    
    #situation-text, .game-over-text, .victory-text {
        font-size: 0.75em;
        line-height: 1.5;
        padding: 10px 20px;
    }
    
    .swipe-left-indicator {
        left: 15px;
        font-size: 2em;
    }
    
    .swipe-right-indicator {
        right: 15px;
        font-size: 2em;
    }
    
    .restart-button, .victory-button {
        padding: 10px 18px !important;
        font-size: 0.75em !important;
    }
}

@media (max-width: 480px) {
    .stats-panel, .hidden-metrics {
        padding: 10px;
        gap: 8px;
    }
    
    .stat, .metric {
        padding: 3px;
        gap: 6px;
    }
    
    .stat-label, .metric-label {
        font-size: 0.6em;
    }
    
    .stat-value {
        font-size: 0.8em;
    }
    
    .card, .game-over-screen, .victory-screen {
        padding: 12px;
    }
    
    #situation-text, .game-over-text, .victory-text {
        font-size: 0.7em;
        line-height: 1.4;
        padding: 5px 15px;
    }
    
    .choice-button, .restart-button, .victory-button {
        font-size: 0.65em !important;
        padding: 8px 15px !important;
        min-height: 40px;
    }
    
    #choices-container, .game-over-content, .victory-content {
        gap: 15px;
    }
    
    .choice-button {
        min-width: 180px;
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .choice-button::after {
        display: none;
    }
    
    .choice-button.negative::after {
        display: none;
    }
    
    .restart-button, .victory-button {
        font-size: 0.7em !important;
        padding: 12px 20px !important;
        min-width: 180px;
    }
}

@media (max-width: 350px) {
    .choice-button {
        padding-left: 12px;
        padding-right: 12px;
    }
}

@media (max-height: 700px) {
    .stats-panel {
        padding: 8px;
        margin: 5px auto;
    }
    
    .card, .game-over-screen, .victory-screen {
        margin: 5px auto;
        height: calc(100vh - 150px);
        height: calc(100dvh - 150px);
    }
    
    .hidden-metrics {
        padding: 8px;
        margin: 5px auto;
    }
    
    .game-over-text, .victory-text {
        margin-bottom: 5px;
    }
    
    .restart-button, .victory-button {
        margin-top: 10px;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .game-container {
        height: 100vh;
        height: 100dvh;
        padding-bottom: 0;
    }
    
    .stats-panel {
        position: absolute;
        top: 5px;
        left: 0;
        right: 0;
        z-index: 10;
        background: rgba(0, 0, 0, 0.85);
    }
    
    .card-container {
        padding-top: 50px;
        padding-bottom: 0;
    }
    
    .card, .game-over-screen, .victory-screen {
        height: calc(100vh - 140px);
        height: calc(100dvh - 140px);
    }
    
    #situation-text, .game-over-text, .victory-text {
        font-size: 0.65em;
        line-height: 1.3;
        margin-bottom: 10px;
    }
    
    #choices-container {
        position: sticky;
        bottom: 0;
        background: rgba(34, 34, 34, 0.95);
        border-radius: 0 0 10px 10px;
        margin: 0 -12px -12px -12px;
        padding: 8px 0;
        width: calc(100% + 24px);
    }
    
    .choice-button, .restart-button, .victory-button {
        font-size: 0.6em !important;
        padding: 6px 12px !important;
        min-height: 35px;
    }
    
    .hidden-metrics {
        position: absolute;
        bottom: 5px;
        left: 0;
        right: 0;
    }
    
    .game-over-content, .victory-content {
        padding: 5px;
        gap: 15px;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card, .choice-button, .game-over-screen, .victory-screen {
        box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
    }
}

@media (prefers-reduced-motion: reduce) {
    .card, .choice-button, .decision-text {
        transition: none;
    }
    
    .card.new-card,
    .card.swiped-left,
    .card.swiped-right,
    .card.returning {
        animation-duration: 0.01s;
    }
}

.share-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    width: calc(100% - 30px);
    box-sizing: border-box;
}

.share-title {
    font-size: 0.7em;
    color: #888;
    margin: 0;
    text-align: center;
}

.share-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    width: 100%;
    padding: 0 10px;
}

.share-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    color: white;
    padding: 0;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.share-button:active {
    transform: translateY(0);
}

.share-button i {
    font-size: 20px;
    line-height: 1;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.share-button.telegram {
    background-color: #0088cc;
}

.share-button.vk {
    background-color: #0077ff;
}

.share-button.twitter {
    background-color: #1da1f2;
}

.share-button.copy {
    background-color: #6c757d;
}

.share-button.copy.copied {
    background-color: #28a745;
}

@media (max-width: 480px) {
    .share-container {
        padding: 12px;
        gap: 12px;
        width: calc(100% - 24px);
    }

    .share-title {
        font-size: 0.65em;
    }

    .share-buttons {
        gap: 15px;
        padding: 0 5px;
    }

    .share-button {
        width: 40px;
        height: 40px;
    }

    .share-button i {
        font-size: 16px;
    }
} 