/* Hyperlocal Durham: Queer History - Styles */
/* Mobile-first, responsive design */

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

body {
    font-family: 'Courier New', monospace;
    background: #ffffff;
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

#game-container {
    max-width: 1400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin-top: 20px;
    margin-bottom: 20px;
}

#title-graphic {
    width: 100%;
    max-width: 1024px;
    height: auto;
    z-index: 10;
    margin-bottom: -20px;
    position: relative;
}

#game-wrapper {
    background: transparent;
    margin: 0 auto;
    width: 100%;
    max-width: 1024px;
    position: relative;
    display: inline-block;
}

#gameCanvas {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

/* Character Dialogue Box (below map) */
#character-dialogue {
    margin-top: 5px;
    width: 100%;
    max-width: 1024px;
    display: flex;
    gap: 5px;
    align-items: stretch;
}

#character-dialogue.hidden {
    display: none;
}

.character-bust {
    flex-shrink: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.character-dialogue-box {
    flex: 1;
    background: #f0f0f0;
    border: none;
    border-radius: 0;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 120px;
}

.character-text {
    color: #333;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0 0 10px 0;
    flex: 1;
}

.learn-more-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 0;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Courier New', monospace;
    align-self: flex-start;
}

.learn-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Info Dialogue Box (centered) */
#dialogue-box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    padding: 20px;
}

#dialogue-box.hidden {
    display: none;
}

.dialogue-content {
    background: #fff;
    border-radius: 0;
    padding: 30px;
    max-width: 700px;
    width: 100%;
    position: relative;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease-out;
}

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

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #000;
}

/* Section 1: Header with image and facts */
.dialogue-header {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.dialogue-image-container {
    flex-shrink: 0;
    width: 200px;
}

#dialogue-image {
    width: 100%;
    height: auto;
    display: block;
}

.dialogue-facts {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#dialogue-title {
    color: #764ba2;
    font-size: 1.5rem;
    margin: 0 0 10px 0;
    padding-right: 30px;
}

.address {
    font-size: 0.95rem;
    color: #666;
    margin: 0;
    font-style: italic;
}

/* Section 2: Characteristics icons */
.characteristics-row {
    display: flex;
    gap: 15px;
    margin: 0;
    padding: 0 0 10px 0;
    border-bottom: 2px solid #f0f0f0;
}

.characteristics-row img {
    height: 41px;
}

/* Section 3: Preview text and button */
.dialogue-preview {
    margin-top: 10px;
}

#dialogue-preview-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 15px;
}

.see-more-toggle {
    color: #764ba2;
    cursor: pointer;
    font-weight: bold;
    text-decoration: underline;
    font-size: 0.875rem;
    display: inline;
    margin-left: 5px;
}

.see-more-toggle:hover {
    color: #667eea;
}

.read-more-btn {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.read-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Controls */
#controls {
    text-align: center;
    margin-top: 10px;
    margin-bottom: 5px;
    color: #fff;
    font-size: 0.9rem;
    padding: 10px;
    background: #000000;
    border-radius: 0;
}

/* Main Page Button */
#main-page-button-container {
    margin-top: 20px;
    margin-bottom: 10px;
    width: 100%;
    max-width: 1024px;
    text-align: center;
}

.main-page-btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 0;
    font-weight: bold;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Courier New', monospace;
}

.main-page-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

/* Footer Credits */
#credits {
    margin-top: 15px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 1024px;
    text-align: center;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.6;
}

#credits p {
    margin: 5px 0;
}

#credits a {
    color: #764ba2;
    text-decoration: none;
    font-weight: bold;
}

#credits a:hover {
    text-decoration: underline;
}

/* Desktop: Scale game to fit with dialogue visible */
@media (min-width: 769px) {
    /* Calculate game width to ensure everything fits in viewport */
    #game-wrapper,
    #character-dialogue,
    #main-page-button-container,
    #credits {
        max-width: min(1024px, calc(100vw - 40px));
    }

    #title-graphic {
        max-width: min(1024px, calc(100vw - 40px));
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }
}

/* Large Desktop: More breathing room */
@media (min-width: 1400px) {
    body {
        padding: 40px;
    }

    #game-container {
        max-width: 1200px;
    }

    #game-wrapper,
    #character-dialogue,
    #main-page-button-container,
    #credits,
    #title-graphic {
        max-width: 1024px;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #title-graphic {
        width: 100%;
        margin-bottom: -15px;
    }

    #gameCanvas {
        width: 100%;
        height: auto;
    }

    .dialogue-content {
        padding: 20px;
        margin: 10px;
    }

    .dialogue-header {
        flex-direction: column;
        gap: 15px;
    }

    .dialogue-image-container {
        width: 100%;
    }

    #dialogue-title {
        font-size: 1.2rem;
        padding-right: 30px;
    }

    #dialogue-preview-text {
        font-size: 0.9rem;
    }

    .characteristics-row img {
        height: 17px;
    }

    #controls {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }

    #title-graphic {
        width: 100%;
        margin-bottom: -10px;
    }

    .dialogue-content {
        padding: 15px;
    }

    #dialogue-title {
        font-size: 1rem;
    }

    .learn-more {
        font-size: 0.9rem;
        padding: 8px 16px;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .close-btn {
        font-size: 2.5rem;
        padding: 10px;
    }

    .learn-more {
        padding: 12px 24px;
    }
}
