:root {
    --primary-color: #4a8522;
    --primary-hover: #5a9832;
    --secondary-color: #2a5298;
    --secondary-hover: #3a6db7;
    --accent-color: #8a4d9e;
    --accent-hover: #9b5eaf;
    --dark-bg: #121417;
    --card-bg: rgba(30, 30, 34, 0.95);
    --text-light: #f5f5f5;
    --text-dim: #aaaaaa;
    --border-radius: 12px;
    --box-shadow: 0 5px 25px rgba(0, 0, 0, 0.7);
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--dark-bg);
    color: var(--text-light);
    line-height: 1.6;
    background-image: linear-gradient(to bottom, rgba(18, 20, 23, 0.95), rgba(18, 20, 23, 0.95)),
        url('https://images.unsplash.com/photo-1511497584788-876760111969?ixlib=rb-4.0.3&auto=format&fit=crop&w=1500&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px 0;
}

.game-container {
    max-width: 850px;
    margin: 20px auto;
    padding: 35px;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: relative;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

.game-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

.game-title {
    text-align: center;
    font-family: 'Cinzel', serif;
    margin-bottom: 35px;
    color: var(--text-light);
    font-size: 2.8rem;
    text-shadow: 0 3px 10px rgba(0, 0, 0, 0.7);
    letter-spacing: 1px;
    position: relative;
}

.game-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(to right, var(--primary-color), transparent);
    margin: 10px auto 0;
}

.game-title span {
    color: var(--primary-color);
    position: relative;
}

.game-title span::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    opacity: 0.5;
}

.score {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    border-radius: 20px;
    padding: 5px 15px;
    font-weight: bold;
    font-size: 0.9rem;
    position: absolute;
    top: 10px;
    right: 10px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 100;
}

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

.image-container {
    position: relative;
    margin-bottom: 25px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease;
}

.image-container:hover {
    transform: translateY(-5px);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    pointer-events: none;
}

.story-image {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    margin-bottom: 0;
    border-radius: 0;
    box-shadow: none;
    display: block;
    background-color: #2a2a2a;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.story-image:hover {
    filter: brightness(1.1);
}

.situation {
    margin-bottom: 25px;
    font-size: 19px;
    line-height: 1.5;
    white-space: pre-line;
    padding: 25px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    font-family: 'Inter', sans-serif;
    position: relative;
    color: var(--text-light);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.situation::before {
    content: '"';
    font-family: Georgia, serif;
    font-size: 4em;
    position: absolute;
    left: 10px;
    top: -20px;
    color: rgba(74, 133, 34, 0.2);
}

.choice-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
}

.choice-container button {
    padding: 18px 22px;
    border: none;
    border-radius: var(--border-radius);
    background-color: var(--secondary-color);
    color: white;
    font-size: 17px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    line-height: 1.4;
}

.choice-container button:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.choice-container button::before {
    content: '›';
    margin-right: 10px;
    font-size: 1.4em;
    font-weight: bold;
    opacity: 0.8;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.choice-container button:hover::before {
    transform: translateX(3px);
    opacity: 1;
}

.reset-container {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
    margin-top: 15px;
}

.reset-button {
    background: linear-gradient(to bottom right, var(--accent-color), var(--accent-hover));
    padding: 12px 25px;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.reset-button::before {
    content: '↻';
    margin-right: 8px;
    font-size: 1.2em;
}

.reset-button:hover {
    background: linear-gradient(to bottom right, var(--accent-hover), #ac6fcf);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.loading {
    text-align: center;
    padding: 20px;
    display: none;
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: var(--border-radius);
    position: relative;
    margin: 20px 0;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.loading::before {
    content: "⟳";
    display: inline-block;
    margin-right: 10px;
    animation: spin 1.5s infinite linear;
}

.loading::after {
    content: "...";
    position: absolute;
    display: inline-block;
    animation: ellipsis 1.5s infinite;
    width: 30px;
    text-align: left;
    margin-left: 5px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes ellipsis {
    0% {
        content: ".";
    }

    33% {
        content: "..";
    }

    66% {
        content: "...";
    }
}

.end-screen {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: rgba(20, 30, 40, 0.9);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
}

.end-screen h2 {
    font-family: 'Cinzel', serif;
    color: #ffd700;
    text-align: center;
    margin-bottom: 15px;
    font-size: 2rem;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.score-display .score-label {
    font-size: 1.1rem;
    font-weight: bold;
    color: #ddd;
}

.score-display .score-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffd700;
    margin: 5px 0;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.7);
}

.star-rating {
    font-size: 1.5rem;
    color: #ffd700;
    margin-top: 5px;
    letter-spacing: 2px;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.end-message {
    font-style: italic;
    text-align: center;
    color: #aaddff;
    margin: 15px 0;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.end-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    gap: 20px;
    margin-top: 30px;
}

.manga-image,
.summary-image {
    max-width: 45%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.manga-image:hover,
.summary-image:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.end-reset {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 15px;
}

.end-reset-button {
    background-color: #2c7c5d;
}

.share-button {
    background-color: #3b5998;
}

.end-reset-button:hover {
    background-color: #1f5e46;
}

.share-button:hover {
    background-color: #2d4373;
}

/* Responsive adjustments for end screen */
@media (max-width: 600px) {

    .manga-image,
    .summary-image {
        max-width: 90%;
        margin: 10px auto;
    }

    .end-images {
        flex-direction: column;
    }

    .end-reset {
        flex-direction: column;
        align-items: center;
    }

    .end-reset-button,
    .share-button {
        width: 100%;
        max-width: 250px;
    }
}

.game-footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    color: var(--text-dim);
}

.game-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.game-footer a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .game-container {
        margin: 10px;
        padding: 20px;
    }

    .game-title {
        font-size: 2.2rem;
    }

    .situation {
        font-size: 17px;
        padding: 20px;
    }

    .choice-container button {
        font-size: 16px;
        padding: 14px 18px;
    }
}

/* Dark mode preference support */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #0d1117;
    }

    .game-container {
        background-color: rgba(30, 30, 30, 0.9);
    }
}

.game-header {
    position: relative;
    margin-bottom: 35px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.blockchain-status {
    display: flex;
    align-items: center;
    gap: 10px;
}

#connection-status {
    font-size: 0.9rem;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.connect-button {
    background: linear-gradient(135deg, #8B5CF6, #A855F7);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.connect-button:hover {
    background: linear-gradient(135deg, #7C3AED, #9333EA);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.footer-brand {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-note {
    font-style: italic;
    margin-top: 8px;
    opacity: 0.8;
    font-size: 0.85rem;
}

/* Improve main content layout */
main {
    position: relative;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Add styles for the share modal */
.share-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fadeIn 0.3s ease;
}

.share-modal-content {
    background-color: var(--card-bg);
    margin: 5% auto;
    padding: 30px;
    border-radius: var(--border-radius);
    max-width: 800px;
    width: 90%;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: slideDown 0.4s ease;
}

.close-modal {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-modal:hover {
    color: white;
}

.share-modal h2 {
    font-family: 'Cinzel', serif;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.share-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    min-height: 300px;
    position: relative;
}

.share-manga-image {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.share-manga-image:hover {
    transform: scale(1.02);
}

.share-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
}

.action-button {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 140px;
}

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

.download-button {
    background-color: var(--primary-color);
    color: white;
}

.download-button:hover {
    background-color: var(--primary-hover);
}

.copy-button {
    background-color: var(--secondary-color);
    color: white;
}

.copy-button:hover {
    background-color: var(--secondary-hover);
}

.social-button {
    color: white;
}

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

.twitter-button:hover {
    background-color: #0d8bd9;
}

.facebook-button {
    background-color: #4267B2;
}

.facebook-button:hover {
    background-color: #365899;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Media queries for responsive share modal */
@media (max-width: 600px) {
    .share-modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }

    .share-actions {
        flex-direction: column;
        align-items: center;
    }

    .action-button {
        width: 100%;
        max-width: 250px;
    }

    .share-modal h2 {
        font-size: 1.5rem;
    }
}

/* Dark mode support for share modal */
@media (prefers-color-scheme: dark) {
    .share-modal-content {
        background-color: rgba(30, 30, 34, 0.95);
    }
}

.footer-note {
    font-style: italic;
    margin-top: 10px;
    opacity: 0.8;
}

/* Blockchain button styling */
.blockchain-button {
    background: linear-gradient(135deg, #8B5CF6, #A855F7) !important;
    border: none !important;
    color: white !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.blockchain-button:hover {
    background: linear-gradient(135deg, #7C3AED, #9333EA) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4) !important;
}

.blockchain-button:disabled {
    background: #10B981 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}