body {
    background-color: #222;
    color: #eee;
    font-family: sans-serif;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 100vh;
    padding-top: 0;
    margin: 0;
}
#container {
    text-align: center;
}

.bottomInfoBox {
    width: min(864px, calc(100vw - 24px));
    border: 1px solid #555;
    border-radius: 4px;
    color: #9a9;
    margin: 16px auto 0;
    padding: 10px;
    box-sizing: border-box;
}

.bottomInfoBox .bottomInfoTitle {
    font-weight: bold;
    text-align: left;
    font-size: 1.1em;
    margin: 20px 0 8px 0;
}

.bottomInfoBox .bottomInfoParagraph {
    text-align: justify;
    margin: 8px 0;
}

.bottomInfoBox .shortcutColumns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.bottomInfoBox .shortcutList {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bottomInfoBox .shortcutList + .shortcutList {
    border-left: 1px solid #555;
    padding-left: 12px;
}

.bottomInfoBox .shortcutListItem {
    display: grid;
    grid-template-columns: 120px 1fr;
    column-gap: 10px;
    align-items: baseline;
    padding: 2px 0;
}

.bottomInfoBox .shortcutKey {
    text-align: left;
    white-space: nowrap;
}

.bottomInfoBox .shortcutDesc {
    text-align: left;
}

body:fullscreen {
    background-color: black;
    display: flex;
    align-items: center;   /* svislé centrování */
    justify-content: center; /* vodorovné centrování */
    margin: 0;
    overflow: hidden;
}

#screen {
    image-rendering: pixelated;
    outline: 2px solid #555;
    outline-offset: 0px;
    border: none; /* Skutečný border necháš nulový */
    background-color: #000;
}

#screen.screenDragOver {
    outline: 2px solid #7ab8ff;
    box-shadow: 0 0 0 1px rgba(122, 184, 255, 0.45) inset;
}

#canvascontainer {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.canvasStartOverlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 100%;
    background: radial-gradient(circle at center, rgba(58, 58, 58, 0.92) 0%, rgba(20, 20, 20, 0.96) 70%);
    border: 1px solid #666;
    border-radius: 4px;
    color: #f0f0f0;
    cursor: pointer;
    transition: opacity 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.canvasStartOverlay:hover:not(:disabled) {
    background: radial-gradient(circle at center, rgba(72, 72, 72, 0.94) 0%, rgba(28, 28, 28, 0.97) 70%);
}

.canvasStartOverlay:active:not(:disabled) {
    transform: scale(0.995);
}

.canvasStartOverlay.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.canvasStartOverlayIcon {
    font-size: 4.2rem;
    line-height: 1;
    color: #20e454;
    text-shadow: 0 0 18px rgba(124, 255, 159, 0.22);
}

.canvasStartOverlayText {
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Kontejner, který vyplní celou obrazovku */
#canvascontainer:fullscreen {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
    width: 100vw;
    height: 100vh;
}

/* Vzhled, když je KONTEJNER (wrapper) ve fullscreenu */
#canvascontainer:fullscreen #screen {
    border: none;           /* Ve fullscreenu okraj zmizí */
    outline: none;          /* Pro jistotu odstraníme i outline */
}

#canvasTopSpacer {
    height: 20px;
}

#emulatorTitle {
    font-size: 1.3em;
    font-weight: bold;
    color: #ddd;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

#canvasStatusRow {
    width: 100%;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

#controls {
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
}
button {
    padding: 8px 12px;
    margin: 0;
    background-color: #444;
    border: 1px solid #666;
    border-radius: 4px;
    color: #eee;
    font-size: 0.85em;
    height: 28px;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
button.icon {
    /* width: 34px; */
    height: 28px;
    font-size: 0.85em;
    display: flex;    
    justify-content: center;
}
button:hover {
    background-color: #555;
}

button:focus {  /* Úplné odstranění obrysu pro všechna tlačítka */
    outline: none;
    box-shadow: none;
}

/* Styl pro zakázané tlačítko */
button:disabled {
    background-color: #cccccc; /* Šedá */
    color: #666666;            /* Tmavší šedá pro text */
    cursor: not-allowed;       /* Ikona přeškrtnutého kruhu */
    opacity: 0.6;              /* Průhlednost */
    transform: scale(1.0);     /* Zamezení efektům při kliknutí */
}

#leds {
    margin-top: 0;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.led {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #444;
    border: 1px solid #666;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: background-color 0.1s ease;
}

#scaleRadios,
.vradios {
    display: inline-flex;
    align-items: center;
    border: 1px solid #666;
    border-radius: 4px;
    overflow: hidden;
}

#scaleRadios label,
.vradios label {
    margin: 0;
    min-width: 36px;
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85em;
    background-color: #444;
    color: #9a9;
    cursor: pointer;
    border-right: 1px solid #666;
    user-select: none;
    transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

#scaleRadios label:last-child,
.vradios label:last-child {
    border-right: none;
}

#scaleRadios input,
.vradios input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

#scaleRadios label:has(input:checked),
.vradios label:has(input:checked) {
    background-color: #2f8a44;
    color: #f2fff5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

#scaleRadios label:hover,
.vradios label:hover {
    background-color: #555;
}

#scaleRadios label:has(input:checked):hover,
.vradios label:has(input:checked):hover {
    background-color: #2f8a44;
}

.hradios {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #666;
    border-radius: 4px;
    overflow: hidden;
}

.hradios label {
    margin: 0;
    min-height: 28px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.85em;
    background-color: #444;
    color: #9a9;
    cursor: pointer;
    border-bottom: 1px solid #666;
    user-select: none;
    box-sizing: border-box;
    transition: background-color 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}

.hradios label:last-child {
    border-bottom: none;
}

.hradios input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.hradios label:has(input:checked) {
    background-color: #2f8a44;
    color: #f2fff5;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.hradios label:hover {
    background-color: #555;
}

.hradios label:has(input:checked):hover {
    background-color: #2f8a44;
}
#screenAndConfig {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 15px;
    align-items: flex-start;
    justify-content: center;
}

#leftPanels {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 180px;
    margin-top: 30px;
    justify-self: end;
}

#screenSection {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    grid-column: 2;
    justify-self: center;
}

#sidePanels {
    display: flex;
    flex-direction: row;
    gap: 12px;
    align-items: flex-start;
    margin-top: 30px;
    justify-self: start;
}

#configPanel {
    gap: 12px;
    padding: 12px;
}

.configGroup {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.configGroup label {
    font-size: 0.9em;
    font-weight: bold;
    color: #9a9;
    text-align: left;
}

.configGroup select {
    padding: 6px 8px;
    background-color: #444;
    color: #eee;
    border: 1px solid #666;
    border-radius: 2px;
    font-size: 0.85em;
    cursor: pointer;
}

.configGroup select:hover {
    background-color: #555;
}

.configGroup select:focus {
    outline: 1px solid #88f;
}

.panel {
    background: #2a2a2a;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    text-align: justify;
    margin-bottom: 2px;
}

#gameInfoBox  {
    background: #2a2a2a;
    border: 1px solid #555;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 160px;
    text-align: justify;
    margin-bottom: 2px;
    color: #9a9;
    font-size: 0.9em;
}

#gameInfoBox p {
    text-align: justify;
    margin: 2px 0;
}

#gameInfoBox a {
    color: #aaa;
    text-decoration: none;
    font-weight: bold;   
}

#gameInfoBox h1 {
    font-weight: bold;
    text-align: left;
    font-size: 1.1em;
    margin: 0px 0 8px 0;
    color:#ddd;
}

#gameInfoBox h2 {
    font-weight: bold;
    text-align: left;
    font-size: 1.1em;
    margin: 10px 0 0px 0;
}

#gameInfoBox dl {
  display: grid;
  grid-template-columns: 120px 1fr; /* První sloupec 120px, druhý zbytek */
  gap: 5px 5px;
}

#gameInfoBox dt {
  font-weight: bold;
}

#gameInfoBox dd {
  margin: 0; /* Odstraní výchozí odsazení prohlížeče */
}

#tapePanel.tapePanelDragOver {
    border-color: #7ab8ff;
    background: #233448;
    box-shadow: 0 0 0 1px rgba(122, 184, 255, 0.45) inset;
}

.panelDragOver {
    border-color: #7ab8ff;
    background: #233448;
    box-shadow: 0 0 0 1px rgba(122, 184, 255, 0.45) inset;
}

.panelHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.panelTitle {
    font-weight: bold;
    color: #9a9;
    font-size: 0.9em;
    text-align: left;
}

.panelButton {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    padding: 2px;
    background-color: #3a3a3a;
    border: 1px solid #555;
    border-radius: 2px;
    color: #9a9;
    font-size: 0.9em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.panelButton:hover {
    background-color: #4a4a4a;
    border-color: #6a6a6a;
    color: #ddd;
}

.panelButton:active {
    background-color: #2a2a2a;
    border-color: #555;
}

.panelList {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: 60px;
}

.tapeItem {
    display: flex;
    position: relative;
    height: 20px;
    min-width: 0;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 2px;
    overflow: hidden;
    font-size: 0.8em;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.tapeItem:hover {
    background-color: #222;
    border-color: #555;
}

.tapeItem::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: rgba(100, 150, 200, 0.3);
    z-index: 1;
    transition: width 0.2s ease;
}

.tapeItemContent {
    display: flex;
    width: 100%;
    position: relative;
    z-index: 2;
    align-items: center;
}

.tapeItemName {
    flex: 1;
    padding-left: 6px;
    text-align: left;
    color: #9a9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: bold;
}

.tapeItemSize {
    padding-right: 6px;
    text-align: right;
    color: #aaa;
    white-space: nowrap;
    min-width: 50px;
}

.tapeItemArrow {
    flex-shrink: 0;
    margin-right: 4px;
    text-align: center;
    font-size: 0.8em;
    color: transparent;
    transition: color 0.15s ease;
    min-width: 0;
}

.tapeItemSelected {
    background-color: #2a2a2a !important;
    border-color: #9faa2f !important;
    min-width: 0;

}

.tapeItemSelected .tapeItemArrow {
    color: #9faa2f;
}

.tapeItemSelected .tapeItemName {
    color: #9faa2f;
}

#debugPanel {
    background: #202020;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 10px;
    text-align: left;
    font-size: 0.85em;
}

#debugPanel.debugPanelHidden {
    opacity: 0;
    pointer-events: none;
}

.debugPanelTitle {
    font-weight: bold;
    margin-bottom: 8px;
    color: #9a9;
}

.debugRow {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
    color: #9a9;
}

.debugRow span:last-child {
    font-family: Consolas, "Courier New", monospace;
    color: #9fe89f;
}

#dbgInstr {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.debugRowBp input {
    width: 52px;
    background: #141414;
    border: 1px solid #555;
    border-radius: 3px;
    color: #9fe89f;
    font-family: Consolas, "Courier New", monospace;
    font-size: 1em;
    padding: 1px 4px;
    text-align: center;
    text-transform: uppercase;
    outline: none;
}

.debugRowBp input:focus {
    border-color: #9fe89f;
}

.debugFlags {
    margin-bottom: 6px;
    text-align: right;
    font-family: Consolas, "Courier New", monospace;
    color: #cfcfcf;
}

#romModulePanel {
    padding: 12px;
}

.version {
    font-size: 0.6em;
    color: #9a9;
    font-weight: bold;
    text-align: right;
    margin-bottom: 6px;
}