* {
    box-sizing: border-box;
    background-color: #c0c0c0;
    margin: 0;
    padding: 0;
}

p, h1, h2, h3, h4, h5, h6, span, i, strong, ul, li, b, div {
    background-color: inherit;
}

/* CONTENEDOR PRINCIPAL DEL JUEGO */
.game-container {
    position: fixed;
    inset: 20px;
    display: grid;
    grid-template-columns: 50% 50%; /* área visual (izq) / área interactiva (der) */
    grid-template-rows: 8% 92%; /* game-header / game-container */
    padding:20px;

    background-color: #c0c0c0;
    color: black;
    font-family: 'Courier New', monospace;
    font-size: 1.5em;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

/* CONTENEDOR DE LA CABECERA */
.game-header {
    grid-column: 1 / span 2;
    grid-row: 1;
    gap: 30px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    /* padding: 0 20px; */
    background-color: white;
    font-weight: 800;
    margin-bottom: 20px;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* INDICADORES CABECERA */
.header-info {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    background-color: white;
}

/* INDICADORES CABECERA: líneas verticales separadoras */
.header-info:not(:last-child)::after {
    content: '';
    position: absolute;
    right: -15px;
    top: 0;
    bottom: 0;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

/* INDICADORES CABECERA: nombre del programa */
#header-name {
    color: #333333;
    letter-spacing: 2px;
    background-color: #c0c0c0;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

/* INDICADORES CABECERA: temporizador */
#header-timer {
    color: red;
}

/* ÁREA VISUAL (izq) */
#game-screen {
    grid-column: 1;
    grid-row: 2;
    position: relative;
    overflow: hidden;
    margin-right:10px;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* CONTENIDO DEL ÁREA VISUAL (izq): oculto */
.visual-content, .system-visual {
    width: 100%;
    height: 100%;
    display: none;
    background-color: black;
}

/* CONTENIDO DEL ÁREA VISUAL (izq): visible */
.visual-content.active, .system-visual.active {
    display: block;
}

/* ÁREA INTERACTIVA (der) */
#game-controls {
    grid-column: 2;
    grid-row: 2;
    display: flex;
    flex-direction: column;
    margin-left:10px;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* CONTENEDOR DE LAS PESTAÑAS */
.tabs {
    display: flex;
    overflow-y: auto;
    overflow-x: auto;
}

/* PESTAÑA: oculta */
.tab {
    flex: 1;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.tab:hover {
    color: black;
    background-color: #dddbdb;
}


/* PESTAÑA: visible */
.tab.active {
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

/* CONTENIDO DE LA PESTAÑA */
.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background-color: #494c4f;
}

/* CONTENEDOR DEL ÁREA VISUAL DE LOS DOCUMENTOS (izq)*/
#visual-docs {
    background-color: white;
}

/* CONTENEDOR DEL ÁREA VISUAL DE LOS DOCUMENTOS (izq)*/
.docs-content {
    height: 100%;
    width: 100%;
    padding: 20px;
    background-color: white;
    overflow-y: auto;
}

/* DOCUMENTO DE LA LISTA: asignada dinámicamente  */
.document {
    /* background-color: black;
    color: white;
    padding: 15px; */
    /* margin: 10px 0; */
    /* inset: 100px; */
    /* border-left: 3px solid #444; */
    /* border: 4px dashed white;
    cursor: pointer; */

    padding: 20px;
    cursor: pointer;
    user-select: none;
    color: #333333;
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.document:hover {
    color: black;
    background-color: #dddbdb;
}

.document.active {
    background-color: #c0c0c0;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.document-read {
    color: rgb(0, 159, 0);
    font-weight: 900;
    letter-spacing: 2px;
}

/* LISTA DE TAREAS*/
.challenges-list {
    background-color: white;
}

/* CHECKBOX: tarea */
.checkbox {
    font-weight: 900;
}

.docs-visual-default {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 40px; 
    background-color: inherit;
    opacity: 0.5;
    filter: grayscale(100%);
}

.jurassic-park-logo-docs {
    background-color: inherit;
}

/* GUÍA PALEONTOLÓGICA*/
.dinosaur-wiki ul { padding-left: 20px; }

.dinosaur-wiki img {
    display: block;
    margin: auto;
    min-height: 150px;
}

/* IMAGEN VISUAL DE LOS SISTEMAS*/
.system-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: transparent;
}

/* RETO 1: contenedor del panel del acceso a los sistemas */
.system-code-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 40px; 
    background-color: inherit;
}

/* DOCUMENTO: Sistema de Comunicación (código Morse) */
.communication-system {
    background-color: white;
}

.morse-table {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background-color: #ddd;
    border: 1px solid #ccc;
    margin: 20px 0;
    border-radius: 2px;
    overflow: hidden;
}

.morse-row {
    display: contents;
}

.morse-row.header .morse-cell {
    background-color: #494c4f;
    color: white;
    font-weight: bold;
    padding: 12px;
}

.morse-cell {
    background-color: white;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.morse-cell:nth-child(odd) {
    background-color: #dbdbdb;
}

.system-code-container h3, .system-code-container p { color: white; }


/* RETO 1: código del acceso a los sistemas */
.system-code {
    background-color: #c0c0c0;
    font-size: 2rem;
    letter-spacing: 6px;
    text-align: center;
    padding: 20px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.system-code.incorrect { background-color: #bb6868; }
.system-code.correct { background-color: #75ba67; }

/* RETO 1: grid de los botones del panel del acceso a los sistemas */
.system-code-btn-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    background-color: #494c4f;
}

/* RETO 1: botones del panel del acceso a los sistemas */
.system-code-btn {
    padding: 18px 10px;
    border-radius: 8px;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 20px;
    min-width: 150px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.2s;
    color: #2e2e2e;
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.system-code-btn:hover:not(:disabled) {
    color: black;
    background-color: #dddbdb;
}

.system-code-btn:active:not(:disabled) {
    color: #2e2e2e;
    background-color: #c0c0c0;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.system-code-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;    
}

/* SISTEMAS: pantalla para acceder a cada sistemas*/
.systems-title {
    text-align: center;
    color: white;
}

.systems-btns {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-top: 40px;
    width: 100%;
    gap: 20px; 
    background-color: inherit;
}

.system-btn {
    position: relative;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 20px;
    min-width: 180px;
    min-height: 180px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
    transition: all 0.2s;
    color: #2e2e2e;
    overflow: hidden;
    vertical-align: bottom;
    background-color: #494c4f;
    border: none;
    font-size: 1.1em;
}

.system-btn-label {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: white;
    background-color: transparent;
    padding: 2px 4px;
    z-index: 2;
    pointer-events: none;
    font-family: 'Courier New', monospace;
    font-size: 0.8em;
}

.system-disabled-message {
    margin-top: 30px;
    padding: 15px;
    background-color: #a0a0a0;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
    font-size: 0.9em;
    color: #333;
}

.system-disabled-message ul {
    margin: 10px 0 10px 20px;
}

.system-disabled-message li {
    margin: 5px 0;
    background-color: transparent;
}

#system-electricity-btn, #system-security-btn, #system-bridge-btn {
    background-position: center 20px;
    background-size: 80% auto;
    background-repeat: no-repeat;
}

#system-electricity-btn { background-image: url("images/system-electricity-default.png"); }
#system-electricity-btn:hover { background-image: url("images/system-electricity-hover.png"); }
#system-electricity-btn:disabled { background-image: url("images/system-electricity-disabled.png"); }
#system-electricity-btn:active { border: 1px dashed #c0c0c0; }

#system-security-btn { background-image: url("images/system-security-default.png"); }
#system-security-btn:hover { background-image: url("images/system-security-hover.png"); }
#system-security-btn:disabled { background-image: url("images/system-security-disabled.png"); }
#system-security-btn:active { border: 1px dashed #c0c0c0; }

#system-bridge-btn { background-image: url("images/system-bridge-default.png"); }
#system-bridge-btn:hover { background-image: url("images/system-bridge-hover.png"); }
#system-bridge-btn:disabled { background-image: url("images/system-bridge-disabled.png"); }
#system-bridge-btn:active { border: 1px dashed #c0c0c0; }

/* RETO 2: contenedor del panel de seguridad*/
.system-electricity-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 20px;
    overflow-x: hidden;
    background-color: inherit;
    background-color: #c0c0c0;
    
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.system-electricity-code {
    padding: 10px;
    background-color: white;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

input[type="text"] {
    font-family: 'Courier New', monospace;
    font-size: 1em;
}

input[type="text"]:focus { outline: none; }
input[type="text"]:disabled { color: #8b8b8b; }

.electricity-options {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    width: 80%;
    padding: 20px;
    overflow-x: hidden;
    border-radius: 1px;
    border-width: 4px;
    border-style: double;
    border-color: #808080;
}

.option-title {
    min-width: 200px;
    text-align: left;
    font-weight: 800;
}

.option-container {
    display: flex;
    flex: 1;
    justify-content: space-between;
}

.option-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.option-item input[type="radio"] {
    margin-bottom: 8px;
    cursor: pointer;
}

.option-item label {
    color: #333;
}

input[type="radio"] {
    background-color: white;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;

    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

input[type="radio"]:checked {
    background-color: black;
}

input[type="radio"]:before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    border-width: 3px;
    border-style: solid;
    border-color: white;
}

input[type="radio"]:disabled:checked  {
    background-color: #8b8b8b;
    cursor: not-allowed;
}

input[type="radio"]:disabled{
    background-color: white;
    cursor: not-allowed;
}

#system-electricity-check-btn { transition: all 0.2s; }
#system-electricity-check-btn.incorrect { background-color: #bb6868; }
#system-electricity-check-btn.correct { background-color: #75ba67; }

/* RETO 3: contenedor del panel de seguridad */
.system-security-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 40px; 
    background-color: inherit;
    background-color: #c0c0c0;
    
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.slider-sectors {
    display: flex;
    justify-content: center;
    gap: 60px; /* Mismo gap que slidergrid */
    padding-left: 170px;
    overflow-x: hidden;
}

.slider-sectors label {
    width: 30px; /* Mismo ancho que los slider-container */
    text-align: center;
}

.slidergrid {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    gap: 60px; 
    background-color: inherit;
    height: 300px;
}

.slider-labels {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    align-items: center;
    padding: 5px 0px;
}

.slider-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 30px;
    background-color: transparent;
    position: relative;
}

.slider {
    position: absolute; 
    width: 300px;
    height: 14px;
    top: 50%;
    left: 50%;
    -webkit-appearance: none;
    appearance: none;
    background-color: black;
    border-radius: 2px;
    border: 6px solid;
    border-color: #808080 #808080 #dfdfdf #dfdfdf;
    cursor: pointer;
    transform: translate(-50%, -50%) rotate(270deg);
    transform-origin: center;
}

.slider:disabled {
    opacity: 0.8;
    cursor: not-allowed;    
}

.slider::-moz-range-thumb {
    width: 16px;
    height: 30px;
    background: #c0c0c0;
    cursor: pointer;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #dfdfdf #808080 #808080;
    box-shadow: -1px 1px 0px rgba(0, 0, 0, 0.2);
}

.slider::-moz-range-thumb:active:not(:disabled)  {
    background: #c0c0c0 !important;
    border-color: #808080 #808080 #dfdfdf #dfdfdf;
}

.slider::-moz-range-thumb:hover:not(:disabled)  { background-color: #dddbdb; }
.slider:disabled::-moz-range-thumb { cursor: not-allowed; }

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 38px;
    background: #c0c0c0;
    cursor: pointer;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #dfdfdf #808080 #808080;
    box-shadow: -1px 1px 0px rgba(0, 0, 0, 0.2);
}

.slider::-webkit-slider-thumb:active:not(:disabled)  {
    background: #c0c0c0 !important;
    border-color: #808080 #808080 #dfdfdf #dfdfdf;
}

.slider::-webkit-slider-thumb:hover:not(:disabled)  { background-color: #dddbdb; }
.slider:disabled::-webkit-slider-thumb { cursor: not-allowed; }

#system-security-check-btn { transition: all 0.2s; }
#system-security-check-btn.incorrect { background-color: #bb6868; }
#system-security-check-btn.correct { background-color: #75ba67; }

/* RETO 4: contenedor del panel del puente */
.system-bridge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    width: 100%;
    gap: 20px; 
    background-color: inherit;
    background-color: #c0c0c0;
    
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

/* RETO 4: grid de botones */
.bridge-button-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 500px;
    height: 500px;
    margin: 20px auto;
    background-color: #494c4f;
    padding: 4px;

    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.bridge-button-grid-square {
    width: 100%;
    height: 100%;
    /* display: flex;
    align-items: center;
    justify-content: center; */
    cursor: pointer;
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.bridge-button-grid-square.selected {
    background-color: #b966af !important;
    color: white;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.bridge-button-grid-square:hover:not(.disabled) {
    color: black;
    background-color: #dddbdb;
}

.bridge-button-grid-square.disabled {
    opacity: 0.8;
    cursor: not-allowed;    
}

#system-bridge-check-btn { transition: all 0.2s; }
#system-bridge-check-btn.incorrect { background-color: #bb6868; }
#system-bridge-check-btn.correct { background-color: #75ba67; }

/* TERMINAL DE COMUNICACIONES */
.terminal-container {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #c0c0c0;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow: hidden;
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #c0c0c0;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.terminal-title {
    font-weight: bold;
    letter-spacing: 1px;
}

.terminal-content {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;

    background-color: #c0c0c0;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

.terminal-output {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background-color: #263f89;
    margin-bottom: 10px;
    min-height: 300px;
    color: white;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.terminal-line {
    margin-bottom: 5px;
    line-height: 1.4;
    word-break: break-word;
}

.terminal-line.prompt {
    color: #00aaff;
    font-weight: bold;
}

.terminal-line.success {
    color: #00ff88;
}

.terminal-line.error {
    color: #ff5555;
}

.terminal-line.hint {
    color: #ffff55;
    font-style: italic;
}

.terminal-input {
    display: flex;
    align-items: center;
    padding: 10px;
    background-color: #263f89;

    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #808080 #dfdfdf #dfdfdf #808080;
}

.terminal-input .prompt {
    color: #00aaff;
    margin-right: 10px;
    font-weight: bold;
}

.terminal-input input {
    flex: 1;
    background-color: transparent;
    border: none;
    color: #00aaff;
    font-family: 'Courier New', monospace;
    font-size: 1em;
    outline: none;
}

.terminal-input input::placeholder {
    color: #008888;
}

.terminal-hint {
    padding: 10px 15px;
    font-size: 0.8em;
    color: black;
    background-color: #c0c0c0;
    border-radius: 2px;
    border-width: 4px;
    border-style: solid;
    border-color: #dfdfdf #808080 #808080 #dfdfdf;
    box-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}

/* SCROLLBAR: https://gist.github.com/Dakedres/0ccda599648833a1c2f65d3967aa131b */
body *::-webkit-scrollbar {
  width: 16px;
  height: 16px;
  background: none;
}

body *::-webkit-scrollbar-thumb, body *::-webkit-scrollbar-button {
  width: 16px;
  height: 16px;
  background: silver;
  box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px gray;
  border: 1px solid;
  border-color: silver #000 #000 silver;
}

body *::-webkit-scrollbar-track {
  image-rendering: optimizeSpeed;
  image-rendering: pixelated;
  image-rendering: optimize-contrast;
  background-image: url("images/scrollbar-track-background.svg");
  background-position: 0 0;
  background-repeat: repeat;
  background-size: 8px;
}

body *::-webkit-scrollbar-button {
  background-repeat: no-repeat;
  background-size: 16px;
}

body *::-webkit-scrollbar-button:single-button:vertical:decrement {
  background-image: url("images/arrow-up.svg");
}

body *::-webkit-scrollbar-button:single-button:vertical:increment {
  background-image: url("images/arrow-down.svg");
}

body *::-webkit-scrollbar-button:single-button:horizontal:decrement {
  background-image: url("images/arrow-left.svg");
}

body *::-webkit-scrollbar-button:single-button:horizontal:increment {
  background-image: url("images/arrow-right.svg");
}

body *::-webkit-scrollbar-corner {
  background: silver;
}