/* Self-hosted menu face. Previously this file opened with a render-blocking
   @import of Share Tech Mono, which no rule ever used, and every font-family
   named 'Jersey15-Regular' with no @font-face to back it -- so the page always
   painted in the monospace fallback. Both fixed here. */
@font-face {
    font-family: 'IM Fell English';
    src: url('fonts/IMFellEnglish-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'IM Fell English';
    src: url('fonts/IMFellEnglish-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Barlow Semi Condensed';
    src: url('fonts/BarlowSemiCondensed-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* Menu chrome only. In-game dialogue keeps its existing metrics so timed
   lines do not re-wrap.

   The display face carries the title alone. Everything smaller -- subtitle,
   credits, buttons -- is the sans: a serif this mannered stops being
   atmosphere and starts being noise at 14px over the menu artwork, and the
   contrast between the two is what makes the title read as a title. */
#game-title {
    font-family: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
}

#start-screen h3,
#start-screen h4,
#start-screen .choice-btn,
#start-screen .control-btn,
#main-buttons-container .control-btn,
#save-slots-container .control-btn {
    font-family: 'Barlow Semi Condensed', 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

#start-screen h3 {
    font-weight: 400;
}

#game-title {
    font-weight: 400;
    letter-spacing: 0.12em;
}

/* The menu art is high-contrast pen work, and a serif at credit size gets lost
   in it where the old monospace did not. A plain black shadow keeps the glow
   without needing a scrim over the artwork. */
#start-screen h3,
#start-screen h4 {
    text-shadow: 0 2px 6px #000, 0 1px 2px #000, 0 0 12px rgba(0, 0, 0, 0.9);
}

#start-screen .choice-btn,
#start-screen .control-btn,
#main-buttons-container .control-btn,
#save-slots-container .control-btn {
    background-color: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}


:root {
    --neon-green: #f58ef8;
    --dark-green: #000000;
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: 'Jersey15-Regular', monospace;
    background-color: #000;
    color: var(--neon-green);
    overflow: hidden;
}
#game-container, #start-screen {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

#fade-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.fade-active {
    opacity: 1 !important;
}

#game-container {
    transition: opacity 0.2s ease;
}

#video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    background-color: #000; /* Fallback color */
}

#background-video {
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;

    /* filter: hue-rotate(90deg) saturate(200%); */
}
#background-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

#alt-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    width: 80%;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid var(--neon-green);
    display: none;
}
#overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, transparent 50%, #000 100%);
    pointer-events: none;
}
#text-container {
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border: 2px solid var(--neon-green);
    text-align: center;
    box-shadow: 0 0 10px var(--neon-green);
    transition: all 0.3s ease;
}
#choices-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}
.choice-btn, .control-btn {
    background-color: var(--dark-green);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    cursor: pointer;
    font-family: 'Jersey15-Regular', monospace;
    transition: all 0.3s;
}
.choice-btn:hover, .control-btn:hover {
    background-color: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px var(--neon-green);
}

.control-slider {
    width: 150px;
    margin: 2px 0 15px 0;
    -webkit-appearance: none;
    background: transparent;
    outline: none;
}

.control-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    background: var(--neon-green);
    cursor: pointer;
    border-radius: 50%;
    margin-top: -5px; /* Adjust this value to align with the track */
}

.control-slider::-moz-range-thumb {
    width: 15px;
    height: 15px;
    background: var(--neon-green);
    cursor: pointer;
    border-radius: 50%;
    margin-top: -5px; /* Adjust this value to align with the track */
}

.control-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: #333;
    border-radius: 1.3px;
}

.control-slider::-moz-range-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: #333;
    border-radius: 1.3px;
}

.control-label {
    color: var(--neon-green);
    font-size: 14px;
    margin-top: 10px;
    text-align: left;
    width: 100%;
}
#fullscreen-btn {
    background-color: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'Jersey15-Regular', monospace;
    margin-bottom: 10px;
}
#fullscreen-btn:hover {
    background-color: var(--neon-green);
    color: #000;
}
#volume-control {
    -webkit-appearance: none;
    width: 100px;
    height: 4px;
    background: var(--dark-green);
    outline: none;
    opacity: 0.7;
    transition: opacity .2s;
    border-radius: 2px;
}

#volume-control:hover {
    opacity: 1;
}

#volume-control::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--neon-green);
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-green);
}

#volume-control::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--neon-green);
    cursor: pointer;
    box-shadow: 0 0 5px var(--neon-green);
}

#volume-control::-webkit-slider-runnable-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: var(--dark-green);
    border-radius: 1.3px;
    border: 0.2px solid var(--neon-green);
}
#volume-control::-moz-range-track {
    width: 100%;
    height: 5px;
    cursor: pointer;
    background: var(--dark-green);
    border-radius: 1.3px;
    border: 0.2px solid var(--neon-green);
}
#overview-container {
  position: absolute; /* Allows you to use top, left, right, bottom */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: none;
  padding: 20px;
  overflow-y: auto; /* Enables vertical scrolling */
  scrollbar-width: none; /* For Firefox */
  -ms-overflow-style: none;  /* For IE and Edge */
}
#overview-container::-webkit-scrollbar {
  display: none;  /* For Chrome, Safari, and Opera */
}
.panel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.panel {
    border: 1px solid var(--neon-green);
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
}
.panel-media-placeholder {
    width: 100%;
    height: 200px;
    background-color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 16px;
}
.panel-text, .panel-alt {
    margin-top: 10px;
    font-size: 14px;
}
.panel-alt {
    font-style: italic;
    color: #888;
}
#start-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #000;
    text-align: center;
}
#game-title {
    font-size: 48px;
    margin-bottom: 40px;
    text-shadow: 0 0 10px var(--neon-green);
    text-align: center;
    width: 100%;
}
#start-btn {
    font-size: 24px;
    padding: 15px 30px;
}
#skip-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}   
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}
#return-btn {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 1000;
}

#return-btn:hover {
    background-color: var(--neon-green);
    color: #000;
    box-shadow: 0 0 10px var(--neon-green);
}

#return-btn:hover path {
  fill: #000; /* Replace with your desired color */
}

#loading-text {
    color: var(--neon-green);
    font-size: 24px;
    margin-bottom: 20px;
}

#loading-bar {
    width: 300px;
    height: 20px;
    background-color: #333;
    border: 2px solid var(--neon-green);
    border-radius: 10px;
    overflow: hidden;
}

#loading-progress {
    width: 0%;
    height: 100%;
    background-color: var(--neon-green);
    transition: width 0.3s ease;
}
#text-container {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border: 2px solid var(--neon-green);
    text-align: center;
    box-shadow: 0 0 10px var(--neon-green);
    transition: all 0.3s ease;
}

#text-content {
    margin-bottom: 20px;
}

#choices-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#hide-text-btn {
    margin-left: 10px;
    font-size: x-small;
}

#control-panel-container {
	position: absolute;
	top: 20px;
	right: 20px;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
    }

#control-panel {
    display: none;
    flex-direction: column;
    align-items: flex-end;
    margin-top: 5px;
    position: absolute;
    top: 35px;
    right: 0px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border: 1px solid var(--neon-green);
    z-index: 1000;
    min-width: 280px;
}

.control-row {
    display: flex;
    width: 100%;
    gap: 15px;
    margin-bottom: 10px;
}

.control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.control-slider {
    width: 100%;
    margin: 2px 0 5px 0;
    -webkit-appearance: none;
    background: transparent;
    outline: none;
}

.control-label {
    color: var(--neon-green);
    font-size: 14px;
    margin-top: 5px;
    text-align: left;
    width: 100%;
}

/* Media query for landscape orientation and low height */
@media screen and (max-height: 600px) and (orientation: landscape) {
    #control-panel {
        max-height: 80vh;
        overflow-y: auto;
        padding: 10px;
    }

    .control-row {
        margin-bottom: 5px;
    }

    .control-label {
        font-size: 12px;
        margin-top: 2px;
    }

    .control-slider {
        margin: 0 0 2px 0;
    }

    #fullscreen-btn {
        margin-bottom: 5px;
    }
}

/* For very small heights */
@media screen and (max-height: 400px) and (orientation: landscape) {
    #control-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 5px;
        padding: 8px;
    }

    .control-row {
        grid-column: span 2;
    }

    #fullscreen-btn {
        grid-column: span 2;
        margin-bottom: 3px;
    }
}

#control-panel-toggle {
background-color: transparent;
border: 1px solid var(--neon-green);
color: var(--neon-green);
padding: 5px 10px;
cursor: pointer;
font-family: 'Jersey15-Regular', monospace;
}

#control-panel-toggle:hover {
background-color: var(--neon-green);
color: #000;
}

#text-container { 
    z-index: 800;
}

/* Add responsive adjustments for mobile screens */
@media only screen and (max-width: 768px) and (orientation: portrait) {
    #text-container {
        bottom: 69px;
        width: calc(90% - 50px) !important; /* Full width minus padding */
        font-size: 14px;
        padding: 12px 15px;
        opacity: 0.9;
        left: 50%;
        transform: translateX(-50%);
    }

    .choice-btn, .control-btn {
        padding: 8px 16px;
        font-size: 14px;
        opacity: 0.9;
    }
}

@media only screen and (max-height: 768px) and (orientation: landscape) {
    #text-container {
        bottom: 15px;
        width: 70%;
        font-size: 12px;
        background-color: rgba(0, 0, 0, 0.7);
        padding: 8px;
        opacity: 0.9;
    }

    .choice-btn, .control-btn {
        padding: 6px 12px;
        font-size: 12px;
        margin: 2px;
        opacity: 0.9;

    }
}

/* Add this for very small mobile screens */
@media only screen and (max-width: 768px) and (max-height: 500px) {
    #text-container {
        bottom: 10px;
        padding: 8px;
        opacity: 0.9;
    }
}

#background-video {
    transition: opacity 0.5s;
}

/* style.css */
#hotspot-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10; /* Adjust as necessary to be above other elements */
    pointer-events: none; /* Enable or disable via JavaScript */
}
  
  #hotspot-overlay svg {
    width: 100%;
    height: 100%;
  }
  
  #hotspot-overlay polygon {
    transition: fill 0.3s;
  }
  
  #hotspot-overlay polygon:hover {
    fill: rgba(0, 0, 0, 0.3); /* Change color on hover */
  }
  
  .hotspot {
    position: absolute;
    background: rgba(255, 0, 0, 1); /* Semi-transparent red */
    pointer-events: auto; /* Enable pointer events for hotspots */
  }

  /* Inventory Button */
#inventory-btn {
    position: absolute;
    top: 20px;
    left: 20px; /* Adjust position as needed */
    z-index: 1000;
    background-color: transparent;
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
    padding: 5px 10px;
    cursor: pointer;
    font-family: 'Jersey15-Regular', monospace;
}

/* Inventory Container */
#inventory-container {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    margin-top: 5px;
    position: absolute;
    top: 50px;
    left: 22px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 15px;
    border: 1px solid var(--neon-green);
    z-index: 1000;
    min-width: 280px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#inventory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
}

.inventory-item {
    width: 93%;
    padding: 8px;
    border: 1px solid #2a2a2a;
    background-color: rgba(20, 20, 20, 0.8);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

.inventory-item-container {
    display: flex;
    align-items: center;
    width: 100%;
    position: relative;
}

.inventory-item-image {
    width: 32px;
    height: 32px;
    object-fit: contain;
    margin-right: 10px;
}

.inventory-item-text {
    display: block;
    color: var(--neon-green);
    font-size: 14px;
    flex-grow: 1;
}

.inventory-item-count {
    background-color: var(--neon-green);
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
    margin-left: 10px;
}

.inventory-item.selectable {
    cursor: pointer;
}

.inventory-item.selectable:hover {
    border-color: var(--neon-green);
    background-color: rgba(245, 142, 248, 0.1);
}

.inventory-item.selected {
    border-color: var(--neon-green);
    background-color: rgba(245, 142, 248, 0.2);
}

.inventory-tooltip {
    display: none;
}

#close-inventory-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: transparent;
    border: none;
    color: var(--neon-green);
    cursor: pointer;
    padding: 4px;
    width: 24px;
    height: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
    transition: color 0.2s ease;
}

#close-inventory-btn:hover {
    color: #fff;
}

/* Media query for landscape orientation and low height */
@media screen and (max-height: 600px) and (orientation: landscape) {
    #inventory-container {
        max-height: 80vh;
        padding: 10px;
    }
    
    .inventory-item {
        padding: 5px;
        margin-bottom: 3px;
    }
    
    .inventory-item-text {
        font-size: 12px;
    }
}

/* Add responsive adjustments for mobile screens */
@media only screen and (max-width: 768px) {
    #game-title {
        font-size: 36px;
        margin-bottom: 30px;
        padding: 0 15px;
    }
}

@media only screen and (max-width: 480px) {
    #game-title {
        font-size: 28px;
        margin-bottom: 20px;
    }
}

/* Add responsive adjustments for mobile screens */
@media only screen and (max-width: 390px) {
    .slots-row {
        flex-direction: column !important;
        align-items: center;
    }

    .save-slot-btn {
        width: 280px !important;
        margin-bottom: 10px;
    }

    #game-title {
        font-size: 24px;
        margin-bottom: 15px;
    }
}

/* Add responsive adjustments for portrait orientation */
@media screen and (orientation: portrait) {
    .slots-row {
        flex-direction: column !important;
        align-items: center;
        gap: 15px !important;
    }

    .save-slot-btn {
        width: 280px !important;
        margin-bottom: 5px;
    }

    #save-slots-container {
        padding: 0 10px;
    }
}

/* Add responsive adjustments for very narrow screens */
@media screen and (max-width: 320px) {
    .save-slot-btn {
        width: 250px !important;
        font-size: 14px;
    }
}

.hotspot-hover-text {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--neon-green);
    padding: 10px;
    border: 1px solid var(--neon-green);
    font-family: 'Jersey15-Regular', monospace;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.hotspot-hover-text.visible {
    opacity: 1;
    visibility: visible;
}

.inventory-notification {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background-color: rgba(0, 0, 0, 0.8);
    color: var(--neon-green);
    padding: 10px 20px;
    border: 1px solid var(--neon-green);
    font-family: 'Jersey15-Regular', monospace;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
    box-shadow: 0 0 10px var(--neon-green);
}

.inventory-notification.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.endgame-text {
    font-size: 48px;
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: var(--neon-green);
    font-family: 'Jersey15-Regular', monospace;
    text-shadow: 0 0 10px var(--neon-green);
}

h4 {
    display: inline-block;
    margin: 0 10px;
}

h4 a {
    text-decoration: none;
    color: inherit;
}

#endgame-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

#endgame-content {
    text-align: center;
    padding: 20px;
}

.endgame-text {
    font-size: 48px;
    color: var(--neon-green);
    margin-bottom: 40px;
    text-shadow: 0 0 10px var(--neon-green);
}

#endgame-return-btn {
    font-size: 24px;
    padding: 15px 30px;
}