@font-face {
    font-family: 'Vinque Rg';
    src: url('VinqueRg-Regular.woff2') format('woff2'),
        url('VinqueRg-Regular.woff') format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Base styles */
body, html {
    background: #000;
    font-family: 'Vinque Rg';
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
    color: white;
}

/* Screen styles */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: block;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    z-index: 1;
    pointer-events: none;
}

.screen.active {
    opacity: 1;
    z-index: 2;
}

/* Tactical Points styles */
#tactical-points {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    gap: -20px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 1200px;
}

.faction {        
    filter: drop-shadow(5px 5px 5px rgba(0,0,0,0.5));
    height: 80px;
    margin: 10px 0;
    max-width: 470px;
    display: flex;
    position: relative;
    gap: 10px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;

    @media (min-width: 769px) {
        height: 60px;
    }

    @media (min-width: 933px) {
        height: 110px;
        margin: -10px 0;
        max-width: 730px;
    }
}

.faction:first-child {
    z-index: 5;
}

.faction:nth-child(2) {
    z-index: 4;
}

.faction:nth-child(3) {
    z-index: 3;
}

.faction:nth-child(4) {
    z-index: 2;
}

.faction:nth-child(5) {
    z-index: 1;
}

.pennon-container {
    position: relative;

    @media (min-width: 769px) {
        margin-left: 20px;
    }
}

.faction-info {
    font-size: 36px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    min-width: 100px;
    padding-top: 20px;
    text-align: right;

    @media (min-width: 933px) {
        font-size: 72px;
        min-width: 200px;
    }
}

/* Location screen styles */
.location-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.location-screen h1 {
    font-size: 48px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    margin: 0;
}

.location-screen p {
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    margin: 10px 0;
}

/* Title and subtitle styles */
.title-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
}

.title {
    font-size: 48px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    word-wrap: break-word;

    @media (min-width: 933px) {
        font-size: 72px;
    }
}

body.diplomacy .title,
body.diplomacy .subtitle,
body.tactical-points .title,
body.tactical-points .subtitle {
    @media (max-width: 932px) {
        display: none;
    }
}

.subtitle {   
    font-size: 32px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    text-align: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    word-wrap: break-word;

    @media (min-width: 933px) {
        font-size: 36px;
    }
}

.title.visible,
.subtitle.visible {
    opacity: 1;
}

/* Logo styles */
.logo, .wgt-logo {
    position: absolute;
    bottom: 20px;
    max-height: 100px;
    z-index: 10;

    @media (min-width: 769px) {
        max-height: 175px;
    }
}
.logo {
    right: 20px;
}
.wgt-logo {
    left: 20px;
}

/* Act number and subtitle styles */
.act-number {
    position: absolute;
    top: 20px;
    left: 20px;
    font-size: 48px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 10;

    @media (min-width: 933px) {
        font-size: 72px;
    }
}

.act-subtitle {
    position: absolute;
    top: 80px;
    left: 20px;
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
    z-index: 10;
    
    @media (min-width: 933px) {
        font-size: 24px;
        top: 100px;
    }
}

/* Timer styles */
.time-remaining {
    position: absolute;
    top: 20px;
    right: 20px;
    text-align: right;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.time-remaining.visible {
    opacity: 1;
}

.time-remaining .label {
    font-size: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);

    @media (min-width: 933px) {
        font-size: 24px;
    }
}

.time-remaining .value {
    font-size: 48px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);

    @media (min-width: 933px) {
        font-size: 72px;
    }
}

.time-remaining .unit {
    font-size: 24px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* Diplomacy screen styles */
.diplomacy-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    z-index: 1;
    pointer-events: none;
}

.diplomacy-screen.active {
    opacity: 1;
    z-index: 2;
}

.diplomacy-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    z-index: 3;
}

.lines-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.logos-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

.faction-logo {
    position: absolute;
    width: 80px;
    height: auto;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    z-index: 2;
    object-fit: contain;

    @media (min-width: 933px) {
        width: 100px;
    }
}

.faction-logo[alt="Arcane Registry"] {
    width: auto;
    height: 80px;

    @media (min-width: 933px) {
        height: 100px;
    }
}

.relationship-line {
    position: absolute;
    height: 4px;
    transform-origin: 0 0;
    pointer-events: none;
    z-index: 1;
}

.relationship-line.friendly { background-color: #00ff00; }
.relationship-line.neutral { background-color: #ffff00; }
.relationship-line.hostile { background-color: #ff0000; }
.relationship-line.allied { background-color: #0000ff; }

.diplomacy-legend {
    bottom: 150px;
    position: absolute;
    right: 20px;
    z-index: 20;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: auto;
    
    @media (min-width: 769px) {
        bottom: 250px;
        padding: 8px;
        right: 40px;
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.legend-color {
    width: 20px;
    height: 4px;
}

.legend-color.friendly { background-color: #00ff00; }
.legend-color.neutral { background-color: #ffff00; }
.legend-color.hostile { background-color: #ff0000; }
.legend-color.allied { background-color: #0000ff; }

/* Loading screen styles */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-screen img {
    max-width: 400px;
    margin-bottom: 20px;
}

.loading-screen .loading-text {
    font-size: 36px;
    color: white;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.7);
}

/* Touch controls */
.touch-controls {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

/* Message popup styles */
.message-popup {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 80%;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    z-index: 1000;
    font-size: 24px;
    text-align: center;
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

@media (min-width: 933px) {
    .message-popup {
        font-size: 32px;
        padding: 20px 35px;
    }
}

.touch-top {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 20%;
    pointer-events: auto;
}

.touch-bottom {
    position: absolute;
    top: 200px;
    left: 0;
    width: 100%;
    height: calc(100% - 200px);
    display: flex;
}

.touch-left,
.touch-center,
.touch-right {
    flex: 1;
    height: 100%;
}

/* Mobile styles */
@media (max-width: 768px) {         
    #tactical-points {
        padding: 10px;
        align-items: flex-start;
    }
    
    .legend-item {
        font-size: 14px;
    }
    
    .legend-color {
        width: 16px;
        height: 3px;
    }
    
    .title-container {
        top: 130px;
        width: 100%;
    }
    
    .touch-controls {
        display: block;
    }
}