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

body {
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #033e78 0%, #011d3a 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.intro-screen {
    background: white;
    border-radius: 5px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 100%;
    padding: 50px;
    animation: slideIn 0.5s ease-out;
    text-align: center;
}

.intro-content h1 {
    color: #e74c3c;
    font-size: 3em;
    margin-bottom: 30px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.story-box {
    background: #f8f9fa;
    border-left: 5px solid #ffd700;
    padding: 30px;
    margin: 30px 0;
    border-radius: 3px;
}

.story-text {
    font-size: 1.2em;
    color: #333;
    margin: 15px 0;
    line-height: 1.6;
}

.story-text.urgent {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.3em;
    margin-top: 25px;
}

.btn-start {
    padding: 20px 40px;
    font-size: 1.3em;
    background: linear-gradient(135deg, #ffd700 0%, #033e78 100%);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 8px 15px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
}

.btn-start:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(255, 215, 0, 0.4);
}

.container {
    background: white;
    border-radius: 5px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 30px;
    animation: slideIn 0.5s ease-out;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #033e78;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 3px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffd700 0%, #033e78 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.girl-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 20px;
    animation: bounce 1s infinite;
}

.bara-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

.progress-text {
    margin-top: 10px;
    color: #666;
    font-weight: bold;
}

main {
    min-height: 300px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 3px;
    margin-bottom: 20px;
}

.room-title {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 15px;
    text-align: center;
}

.question-text {
    font-size: 1.2em;
    color: #444;
    margin-bottom: 20px;
    line-height: 1.6;
}

.maze-container {
    display: grid;
    gap: 5px;
    justify-content: center;
    margin: 20px auto;
}

.maze-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: background-color 0.3s;
}

.maze-cell.wall {
    background: #333;
}

.maze-cell.path {
    background: white;
    cursor: pointer;
}

.maze-cell.start {
    background: #4caf50;
}

.maze-cell.end {
    background: #033e78;
}

.maze-cell.player {
    background: #ffd700;
}

.maze-cell.visited {
    background: #e3f2fd;
}

.maze-cell.trap {
    background: #ffeb3b;
    animation: trapPulse 1.5s infinite;
}

.maze-cell.teleport {
    background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
    animation: teleportPulse 2s infinite;
}

@keyframes trapPulse {
    0%,
    100% {
        background: #ffeb3b;
        transform: scale(1);
    }
    50% {
        background: #ffc107;
        transform: scale(1.1);
    }
}

@keyframes teleportPulse {
    0%,
    100% {
        background: linear-gradient(135deg, #9c27b0 0%, #673ab7 100%);
        transform: scale(1) rotate(0deg);
    }
    50% {
        background: linear-gradient(135deg, #673ab7 0%, #3f51b5 100%);
        transform: scale(1.15) rotate(180deg);
    }
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.btn {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: #033e78;
    color: white;
}

.btn-primary:hover {
    background: #ffd700;
    color: #033e78;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.answer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.answer-btn {
    padding: 20px;
    background: white;
    border: 3px solid #033e78;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1em;
    font-weight: bold;
    color: #333;
}

.answer-btn:hover {
    background: #ffd700;
    color: #033e78;
    border-color: #ffd700;
    transform: scale(1.05);
}

.message {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-radius: 3px;
    font-weight: bold;
    font-size: 1.1em;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

.victory-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.victory-screen.show {
    display: flex;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.victory-content {
    background: white;
    padding: 50px;
    border-radius: 5px;
    text-align: center;
    animation: zoomIn 0.5s;
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.victory-content h1 {
    font-size: 3em;
    margin-bottom: 20px;
    color: #4caf50;
}

.final-message {
    margin: 30px 0;
}

.victory-email {
    margin-top: 30px;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 3px;
    border: 2px solid #ffd700;
}

.victory-email p {
    font-size: 1.1em;
    margin: 10px 0;
    color: #333;
}

.victory-email a {
    color: #033e78;
    font-weight: bold;
    text-decoration: none;
    font-size: 1.2em;
}

.victory-email a:hover {
    text-decoration: underline;
}

.rescued-girl {
    font-size: 5em;
    margin-bottom: 20px;
    animation: celebrate 1s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.bara-victory-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid #4caf50;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

@keyframes celebrate {
    0%,
    100% {
        transform: rotate(-5deg);
    }
    50% {
        transform: rotate(5deg);
    }
}

.btn-restart {
    padding: 15px 40px;
    font-size: 1.2em;
    background: #033e78;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn-restart:hover {
    background: #ffd700;
    color: #033e78;
    transform: scale(1.1);
}

.riddle-text {
    font-size: 1.3em;
    color: #333;
    font-style: italic;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-left: 5px solid #ffd700;
    border-radius: 3px;
}

.input-answer {
    width: 100%;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #033e78;
    border-radius: 3px;
    margin: 15px 0;
}

.input-answer:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

@media (max-width: 900px) {
    .container {
        padding: 15px;
        max-width: 95%;
    }

    .maze-container {
        gap: 3px;
        margin: 10px auto;
        overflow-x: auto;
        max-width: 100%;
    }

    .maze-cell {
        width: 25px;
        height: 25px;
        font-size: 14px;
        border: 1px solid #ccc;
    }

    .controls {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        padding: 15px;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        z-index: 100;
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .controls .btn {
        padding: 15px 10px;
        font-size: 1.2em;
        min-height: 50px;
    }

    .controls .btn:nth-child(1) {
        grid-column: 1;
        grid-row: 2;
    }

    .controls .btn:nth-child(2) {
        grid-column: 3;
        grid-row: 2;
    }

    .controls .btn:nth-child(3) {
        grid-column: 2;
        grid-row: 1;
    }

    .controls .btn:nth-child(4) {
        grid-column: 2;
        grid-row: 2;
    }

    main {
        padding-bottom: 180px;
    }

    .message {
        margin-bottom: 100px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5em;
    }

    .intro-content h1 {
        font-size: 2em;
    }

    .story-box {
        padding: 20px;
    }

    .maze-container {
        gap: 2px;
    }

    .maze-cell {
        width: 18px;
        height: 18px;
        font-size: 10px;
        border: 0.5px solid #ddd;
    }

    .answer-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .answer-btn {
        padding: 15px;
    }

    .room-title {
        font-size: 1.2em;
    }

    .question-text {
        font-size: 1em;
    }

    .container {
        padding: 10px;
    }
}

@media (max-width: 400px) {
    .maze-cell {
        width: 15px;
        height: 15px;
        font-size: 8px;
    }
}
