* {
    margin: 0;
    padding: 0;
    font-family: "GFS Didot", serif;
    box-sizing: border-box;
}

body {
    background: #8e0d0d;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    overflow: hidden;
    font-weight: 400;
    font-style: normal;
}

.game-screen {
    position: relative;
    width: 1024px;
    height: 768px;
    overflow: hidden;
}

.title {
    position: absolute;
    top: 30px;
    width: 100%;
    text-align: center;
    font-size: 50px;
    font-weight: bold;
    color: black;
    text-shadow:
        3px 3px 10px rgba(255, 255, 255, 0.7),
        -3px -3px 10px rgba(255, 255, 255, 0.7),
        -3px 3px 10px rgba(255, 255, 255, 0.7),
        3px -3px 10px rgba(255, 255, 255, 0.7);
    z-index: 5;
}

.map-container {
    position: absolute;
    top: 75px;
    left: 240px;
    width: 560px;
    height: 560px;
    z-index: 1;
    filter: drop-shadow(0px 0px 20px rgba(255, 255, 255, 0.9));
}

.game-board,
.region-icons {
    position: absolute;
    inset: 0;
}

.game-board {
    opacity: 0.4;
}

.game-board svg {
    width: 100%;
    height: 100%;
    display: block;
}

.region-icons {
    pointer-events: none;
}

.region-occupied {
    fill: #dd0000;
}

.region-liberated {
    fill: #537b3a;
}

.map-region,
.map-border {
    transition: fill 0.2s ease;
}

.region-fighting {
    animation: region-battle-pulse 0.9s ease-in-out infinite;
}

.region-fight-clickable {
    cursor: pointer;
}

.region-tooltip {
    position: absolute;
    z-index: 4;
    padding: 5px 9px;
    background: rgba(255, 255, 255, 0.96);
    color: #dd0000;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-100% - 10px));
    transition: opacity 0.15s ease;
}

.region-tooltip.is-visible {
    opacity: 1;
}

.region-tooltip.region-tooltip-fighting {
    background: #ffeb3b;
    color: black;
}

@keyframes region-battle-pulse {
    0%,
    100% {
        stroke-opacity: 0.45;
    }

    50% {
        stroke-opacity: 0.9;
    }
}

.region-icon {
    position: absolute;
    width: 30px;
    height: 30px;
    object-fit: contain;
    transform: translate(-50%, -50%);
    opacity: 0.55;
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}

.panel {
    position: absolute;
    top: 170px;
    left: 65px;
    width: 900px;
    background: rgba(255, 255, 255, 0.78);
    padding: 35px 40px;
    z-index: 10;
}

.panel p {
    font-size: 20px;
    line-height: 1.35;
    color: black;
    margin-bottom: 34px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(255, 255, 255, 1);
}

.panel p:last-child {
    margin-bottom: 0;
}

.play-button {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    width: 250px;
    height: 80px;
    background: rgba(255, 255, 255, 1);
    border: 6px solid #dd0000;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 50px;
    font-weight: bold;
    color: black;
    cursor: pointer;
    z-index: 20;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
    transition: 0.2s;
}

.play-button:hover {
    transform: translateX(-50%) scale(1.03);
}

.start-page {
    background: #6f88ee;
}

.start-screen {
    background: #6f88ee;
}

.start-screen .map-container {
    opacity: 1;
}

.start-map {
    top: 30px;
    left: 185px;
    width: 655px;
    height: 655px;
    z-index: 2;
    filter:
        drop-shadow(0 0 18px rgba(255, 255, 255, 0.95)) drop-shadow(0 22px 15px rgba(0, 0, 0, 0.35));
}

.start-page .game-board {
    opacity: 1;
}

.start-page .region-icon {
    width: 42px;
    height: 42px;
    opacity: 1;
    filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.3));
}

.hud {
    position: absolute;
    z-index: 8;
    color: black;
    text-shadow:
        0 0 16px rgba(255, 255, 255, 1),
        0 0 14px rgba(255, 255, 255, 0.95);
}

.hud-units {
    top: 38px;
    left: 35px;
}

.hud-score {
    top: 38px;
    right: 35px;
    text-align: right;
}

.hud-title {
    display: inline-block;
    padding-bottom: 6px;
    text-decoration: underline;
    font-size: 42px;
    font-weight: 700;
    line-height: 0.95;
}

.unit-flags {
    display: flex;
    gap: 12px;
    margin-top: 18px;
}

.unit-flag {
    position: relative;
    width: 28px;
    height: 32px;
    background: url("images/resistance.png") center / contain no-repeat;
    filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

.unit-flag.unit-lost {
    filter: grayscale(1);
    opacity: 0.45;
}

.score-value {
    margin-top:10px;
    font-size: 80px;
    font-weight: 900;
    line-height: 0.9;
}

.start-banner {
    position: absolute;
    top: 322px;
    left: 108px;
    width: 815px;
    padding: 14px 18px 22px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.78);
    color: black;
    font-size: 92px;
    font-weight: 700;
    line-height: 0.95;
    text-align: center;
    white-space: nowrap;
    text-shadow: 0 0 16px rgba(255, 255, 255, 1), 
    0 0 14px rgba(255, 255, 255, 0.9);
}

.start-button {
    bottom: 174px;
    width: 300px;
    height: 88px;
    z-index: 12;
    border: 6px solid #6270df;
    background: rgba(255, 255, 255);
    font-size: 46px;
    font-weight: 700;
    box-shadow: 12px 12px 16px rgba(0, 0, 0, 0.45);
}

.start-footer {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 100%;
    z-index: 8;
    color: black;
    font-size: 58px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-shadow:
        0 0 16px rgba(255, 255, 255, 1),
        0 0 14px rgba(255, 255, 255, 0.95);
}

.question-box {
    position: absolute;
    top: 176px;
    left: 60px;
    width: 904px;
    height: 515px;
    z-index: 14;
    padding: 52px 24px 45px;
    border: 13px solid #d51000;
    background: rgba(255, 255, 255, 0.95);
    box-shadow:
        inset 0 0 22px rgba(213, 16, 0, 0.8),
        0 0 18px rgba(213, 16, 0, 0.55);
}

.question-box.question-result-correct {
    border-color: #537b3a;
    box-shadow:
        inset 0 0 22px rgba(83, 123, 58, 0.8),
        0 0 18px rgba(83, 123, 58, 0.55);
}

.question-box.question-result-wrong {
    border-color: #dd0000;
    box-shadow:
        inset 0 0 22px rgba(221, 0, 0, 0.8),
        0 0 18px rgba(221, 0, 0, 0.55);
}

.question-box.question-end-win {
    border-color: #537b3a;
    box-shadow:
        inset 0 0 22px rgba(83, 123, 58, 0.8),
        0 0 18px rgba(83, 123, 58, 0.55);
}

.question-box.question-end {
    top: 206px;
    left: 50%;
    width: 820px;
    height: 325px;
    padding: 36px 34px;
    transform: translateX(-50%);
}

.question-box.question-result-correct::after,
.question-box.question-result-wrong::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(255, 255, 255, 0.74);
    pointer-events: none;
}

.question-opening {
    animation: question-box-in 0.3s ease-out both;
}

.question-closing {
    animation: question-box-out 0.3s ease-in both;
}

@keyframes question-box-in {
    from {
        opacity: 0;
        transform: scale(0.92);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes question-box-out {
    from {
        opacity: 1;
        transform: scale(1);
    }

    to {
        opacity: 0;
        transform: scale(0.92);
    }
}

.battle-title {
    position: absolute;
    top: 12px;
    left: 24px;
    right: 24px;
    color: black;
    font-size: 22px;
    font-weight: 700;
    line-height: 1;
    cursor: grab;
    user-select: none;
}

.question-box.is-dragging .battle-title {
    cursor: grabbing;
}

.question-title {
    margin: 0;
    width: calc(100% - 120px);
    color: black;
    font-size: 40px;
    font-weight: 700;
    line-height: 1.05;
    text-align: left;
    overflow-wrap: break-word;
    white-space: normal;
}

.question-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 20px;
    align-items: center;
    margin-top: 28px;
}

.question-graphic {
    width: 430px;
    height: 250px;
}

.result-feedback {
    position: absolute;
    inset: 0;
    z-index: 4;
    color: black;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    text-align: center;
}

.result-feedback[hidden] {
    display: none;
}

.result-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 235px;
    height: 235px;
    object-fit: contain;
    transform: translate(-50%, -50%);
}

.result-message {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 52px;
}

.game-started .start-button {
    display: none;
}

.game-ended .start-button {
    bottom: 74px;
    display: flex;
}

.game-ended .start-button.restart-button {
    width: 360px;
}

.end-feedback {
    position: absolute;
    inset: 0;
    z-index: 6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 34px;
    padding: 36px 42px;
    color: black;
    text-align: center;
    overflow: hidden;
}

.end-feedback[hidden] {
    display: none;
}

.end-title {
    max-width: 100%;
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    overflow-wrap: break-word;
}

.end-message {
    max-width: 100%;
    font-size: 50px;
    font-weight: 700;
    line-height: 1.08;
    overflow-wrap: break-word;
}

.question-end .battle-title,
.question-end .question-title,
.question-end .question-content,
.question-end .result-feedback,
.question-end .question-progress,
.question-end .progress-counter {
    display: none;
}

.answer-choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 36px 32px;
}

.answer-choice {
    width: 155px;
    height: 78px;
    border: 6px solid #e9a817;
    background: rgba(255, 255, 255, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    color: black;
    font-size: 30px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 7px 16px rgba(0, 0, 0, 0.42);
    transition: background 0.2s ease, transform 0.2s ease;
}

.answer-choice:hover { 
    background: #e8e4dc;
    transform: scale(1.03);
}

.answer-choice:disabled {
    cursor: default;
}

.answer-choice:disabled:hover {
    background: rgba(255, 255, 255, 1);
    transform: none;
}

.answer-choice.answer-choice-correct,
.answer-choice.answer-choice-correct:disabled:hover {
    background: #537b3a;
    color: white;
}

.answer-choice.answer-choice-wrong,
.answer-choice.answer-choice-wrong:disabled:hover {
    background: #dd0000;
    color: white;
}

.answer-choice-1 {
    border-color: #f266de;
}

.answer-choice-3 {
    border-color: #6aaaa8;
}

.answer-choice-4 {
    border-color: #5958ad;
}

.question-progress {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 46px;
    height: 40px;
    overflow: hidden;
}

.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #dd0000;
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 0.2s linear;
    z-index: 1;
}

.question-result-correct .progress-fill {
    background: #537b3a;
}

.question-result-wrong .progress-fill {
    background: #dd0000;
}

.progress-counter {
    position: absolute;
    top: 44px;
    right: 24px;
    min-width: 80px;
    height: 60px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #dd0000;
    font-size: 52px;
    font-weight: 700;
    line-height: 1;
}

.question-result-correct .progress-counter {
    color: #537b3a;
}

.question-result-correct .question-progress,
.question-result-wrong .question-progress {
    display: none;
}
